vim-lsp icon indicating copy to clipboard operation
vim-lsp copied to clipboard

Feature request: Automatically open fold after jumping to definition with `:LspDefinition` when `&foldopen` includes `'jump'`

Open lukelbd opened this issue 10 months ago • 0 comments

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).

Thanks for all your work on this awesome project!

lukelbd avatar Sep 28 '23 13:09 lukelbd