" vimrc by Ademar Reis " http://www.ademar.org/misc/vimrc " " Warning: " Do not copy&paste this file. It contains non-ascii ansi sequences. Copy " the whole file instead. " shortcuts "------------------------------------------------------------------------- cab Wq wq cab wQ wq cab WQ wq cab Q q cab W w " on/off shortcuts " press the sequence w/out pause " "autoIndent map ,ai :set ai!:echo "autoIndent="&ai "ignoreCase map ,sc :set ic!:echo "ignoreCase="&ic "Highlightedsearch map ,sh :set hls!:echo "Highlightedsearch="&hls "Smartindent map ,si :set si!:echo "SmartIndent="&si "ExpandTAB map ,et :set et!:echo "ExpandTAB="&et "cindent map ,ci :set cin! :echo "CIndent="&cin "set paste map ,tt :set paste! :echo "PasteMode="&paste " to convert from tabs to spaces map :set et:reta " useful when there are too much comments noremap :hi Comment ctermfg=black guifg=black noremap :hi Comment term=bold ctermfg=cyan guifg=cyan " switch between 'windows' map  imap i " main/global config "------------------------------------------------------------------------- set backspace=0 " standard backspace (VI style) set laststatus=2 " status bar at the bottom set autoindent " always set autoindenting on set smartindent " always set smartindenting on set smarttab " make and smarter set tabstop=4 set shiftwidth=4 set textwidth=76 set report=0 set shortmess=filmnrwxt set showcmd " Show (partial) command in status line. set nocompatible " Use vi defaults set showmatch " Show matching brackets. set ruler " Show the line and column numbers of the cursor set ignorecase " Do case insensitive matching set autowrite " Automatically save before commands like :next & :make set nonumber set noet set visualbell set modelines=3 set nobackup " backup files (*~) are for lusers :-) "opcoes de busca set is " IncrementedSearch set hls " HighLightedSearch set ic " IgnoreCase set scs " SmartCaSe set magic " magic set encoding=utf-8 set termencoding=utf-8 set dir=~/tmp "non used options (just to remember) "set number " number lines " 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 " file-type settings "------------------------------------------------------------------------- " disable matchparen plugin :let loaded_matchparen = 1 filetype plugin on " mail files (mutt) au FileType mail set fo=ctq tw=65 et " python - colored tab and so au FileType python set ts=4 tw=80 et au FileType python syn match pythonTAB '\t\+' au FileType python hi pythonTAB ctermbg=blue au FileType python hi pythonString ctermfg=darkgreen au FileType python hi pythonRawString ctermfg=lightgreen au FileType python hi WhitespaceEOL ctermbg=red au FileType python match WhitespaceEOL /\s\+$/ " C let c_space_errors = 1 au FileType ch set shiftwidth=8 au FileType ch set tabstop=8 au FileType ch set noet au FileType ch set cinoptions=>s,e0,n0,f0,{0,}0,^0,:0,=s,ps,t0,+s,(2s,)25,*30,l1,g0 au FileType ch syn keyword cType uchar ushort uint ubyte ulong uint64_t uint32_t uint16_t uint8_t boolean_t int64_t int32_t int16_t int8_t u_int64_t u_int32_t u_int16_t u_int8_t au FileType ch syn keyword cOperator likely unlikely au FileType ch set formatoptions=tcqln " sgml + DocBook au BufNewFile,BufRead *.mod set ft=dtd au BufNewFile,BufRead *.cat set ft=dtd au BufNewFile,BufRead *.gml set ft=dtd " misc au FileType make set tw=0 au FileType man set tw=0 let g:changelog_spacing_errors = 0 "do not remove identation from # (as is the default of smartindent) :inoremap # X# " viminfo "------------------------------------------------------------------------- " remembers cursor postion and command history set viminfo='100,\"500,:20,%,n~/.viminfo au BufReadPost * if line("'\"")|execute("normal `\"")|endif " colors and syntax "------------------------------------------------------------------------- " nice syntax set background=dark if has("terminfo") set t_Co=8 set t_Sf=[3%p1%dm set t_Sb=[4%p1%dm else set t_Co=8 set t_Sf=[3%dm set t_Sb=[4%dm endif syntax on " my xterm supports 256 colors if $TERM =~ '^xterm' set t_Co=256 endif " txt syntax file from aurelio (aurelio.net) au BufNewFile,BufRead *.txt so ~/etc/txt-aurelio.vim au BufNewFile,BufRead README so ~/etc/txt-aurelio.vim au BufNewFile,BufRead INSTALL so ~/etc/txt-aurelio.vim au BufNewFile,BufRead TODO so ~/etc/txt-aurelio.vim au BufNewFile,BufRead CHANGELOG so ~/etc/txt-aurelio.vim au BufNewFile,BufRead Changelog so ~/etc/txt-aurelio.vim " keyboard specific mappings "------------------------------------------------------------------------- " Delete key if &term =~ "xterm" set t_kD=[3~ endif " Several maps useful for most terminals map  map!  map  map!  map  map!  map  map!  map  map!  map OH map! OH map  map!  map OF map! OF map [3~ map! [3~ " calls for external programs "------------------------------------------------------------------------- " antiword autocmd BufReadPre *.doc set ro exec 'autocmd BufReadPost *.doc silent %!antiword -w 90 "%"'