if has("win32") set diffexpr=MyDiff() function MyDiff() let opt = '-a --binary ' if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif let arg1 = v:fname_in if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif let arg2 = v:fname_new if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif let arg3 = v:fname_out if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif if $VIMRUNTIME =~ ' ' if &sh =~ '\ ' . arg3 if exists('l:shxq_sav') let &shellxquote=l:shxq_sav endif endfunction function Formatxml() if !empty( glob($USERPROFILE."/bin/xmllint.exe") ) echo "xmllint --format" silent %!set xmllint_indent= & \%userprofile\%/bin/xmllint --format - else echo "vimscript --format" %j! " ganze Datei auf eine Zeile %s~>\s*<~><~g " Trim content und zwischenraum %s~<~\r<~g " Jeden Tag auf eine neue Zeile %g~^\s*$~d " alle leerZeilen entfernen %g!~>$~j! " überall, wo text (also kein Tag) am ende Steht mach join if line('$') < 500 " einrückung erstellen (filetype muss auf xml sein) norm gg=G endif endif endfunction else " NOT win32 function Formatxml() if !empty( glob("/usr/bin/xmllint") ) echo "xmllint --format" silent %!XMLLINT_INDENT=" " /usr/bin/xmllint --format - else echo "vimscript --format" %j! " ganze Datei auf eine Zeile %s~>\s*<~><~g " Trim content und zwischenraum %s~<~\r<~g " Jeden Tag auf eine neue Zeile %g~^\s*$~d " alle leerZeilen entfernen %g!~>$~j! " überall, wo text (also kein Tag) am ende Steht mach join if line('$') < 500 " einrückung erstellen (filetype muss auf xml sein) " norm gg=G endif endif endfunction endif set nobackup set nowritebackup set noswapfile colorscheme koehler set nocursorline set number set hidden " allows to switch away from unsaved buffer set linebreak set hlsearch set showcmd set textwidth=79 set formatoptions=roq set wildmenu if line('$') > 10000 syntax off else syntax on endif let mapleader = ',' " indent ---------------------------------------------------------------------- set autoindent set nosmartindent set shiftwidth=4 set tabstop=4 set expandtab vmap > >gv vmap >gv vmap < <,,0,) command -nargs=? -range=% Tab2Space call IndentConvert(,,1,) command -nargs=? -range=% RetabIndent call IndentConvert(,,&et,) command -nargs=1 -range SuperRetab ,s/\v%(^ *)@<= {}/\t/g " misc ------------------------------------------------------------------------ " buffer window map j map k map h map l " closeBuffer nnoremap :bp:bd# " change cwd to current file nnoremap cdc :cd %:p:h:pwd " Not searchNext. Do only highlight word under cursor. nmap * *N " save with ctrl-s (useless if term emu catches keymapping) nnoremap :up " commenting autocmd FileType c,cpp,java,php,javascript,html let b:comment_leader = '//' autocmd FileType sh,ruby,python let b:comment_leader = '#' autocmd FileType conf,fstab let b:comment_leader = '#' autocmd FileType tex let b:comment_leader = '% ' autocmd FileType mail let b:comment_leader = '> ' autocmd FileType vim let b:comment_leader = '"' map ,cc :silent s/^/=escape(b:comment_leader,'\/')/:nohlsearch map ,cu :silent s/^\V=escape(b:comment_leader,'\/')//e:nohlsearch " NERDTree config ------------------------------------------------------------- nnoremap ° :NERDTreeToggle " YCM config ------------------------------------------------------------------ command YcmEnable call YcmEnable() function YcmEnable() unlet b:ycm_largefile endfunction command YcmDisable call YcmDisable() function YcmDisable() let b:ycm_largefile = 1 endfunction " OS integration -------------------------------------------------------------- if has("win32") " insert current TS inoremap a=strftime('%Y%m%d%H%M%S') inoremap a=strftime('%d.%m.%Y %H:%M:%S%z') inoremap a=strftime('%Ec') " Printer ----------------------------- set printfont=Courier:h10 set printoptions=header:2,left:15mm,right:10mm,bottom:15mm,number:y,paper:A4,portrait:y,syntax:y else " Insert hash inoremap =system("date\|md5sum\|awk '{printf \"%s\",$1}'") " insert current TS inoremap a=strftime('%d.%m.%Y %H:%M:%S%z') inoremap a=strftime('%Ec') command OsTerminal !x-terminal-emulator & command OsFileExplorer !x-file-manager `pwd` & command OsFirefox !firefox `pwd` & command OsChromium !chromium `pwd` & endif " filetype specific ----------------------------------------------------------- autocmd FileType html setlocal shiftwidth=2 tabstop=2 autocmd FileType xml setlocal shiftwidth=2 tabstop=2 autocmd FileType Makefile setl noexpandtab " typescript autocmd BufNewFile,BufRead *.ts setlocal ft=javascript