mirror of
https://github.com/gyoder/dots.git
synced 2026-04-05 13:32:53 +00:00
nvim overhaul
This commit is contained in:
parent
a34e41df2e
commit
70a1581228
13 changed files with 319 additions and 305 deletions
|
|
@ -1,319 +0,0 @@
|
|||
vim.cmd [[packadd packer.nvim]]
|
||||
|
||||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
-- use "neovim/nvim-lspconfig"
|
||||
|
||||
use {
|
||||
'maxmx03/solarized.nvim',
|
||||
config = function()
|
||||
vim.o.background = 'dark'
|
||||
---@type solarized
|
||||
local solarized = require('solarized')
|
||||
vim.o.termguicolors = true
|
||||
vim.o.background = 'dark'
|
||||
solarized.setup({})
|
||||
-- vim.cmd.colorscheme 'solarized'
|
||||
end
|
||||
}
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = { { 'nvim-lua/plenary.nvim' } },
|
||||
run = ":TSUpdate",
|
||||
config = function()
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case",
|
||||
"--glob=!node_modules/**",
|
||||
"--glob=!build/**",
|
||||
},
|
||||
file_ignore_patterns = { "node_modules", "build" },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
branch = 'main',
|
||||
run = ':TSUpdate',
|
||||
config = function()
|
||||
require('nvim-treesitter').setup()
|
||||
|
||||
require('nvim-treesitter').install({
|
||||
'c', 'lua', 'vim', 'vimdoc', 'query', 'markdown', 'markdown_inline', 'go'
|
||||
}):wait()
|
||||
|
||||
-- enable highlighting
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
callback = function(args)
|
||||
local max_filesize = 100 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(args.buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return
|
||||
end
|
||||
pcall(vim.treesitter.start)
|
||||
end,
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
|
||||
use 'mbbill/undotree'
|
||||
use 'mfussenegger/nvim-lint'
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = { 'nvim-tree/nvim-web-devicons', opt = true },
|
||||
config = function() require('plugins/lualine-config') end
|
||||
}
|
||||
-- use {
|
||||
-- 'm4xshen/autoclose.nvim',
|
||||
-- config = function() require("autoclose").setup() end
|
||||
-- }
|
||||
--
|
||||
use {
|
||||
"windwp/nvim-autopairs",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("nvim-autopairs").setup {}
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
'CRAG666/betterTerm.nvim',
|
||||
config = function() require('betterTerm').setup() end
|
||||
}
|
||||
|
||||
use {
|
||||
'anurag3301/nvim-platformio.lua',
|
||||
requires = {
|
||||
{ 'akinsho/nvim-toggleterm.lua' },
|
||||
{ 'nvim-telescope/telescope.nvim' },
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
},
|
||||
config = function()
|
||||
if not vim.g.is_purdue then
|
||||
require('platformio').setup({
|
||||
lsp = "clangd" --default: ccls, other option: clangd
|
||||
-- If you pick clangd, it also creates compile_commands.json
|
||||
})
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
"chentoast/marks.nvim",
|
||||
config = function() require('plugins/marks-config') end
|
||||
}
|
||||
|
||||
use {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
use { "nvim-tree/nvim-web-devicons" }
|
||||
use { "MunifTanjim/nui.nvim" }
|
||||
|
||||
use { 'rafamadriz/friendly-snippets' }
|
||||
use {
|
||||
'saghen/blink.cmp',
|
||||
run = 'cargo build --release',
|
||||
config = function()
|
||||
require("plugins/blink_config")
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
'f-person/git-blame.nvim',
|
||||
config = function()
|
||||
require("gitblame").setup {
|
||||
gitblame_delay = 1
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
-- use {
|
||||
-- 'mrcjkb/rustaceanvim',
|
||||
-- config = function() require('plugins/rust-config') end
|
||||
-- }
|
||||
|
||||
use {
|
||||
"NeogitOrg/neogit",
|
||||
config = function()
|
||||
require("neogit").setup {}
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
"mfussenegger/nvim-dap",
|
||||
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
|
||||
require('dap.ext.vscode').load_launchjs(nil, {
|
||||
node = { 'javascript', 'typescript' },
|
||||
python = { 'python' },
|
||||
go = { 'go' },
|
||||
codelldb = { 'c', 'cpp', 'rust' }
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<M-u>', function() dap.continue() end, { desc = 'DAP: Continue' })
|
||||
vim.keymap.set('n', '<M-i>', function() dap.step_into() end, { desc = 'DAP: Step Into' })
|
||||
vim.keymap.set('n', '<M-o>', function() dap.step_out() end, { desc = 'DAP: Step Out' })
|
||||
vim.keymap.set('n', '<M-p>', function() dap.step_over() end, { desc = 'DAP: Step Over' })
|
||||
vim.keymap.set('n', '<M-b>', function() dap.toggle_breakpoint() end, { desc = 'DAP: Toggle Breakpoint' })
|
||||
vim.keymap.set('n', '<F5>', function() dap.continue() end)
|
||||
vim.keymap.set('n', '<F10>', function() dap.step_over() end)
|
||||
vim.keymap.set('n', '<F11>', function() dap.step_into() end)
|
||||
vim.keymap.set('n', '<F12>', function() dap.step_out() end)
|
||||
vim.keymap.set('n', '<Leader>b', function() dap.toggle_breakpoint() end)
|
||||
vim.keymap.set('n', '<Leader>dr', function() dap.repl.open() end)
|
||||
|
||||
dap.adapters.codelldb = {
|
||||
type = "executable",
|
||||
command = "codelldb"
|
||||
}
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch file",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
},
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
use {
|
||||
'stevearc/overseer.nvim',
|
||||
config = function() require('overseer').setup() end
|
||||
}
|
||||
use 'theHamsta/nvim-dap-virtual-text'
|
||||
use {
|
||||
"rcarriga/nvim-dap-ui",
|
||||
requires = { "mfussenegger/nvim-dap", "nvim-neotest/nvim-nio" },
|
||||
config = function()
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
dapui.setup()
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
use { "geigerzaehler/tree-sitter-jinja2" }
|
||||
|
||||
use "echasnovski/mini.base16"
|
||||
|
||||
use 'rktjmp/lush.nvim'
|
||||
|
||||
use {
|
||||
"rose-pine/neovim",
|
||||
as = "rose-pine",
|
||||
config = function()
|
||||
require("rose-pine").setup({
|
||||
variant = "moon"
|
||||
})
|
||||
vim.cmd("colorscheme rose-pine")
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
'chomosuke/typst-preview.nvim',
|
||||
tag = 'v1.*',
|
||||
config = function()
|
||||
require 'typst-preview'.setup {}
|
||||
end,
|
||||
}
|
||||
|
||||
-- use "folke/which-key.nvim"
|
||||
|
||||
use({
|
||||
"andrewferrier/wrapping.nvim",
|
||||
config = function()
|
||||
require("wrapping").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
use({
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = function() vim.fn["mkdp#util#install"]() end,
|
||||
})
|
||||
|
||||
|
||||
-- use {
|
||||
-- 'preservim/vim-pencil',
|
||||
-- config = function()
|
||||
-- vim.cmd([[
|
||||
-- augroup PencilSetup
|
||||
-- autocmd!
|
||||
-- autocmd FileType markdown,text,tex,gitcommit setlocal formatoptions+=t
|
||||
-- autocmd FileType markdown,text,tex,gitcommit PencilHard
|
||||
-- augroup END augroup END
|
||||
-- ]])
|
||||
-- end
|
||||
-- }
|
||||
|
||||
use {
|
||||
'LukasPietzschmann/telescope-tabs',
|
||||
requires = { 'nvim-telescope/telescope.nvim' },
|
||||
config = function()
|
||||
require 'telescope-tabs'.setup {
|
||||
-- Your custom config :^)
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
use "HiPhish/rainbow-delimiters.nvim"
|
||||
|
||||
|
||||
------------------------
|
||||
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue