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

Implement vim previous and forward location shortcuts (Ctrl+O, Ctrl+I) between files #25

Open
usamytch opened this issue Feb 18, 2014 · 13 comments

Comments

@usamytch
Copy link

First, thank you for a great plugin!

Previous and forward shortcuts don't work when moving between files. You can reproduce it by go to definition outside from current file and then pushing Ctrl + O. You'll be moved to the beginning of a definition file, not to original file.

@hluk
Copy link
Owner

hluk commented Feb 18, 2014

Oh, true. Shouldn't be too difficult to implement since you already can jump to other files using marks -- this will just make the jumplist global.

@hluk
Copy link
Owner

hluk commented Feb 19, 2014

Well, it seems it won't be easy to implement after all. Vim has jumplist for each window. In Qt Creator, each splits would need to have its own jumplist and that could get really complicated.

I won't be doing this any time soon, so we'll have to live with Qt Creator's Alt+Left and Alt+Right to jump to old positions across multiple files.

@ANtlord
Copy link

ANtlord commented Feb 5, 2016

Hello! As temporary solution, I can suggest bind Ctrl+I Ctrl+O to user commands, in User Command Mapping, that will call GoBack and GoForward. Behaviour of this commands are similar to behaviour of VIM moving.

But I've got another issue. When goes to another file, say by FollowSymbolUnderCursor, then I move cursor to some lines up or down, after this I can't go back.

I use case, that I decripted above, when I type my User Command directly it doesn't works too.

I use it on Windows 7.
Qt Creator 3.6.0
Based on Qt 5.5.1 (MSVC 2013, 32 bit). Fakevim is 3.6.0 too.

I have one more question, how do you debug this project? And if you don't have a time, can you say me, where can I start bug in code.

Sorry, if my english is not clear.

@hluk
Copy link
Owner

hluk commented Feb 6, 2016

I don't use user commands in Qt Creator. If you want to debug Qt Creator behavior you will have to build it in debug mode (or perhaps just the plugin).

This project is stand-alone library for Qt application and not plugin to Qt Creator though they share the same code base. I fix bug and implement features first for the plugin since there are automated tests and code review.

@ANtlord
Copy link

ANtlord commented Feb 8, 2016

Mmm. I've got it. So... thank you. I will take a look on QtCreator.

@sheinz
Copy link

sheinz commented Oct 7, 2016

I can't figure out how to map Ctr-O/Ctrl-I to QtCreator's "GoBack"/"GoForward".
It seems like FakeVim intercepts those key bindings.
Is there a way to let Ctrl-O/Ctrl-I to go to QtCreator in FakeVim mode?
Thanks

@hluk
Copy link
Owner

hluk commented Oct 7, 2016

@sheinz You have to disable "Pass control key" in FakeVim configuration in Qt Creator. Alternatively you can also do :map <C-O> ,<C-O> (comma is to enter special PASS mode) selectively for shortcuts you want to pass to IDE (more info at https://bugreports.qt.io/browse/QTCREATORBUG-14413).

@sheinz
Copy link

sheinz commented Oct 19, 2016

I still haven't reached the desired behaviour.
I have unchecked "Pass control key" in my FakeVim setting page.
I have the following .vimrc:

map <C-O> ,<C-O>
map <C-I> ,<C-I>
map <C-]> ,<C-]>

And I reassigned "GoForward", "GoBack" and "FollowSymbol" in QtCreator to <C-I>, <C-O> and <C-]>.

Now when I press <C-]> the status line displaying PASSING and nothing happens. If I press <C-]> once more "FollowSymbol" operation is performed. So, I have to press each key sequence twice :(

Am I doing something wrong?
My FakeVim version is 4.0.2 (4.0.0)

Thanks

@hluk
Copy link
Owner

hluk commented Oct 19, 2016

@sheinz Try using noremap instead of map. Also this may not work for some shortcuts and functionality in Qt Creator.

@sheinz
Copy link

sheinz commented Oct 20, 2016

@hluk Unfortunately noremap doesn't work, no reaction on key press. :(

@ANtlord
Copy link

ANtlord commented Oct 20, 2016

@sheinz nmap instead noremap?

@sheinz
Copy link

sheinz commented Oct 20, 2016

@ANtlord with nmap the behaviour is the same as with map: have to press key sequence two times to trigger the action. Also red status "Recursive mapping" is displayed sometimes.

@amosbird
Copy link

@sheinz Hmm, have you found a solution for that?

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

5 participants