X-Git-Url: https://git.jankratochvil.net/?p=nethome.git;a=blobdiff_plain;f=.vimrc;h=08001f1b317869db4363338863533f7a9e12eb5d;hp=e04bdf0896083c85eea4c29311e47526386e7605;hb=b85843cac0218419d243eca8428a81737e38a232;hpb=6e6b9ae780a7b9a4c552f1acf1a58d8375dbbf4a diff --git a/.vimrc b/.vimrc index e04bdf0..08001f1 100644 --- a/.vimrc +++ b/.vimrc @@ -1,15 +1,62 @@ -":version 4.x -autocmd BufEnter * set sw=8 tabstop=8 -autocmd BufEnter /home/{short,root}/src/* set sw=2 tabstop=2 -set autoindent +if !exists("g:_kratochvil_vimrc") + let g:_kratochvil_vimrc=1 + +"autocmd * * echo "test" + +"startup read existing file: BufReadPre BufReadPost BufEnter VimEnter +"command read non-existing file: BufCreate BufNewFile BufEnter +"immediate switch to existing file: BufReadPre BufReadPost BufEnter +"immediate switch to non-existing file: BufNewFile BufEnter + +autocmd BufCreate,VimEnter * let g:BufEnter_ts= 8 +autocmd BufCreate,VimEnter */home/{short,kratochvil,root}/{src,WWW}/* let g:BufEnter_ts= 2 +autocmd BufCreate,VimEnter */home/{short,kratochvil,root}/src/*gnokii*/* let g:BufEnter_ts= 8 +autocmd BufCreate,VimEnter *.{i{,.as},s} let g:BufEnter_ts=20 +autocmd BufEnter * call BufEnter() +autocmd VimEnter * call BufEnter() +set runtimepath=.,$VIMRUNTIME +function BufEnter() + if exists("g:BufEnter_ts") + let &ts=g:BufEnter_ts + let &sw=g:BufEnter_ts + unlet g:BufEnter_ts + + set autoindent + set nocindent + set nosmartindent + set indentexpr= + + runtime! ./../../../../../../../../../../../.vimrc ./../../../../../../../../../../.vimrc ./../../../../../../../../../.vimrc ./../../../../../../../../.vimrc ./../../../../../../../.vimrc ./../../../../../../.vimrc ./../../../../../.vimrc ./../../../../.vimrc ./../../../.vimrc ./../../.vimrc ./../.vimrc ./.vimrc + endif +endfunction + +set encoding=utf-8 +set termencoding=iso-8859-2 +" fileencoding is detected from fileencodings, first one for empty files +set fileencodings=utf-8,iso-8859-2 + +ca X x +syntax off set noerrorbells set ruler set ignorecase set nobackup set nowritebackup set exrc -syntax off -ca X x -set fo=tcq2 +set nostartofline +set nohlsearch +set fo=tcq set viminfo='100,\"1000,:100,/40 -set tags=./tags,./TAGS,./../tags,./../TAGS,./../../tags,./../../TAGS,./../../../tags,./../../../TAGS,./../../../../tags,./../../../../TAGS,./../../../../../tags,./../../../../../TAGS,./../../../../../../tags,./../../../../../../TAGS,./../../../../../../../tags,./../../../../../../../TAGS,./../../../../../../../../tags,./../../../../../../../../TAGS,./../../../../../../../../../tags,./../../../../../../../../../TAGS,./../../../../../../../../../../tags,./../../../../../../../../../../TAGS,./../../../../../../../../../../../tags,./../../../../../../../../../../../TAGS,/usr/src/redhat/BUILD/tags,/usr/src/redhat/BUILD/TAGS,/usr/include/tags,/usr/include/TAGS +set tags=./tags,./TAGS,./../tags,./../TAGS,./../../tags,./../../TAGS,./../../../tags,./../../../TAGS,./../../../../tags,./../../../../TAGS,./../../../../../tags,./../../../../../TAGS,./../../../../../../tags,./../../../../../../TAGS,./../../../../../../../tags,./../../../../../../../TAGS,./../../../../../../../../tags,./../../../../../../../../TAGS,./../../../../../../../../../tags,./../../../../../../../../../TAGS,./../../../../../../../../../../tags,./../../../../../../../../../../TAGS,./../../../../../../../../../../../tags,./../../../../../../../../../../../TAGS,./w32/inc/tags,./../w32/inc/tags,./../../w32/inc/tags,,./../../../w32/inc/tags,./../../../../w32/inc/tags,./../../../../../w32/inc/tags,./../../../../../../w32/inc/tags,./../../../../../../../w32/inc/tags,/usr/src/redhat/BUILD/tags,/usr/src/redhat/BUILD/TAGS,/usr/include/tags,/usr/include/TAGS + +noremap p :set invpaste paste? +noremap l :set invlist paste? +noremap q @q +noremap : @: +noremap N :next +noremap P :prev +noremap  G:r !date '+\%H:\%M:\%S-' kA +noremap d :set hlsearch/^[+-]\([^+-].*\\|\)$ +noremap D :set hlsearch/^[+-][+-]\([^+-].*\\|\)$ + +endif "!exists("g:_kratochvil_vimrc")