" Tony's .vimrc " < SETTINGS > " set term=xterm " write all tmp files to /tmp set dir=/tmp " disable annoying parenthesis highlighting let loaded_matchparen = 1 let g:xml_syntax_folding = 1 " default encoding set termencoding=utf-8 " plug in dictionaries for autocompletion "set cpt=.,w,b,u,t,i,k/home/tony/.vim/dictionaries/* set cpt=.,w,b,u,t,i " do NOT unload buffer when switching to another one " this allows to edit several files in the same time without having to save " them each time you switch between them set hidden " I like {{{ }}} folding markers set foldmethod=marker " use visual bell (don't beep) set vb set t_vb= " Make command line two lines high set ch=1 " Hide the mouse when typing text set mousehide " turn on autoindent set autoindent " highlight strings inside C comments let c_comment_strings=1 " Switch on syntax highlighting if it wasn't on yet. if !exists("syntax_on") syntax on endif " expand tab to spaces ? "set expandtab " default tab size set shiftwidth=4 set softtabstop=4 set tabstop=4 " status line set statusline=%<%F:%l,%c\ %P\ %m%r\ byte:\ %b\ encoding:\ %{&encoding}\ buffer:\ %n set laststatus=2 "parse modelines automatically, check 10 lines at the bottom and the start of file set modeline set modelines=10 " continue searching set incsearch " highlight search results set hlsearch " Only execute this part when compiled with support for autocommands. if has("autocmd") " Enable file type detection. " Use the default filetype settings, so that mail gets 'tw' set to 72, " 'cindent' is on in C files, etc. " Also load indent files, to automatically do language-dependent indenting. filetype plugin indent on " For all text files set 'textwidth' to 78 characters. autocmd FileType text setlocal textwidth=78 " When editing a file, always jump to the last known cursor position. " Don't do it when the position is invalid or when inside an event handler " (happens when dropping a file on gvim). autocmd BufReadPost * \ if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif endif " has("autocmd") " " " < BINDINGS > " " allow to use backspace instead of "x" set backspace=indent,eol,start whichwrap+=<,>,[,] " map keys to switch between cyrillic encodings "map :e ++enc=cp1251 % "map :e ++enc=utf-8 % "map :e ++enc=koi8-r % " CTRL-C and CTRL-Insert are Copy "vnoremap "+y vnoremap "+y "map "+gP map "+gP imap vmap " paste mode map :set paste " nopaste mode map :set nopaste " move to the previous buffer map :bp " move to the next buffer map :bn " Make shift-insert work as in Xterm map map! " map F2 to quick save map :w vnoremap :wi inoremap :wi " map < & > to indent blocks vnoremap < >gv " Tab autocompletion function InsertTabWrapper() let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\" else return "\" endif endfunction inoremap =InsertTabWrapper() " the following binds are only useful for those who write *.phpt test files " my own func to read *.out files and to paste their content to the current " test function CopyBack() let file=expand("%") let out_file=substitute(file, '\.phpt', ".out", '') execute "$read ".out_file endfunction function UCopyBack() let file=expand("%") let out_file=substitute(file, '\.phpt', ".u.out", '') execute "$read ".out_file endfunction map ff :call CopyBack() map fu :call UCopyBack() map fr :%s/in \/\([^ ]*\) on line \([0-9]*\)/in %s on line %d/g map fe :%s/resource(\([0-9]*\))/resource(%d)/g " templates (for tests) let g:TEMPLATE_HOME = "~/.vim/templates/" map hh :execute "0read ".TEMPLATE_HOME."template.phpt" map jj :execute "0read ".TEMPLATE_HOME."doc.xml" " " " < COLORS >" " Switch on search pattern highlighting. set hlsearch set background=dark hi clear if exists("syntax_on") syntax reset endif " GUI highlight Text guifg=black guibg=black hi Normal guifg=lightgrey guibg=black highlight Search guifg=Black guibg=Red highlight Visual guifg=Grey45 highlight Cursor guifg=Black guibg=Green highlight Special guifg=Orange highlight Comment guifg=#80a0ff guibg=black highlight StatusLine guifg=blue guibg=white highlight Statement guifg=Yellow gui=NONE highlight Type gui=NONE highlight Constant gui=NONE guibg=black " Console highlight Normal ctermfg=LightGrey ctermbg=Black highlight Search ctermfg=Black ctermbg=Red cterm=NONE highlight Visual cterm=reverse highlight Cursor ctermfg=Black ctermbg=Green highlight Special ctermfg=Brown highlight Comment ctermfg=Blue highlight StatusLine ctermfg=blue ctermbg=white highlight Statement ctermfg=Yellow cterm=NONE highlight Type cterm=NONE hi Folded guifg=#A0A0A0 guibg=#303070 ctermfg=darkgrey ctermbg=black hi FoldColumn guifg=#A0A0A0 guibg=#303070 ctermfg=darkgrey ctermbg=black hi LineNr guifg=#90f020 ctermfg=green cterm=none "