My terminal sends ^? for backspace and ^[[3~ for delete. To get these keys working in vim like they work in other programs, I put

set backspace=indent,eol,start
set t_kb=^?
set t_kD=^[[3~

into my .vimrc. Of course, one must use ^V <backspace> and ^V <delete> to insert the characters into the text.


Another set of essential settings for me is to change the arrow keys to work by visual lines, not physical lines. [HJKL isn't for me. I'm a 90s kid, all I know is ↑←↓→ and WASD.]

nnoremap <Down> gj
nnoremap <Up> gk
vnoremap <Down> gj
vnoremap <Up> gk
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk


I've found some servers which tell me "Invalid command: [vim]" and only have vi. vi is always just a link to vim, but in that awful lets-emulate-the-bad-times mode. Hence, this minimal .vimrc to get a usable environment.

set nocompatible
set backspace=indent,eol,start


Vim beeps too much. Here's how to make it STFU.

set noerrorbells visualbell t_vb=
if has(autocmd)
  autocmd GUIEnter * set visualbell t_vb=
endif

source


:set option? gets the current value of option.


Originally posted 2014-06-18, last edited 2016-01-16. | home