Make IdeaVim use IDE shortcuts in insert mode but VIM key map in normal mode - intellij-idea

I'm new to vim and still learning it but i found the shortcuts in IntelliJ are quite easy to use.
Eg: Ctrl + b for Go to declaration, Ctrl + q Show doc
I often check docs while I'm writing code and I'd like to keep the shortcuts available in insert mode(since vim key map seems mostly work with normal mode).
I read online and saw methods about adding custom key mapping for vim. Besides that, Is there anyway that I can keep all IDE shortcuts in insert mode?

Currently each shortcut like Ctrl+B is handled by either the Vim emulation or the IDE. See the docs on how to choose the handler for a shortcut.
Feel free to file a feature request here for handling Vim commands only the normal mode.

Related

Disable vim mode in PhpStorm in debug

Is it possible to disable vim in certain windows/modes? For instance in debugger it's a bit annoying, also when editing cell values in Database mode it's not perfect.
Another question if a tab can switch to command mode when I'm about to navigate to another tab.
Thanks
It's currently not possible in IdeaVim 0.50. There is a feature request that partially covers what you're describing: VIM-765 Option to disable plugin in dialog boxes. Feel free to vote for this feature and/or file new requests at https://youtrack.jetbrains.com/issues/VIM.
You can remap <Tab> to gt using standard Vim mapping commands. Put them into your ~/.ideavimrc.

Navigating between splits

I wanted to settup vim-tmux-navigation like navigation on intellij IDE and only way to settup this is from IdeaVim so my configuration in settings -> keymap looks like this:
VimWindowDown_____ alt J
VimWindowLeft______ alt L
VimWindowRight_____alt H
VimWindowUp_______ alt K
But when I split the windows it's not working.... Is this a bug or I'm missing some stuff?
Oh and don't suggest me switcher for my problem...
The best place for setting up custom keys for Vim actions is the ~/.ideavimrc file. You can use the standard Vim map/nmap/noremap/imap/... commands there. For example:
nmap <A-J> <C-W>j
For potential keymap conflicts between the Vim emulation and the IDE see Settings | Vim Emulation.
Chaning Vim actions via Settings | Keymap is not recommended.
OK, got a partial answer.
There is a "Go To Next Splitter" and "Go To Previous Splitter" commands in IntelliJ. So in the keymap settings, change or add keystrokes for those commands to C-h and C-l (or whatever you want). If you are using ideavim, don't forget to override those keymap settings so that C-h and C-l are set to use the IDE. C-h and C-l will probably already be used so be sure you don't need the existing hotkey before you make the change.
This solution will at least allow you to move left/right quickly. Not sure it's going to be possible to move between up/down splits without doing some scripting or if that's even possible to do with scripting.

IdeaVIM Keybindings not working in intellij

I just upgraded IdeaVIM to use the newly added support for window management. The problem I'm having is that the keybindings aren't working at all. I've tried editing the keymap manually, adding back the default bindings, but they're not in effect.
When I hit C-w I get some help in the modeline letting me know which keybindings are available at that prefix (l for window right, h for window left etc) but when I hit the second key nothing happens!What's going on here? I'm running ideavim 13.1.3.
NOT exactly the same problem but for me
Vimidea / Vim plugin was not working on Pycharm / Rubymine / Intellij
Finally found the solution!!!
(ON MAC)
Just make sure that you don't have a conflict with the Keymap to refactor->extract->variable and vim emulator!
Go to settings->Keymap->MainMenu->Refactor->Extract->Variable
And remove the shortcut
Now run the shortcut to make the VimEmulator to run, in Mac just hit:
Cmd+option+V (option is the key next to command)
If its still doesn't work it means that you cannot exit insert mode - make sure to bind the escape key to:
settings->Keymap->Plug-ins->ideavim->Exit Insert Mode == escape
Actually using the shortcut to start/stop VimEmulator is a great idea when you ask your team-mate help with your code and he/she is not used to working with Vim.
Just hit cmd+option+V and you are back to using the idea without Vim and again to start working with Vim again :)
You can enable/disble it through: shift-cmd-A, then type ideavim and you'll see a switch on there

how to return run default content for intellij

I used one of the best shortcuts for Intellij:
Ctrl+Shift+F10
And it runs default content, which will be open.
I don't know how, but now it really do nothing.
All other short cuts are ok. And this one is dead (doesn't work anymore).
How to return to this useful short cut (or general set to Intellij default)?
Well since you have a psvm method, and your focus is in the code for that class when you press the shortcut, and given your caps key isn't on, then you should see IntelliJ try to make before running your code.
Do you see it Making ?
If not, it's likely another plugin or action has stolen the key shortcut.
Go to Settings -> Ide Settings / Keymap, and type RunClass in the search box.
You should see this: Run context configuration -> Ctrl + Shift + F10
If the key shortcut is missing, assign it.
Hope this helps.
P.S. I was recently using the Haskell IntelliJ plugin which conflicted with this shortcut. Disabling it did the trick to restore it.

Intellij IdeaVim change keys

I would really like to be able to use IdeaVIM but I am unable to figure out where I can set my custom vim key mappings. For example instead of using Esc I would like to use Ctrl-C and instead of using hjkl I like to use wasd.
I have all these already set in my .vimrc but IdeaVIM failed to load them. I can copy them over manually to whatever file is needed but there is no documentation on how to do this.
As of IdeaVim 0.35 (released 2014-05-15), key mappings in ~/.ideavimrc are supported. You can put source ~/.vimrc in that file if you want to include mappings from ~/.vimrc.
Release announcement
VIM-288
(Note: This question could probably be considered a duplicate of this other StackOverflow question.)
I've done this myself, and its pretty easy in IntelliJ 11. I know that in previous versions (9, maybe?) setting up keymap values is significantly different.
In IntelliJ 11 you can do the following:
Go to Settings
Select Keymap from the left menu
Search for Exit Insert Mode on the right side and associate whatever key you want to use, such as CTRL-C
If you like to have Vim plugin installed (I find it very handy for typing) and at the same time have Ctrl+C and Ctrl+V working for copy and paste actions, do the following:
In the IntelliJ Idea, click on File > Setting. On the left pane, expand Editor and click on Vim Emulation.
Here, under the Shortcut column, find Ctrl+C and change it's Handler (under Handler column) to IDE instead of Vim.
Repeat it for Ctrl+V as well and hit Apply and Ok.
Now, you should be able to use the keyboard shortcuts for copy and paste while keeping the Vim Emulator enabled.
IntelliJ 12.1:
Go to Settings
Select Keymap from the left menu
Find Escape under the Editor Actions section and add the Ctrl-C shortcut there. ("Escape" under the "IdeaVim" section didn't work for me)
Following the same steps, but replacing "Escape" with "Exit Insert Mode" only partially worked for me. It exited insert mode correctly but ignored the following keystroke. So typing Ctrl-C,j,j would exit insert but only go up one line instead of two.