Your .vimrc and You · Jul 20, 11:20 AM by Dylan Doxey
There you are, opening up a file in vim and you realize, "Oh, I've never used vim on this particular machine before." It can be an interesting challenge trying to enter your favorite settings all from memory. But I usually find this to be a time consuming distraction. The next time this occurs, I'm just going to cut & paste the following...
syntax on
let perl_fold = 1
let perl_fold_blocks = 1
set number
inoremap # X^H#
inoremap # X<C-H>#
set title
set background=dark
set autoindent
set backspace=indent,eol,start
set tabstop=4
set expandtab
set shiftwidth=4
set shiftround
set matchpairs+=<:>
function! CleverTab()
if strpart( getline('.'), 0, col('.')-1 ) =~ '^\s*$'
return "\<Tab>"
else
return "\<C-X>\<C-N>"
endfunction
inoremap <Tab> <C-R>=CleverTab()<CR>
inoremap <C-Tab> <C-X><C-U>
nmap <C-right> zo
nmap <C-left> zc
nmap <C-S-left> zM
nmap <C-S-right> zR
nmap <F6> :%s/ \+$// <CR>
nmap <F5> :w<CR>:! perl -Tcw %<CR>
vmap <F3> :! perltidy<CR>
set pastetoggle=<F12>
Your .vimrc lives at:
~/.vimrc

Commenting is closed for this article.
