From 744cbd90cf0c9d066d45db5707cc7a1613396bfc Mon Sep 17 00:00:00 2001 From: Warwick Date: Tue, 16 Nov 2021 12:41:19 +0000 Subject: [PATCH] Added leader paradighm so I might actually use lsp more --- plugins.vim | 25 ++++++++++++++----------- vimrc | 7 +++++-- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/plugins.vim b/plugins.vim index ebdf9f8..2c6ace0 100644 --- a/plugins.vim +++ b/plugins.vim @@ -45,6 +45,8 @@ filetype plugin indent on " required " see :h vundle for more details or wiki for FAQ " Put your non-Plugin stuff after this line +" Plugin leader mappings + " Tab completion inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" @@ -60,17 +62,18 @@ function! s:on_lsp_buffer_enabled() abort setlocal omnifunc=lsp#complete setlocal signcolumn=yes if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif - nmap gd (lsp-definition) - nmap gs (lsp-document-symbol-search) - nmap gS (lsp-workspace-symbol-search) - nmap gr (lsp-references) - nmap gi (lsp-implementation) - nmap gt (lsp-type-definition) - nmap gx (lsp-document-diagnostics) - nmap rn (lsp-rename) - nmap [g (lsp-previous-diagnostic) - nmap ]g (lsp-next-diagnostic) - nmap K (lsp-hover) + nmap l? :echon " ld lsp-definition \n ls lsp document symbol search \n lS lsp workspace symbol search \n lr lsp references \n li lsp implementation \n lt lsp type definition \n lj lsp document diagnostics \n lrn lsp rename \n l[g lsp previous diagnostic \n l]g lsp next diagnostic \n lK lsp hover" + nmap ld (lsp-definition) + nmap ls (lsp-document-symbol-search) + nmap lS (lsp-workspace-symbol-search) + nmap lr (lsp-references) + nmap li (lsp-implementation) + nmap lt (lsp-type-definition) + nmap lj (lsp-document-diagnostics) + nmap lrn (lsp-rename) + nmap l[g (lsp-previous-diagnostic) + nmap l]g (lsp-next-diagnostic) + nmap lK (lsp-hover) let g:lsp_format_sync_timeout = 1000 autocmd! BufWritePre *.rs,*.go,*.cpp,*.c,*.h,*.cs call execute('LspDocumentFormatSync') diff --git a/vimrc b/vimrc index d10089e..e58542d 100644 --- a/vimrc +++ b/vimrc @@ -95,7 +95,10 @@ hi CursorLine ctermbg=8 guibg=#404040 hi Cursor ctermbg=15 " set spellcheck "set spell -" Remap Lex -nnoremap :Lex + +" Leader mapping +let mapleader = "\" +nnoremap ? :echon " n :Lex \n l? lsp help (if implemented in buffer)" +nnoremap n :Lex " Load Plugins so ~/.vim/plugins.vim