]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Add example of count in the docs
authorAndreas Louv <andreas@louv.dk>
Sun, 16 Apr 2023 22:09:03 +0000 (00:09 +0200)
committerAndreas Louv <andreas@louv.dk>
Sun, 16 Apr 2023 22:10:39 +0000 (00:10 +0200)
doc/lsp.txt

index bce3d0f218d6acff7b58664b3f926334728b813e..206ec37fec08b9563ac2eb1a8b23007dc8ee4a28 100644 (file)
@@ -642,8 +642,13 @@ can map these commands to keys and make it easier to invoke them.
 <
                        You may want to map a key to invoke this command: >
 
-                           nnoremap <buffer> gd <Cmd>LspGotoDefinition<CR>
-                           nnoremap <buffer> <C-W>gd <Cmd>topleft LspGotoDefinition<CR>
+           nnoremap <buffer> gd <Cmd>LspGotoDefinition<CR>
+           nnoremap <buffer> <C-W>gd <Cmd>topleft LspGotoDefinition<CR>
+<
+                       Or if you want to support [count]gd >
+
+           nnoremap <buffer> gd <Cmd>execute v:count .. 'LspGotoDefinition'<CR>
+           nnoremap <buffer> <C-W>gd <Cmd>execute 'topleft ' .. v:count .. 'LspGotoDefinition'<CR>
 <
                                                *:LspGotoImpl*
 :[count]LspGotoImpl    Jumps to the implementation of the symbol under the