Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are ways to reduce mode errors while learning vim?

I frequently make mode errors while using vim, i.e. I'll start typing text while in Normal mode, or start typing commands while in Insert mode. I understand this goes away with time as vim's quirks seep into your bones, but are there any ways to speed the process?

like image 999
Andrew Wagner Avatar asked Nov 27 '22 05:11

Andrew Wagner


2 Answers

I use these autocmd's to highlight the entire line containing the cursor while in insert mode, and not while in normal mode:

if v:version >= 700
  autocmd InsertEnter * set cursorline
  autocmd InsertLeave * set nocursorline
endif

This provides a little bit more visual feedback about the mode.

like image 128
Ned Batchelder Avatar answered Dec 11 '22 03:12

Ned Batchelder


If you haven't done so already you can display the current mode by using :set showmode. That'll display -- INSERT -- in the status bar when in insert mode.

like image 26
Brian Rasmussen Avatar answered Dec 11 '22 02:12

Brian Rasmussen