" An example for a vimrc file. " " Maintainer: Bram Moolenaar " Last change: 2001 Jul 18 " " To use it, copy it to " for Unix and OS/2: ~/.vimrc " for Amiga: s:.vimrc " for MS-DOS and Win32: $VIM\_vimrc " for OpenVMS: sys$login:.vimrc " When started as "evim", evim.vim will already have done these settings. if v:progname =~? "evim" finish endif set nocp set autowrite set backup " keep a backup file set backspace=indent,eol,start "set cmdheight=2 set expandtab set formatoptions=tcq1 set guioptions-=t set guioptions-=T set guioptions-=m "set guioptions+=f set history=1000 set nohlsearch set noignorecase " Do case insensitive matching set incsearch " do incremental searching set listchars="trail:-,eol:$,tab:>-" set modelines=5 set printencoding=utf-8 set scrolloff=2 set selectmode="key" " SELECT mode on Shift-motion set shiftwidth=4 set showcmd " display incomplete commands set shortmess+=T set softtabstop=4 set tabstop=4 set termencoding=utf-8 set textwidth=65 " standard width of text set visualbell let mapleader="," let maplocalleader=mapleader let python_highlight_all = 1 " Don't use Ex mode, use Q for formatting map Q gq map Y y$ " Also switch on highlighting the last used search pattern. syntax on " Insert date (in ISO format) map kd o:r !date -Io " inspirace Emacsem :-) noremap zz inoremap zzi " ctrlax "nmap Ctrl_A "nmap Ctrl_X "set nrformats=alpha,octal,hex "odhackuj emailovou zpravu map ka gg/^$jV/^-- $2k:!cstocs il2 ascii "obzvlaste oblibene chyby abb teh the " Only do 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=65 " 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 function! MailCreateToField() let @@ = input("Enter search string for address: ") normal! gg/^To: 4lPi,aq endfunction autocmd BufEnter * exe 'lcd '.expand("%:p:h") function! NewsEditSettings() setlocal nobackup setlocal ft=mail setlocal tw=65 setlocal fo+=aw2n fo-=c viminfo="" noremap kp :.,/^>*$/-2s/$/ /3j imap " ``''h map ks G?^> *-- $d/^-- $ map kb :set fo-=ad/^-- $:nohlO:set fo+=aa map kt :set fo-=agg/^-- V/^$dGpOgg/^$ddzz:set fo+=a map kf mmgg/matej@ceplovi.czc/>cepl@surfbest.net`m map kn gg/ :set fo-=aC bible@iglou.net:set fo+=a endfunction function! MailEditSettings() :call NewsEditSettings() runtime ftplugin/uri-ref.vim imap MailAliasQuery map :call MailCreateToField() endfunction au BufNewFile,BufRead /tmp/mutt* :call MailEditSettings() au BufNewFile,BufRead /tmp/kde-${LOGNAME}/kmail* :call MailEditSettings() au BufNewFile,BufRead */archiv/news/* :call NewsEditSettings() au BufNewFile,BufRead */archiv/news/postponed/* :call NewsEditSettings() au BufNewFile,BufRead /tmp/SLRN* :call NewsEditSettings() au BufNewFile,BufRead *.bib map i{l} au BufNewFile,BufRead *.tex compiler tex "au BufNewFile,BufRead *.tex set fileencoding=latin-2 au BufNewFile,BufRead *.vcf set encoding=utf-8 "au BufNewFile,BufRead *.py set noexpandtab ts=3 sts=3 sw=3 au BufNewFile,BufRead *.thm run refoot.vim au BufNewFile,BufRead *.{dat,tab} set noexpandtab tw=0 nowrap au BufNewFile,BufRead channels.txt set noexpandtab nobackup nowrap endif " has("autocmd") " Local additions let spell_auto_type="tex,mail,text,sgml,bib,Wikipedia" let spell_language_list="american,czech" " spell checking shortcuts nmap sk SpellCheck " Kontrola nmap sz SpellChangeLanguage " Zmen jazyk runtime ftplugin/man.vim " LaTeX-suite set grepprg=grep\ -nH\ $*