the behavior of IntelliJ Idea Vim is something strange - intellij-idea

I use Ctrl+k for exiting Insert mode.
So, I did the key mapping on IntelliJ.
enter image description here
it seems work well. But, something is wrong.
When I type Ctrl+k, it looks exited insert mode.
but after the input ctrl+k, next input is not recognize.
it's difficult to explain for my poor English. so please try setting Ctrl+k as a Exit Insert Mode, and check the behavior.
thank you for your help.

You should configure alternative shortcuts for the Vim emulation keys as Vim key mappings as in the original Vim. See the Vim help for :map commands. You can put those mapping into your ~/.ideavimrc.
A small example:
inoremap <C-K> <Esc>
Configuring them via "File | Settings | Keymap" is not supported.

Related

How do I disable auto-indent on Kakoune?

I don't like text editors that perform auto-indentation in my code, because of various reasons, but Kakoune seems to be hardcoded to do that? Is it possible to disable it?
I couldn't find any defined "hooks" for indent, just for autocomplete.
Just run :set global disabled_hooks .*-indent in your Kakoune window or put
set global disabled_hooks .*-indent
in your kakrc.
Found the answer at https://github.com/mawww/kakoune/wiki/How-To#disable-auto-indentation, although it wasn't immediately clear what "disabled_hooks option" meant.
It's not strictly an answer to your question, but I sometimes need to paste text into kakoune over an SSH session from Windows. In vim, I could do :set paste/:set nopaste.
In kakoune, I found I can enter insert mode with disabled hooks (see "Disabling Hooks" in https://discuss.kakoune.com/t/hooks/544) by typing in a \ first, e.g. \i. Then I paste the text without indentation fuss and can leave insert mode again. Neat!

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

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.

How to open class file in IdeaVim through shortcut?

I'm using IntelliJ IDEA with IdeaVim. Usually I can open any class file by shortcut Ctrl+N without IdeaVim, which is really handy. However when I switched to IdeaVim, The shortcut doesn't work both in Normal Mode and Insert Mode. Neither can I find a settings option in the following dialog.
I'd really appreciate that if anyone can shed light on this issue. :)
You can use :actionlist *class* to find an IDE action for going to the definition of a class.
You can use the found action :action GotoClass as a Vim command-mode command.
You can map this command to any key combination in any Vim mode you want using the :map family of Vim commands, e.g. :nmap ,c :action GotoClass<CR>.
You can put your mapping command into ~/.ideavimrc so it'll load at startup:
~/.ideavimrc:
nmap ,c :action GotoClass<CR>
Change handler(last column in this image) of this shourtcut to IDE.

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

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.