We have learned several things to configure vim. Especially the set command is aimed to configure some vim features. All those settings can be written in a single file and will be executed before vim startup. This file is called .vimrc and should be placed in your home directory (on unix systems). On Windows systems the file is called _vimrc. Look “:help vimrc” for more information. In .vimrc all commands are read as an ex command. So you don’t need to write the prepended colons.
Note: When starting vim on a console, using the -c option (execute command), the command will be executed after .vimrc is read. Using the –cmd option will change this behaviour (before .vimrc is read).
set ignorecase
We already talked about it in the section “find, search, grep”. This makes searches incase-sensitive. It’s abbreviation is “set ic”. Prepending “no” will (of course) lead to the opposite behaviour.
set nocompatible
This makes Vim starting in compatibility mode. For example everything is interpreted as an command and no cursor keys are available (as it is in Vi) and every Vim reference tells you to turn it off, because using newer Vim plugins might result in an error, because those plugin are not compatible with old versions of Vim.Using a file named “.vimrc” disables the compatibility flag in most cases automatically.
set nodigraph
Digraph is a feature by Vim to create special characters. For example typing 1<BS>2 will result in ½. I really make typing mistakes often and as far as I don’t use commands to delete sequences in an text, the backspace key is very important for me. So I really recommend to turn it off. I only use Vim for programming and special characters in source code is also bad.
So using these settings will result in an .vimrc like (comments are written with an introducing double-quote “)
" My vimrc set ignorecase " case-insensitive searches set nocompatible " no compatibility mode set nodigraph " no digraph

Recent Comments