" $Id$ " Options set autoindent " always set autoindenting on set autoread " Automatically read buffers if file changed on disk set autowrite " Automatically save before commands like :next and :make set backspace=2 " allow backspacing over everything in insert mode "set backup " keep a backup file set backupskip=/tmp/*,$TMPDIR/*,*.tmp set nocompatible " Use Vim defaults (much better!) set fileencodings=ucs-bom,utf-8,default,latin1 set nofoldenable set hidden " use multiple buffers set hlsearch " highlight matches set ignorecase " Do case insensitive matching set incsearch " Incremental search set list " show tabs et al. set lcs=tab:·\ ,trail:· " how to show tabs set nojoinspaces " \frenchspacing set nrformats=hex " drop octal number format set ruler " Show the line and column numbers of the cursor set rulerformat=%22(%n:%l/%L,%c%V%=%P%) set scrolloff=3 " always show n lines before and after current linE set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set smartcase " Do case-sensitive case sensitive matching "set statusline=\ %n:%<%f%M%R%W\ %y%a%=%l/%L,%c%V\ %P\ set nostartofline " Do not move to start of line on buffer change etc. "set textwidth=0 " Don't wrap words by default set title " Set xterm title ... to: nmap _t :set titlestring=vim\ -\ %n:%f\ %(%{Tlist_Get_Tagname_By_Line()}\ %)%(%R%M%W\ %)%y%k:TlistUpdate set titlestring=vim\ -\ %n:%f\ %(%R%M%W\ %)%y%k "set nottybuiltin term=$TERM " Make vim consult the external termcap entries first set viminfo='20,\"50,h " read/write a .viminfo file, don't store more than " 50 lines of registers, do not highlight searches set wildmode=longest,list:longest,list:full " filename tab completion let g:is_posix=1 " sh syntax is POSIX filetype plugin indent on " Key bindings nmap :bp nmap :bp nmap :bn imap imap nmap nmap - nmap M :make! set pastetoggle= " turn on/off paste in insert mode " wurstfinger mode imap nmap :set invlist imap :set invlist nmap :b1 nmap :b2 nmap :b3 nmap :b4 nmap :b5 nmap :b6 nmap :b7 nmap :b8 nmap :b9 nmap :b10 nmap :b11 nmap :b12 nmap :b13 nmap :b14 nmap :b15 nmap :b16 nmap :b17 nmap :b18 nmap :b19 nmap :b20 " for imwheel nmap :bp nmap :bn imap :bp imap :bn " swap C arguments nmap __ :s/\([(,]\)\(.\{-0,\}\)\%#\(, *\)\(.\{-0,\}\)\([),]\)/\1\4\3\2\5/ " highlights hi NonText cterm=NONE " 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 is a color terminal if &term =~ "xterm*" set t_Co=16 set t_Sf=[3%dm set t_Sb=[4%dm endif " Screen has a title bar if &term =~ "screen*" set t_ts=]0; set t_fs= endif " Vim5 comes with syntaxhighlighting. if has("syntax") let mysyntaxfile = "~/.vim/syntax.vim" syntax on endif if has("autocmd") au BufNewFile,BufRead *.swml setf wml " Prevent accidental editing of patch .orig files autocmd BufRead *.orig set readonly " HTML (.shtml for server side) "augroup html " au! " au BufNewFile,BufRead *.html,*.htm,*.shtml imap ä ä " au BufNewFile,BufRead *.html,*.htm,*.shtml imap Ä Ä " au BufNewFile,BufRead *.html,*.htm,*.shtml imap ö ö " au BufNewFile,BufRead *.html,*.htm,*.shtml imap Ö Ö " au BufNewFile,BufRead *.html,*.htm,*.shtml imap ü ü " au BufNewFile,BufRead *.html,*.htm,*.shtml imap Ü Ü " au BufNewFile,BufRead *.html,*.htm,*.shtml imap ß ß "augroup END " 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 endif " has ("autocmd")