User:Chili b/Vim

From Extremely Corporate Wiki
Jump to navigation Jump to search

Here is the minimal Vim configuration I use on most remote servers on which I have an account. I have a more elaborate configuration for my own machines, but it would be troublesome to duplicate that to every computer I use.

set number
set mouse=ai
set colorcolumn=80

" tabs for indentation
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab

" auto indent settings
filetype indent plugin on
set backspace=indent,eol,start
set autoindent

" show status line
set laststatus=2

" remember cursor position
autocmd BufReadPost *
    \ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
    \ |   exe "normal! g`\""
    \ | endif

" highlights
hi LineNr ctermfg=blue cterm=none
hi ColorColumn ctermbg=lightgray