diff --git a/autoload/langserver/mappings.vim b/autoload/langserver/mappings.vim new file mode 100644 index 0000000..e27166b --- /dev/null +++ b/autoload/langserver/mappings.vim @@ -0,0 +1,13 @@ + + +function! langserver#mappings#default(opts) abort + " Goto mappings + nnoremap (langserver_goto_request) :call langserver#goto#request() + + " Hover mappings + nnoremap (langserver_hover_request) :call langserver#hover#request() + + " Reference mappings + nnoremap (langserver_textdocument_references) :call langserver#references#request() +endfunction + diff --git a/plugin/langserver.vim b/plugin/langserver.vim index f0ce6df..e5a53ac 100644 --- a/plugin/langserver.vim +++ b/plugin/langserver.vim @@ -17,7 +17,7 @@ command! LSPGoto call langserver#goto#request() " Request a hover command! LSPHover call langserver#hover#request() - - -nnoremap gd :call langserver#goto#request() -nnoremap gh :call langserver#hovoer#request() +let s:mapping_options = get(g:, 'langserver_mapping_options', {}) +call langserver#mappings#default(s:mapping_options) +nmap gd (langserver_goto_request) +nmap gh (langserver_hover_request)