" pSy's vimrc 0.1 " originally from http://arch.har-ikkje.net/configs/home/dot.vim/vimrc " -[ General behaviour ]- " general set nocompatible set wrap " search set ignorecase set smartcase set incsearch set hlsearch set showmatch " indenting set autoindent set smartindent " command mode set wildmenu set wildmode=list:longest,full " -[ Look ]- " general set showcmd set showmode set number " statusline set statusline=%<%f\ %y%h%m%r\ CWD:%{getcwd()}%=%-14.(%l,%c%V%)\ %P set laststatus=2 " -[ FileTypes ]- filetype indent on " vim as pager autocmd FileType man set colorcolumn=0 " mail autocmd FileType mail,human set formatoptions+=t textwidth=72 " latex-suite filetype plugin indent on set grepprg=grep\ -nH\ $* let g:tex_flavor = "latex" " Python stuff autocmd FileType python let python_highlight_all = 1 autocmd FileType python let python_slow_sync = 1 autocmd FileType python set complete+=k/home/psy/.vim/pydiction iskeyword+=.,( autocmd bufnewfile *.py so /home/psy/.vim/headers/py autocmd bufnewfile *.py exe "1," . 10 . "g/File Name.*/s//File Name : " .expand("%") autocmd bufnewfile *.py exe "1," . 10 . "g/Creation Date :.*/s//Creation Date : " .strftime("%d-%m-%Y") autocmd Bufwritepre,filewritepre *.py execute "normal ma" autocmd Bufwritepre,filewritepre *.py exe "1," . 10 . "g/Last Modified :.*/s/Last Modified :.*/Last Modified : " .strftime("%c") autocmd bufwritepost,filewritepost *.py execute "normal Gi" autocmd FileType python setlocal omnifunc=pysmell#Complete " Ruby, YAML, HAML, SASS, JavaScript, CoffeeScript, HTML stuff autocmd FileType ruby,eruby,yaml,haml,sass,javascript,coffee,html setlocal softtabstop=2 shiftwidth=2 tabstop=2 let javaScript_fold=1 " LaTeX autocmd Filetype tex,latex set grepprg=grep\ -nH\ $ autocmd Filetype tex,latex let g:tex_flavor = "latex" autocmd bufnewfile *.tex so /home/psy/.vim/headers/tex " Less (the CSS thing) autocmd bufread,bufnewfile *.less set filetype=css " lyX autocmd bufread,BufNewFile *.lyx set syntax=lyx foldmethod=syntax foldcolumn=3 filetype=lyx autocmd bufread,BufNewFile *.lyx syntax sync fromstart autocmd Filetype lyx,lyX set grepprg=grep\ -nH\ $ autocmd Filetype lyx,lyX let g:tex_flavor = "lyx" " C autocmd bufnewfile *.c so /home/psy/.vim/headers/c autocmd bufnewfile *.c exe "1," . 6 . "g/File Name.*/s//File Name : " .expand("%") autocmd bufnewfile *.c exe "1," . 6 . "g/Creation Date :.*/s//Creation Date : " .strftime("%d-%m-%Y") autocmd Bufwritepre,filewritepre *.c execute "normal ma" autocmd Bufwritepre,filewritepre *.c exe "1," . 6 . "g/Last Modified :.*/s/Last Modified :.*/Last Modified : " .strftime("%c") autocmd bufwritepost,filewritepost *.c execute "normal `a" " HTML autocmd bufnewfile *.html so /home/psy/.vim/headers/html " Nimrod autocmd BufRead,BufNewFile *.nim set filetype=nimrod " JS SyntaxHighlighter Brush autocmd bufnewfile shBrush*.js so /home/psy/.vim/headers/syntaxhighlighterbrush.js " php autocmd bufnewfile *.php so /home/psy/.vim/plugins/phpdoc.vim autocmd bufnewfile *.php inoremap :call PhpDocSingle()i autocmd bufnewfile *.php nnoremap :call PhpDocSingle() autocmd bufnewfile *.php vnoremap :call PhpDocRange() " markdown autocmd bufread,bufnewfile *.md set filetype=markdown " blog entry auto renaming function! Blog_RenameArticle() " paranoia? if isdirectory(expand("%")) return endif let abspath = expand("%:p:h") if abspath !~ 'blog\.nkoehring\.de/src/pages/articles' return endif let filename = expand("%:t") let matches = matchlist(filename, '\(\d\{14}\)\(\p\+\)') if len(matches) > 0 let oldname = abspath.'/'.matches[0] let newname = abspath.'/'.strftime("%Y%m%d%H%M%S").matches[2] call rename(oldname, newname) execute ":saveas! ".newname else execute ":saveas " .abspath. "/" .strftime("%Y%m%d%H%M%S"). "_" .filename endif endfunction function! Blog_NewArticle() if expand("%:p:h") =~ 'blog\.nkoehring\.de/src/pages/articles' source /home/psy/.vim/headers/article.haml endif endfunction autocmd BufWritePre *.haml call Blog_RenameArticle() autocmd BufNewFile *.haml call Blog_NewArticle() " -[ Mappings ]-" " taglist nnoremap :TlistToggle inoremap :TlistTogglea nnoremap :TlistUpdate inoremap :TlistUpdatea inoremap # X# " map w!! to write as root cmap w!! w !sudo tee % >/dev/null " -[ Plugins and Scripts ]- " taglist let Tlist_Use_Right_Window = 1 let Tlist_Compart_Format = 1 let Tlist_Show_Menu = 1 let Tlist_Exit_OnlyWindow = 1