Warning: Trying to access array offset on value of type bool in /data/www/freeminded.org/www/wp-content/plugins/wp-latex/wp-latex.php on line 39 vimrc @ Freeminded.org Warning: Trying to access array offset on value of type bool in /data/www/freeminded.org/www/wp-content/plugins/wp-latex/wp-latex.php on line 46

vimrc

This entry was posted by on Saturday, 17 April, 2010 at

An article about our customised .vimrc config file we use on our systems. You may want to have a look here to find out how to use Vim effectively.


" Configuration file for gvim
" Written for Debian GNU/Linux by W.Akkerman
" Some modifications by J.H.M. Dassen

set number " Regelnummers tonen
set showmode " Laat de modus zien
set showcmd " Laat halve commando's zijn (bv. 'y' in 'yy')
set bg=dark " Donkere achtergrond
set ic " Negeer 'case'
set nohlsearch " Gevonden zoektermen niet lichter maken
set nocompatible " Gebruik VIM-standaarden (veel beter :)
set backspace=2 " Laat i_ alles weghalen
set autoindent " Laat lijnen goed inspringen
"set expandtab " Weg met stomme tabs!
set tabstop=4 " Twee spaties inspringen
set shiftwidth=4 " Twee spaties inspringen in visual mode
set textwidth=0 " Woorden niet wrappen
set nobackup " Wat nou backup? ;)
set viminfo='20,\"50 " .viminfo bevat niet meer dan 50 regels ofzo
set history=50 " 50 regels commando-geheugen
set ruler " Altijd cursor tonen
set softtabstop=4 " Tja, eh, handig om tabs weg te hebben ofzo
set matchpairs=(:),{:},[:],<:>

"stukje voor handige keymaps
"map [D B
"map [C W
"map [A
"map [B
vmap _l :!/usr/share/vim/vim61/macros/align.pl left
vmap _c :!/usr/share/vim/vim61/macros/align.pl center
vmap _r :!/usr/share/vim/vim61/macros/align.pl right
vmap _j :!/usr/share/vim/vim61/macros/align.pl justify
" Don't stop visual mode after indenting
vnoremap < >gv

" Suffixes that get lower priority when doing tab completion for filenames.
" These are files we are not likely to want to edit or read.
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc

" We know xterm-debian is a color terminal
if &term =~ "xterm-debian" || &term =~ "xterm-xfree86"
set t_Co=16
set t_Sf= [3%dm
set t_Sb= [4%dm
endif

" Vim5 comes with syntaxhighlighting. If you want to enable syntaxhightlighting
" by default uncomment the next three lines.
if has("syntax")
syntax on " Default to no syntax highlightning
endif

" Debian uses compressed helpfiles. We must inform vim that the main
" helpfiles is compressed. Other helpfiles are stated in the tags-file.
set helpfile=$VIMRUNTIME/doc/help.txt

if has("autocmd")

" Set some sensible defaults for editing C-files
augroup cprog
" Remove all cprog autocommands
au!

" When starting to edit a file:
" For *.c and *.h files set formatting of comments and set C-indenting on.
" For other files switch it off.
" Don't change the order, it's important that the line with * comes first.
autocmd BufRead * set formatoptions=tcql nocindent comments&
autocmd BufRead *.c,*.h set formatoptions=croql cindent comments=sr:/*,mb:*,el:*/,://
augroup END

" Also, support editing of gzip-compressed files. DO NOT REMOVE THIS!
" This is also used when loading the compressed helpfiles.
augroup gzip
" Remove all gzip autocommands
au!

" Enable editing of gzipped files
" read: set binary mode before reading the file
" uncompress text in buffer after reading
" write: compress file after writing
" append: uncompress file, append, compress file
autocmd BufReadPre,FileReadPre *.gz set bin
autocmd BufReadPre,FileReadPre *.gz let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
autocmd BufReadPost,FileReadPost *.gz set nobin
autocmd BufReadPost,FileReadPost *.gz let &ch = ch_save|unlet ch_save
autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r")

autocmd BufWritePost,FileWritePost *.gz !mv :r
autocmd BufWritePost,FileWritePost *.gz !gzip :r

autocmd FileAppendPre *.gz !gunzip
autocmd FileAppendPre *.gz !mv :r
autocmd FileAppendPost *.gz !mv :r
autocmd FileAppendPost *.gz !gzip :r
augroup END

augroup bzip2
" Remove all bzip2 autocommands
au!

" Enable editing of bzipped files
" read: set binary mode before reading the file
" uncompress text in buffer after reading
" write: compress file after writing
" append: uncompress file, append, compress file
autocmd BufReadPre,FileReadPre *.bz2 set bin
autocmd BufReadPre,FileReadPre *.bz2 let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost *.bz2 |'[,']!bunzip2
autocmd BufReadPost,FileReadPost *.bz2 let &ch = ch_save|unlet ch_save
autocmd BufReadPost,FileReadPost *.bz2 execute ":doautocmd BufReadPost " . expand("%:r")

autocmd BufWritePost,FileWritePost *.bz2 !mv :r
autocmd BufWritePost,FileWritePost *.bz2 !bzip2 :r

autocmd FileAppendPre *.bz2 !bunzip2
autocmd FileAppendPre *.bz2 !mv :r
autocmd FileAppendPost *.bz2 !mv :r
autocmd FileAppendPost *.bz2 !bzip2 -9 --repetitive-best :r
augroup END

endif " has ("autocmd")

" Some Debian-specific things
augroup filetype
au BufRead reportbug.* set ft=mail
augroup END

" The following are commented out as they cause vim to behave a lot
" different from regular vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make


Leave a Reply