VIM Runtime Configuration File (.vimrc)
Vim is a cross-platform text editor based on vi text editor
program for Unix. Most Unix-like systems have vim preinstalled but if the
system does not have vim then use system package manager to install vim.
For example, on Ubuntu system use apt install vim
. However, sometimes the
default configuration is not enough to get most out of the vim, text editor.
So one of the ways to customize the vim experience is by creating a .vimrc
file in the user’s home directory.
Here is my vim runtime configuration file (.vimrc),
syntax on
set number
set numberwidth=1
set tabstop=4
set shiftwidth=4
set smartindent
set expandtab
set showcmd
set incsearch
set hlsearch
set ruler
set background=dark
set softtabstop=4
set autoindent
set shiftround
filetype on
filetype plugin indent on
" highlight column 79
if exists('+colorcolumn')
set colorcolumn=79
else
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>79v.\+', -1)
endif
" remember the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
Please provide any feedback using the comments below, and I invite you to check out following posts.