From 1b01726fc908c4585ace407b5de34f4a8ef103b9 Mon Sep 17 00:00:00 2001 From: D4VIDB2 Date: Fri, 19 Nov 2021 09:04:10 +0100 Subject: [PATCH] fix nvim dotnet remaps --- nvim/.config/nvim/init.vim | 113 +++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 55 deletions(-) diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index f1f2c08..2b09236 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -89,35 +89,35 @@ call plug#begin('~/.config/nvim/autoload/plugged') - " LSP: + " " LSP: - " Collection of common configurations for the Nvim LSP client - Plug 'neovim/nvim-lspconfig' + " " Collection of common configurations for the Nvim LSP client + " Plug 'neovim/nvim-lspconfig' - " Autocompletion framework - Plug 'hrsh7th/nvim-cmp' - " cmp LSP completion - Plug 'hrsh7th/cmp-nvim-lsp' - " cmp Snippet completion - Plug 'hrsh7th/cmp-vsnip' - " cmp Path completion - Plug 'hrsh7th/cmp-path' - Plug 'hrsh7th/cmp-buffer' - " See hrsh7th other plugins for more great completion sources! + " " Autocompletion framework + " Plug 'hrsh7th/nvim-cmp' + " " cmp LSP completion + " Plug 'hrsh7th/cmp-nvim-lsp' + " " cmp Snippet completion + " Plug 'hrsh7th/cmp-vsnip' + " " cmp Path completion + " Plug 'hrsh7th/cmp-path' + " Plug 'hrsh7th/cmp-buffer' + " " See hrsh7th other plugins for more great completion sources! - " Adds extra functionality over rust analyzer - Plug 'simrat39/rust-tools.nvim' + " " Adds extra functionality over rust analyzer + " Plug 'simrat39/rust-tools.nvim' - " Snippet engine - Plug 'hrsh7th/vim-vsnip' + " " Snippet engine + " Plug 'hrsh7th/vim-vsnip' - " Optional - Plug 'nvim-lua/popup.nvim' - Plug 'nvim-lua/plenary.nvim' - Plug 'nvim-telescope/telescope.nvim' + " " Optional + " Plug 'nvim-lua/popup.nvim' + " Plug 'nvim-lua/plenary.nvim' + " Plug 'nvim-telescope/telescope.nvim' - " Some color scheme other then default - Plug 'arcticicestudio/nord-vim' + " " Some color scheme other then default + " Plug 'arcticicestudio/nord-vim' call plug#end() @@ -150,7 +150,7 @@ let g:vim_http_split_vertically = 1 " Markdown -let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'xml', 'javascript', 'json', 'asm'] +let g:markdown_fenced_languages = ['html', 'python', 'bash=sh', 'xml', 'javascript', 'json', 'asm', 'cs'] let g:markdown_minlines = 100 @@ -269,8 +269,8 @@ fun! SetupDotnet() " Tell ALE to use OmniSharp for linting C# files, and no other linters. "let g:ale_linters = { 'cs': ['OmniSharp'] } - augroup omnisharp_commands - autocmd! + "augroup omnisharp_commands + "autocmd! " Show type information automatically when the cursor stops moving. " Note that the type is echoed to the Vim command line, and will overwrite @@ -278,42 +278,42 @@ fun! SetupDotnet() autocmd CursorHold *.cs OmniSharpTypeLookup " The following commands are contextual, based on the cursor position. - autocmd FileType cs nmap gd (omnisharp_go_to_definition) - autocmd FileType cs nmap gu (omnisharp_find_usages) - autocmd FileType cs nmap gi (omnisharp_find_implementations) - autocmd FileType cs nmap ospd (omnisharp_preview_definition) - autocmd FileType cs nmap ospi (omnisharp_preview_implementations) - autocmd FileType cs nmap ost (omnisharp_type_lookup) - autocmd FileType cs nmap osd (omnisharp_documentation) - autocmd FileType cs nmap osfs (omnisharp_find_symbol) - autocmd FileType cs nmap osfx (omnisharp_fix_usings) - autocmd FileType cs nmap (omnisharp_signature_help) - autocmd FileType cs imap (omnisharp_signature_help) + nmap gd (omnisharp_go_to_definition) + nmap gu (omnisharp_find_usages) + nmap gi (omnisharp_find_implementations) + nmap ospd (omnisharp_preview_definition) + nmap ospi (omnisharp_preview_implementations) + nmap ost (omnisharp_type_lookup) + nmap osd (omnisharp_documentation) + nmap osfs (omnisharp_find_symbol) + nmap osfx (omnisharp_fix_usings) + nmap (omnisharp_signature_help) + imap (omnisharp_signature_help) " Navigate up and down by method/property/field - autocmd FileType cs nmap [[ (omnisharp_navigate_up) - autocmd FileType cs nmap ]] (omnisharp_navigate_down) + nmap [[ (omnisharp_navigate_up) + nmap ]] (omnisharp_navigate_down) " Find all code errors/warnings for the current solution and populate the quickfix window - autocmd FileType cs nmap oscc (omnisharp_global_code_check) + nmap oscc (omnisharp_global_code_check) " Contextual code actions (uses fzf, vim-clap, CtrlP or unite.vim selector when available) - autocmd FileType cs nmap osca (omnisharp_code_actions) - autocmd FileType cs xmap osca (omnisharp_code_actions) + nmap osca (omnisharp_code_actions) + xmap osca (omnisharp_code_actions) " Repeat the last code action performed (does not use a selector) - autocmd FileType cs nmap os. (omnisharp_code_action_repeat) - autocmd FileType cs xmap os. (omnisharp_code_action_repeat) + nmap os. (omnisharp_code_action_repeat) + xmap os. (omnisharp_code_action_repeat) - autocmd FileType cs nmap os= (omnisharp_code_format) + nmap os= (omnisharp_code_format) - autocmd FileType cs nmap rn (omnisharp_rename) + nmap rn (omnisharp_rename) - autocmd FileType cs nmap osre (omnisharp_restart_server) - autocmd FileType cs nmap osst (omnisharp_start_server) - autocmd FileType cs nmap ossp (omnisharp_stop_server) + nmap osre (omnisharp_restart_server) + nmap osst (omnisharp_start_server) + nmap ossp (omnisharp_stop_server) - "autocmd FileType cs nmap :vs | term dotnet run - autocmd FileType cs nmap run :vs:w:term dotnet run + "nmap :vs | term dotnet run + nmap run :vs:w:term dotnet run - augroup END + "augroup END let g:OmniSharp_selector_ui = 'fzf' " Use fzf let g:OmniSharp_selector_findusages = 'fzf' @@ -360,9 +360,9 @@ endfun " Steps: " - :PlugInstall " - Restart +" - -function SetupLSP() +function! SetupLSP() " Set completeopt to have a better completion experience " :help completeopt " menuone: popup even when there's only one match @@ -502,7 +502,6 @@ EOF " colorscheme nord endfunction -:call SetupLSP() @@ -597,8 +596,12 @@ autocmd FileType java,typescript,go,cpp,h,c :call SetupYCM() autocmd FileType html,css,js,djangohtml,py,sh,lua,php :call SetupCoC() +autocmd FileType cs :call SetupDotnet() + " autocmd FileType rust :call SetupRust() +" :call SetupLSP() +