Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to open :LspDefinition in a split #169

Closed
ghost opened this issue Aug 16, 2018 · 3 comments
Closed

Option to open :LspDefinition in a split #169

ghost opened this issue Aug 16, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 16, 2018

Hello,

Love your plugin especially the fact that it is written in vim script. However, one of the feature I'd like to use is jumping to a definition in a split. Language client provides this feature:
https://github.com/autozimu/LanguageClient-neovim/wiki/Goto-definition-in-a-split

Note that this is not the same as doing: :sp<CR> :LspDefinition<CR>
The above way would open up a split even if lsp was unable to find the definition which is not what I want. I only want to split if the definition exists.

This should be easy to do. Its the only feature I miss moving over from LanguageClient. I'd really appreciate it if you can put this option in (pretty please).

@ghost ghost changed the title :LspDefinition opens in a split Option to open :LspDefinition in a split Aug 16, 2018
@andyl
Copy link

andyl commented Sep 9, 2018

Also: jump to a definition in a tab would be great.

@andyl
Copy link

andyl commented Sep 9, 2018

Here's a workaround - put this in .vimrc

nmap \gd :LspDefinition<cr>
nmap \gt :tab split<cr>:LspDefinition<cr>
nmap \gs :sp<cr>:LspDefinition<cr>
nmap \gv :vsp<cr>:LspDefinition<cr>

@prabirshrestha
Copy link
Owner

This is now possible with <mod> which is the vim way. #776

Examples:
usage:

:leftabove LspDefinition Splits horizontally and opens a window to the above.
:rightbelow vertical LspDefinition Splits vertically and opens a window to the right.
:tab LspDefinition Opens a window to the new tabpage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants