From 47be6a508c4150f8ef2627ae185c650c081c6bbf Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Sat, 4 Jun 2022 19:17:01 +0800 Subject: Add more plugins for nvim --- .vim/after/plugin/cmp.vim | 7 ++++++ .vim/after/plugin/dap.vim | 46 ++++++++++++++++++++++++++++++++++++++++ .vim/after/plugin/git.vim | 7 ++++++ .vim/after/plugin/minpac.vim | 18 ++++++++++++++++ .vim/after/plugin/nvim-lsp.vim | 9 +++++++- .vim/after/plugin/vimspector.vim | 17 +++++++++++++++ 6 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 .vim/after/plugin/dap.vim create mode 100644 .vim/after/plugin/git.vim create mode 100644 .vim/after/plugin/vimspector.vim (limited to '.vim/after/plugin') diff --git a/.vim/after/plugin/cmp.vim b/.vim/after/plugin/cmp.vim index 226f8c5..e95dd71 100644 --- a/.vim/after/plugin/cmp.vim +++ b/.vim/after/plugin/cmp.vim @@ -9,6 +9,7 @@ packadd nvim-cmp packadd cmp-buffer packadd cmp-path packadd cmp-cmdline +packadd cmp-nvim-ultisnips lua <b', dap.toggle_breakpoint) +vim.keymap.set('n', 'B', dap.list_breakpoints) +vim.keymap.set('n', 'c', dap.continue) +vim.keymap.set('n', 'n', dap.step_over) +vim.keymap.set('n', 'si', dap.step_into) +vim.keymap.set('n', 'so', dap.step_out) +vim.keymap.set('n', 'rl', dap.run_last) +vim.keymap.set('n', 'ut', dap.run_to_cursor) +vim.keymap.set('n', 'su', dap.up) +vim.keymap.set('n', 'sd', dap.down) +vim.keymap.set('n', 'K', widgets.hover) + +float_scopes = function () + widgets.centered_float(widgets.scopes) +end + +float_frames = function () + widgets.centered_float(widgets.frames) +end + +float_threads = function () + widgets.centered_float(widgets.threads) +end + +vim.keymap.set('n', 's', float_scopes) +vim.keymap.set('n', 'f', float_frames) +vim.keymap.set('n', 't', float_threads) +vim.keymap.set('n', 'r', dap.repl.toggle) + +dap_go.setup() + +EOF + diff --git a/.vim/after/plugin/git.vim b/.vim/after/plugin/git.vim new file mode 100644 index 0000000..687f2ab --- /dev/null +++ b/.vim/after/plugin/git.vim @@ -0,0 +1,7 @@ +if has('nvim') + let g:gitblame_enabled = 0 + + packadd plenary.nvim + packadd diffview.nvim + packadd git-blame.nvim +endif diff --git a/.vim/after/plugin/minpac.vim b/.vim/after/plugin/minpac.vim index baaac09..a557fda 100644 --- a/.vim/after/plugin/minpac.vim +++ b/.vim/after/plugin/minpac.vim @@ -23,13 +23,28 @@ function! InitMinpac() abort call minpac#add('https://github.com/ctrlpvim/ctrlp.vim.git', {'type': 'opt'}) call minpac#add('https://github.com/FelikZ/ctrlp-py-matcher.git', {'type': 'opt'}) call minpac#add('https://github.com/preservim/tagbar.git') + call minpac#add('https://github.com/puremourning/vimspector', {'type': 'opt'}) + + call minpac#add('https://github.com/nvim-lua/plenary.nvim', {'type': 'opt'}) + call minpac#add('https://github.com/sindrets/diffview.nvim', {'type': 'opt'}) + call minpac#add('https://github.com/f-person/git-blame.nvim', {'type': 'opt'}) + + call minpac#add('https://github.com/simrat39/symbols-outline.nvim', {'type': 'opt'}) call minpac#add('https://github.com/neovim/nvim-lspconfig', {'type': 'opt'}) + call minpac#add('https://github.com/ray-x/lsp_signature.nvim', {'type': 'opt'}) + + call minpac#add('https://github.com/mfussenegger/nvim-dap', {'type': 'opt'}) + call minpac#add('https://github.com/rcarriga/nvim-dap-ui', {'type': 'opt'}) + call minpac#add('https://github.com/leoluz/nvim-dap-go', {'type': 'opt'}) + call minpac#add('https://github.com/hrsh7th/nvim-cmp', {'type': 'opt'}) call minpac#add('https://github.com/hrsh7th/cmp-buffer', {'type': 'opt'}) call minpac#add('https://github.com/hrsh7th/cmp-path', {'type': 'opt'}) call minpac#add('https://github.com/hrsh7th/cmp-nvim-lsp', {'type': 'opt'}) call minpac#add('https://github.com/hrsh7th/cmp-cmdline', {'type': 'opt'}) + call minpac#add('https://github.com/quangnguyen30192/cmp-nvim-ultisnips', {'type': 'opt'}) + call minpac#add('https://github.com/nvim-treesitter/nvim-treesitter', { \ 'type': 'opt', \ 'do': 'if has("nvim") | packadd nvim-treesitter | :TSUpdate | endif', @@ -84,6 +99,9 @@ function! InitMinpac() abort call minpac#add('https://github.com/ledger/vim-ledger.git') call minpac#add('https://github.com/axvr/org.vim.git') call minpac#add('https://github.com/chr4/nginx.vim') + call minpac#add('https://github.com/iamcco/markdown-preview.nvim', { + \ 'type': 'start', + \ 'do': 'call mkdp#util#install()'}) let g:minpac_initialized = 1 endfunction diff --git a/.vim/after/plugin/nvim-lsp.vim b/.vim/after/plugin/nvim-lsp.vim index f6d23c3..d36ed3d 100644 --- a/.vim/after/plugin/nvim-lsp.vim +++ b/.vim/after/plugin/nvim-lsp.vim @@ -4,11 +4,15 @@ endif packadd nvim-lspconfig packadd cmp-nvim-lsp +packadd symbols-outline.nvim +packadd lsp_signature.nvim lua <f', vim.lsp.buf.formatting, bufopts) + vim.keymap.set('n', 's', symbols_outline.toggle_outline) + vim.cmd [[ - autocmd! BufWritePre *.go,*.rs lua vim.lsp.buf.formatting_sync(nil, 1000) + autocmd BufWritePre *.go,*.rs lua vim.lsp.buf.formatting_sync(nil, 1000) ]] + lsp_signature.on_attach() end local servers = { 'clangd', 'gopls' , 'gdscript', 'pylsp' } diff --git a/.vim/after/plugin/vimspector.vim b/.vim/after/plugin/vimspector.vim new file mode 100644 index 0000000..7157afb --- /dev/null +++ b/.vim/after/plugin/vimspector.vim @@ -0,0 +1,17 @@ +packadd vimspector + +nmap di VimspectorBalloonEval +xmap di VimspectorBalloonEval + +nmap db VimspectorToggleBreakpoint +nmap dB VimspectorBreakpoints + +nmap dc VimspectorContinue +nmap dr VimspectorRstart +nmap dn VimspectorStepOver +nmap dsi VimspectorStepInto +nmap dso VimspectorStepOut + +nmap dut VimspectorRunToCursor +nmap dq :VimspectorReset + -- cgit v1.2.3