Skip to main content
Slightly rephrase
Source Link
Marco
  • 34.3k
  • 11
  • 115
  • 147

Create a custom mapping for frequenly used tasks. If you quit vim often, then create a mapping with few key strokes, e.g.

nnoremap <leader><leader> :xa<cr> 

If the <leader> is set to comma using let mapleader = "," then hitting the comma twice is a quick way of quitting vim and saving your changes. If you want to save one more key stroke when you are in insert mode, also create ana corresponding insert mode mapping:

inoremap <leader><leader> <esc>:xa<cr> 

But beware, this might accidentally quite vim when you hit the <leader twice.

Create a custom mapping for frequenly used tasks. If you quit vim often, then create a mapping with few key strokes, e.g.

nnoremap <leader><leader> :xa<cr> 

If the <leader> is set to comma using let mapleader = "," then hitting the comma twice is a quick way of quitting vim and saving your changes. If you want to save one more key stroke when you are in insert mode, also create an insert mode mapping:

inoremap <leader><leader> <esc>:xa<cr> 

But beware, this might accidentally quite vim when you hit the <leader twice.

Create a custom mapping for frequenly used tasks. If you quit vim often, create a mapping with few key strokes, e.g.

nnoremap <leader><leader> :xa<cr> 

If the <leader> is set to comma using let mapleader = "," hitting comma twice is a quick way of quitting vim and saving your changes. If you want to save one more key stroke when you are in insert mode, also create a corresponding insert mode mapping:

inoremap <leader><leader> <esc>:xa<cr> 

But beware, this might accidentally quite vim when you hit the <leader twice.

Source Link
Marco
  • 34.3k
  • 11
  • 115
  • 147

Create a custom mapping for frequenly used tasks. If you quit vim often, then create a mapping with few key strokes, e.g.

nnoremap <leader><leader> :xa<cr> 

If the <leader> is set to comma using let mapleader = "," then hitting the comma twice is a quick way of quitting vim and saving your changes. If you want to save one more key stroke when you are in insert mode, also create an insert mode mapping:

inoremap <leader><leader> <esc>:xa<cr> 

But beware, this might accidentally quite vim when you hit the <leader twice.