Fixing vim

From Da Nerd Mage Wiki
Jump to navigation Jump to search

VIM (& fixing it on Debian)

(as installed on Debian) has mouse weirdness. Selecting text with the mouse automatically enters visual mode. This prevents useful things like using the mouse to copy/paste while editing in the terminal. (Visual Mode is stupid...)

Solution

Either enter:

  • :set mouse-=a

during an editing session, or even better, put it (without the leading colon) in your ~/.vimrc file. (create the .vimrc file if it's not already there...)

  • vim ~/.vimrc
set mouse-=a

If you tend to use vim via sudo a lot... (duh... Who doesn't?)

  • sudo vim ~root/.vimrc

Sadly, this seems to turn off the colour syntax hilighting.

But!

add

syntax on

to the .vimrc files & it's back.