syntax on colorscheme elflord set background=dark set incsearch set nohlsearch " Disable that stupid search-highlight set nobackup " Don't write backup files that litter the disk set title " Set XTerm title set showcmd " Show (partial) command in status line. set showmatch " Show matching brackets. set smartcase " Do smart case matching set autowrite " Automatically save before stuff like :next and :make set redrawtime=200 " never waste more than X ms drawing the screen decors set scrolloff=3 set mouse= " no mouse! set t_Co=256 " moar colours "set textwidth=80 " The Standard set wildmode=longest,list,full " tab completion for files set wildignore=*.swp,*.bak,*.pyc,*.class "if exists('+colorcolumn') " set colorcolumn=81 " do not cross here :-) "endif " help and navigation nmap :exec("tag ".expand("")) nmap " Scrolling with shift/meta + arrow map map map map imap imap imap imap " window navigation map h map l map j map k map k map j map h map l " Delete word "map d/\> " Tip #80: Restore cursor to file position in previous editing session set viminfo='10,\"100,:20,%,n~/.viminfo if has("autocmd") au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$") \| exe("norm '\"")|else|exe "norm $" | endif au BufNewFile,BufRead Cpafile, *.cap setf ruby endif " indenting if has("autocmd") filetype indent on endif " don't mess my terminal title (useless) let &titleold="rxvt" "function TrimSpaces() range " let oldhlsearch=ShowSpaces( 1) " execute a:firstline.",".a:lastline."substitute ///gec" " let &hlsearch=oldhlsearch "endfunction "nnoremap m`:TrimSpaces`` "vnoremap :TrimSpaces map :w:make:cw " BEGIN highlight bad formatting " " I can't use LongLines and RedundantSpaces both at the same time. " Instead, here's a single group for both. " " spaces " tabs " spaces after tab " tab after spaces " longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong " 345678 012345678 012345678 012345678 012345678 012345678 012345678 012345678 0 " 345678 012345678 012345678 012345678 012345678 012345678 012345678 012345678 012345678 " highlight BadFormatting cterm=NONE ctermbg=red ctermfg=black guibg=red guifg=black " highlight BadFormatting ctermbg=green ctermfg=black guibg=green guifg=black "highlight BadFormatting ctermbg=red guibg=red "match BadFormatting /\s\+$\| \+\ze\t\|.\%>80v.\+/ "match BadFormatting /\s\+$\| \+\ze\t\|\%>80v.\+/ match BadFormatting /\s\+$\| \+\ze\t\|\%<83v.\%>81v/ " ColorColumn is great, except that it messes terminal's X11 copy-paste :-( "highlight ColorColumn cterm=NONE ctermbg=red ctermfg=black gui=NONE guibg=red guifg=black "set cc=+1,+2,+3,+4 " " END highlight bad formatting " BEGIN highlight line set cursorline " comparison against t_Co is questionable at best :-( if &t_Co >= 256 highlight CursorLine cterm=NONE ctermbg=235 elseif &y_Co >= 16 " 17 = dark blue, mayhaps highlight CursorLine cterm=NONE ctermbg=17 endif "highligh CursorLine cterm=NONE ctermbg=235 ctermfg=white guibg=235 guifg=white " END highlight line " BEGIN settings for e-mail " if has("autocmd") autocmd FileType mail call FT_mail() endif function FT_mail() set textwidth=72 /^$ endfunction " " END settings for e-mail " ruby if has("autocmd") autocmd FileType ruby set ai ts=2 sts=2 sw=2 expandtab " autocmd FileType ruby match RedundantSpaces /\s\+$\|\t/ endif set modeline set modelines=5 if has('cmdlog') set cmdlogdir=~/.vimlogs/ end