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

GoToDefinition in a new tab #1146

Closed
j5shi opened this issue Sep 3, 2014 · 10 comments
Closed

GoToDefinition in a new tab #1146

j5shi opened this issue Sep 3, 2014 · 10 comments

Comments

@j5shi
Copy link

j5shi commented Sep 3, 2014

Could you please add (or is there) an option to go to definition in a new tab? I found nnoremap <leader>f :YcmCompleter GoToDefinition<CR> will open the buffer in the current tab view.

@vheon
Copy link
Contributor

vheon commented Sep 3, 2014

:h g:ycm_goto_buffer_command

@vheon vheon closed this as completed Sep 3, 2014
@j5shi
Copy link
Author

j5shi commented Sep 3, 2014

I couldn't find g:ycm_goto_buffer_command on help doc youcompleteme.txt, strange...I'm using YCM on windows.

@j5shi
Copy link
Author

j5shi commented Sep 3, 2014

though I added let g:ycm_goto_buffer_command = 'new-tab' to my _vimrc, nothing changed, and I'm using YCM on windows, I'm afriad my YCM is way behind the latest version.

@vheon
Copy link
Contributor

vheon commented Sep 3, 2014

I'm not sure if you have to restart vim. And this feature has been there since March 4th.

EDIT: I'm trying but it seems to be broken. Reopening.

@vheon vheon reopened this Sep 3, 2014
@vheon
Copy link
Contributor

vheon commented Sep 3, 2014

I'm investigating further and it seems that the g:ycm_goto_buffer_command options is used only when we have to move in a different file. Which is reasonable but I don't know if it is the intended behaviour, so we have to wait for @Valloric.

@Valloric
Copy link
Member

Valloric commented Sep 3, 2014

I'm investigating further and it seems that the g:ycm_goto_buffer_command options is used only when we have to move in a different file. Which is reasonable but I don't know if is the intended behaviour

This is the intended behavior. It's what most people want and adding a conf option to change this isn't worth it.

@Valloric Valloric closed this as completed Sep 3, 2014
@pbn4
Copy link

pbn4 commented Jan 6, 2016

I know it's a bit old, but the solution is to map multiple commands to one key i.e.:
nnoremap f :tab split | YcmCompleter GoToDefinition

@jnm
Copy link

jnm commented Aug 22, 2018

Now it's even older 😏 but, in case it's helpful, I found I had to escape the pipe:

nnoremap f :tab split \| YcmCompleter GoToDefinition

@forwidur
Copy link

We are almost there:
nnoremap f :tab split \| YcmCompleter GoToDefinition<CR> ;-)

@Kipparis
Copy link

Reason may be not in ycm, but in other plugins:
I noticed that jedi-vim takes control over go-to command and after specifying
let g:jedi#use_tabs_not_buffers = 1
all work as expected

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants