87 votes
Accepted

Other ways to exit Insert mode besides Escape

A common binding you'll see is jj, because it works well for QWERTY layouts if you use home row positioning. inoremap jj <ESC> In that case, to type a literal jj - you should wait for 1 sec (...
user avatar
  • 1,034
85 votes
Accepted

Why does vim use hjkl for cursor keys?

From http://www.catonmat.net/blog/why-vim-uses-hjkl-as-arrow-keys/: When Bill Joy created the vi text editor he used the ADM-3A terminal, which had the arrows on hjkl keys. Naturally he reused the ...
user avatar
  • 15.2k
58 votes

Other ways to exit Insert mode besides Escape

Beside the built-in alternatives <C-[> and <C-c> to <Esc> key cited by others, another popular solution is to remap <CapsLock> as an additional Escape. This both on a Qwerty ...
user avatar
39 votes

Other ways to exit Insert mode besides Escape

The mappings that I use are: inoremap jk <esc> inoremap kj <esc> This way, you can simply hit j and k at the same time, without having to worry about which one you press first.
user avatar
  • 13.8k
28 votes
Accepted

How do I keep accidentally creating a no break space before opening curly brace?

Others have already provided work-arounds, but as for the reason why it happens, I bet you're accidentally pressing Alt+Space. I'm using Xubuntu with the 105-key Finnish keyboard layout myself, so ...
user avatar
26 votes

Why does vim use hjkl for cursor keys?

Nobe4's answer is great, and explains why we use hjkl very well. However, it's really interesting to see the full keyboard, and a lot of strange things about vim make more sense when you can see the ...
user avatar
  • 16.8k
21 votes

Other ways to exit Insert mode besides Escape

<C-[> and <C-c> are two native alternatives to <Esc>. See :help i_<esc> and :help i_ctrl-c which explains the difference between <C-c> and <Esc>.
user avatar
  • 33.1k
21 votes
Accepted

Why doesn't my numpad work right in my terminal?

Short answer Turn off “application keypad mode switching.” Terminal-specific instructions PuTTY (also here): Terminal > Features > uncheck Disable application keypad mode SecureCRT: Session ...
user avatar
  • 753
20 votes

How do I keep accidentally creating a no break space before opening curly brace?

You can add an autocommand that replaces non-breaking spaces with regular ones upon saving particular file types, eg. by putting something like this in your vimrc: augroup RemoveSpaces autocmd! ...
user avatar
17 votes

Why does vim use hjkl for cursor keys?

As to why these arrows were printed on these keys... it's because they could be used with the control key for local cursor movement. Ctrl-H and Ctrl-J (backspace and line feed) are obvious, and an ...
user avatar
  • 1,172
16 votes

How do I keep accidentally creating a no break space before opening curly brace?

The 'listchars' option provides a means to make 'list' display non-breaking spaces. It's not set by default, so you probably want to add it. set listchars+=nbsp:‗
user avatar
  • 10.4k
13 votes
Accepted

Using marks with dead keys

Try making it a mapping: " Mapping dead keys in normal mode nmap á 'a That way, when Vim gets the accented a, it interprets it as `+a Using nmap allows this to happen in normal mode only; in insert ...
user avatar
  • 8,072
12 votes

What is the most convenient way to work with different keyboards in vim?

As I said in the comments, mappings in are not designed to do what you want to do. An interesting option for this use case is langmap. This option allows to keep the behavior or your keyboard in ...
user avatar
  • 46.5k
11 votes
Accepted

How can I modify Vim to work with a different keyboard layout?

:help langmap You can remap keys in command mode but leave them intact for typing. This means you can use the intent of hjkl - adjacent homerow keys for scrolling - by pressing the positional ...
user avatar
8 votes

Other ways to exit Insert mode besides Escape

I would suggest using my plugin vim-easyescape. Plug "zhou13/vim-easyescape" let g:easyescape_chars = { "j": 1, "k": 1 } let g:easyescape_timeout = 100 cnoremap jk <ESC> cnoremap kj <ESC> ...
user avatar
8 votes

How to enter tilde (~), back tick (`) and special chars with a non-US keyboard?

From :he digraph: Digraphs are used to enter characters that normally cannot be entered by an ordinary keyboard. Running :digraphs will show you the currently defined digraphs. ` is defined as '!...
user avatar
  • 1,357
7 votes
Accepted

How can I create a pseudo insert mode with a different keymap?

Vim has something like this in the form of keymaps. From :help mbyte-keymap: When the keyboard doesn't produce the characters you want to enter in your text, you can use the 'keymap' option. This ...
user avatar
  • 16.9k
7 votes
Accepted

What is the most convenient way to work with different keyboards in vim?

I would recommend keymap, which can solve your trouble. Put these in your vimrc " set keymap=greek_utf-8 set iminsert=0 set imsearch=-1 to disable Greek as a default.You can toggle the option on (...
user avatar
  • 1,121
7 votes

Other ways to exit Insert mode besides Escape

You can map Caps Lock to Control without installing any extra software: In Mac OS X visit System Preferences > Keyboard -> Modifier Keys In Linux execute: setxkbmap -option caps:ctrl_modifier ...
user avatar
  • 3,442
7 votes
Accepted

german umlaute mapping

You might want to look into digraphs, which give you a built-in solution to accents and umlauts in Vim. For umlauted "u" you can type: Ctrl+K, :, u Or: Ctrl+K, u, : See :help digraphs-use for ...
user avatar
  • 26.2k
6 votes

Other ways to exit Insert mode besides Escape

If you have an US English keyboard, pressing Ctrl-[ is equivalent for pressing Esc. This provides an easy way to exit from insert mode. Alternatively use Ctrl-c. If you've vim in easy mode (-y), then ...
user avatar
  • 16.8k
5 votes
Accepted

Can I write Japanese (SKK) text in Vim?

OK, this took several days of struggle against the skk.vim plugin mentioned by @SatoKatsura. All the documentation is in Japanese therefore I still do not know of most of its features, and, certainly,...
user avatar
  • 1,616
5 votes
Accepted

How to open a vertical split to the main view not just next to the current one in case of horizontal splitted viewport?

There isn't one single builtin command to open the buffer and position it, I don't believe. Option #1: Well, it turns out there is. The :botright {cmd} style of commands (e.g. :botright vsplit). If @...
user avatar
  • 18.4k
4 votes

Other ways to exit Insert mode besides Escape

In terminal vi and Vim, alt + single-normal-mode-key will work for quick edits in most terminals. This works because most terminals send the alt modifier as the escape character. For example, when ...
user avatar
  • 226
4 votes
Accepted

Use the same key for `, ~, esc

As far as I know there is no built-in support for mappings that change based on the time you hold the key. But as the problematic key is Esc, you have some good alternatives: Use Ctrl+[, which works ...
user avatar
  • 6,420
4 votes

Can I write Japanese (SKK) text in Vim?

Since I was in search for a good way to input unicode Japanese characters in VIM, this post was really helpful. I tried using skk.vim but found it really difficult, because contrary to the OP, I ...
user avatar
  • 141
4 votes

How do international users use Ctrl-] efficiently? Remapping?

In the place where ANSI US has [ and ] Nordic keyboards have å and ¨, of which the latter is really not bindable, since it sends "half a character" and waits for the character to be accented. For ...
user avatar
  • 141
4 votes

How do I swap key bindings without breaking plugins?

I think your best bet would be to remap everything that uses s in all modes. You are already aware of the command for normal mode I think, nnoremap. This changes the normal mode mapping only. Once you ...
user avatar
  • 912
4 votes

How do I swap key bindings without breaking plugins?

EDIT @Octaviour's solution is way smarter, you should use it :-) Nonetheless I'll leave this answer here because I worked on it and because it contains some interesting part about the usage of <SID&...
user avatar
  • 46.5k
4 votes
Accepted

NERDTreeMenu Remapping

if you look at the documentation (:help NERDTree-t), you'll see that each of the command have a name and a default key. To remap for example NERDTreeMapUpdir to the 'a' key, you just have to add to ...
user avatar
  • 256

Only top scored, non community-wiki answers of a minimum length are eligible