" allow backspacing over everything in insert mode set backspace=indent,eol,start " how backspace works at start of line set nocompatible " don't behave Vi-compatible as much as possible set number " print the line number in front of each line set cindent " do C program indenting set history=50 " keep 50 lines of command line history set ruler " show the cursor position all the time set incsearch " do incremental searching set ignorecase " ignore case in search patterns set smartcase " no ignore case when pattern has uppercase set showmatch " briefly jump to matching bracket if insert one set showmode " message on status line to show current mode set showcmd " display incomplete commands set autochdir " change directory to the file in the current window set autoread " autom. read file when changed outside of Vim set noerrorbells " ring the bell for error messages set novisualbell " use visual bell instead of beeping set nostartofline " commands move cursor to first blank in line set shortmess=a " no 'Hit ENTER to continue' set clipboard=unnamed " yank to clipboard set encoding=iso-8859-15 set pastetoggle= " key code that causes 'paste' to toggle set mps+=<:> " Make % work with <> set listchars=tab:>-,trail:-,eol:$ map Q gq " Don't use Ex mode, use Q for formatting " Make p in Visual mode replace the selected text with the "" register. vnoremap p :let current_reg = @"gvs=current_reg " Switch syntax highlighting on, when the terminal has colors " Also switch on highlighting the last used search pattern. if &t_Co > 2 || has("gui_running") syntax on " syntax to be loaded for current buffer set hlsearch " highlight matches with last search pattern endif "" immer die Statuszeile mit dem Dateinamen anzeigen set laststatus=2 " tells when last window has status lines " ä->ä & vice versa map :%s/ä/ä/g:%s/ö/ö/g:%s/ü/ü/g:%s/Ä/Ä/g:%s/Ü/Ü/g:%s/ß/ß/g:%s/Ö/Ö/g map :%s/ä/\ä/g:%s/ö/\ö/g:%s/ü/\ü/g:%s/Ä/\Ä/g:%s/Ü/\Ü/g:%s/ß/\ß/g:%s/Ö/\Ö/g "" F9 schaltet syntaxhervorhebung ein und aus map :if has("syntax_items")syntax offelsesyntax onendif "" F8 schaltet Zeilennummerierung ein und aus map :if has("number")nonumberelsenumberendif nmap :silent noh " disable search hiliting " Folding stuff, enabled for pl, pm, c, h and cpp files. au BufNewFile,BufRead * syn sync fromstart au BufNewFile,BufRead * set foldmethod=manual au BufNewFile,BufRead *.c,*.h,*.cpp,*.cc,*.java set foldmethod=syntax cindent au BufNewFile,BufRead *.pl,*.pm set foldmethod=indent au BufNewFile,BufRead *.c,*.h,*.cpp,*.cc,*.pl,*.pm,*.java syn region myFold start="{" end="}" transparent fold au BufNewFile,BufRead * set foldlevel=99 au BufNewFile,BufRead *.html,*.htm set sw=1 au BufNewFile,BufRead *.po set tw=80 au BufNewFile,BufRead *.hg set ft=cpp au BufNewFile,BufRead *.ccg set ft=cpp command! Wq wq " allows :Wq function! CHANGE_CURR_DIR() let _dir = expand("%:p:h") exec "cd " . _dir unlet _dir endfunction autocmd BufEnter * call CHANGE_CURR_DIR() colorscheme pleasant "" Experimental function InsertTabWrapper() let col = col('.') - 1 if !col || getline('.')[col - 1] !~ '\k' return "\" else return "\" endif endfunction inoremap =InsertTabWrapper() " Toggle fold state between closed and opened. " " If there is no fold at current line, just moves forward. " If it is present, reverse it's state. fun! ToggleFold() if foldlevel('.') == 0 normal! l else if foldclosed('.') < 0 . foldclose else . foldopen endif endif " Clear status line echo endfun " Map this function to Space key. noremap :call ToggleFold() ""inoremap ( ()i ""inoremap { {}i ""inoremap < <>i ""inoremap " ""i ""inoremap [ []i " set up syntax highlighting for my e-mail au BufRead,BufNewFile *tmp/mutt* :set ft=mail "au FileType mail set comments=nb:> au FileType mail vmap D dO[...]^[ autocmd FileType mail setlocal spell spelllang=de_20,en "I can delete text bloxks with D, it gets replaced by [...] then au FileType mail silent normal /--\s*$^MO^[gg/^$^Mj "the last line brings the cursor to where I can start typing "for boxes around text, I pipe text through the boxes program with "convenient bindings in vim e.g. map b2 :!boxes -d ca--tlb-n (ca--tlb-n is a design by my own so) " Break the current line after the cursor nmap a " Suppress all spaces at end/beginning of lines nmap _s :%s/\s\+$// nmap _S :%s/^\s\+// iab nahc nach iab dohc doch iab ihc ich iab nihct nicht set cursorline set numberwidth=1 set background=dark set tabstop=8 set softtabstop=4 set wildmenu set wildmode=longest,list " Make Ctrl+J join lines in insert mode inoremap J set title set suffixes=.aux,.bak,.dvi,.gz,.idx,.log,.ps,.swp,.tar,.tgz,.tar,.zip set statusline=%<[%n]\ %F\ \ Filetype=\%Y\ \ %r\ %1*%m%*%w%=%(Line:\ %l%)%4(%)Column:\ %5(%c%V/%{strlen(getline(line('.')))}%)\ %4(%)%p%% set textwidth=80 " enable Xterm mouse wheel scrolling map [62~ map! [62~ map [63~ map! [63~ map [64~ map! [64~ map [65~ map! [65~ set mouse=a