" .vimrc " source for this file: " http://www.wg-karlsruhe.de/seth/vimrc.php " sources used for creating this file: " http://www.stripey.com/vim/ " http://www.vi-improved.org/vimrc.php """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " general """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "autocmd! " clear any autocommands set nocompatible " get out of horrible vi-compatible mode filetype on " enable filetype detection set history=1000 " #lines to remember "set confirm " enable error files and error jumping "filetype plugin indent on " load filetype plugins filetype plugin on " load filetype plugins "set isk+=_,$,@,%,#,- " none of these should be word dividers, so make them not be (iskeyword) set encoding=UTF-8 "language en_US.UTF-8 " english if has("gui_running") source $VIMRUNTIME/delmenu.vim set langmenu=en_US.UTF-8 source $VIMRUNTIME/menu.vim set guioptions-=T set lines=50 set columns=120 if has("gui_gtk2") set guifont=Courier\ New\ 10 "set guifont=Monospace\ 10 elseif has("x11") "set guifont=-*-lucidatypewriter-medium-r-normal-*-*-180-*-*-m-*-* else set guifont=Lucida_Console:h10:cDEFAULT "set guifont=Andale_Mono:h10:cDEFAULT endif endif set viminfo='200,<300,s150,%,h,! """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " theme/colors """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " have syntax highlighting in terminals which can display colors if has('syntax') && (&t_Co > 2) || has("gui_running") syntax on " syntax highlighting on set background=dark " colorscheme blue " colorscheme evening colorscheme koehler " colorscheme metacosm " colorscheme oceanblack " colorscheme ron endif """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " vim ui """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "set linespace=0 " space it out a little more (easier to read) set wildmenu " turn on wild menu " have command-line completion (for filenames, help topics, option names) " first list the available options and complete the longest common part, then " have further s cycle through the possibilities: "set wildmode=list:longest,full set ruler " show actual cursor position "set cmdheight=2 " the command bar is 2 high set number " line numbers set lazyredraw " do not redraw while running macros (much faster) "set hidden " you can change buffer without saving set backspace=2 " backspace over everything "set whichwrap+=<,>,h,l " backspace and cursor keys wrap to "set mouse=a " use mouse everywhere set shortmess=atI " shortens messages "set report=0 " tell us when anything is changed via :... set errorbells " make noise "set noerrorbells " don't make noise "set vb t_vb= " prevents vi from making its annoying beeps (visualbell) "set fillchars=vert:\ ,stl:\ ,stlnc:\ " make the splitters between windows be blank """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " vim cues """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " vim 7+ and slow machines set noshowmatch " will cause the cursor to very briefly jump to a brace/parenthese/bracket's 'match' set mat=0 " how many tenths of a second to blink matching brackets for " vim 6- or fast machines "set showmatch " will cause the cursor to very briefly jump to a brace/parenthese/bracket's 'match' "set mat=5 " how many tenths of a second to blink matching brackets for "set nohlsearch " do not highlight searched for phrases set hlsearch " highlight all matches for a search pattern "set ignorecase " ignore case in search, "set smartcase " unless they contain upper-case letters. set incsearch " incremental search: show the `best match so far' as search strings are typed "set gdefault " assume the /g flag on :s substitutions to replace all matches in a line "set listchars=tab:\|\ ,trail:.,extends:>,precedes:<,eol:$ " what to show when I hit :set list "set lines=80 " 80 lines tall "set columns=160 " 160 cols wide "set so=10 " Keep 10 lines (top/bottom) for scope "set novisualbell " don't blink set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [HEX=\%04.4B]\ [POS=%04l,%04v][%p%%]\ [LEN=%L] set laststatus=2 " always show the status line """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " text formatting/layout """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "set fo=tcrqn " (formatoptions) set autoindent " autoindent set smartindent " smartindent "set cindent " do c-style indenting set softtabstop=2 " unify (use indents of 2 spaces) " no tabs "set shiftround "set expandtab " use tabs set tabstop=2 " tab spacing (settings below are just to unify it) set shiftwidth=2 " unify set noexpandtab " real tabs please! "set smarttab " use tabs at the start of a line, spaces elsewhere " nowrap "set nowrap " do not wrap lines (only on display) "set sidescroll=10 " wrap set wrap " wrap lines (only on display) set listchars+=tab:>-,eol:<,precedes:<,extends:> "set textwidth=72 " linebreak with after length "set wrapmargin=5 " linebreak with after (screewidth - length) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " other """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " display the current mode and partially-typed commands in the status line set showmode " display current mode ('insert', 'replace', ...) set showcmd " display partially-typed commands in the status line set nomodeline " don't have files trying to override this .vimrc set fileformat=unix set fileformats=unix,dos,mac " for both CSS and HTML, use genuine tab characters for indentation, to make " files a few bytes smaller autocmd FileType html,css set noexpandtab tabstop=2 " in makefiles, don't expand tabs to spaces, since actual tab characters are " needed, and have indentation at 8 chars to be sure that all indents are tabs " (despite the mappings): autocmd FileType make set noexpandtab shiftwidth=8 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " abbrevs """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "iab xasp <%@language=jscript%><%%>< "iab xdate =strftime("%d/%m/%y %H:%M:%S") """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " mappings """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" "map :Sex " up arrow (normal mode) brings up a file list "map :Tlist " down arrow (normal mode) brings up the tag list "map i r " alt-i (normal mode) inserts a single char, and then switches back to normal "map ggVGg? " rot13 the file (toggle) """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " keystrokes """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " ***** keystrokes -- moving around ***** " have the h and l cursor keys wrap between lines (like and do " by default), and ~ covert case over line breaks; also have the cursor keys " wrap in insert mode: "set whichwrap+=h,l,~,[,] noremap ok " insert empty line " [ by default is like l, like h, and - like k.] " scroll page, but leave cursor on its absolut screen-position noremap j inoremap ja noremap k inoremap ka " let switch between 1| and ^ noremap ^ inoremap ^i " use to cycle through split windows (and + to cycle backwards, " where possible): nnoremap w nnoremap W " use +N/+P to cycle through files: "nnoremap :next "nnoremap :prev " [+N by default is like j, and +P like k.] " have % bounce between angled brackets, as well as t'other kinds: "set matchpairs+=<:> " have prompt for a help topic, rather than displaying the introduction " page, and have it do this from any mode: nnoremap :help vmap omap map! " * beschissene deutsche umlaute und sz imap ÎáÎéÎå ä imap ÎÝÎåÎåÎý ä imap ÎáÎíÎý ö imap ÎÝÎåÎíÎõ ö imap ÎáÎåÎ÷ ü imap ÎÝÎåÎñÎå ü imap ÎáÎíÎå Ä imap ÎÝÎáÎ÷Îõ Ä imap ÎáÎñÎé Ö imap ÎÝÎåÎáÎí Ö imap ÎáÎñÎí Ü imap ÎÝÎåÎåÎÝ Ü imap ÎåÎåÎñ ß imap ÎÝÎåÎåÎé ß " * keystrokes -- formatting " have Q reformat the current paragraph (or selected text if there is any): "nnoremap Q gqap "vnoremap Q gq " have the usual indentation keystrokes still work in visual mode: "vnoremap > "vnoremap "vmap "vmap " have Y behave analogously to D and C rather than to dd and cc (which is " already done by yy): noremap Y y$ " * keystrokes -- toggles " Keystrokes to toggle options are defined here. They are all set to normal " mode keystrokes beginning \t but some function keys (which won't work in all " terminals) are also mapped. " have \tp ("toggle paste") toggle paste on/off and report the change, and " where possible also have do this both in normal and insert mode: "nnoremap \tp :set invpaste paste? "nmap \tp "imap \tp "set pastetoggle= " have \tf ("toggle format") toggle the automatic insertion of line breaks " during typing and report the change: "nnoremap \tf :if &fo =~ 't' set fo-=t else set fo+=t " \ endif set fo? "nmap \tf "imap \tf " have \tl ("toggle list") toggle list on/off and report the change: "nnoremap \tl :set invlist list? "nmap \tl " have \th ("toggle highlight") toggle highlighting of search matches, and " report the change: "nnoremap \th :set invhls hls? " * Keystrokes -- Insert Mode " allow to delete line breaks, beyond the start of the current " insertion, and over indentations: "set backspace=eol,start,indent " have (and + where it works) change the level of " indentation: "inoremap "inoremap " [+V still inserts an actual tab character.] """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " matlab """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" au FileType matlab call FT_matlab() function FT_matlab() "command -nargs=1 Matlabhelp !matlab -nojvm -nosplash -r "help ; exit" | more +11 set keywordprg=Matlabhelp if version < 600 set isk+=. else setlocal isk+=. endif endfunction """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " perl """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let perl_extended_vars=1 " highlight advanced perl vars inside strings """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " php """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" let php_htmlInStrings=1 " highlight html code inside php string let php_sql_query=1 " highlight mysql queries inside php string """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " tex """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" au FileType tex call FT_tex() function FT_tex() " set grepprg=grep\ -nH\ $* if version < 600 set isk+=:,_ else setlocal isk+=:,_ endif "command -nargs=1 GetTOC call GetTOC_latex() endfunction "function GetTOC_latex(filename) " new " execute '0r !./get_index_from_latex_file.pl '.a:filename " execute "normal " "endfunction