Skip to content
This repository has been archived by the owner on Mar 25, 2020. It is now read-only.

Commit

Permalink
Move to more vim-like mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
tjdevries committed Nov 19, 2016
1 parent 9eb9c8d commit 5f22284
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
13 changes: 13 additions & 0 deletions autoload/langserver/mappings.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@


function! langserver#mappings#default(opts) abort
" Goto mappings
nnoremap <Plug>(langserver_goto_request) :<c-u>call langserver#goto#request()<CR>
" Hover mappings
nnoremap <silent> <Plug>(langserver_hover_request) :call langserver#hover#request()<CR>
" Reference mappings
nnoremap <silent> <Plug>(langserver_textdocument_references) :call langserver#references#request()<CR>
endfunction

8 changes: 4 additions & 4 deletions plugin/langserver.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ command! LSPGoto call langserver#goto#request()
" Request a hover
command! LSPHover call langserver#hover#request()



nnoremap <leader>gd :call langserver#goto#request()<CR>
nnoremap <leader>gh :call langserver#hovoer#request()<CR>
let s:mapping_options = get(g:, 'langserver_mapping_options', {})
call langserver#mappings#default(s:mapping_options)
nmap <leader>gd <Plug>(langserver_goto_request)
nmap <leader>gh <Plug>(langserver_hover_request)

0 comments on commit 5f22284

Please sign in to comment.