Skip to content

sethandler

Alex Pláte edited this page May 19, 2021 · 5 revisions

Configuring conflicting keys via .ideavimrc

[To Be Released]

IdeaVim allows defining handlers for the shortcuts that exist for both IDE and vim (e.g. <C-C>).

" Use ctrl-c as an ide shortcut in normal and visual modes
sethandler <C-C> n-v:ide i:vim

This option consist of an optional shortcut and a list of space separated list of handlers: mode-list:handler mode-list:handler ...
The mode-list is a dash separated list of modes that is similar to guicursor notation and defines the following modes:

  • n - Normal mode
  • i - Insert mode
  • x - Visual mode
  • v - Visual and Select modes
  • a - all modes

The handler is an argument that may accept the following values:

  • ide - use IDE handler
  • vim - use vim handler

Examples:

  • n:ide - use IDE handler in normal mode
  • i-v:vim - use vim handler in normal, visual, and select modes
  • a:ide - use IDE handler in all modes

Using sethandler you can define handlers for a single shortcut: sethandler <C-A> n:vim i-x:ide - use as vim shortcut in normal mode and as ide shortcut in insert and visual modes for ctrl-A, or you can set up handlers for all shortcuts by avoiding shortcut definition: sethandler n:vim i:ide - use vim handlers in normal mode and ide handlers in insert for all shortcuts.

If the definition of the handler is missing for some mode, it defaults to vim: sethandler <C-X> i:ide - use IDE handler in insert mode and vim handler in all other modes.

Clone this wiki locally