I use set foldlevelstart=0 in .vimrc to have all folds closed whenever I open new files. As a result, after jumping to a definition in an unopened file with :LspDefinition, I often have to hit zv to show the definition under the cursor. I tried the maps noremap gd <Cmd>LspDefinition<CR>zv and noremap gd <Cmd>LspDefinition \| feedkeys('zv', 'n')<CR> but both fail to open the fold (perhaps due to asynchronous processing of LspDefinition?).
Is there any way to get vim-lsp to open a fold after jumping by default? Perhaps vim-lsp could do this automatically whenever the &foldopen setting contains the string 'jump' (to be consistent with built-in jumping methods like gd).
I use
set foldlevelstart=0
in.vimrc
to have all folds closed whenever I open new files. As a result, after jumping to a definition in an unopened file with:LspDefinition
, I often have to hitzv
to show the definition under the cursor. I tried the mapsnoremap gd <Cmd>LspDefinition<CR>zv
andnoremap gd <Cmd>LspDefinition \| feedkeys('zv', 'n')<CR>
but both fail to open the fold (perhaps due to asynchronous processing ofLspDefinition
?).Is there any way to get vim-lsp to open a fold after jumping by default? Perhaps vim-lsp could do this automatically whenever the
&foldopen
setting contains the string'jump'
(to be consistent with built-in jumping methods likegd
).Thanks for all your work on this awesome project!