From 5f222846bc7cff062fb669d842c60b8fe2552d8c Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Fri, 18 Nov 2016 21:48:43 -0500 Subject: [PATCH] Move to more vim-like mappings --- autoload/langserver/mappings.vim | 13 +++++++++++++ plugin/langserver.vim | 8 ++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 autoload/langserver/mappings.vim 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)