New answers tagged

2 votes

How to map q for saving and quitting?

(cross-posted from SO) First things first: Vim is Vim, not Vi. They have lots of things in common but even more differences. If you absolutely want to learn from a book, pick a book about Vim, not a ...
romainl's user avatar
  • 40k
2 votes

How to map q for saving and quitting?

The answer of @MaximKim is the modern one. When Joy and Horton say at paragraph 6.9: :map q :wq^V^VCR CR They actually mean: :map q :wqCtrl vCtrl vEnterEnter The document you are reading is about vi ...
Vivian De Smedt's user avatar
2 votes
Accepted

How to map q for saving and quitting?

Only for normal mode: nnoremap q :<C-u>wq<CR> or nnoremap q <cmd>wq<CR> PS, be aware with mapped q you will have trouble to work with macro recordings.
Maxim Kim's user avatar
  • 13.1k

Top 50 recent answers are included