"set vim config dir let b:vim_conf_dir = $HOME.'/.vim' if has("win32") let b:vim_conf_dir = $HOME.'\vimfiles' endif set nocompatible if isdirectory( b:vim_conf_dir . '/tmp/') == 0 call mkdir(b:vim_conf_dir.'/tmp/', 'p', 0700) endif "load plugins if filereadable(b:vim_conf_dir . '/plugins.vundel.vim') exec 'source ' . b:vim_conf_dir . '/plugins.vundel.vim' endif " " auskommentiert, macht in screen das nix gut aussieht.. "set termguicolors set background=dark try let g:gruvbox_contrast_dark = 'hard' let g:gruvbox_italicize_comments = 0 colorscheme gruvbox catch /^Vim\%((\a\+)\)\=:E185/ " wird evtl rest instlliert... E185 heißt nicht gefunden.. endtry syntax on set backspace=indent,eol,start set relativenumber set number set lazyredraw set autoindent set smartindent set expandtab set tabstop=4 set softtabstop=4 set shiftwidth=4 set pastetoggle= set encoding=utf-8 set modeline set history=50 set noerrorbells set visualbell t_vb= set hidden set nojoinspaces set nrformats= set ttymouse=xterm2 set mouse=a " Tab-completion in command-line mode set path+=** set wildmode=full set wildmenu set wildignore=*.pdf,*.fo, set title " Appearance set ruler set showmode set showcmd set laststatus=2 set hlsearch set incsearch set ignorecase set smartcase " remove =, thus 'gf' works whit filepath asignemens like myvar=/path/tofile set isfname-== let perl_include_pod = 1 augroup PerlSettings autocmd! autocmd FileType perl setlocal complete-=i augroup END let mapleader = "," nnoremap ]s nnoremap [s nnoremap Z Y " Window switching nnoremap k nnoremap j nnoremap h nnoremap l nnoremap i a'" << << "' 6hi nnoremap a a'{}' 2hi nnoremap A a'"+ +"' 4hi autocmd FileType cpp nnoremap a a'"<< <<"' 5hi " see :h restore-position nnoremap = msgg=G`s inoremap kj inoremap jk inoremap ts // TODOts: =$A inoremap obs /// OBSOLETE kann nach der Abspaltung von 1.12 entfernt werden=$A inoremap no 0i 0i///=$ inoremap td 0i//TODOts: doku 0i/// kVj=$ autocmd InsertEnter * set timeoutlen=500 autocmd InsertLeave * set timeoutlen=1000 inoremap in 0i0i///V= " do not use ex mode map Q nnoremap :bprev nnoremap :bnext nnoremap e :tabedit $MYVIMRC nnoremap ZZ :wqall nnoremap :wa:make -j 8 inoremap :wa:make -j 8 nnoremap :wa\|!./% inoremap :wa\|!./% nnoremap l " Copy paste to/from system clipboard vnoremap "*y noremap "*p noremap "*p inoremap "*p vnoremap "*p "nnoremap = mzgg=G`z nnoremap :call FormatDocument() " write using sudo. cmap w!! w !sudo tee > /dev/null % " "move visually selected vnoremap :m '>+1gv=gv vnoremap :m '<-2gv=gv nnoremap :m -2== nnoremap :m +1== " repeat last command on all selected: vnoremap . :normal. vnoremap tt :Tabular /^[^-+=]*\zs\S*=/l1l1 vnoremap t, :Tabular /,\zs/l1l1 vnoremap t :Tabular /\s\+\zs/l1l0 vnoremap t: :Tabular /:\zs/l1l0 vnoremap t( :Tabular /(/l1l0 " " append word under cursor with 'or' to current search pattern nnoremap s yiw//\\|" " append selection with 'or' to current search pattern vnoremap s y//\\|" cmap w!! w !sudo tee % >/dev/null nnoremap mh :wa:silent !mhsend -run reload code:redraw! nnoremap ll iprint_log("");V=0f(la if has('win32') nnoremap r :source ~/vimfiles/vimrc else nnoremap r :source ~/.vim/vimrc endif filetype plugin indent on " ack seems to have vanished from artfull, thus use silversearchger-ag " for ack.vim: if executable('ag') let g:ackprg = 'ag --vimgrep' endif set list listchars=tab:→\ ,trail:· hi Visual guifg=White guibg=Blue gui=bold set diffopt+=vertical "set diffopt+=iwhite set diffopt+=algorithm:patience "jump to next diff and center line noremap n ]cz. noremap p [cz. if has ('win32') set guifont=DejaVu_Sans_Mono:h11:cANSI:qDRAFT endif if &diff " ignore whitespace set diffopt+=vertical set diffopt+=iwhite set diffopt+=algorithm:patience syntax off highlight DiffText term=reverse cterm=reverse ctermfg=214 ctermbg=234 gui=reverse guifg=lightgreen guibg=DarkGreen " go fullscreen: if has ('win32') autocmd GuiEnter * simalt ~x set guifont=DejaVu_Sans_Mono:h8:cANSI:qDRAFT endif " make all diff windows the same size autocmd VimResized * wincmd = autocmd VimEnter * 2wincmd w autocmd VimEnter * syntax off autocmd VimEnter * set guioptions+=b set relativenumber! set number else if has("gui_running") set lines=999 columns=120 endif " from /etc/vim/vimrc (restore last editing position) if has("autocmd") au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif endif set textwidth=120 let &colorcolumn="121" highlight ColorColumn ctermbg=lightgray guibg=lightcyan endif " remove currently unused fugitive buffers: autocmd BufReadPost fugitive://* set bufhidden=delete " reset terminal colors after vim leaves "if !has("gui_running") " au VimLeave * !echo -ne "\033[0m" "endif " macht dass auch in screen auf dem server der vollstaendige hintergund gmalt " wird. set t_ut= if has ('win32') || has('win32unix') let g:vimwiki_list = [ \{ \ 'path':'~/vimwiki', \ 'path_html':'~/vimwiki/html/', \ 'syntax': 'markdown', \ 'ext': '.md' \ } \ ] else let g:vimwiki_list = [ \ { \ 'path':'~/p/wiki', \ 'path_html':'~/p/wiki/html/', \ 'syntax': 'markdown', \ 'ext': '.md' \ } \ ] endif "" tmp files: if isdirectory( b:vim_conf_dir . '/tmp/backup') == 0 call mkdir(b:vim_conf_dir.'/tmp/backup', 'p', 0700) endif exec 'set backupdir='. b:vim_conf_dir.'/tmp/backup//' set backup " Save your swp files to a less annoying place than the current directory. " If you have .vim-swap in the current directory, it'll use that. " Otherwise it saves it to ~/.vim/swap, ~/tmp or . if isdirectory( b:vim_conf_dir . '/tmp/swap') == 0 call mkdir(b:vim_conf_dir.'/tmp/swap', 'p', 0700) endif exec 'set directory='. b:vim_conf_dir.'/tmp/swap//' " viminfo stores the the state of your previous editing session if has('win32') set viminfo+=n~/vimfiles/tmp/viminfo else set viminfo+=n~/.vim/tmp/viminfo endif " letzte suche beim öffnen einer Datei sofort wieder anzeigen set viminfo-=h if exists("+undofile") " undofile - This allows you to use undos after exiting and restarting " This, like swap and backups, uses .vim-undo first, then ~/.vim/undo " :help undo-persistence " This is only present in 7.3+ if isdirectory( b:vim_conf_dir . '/tmp/undo') == 0 call mkdir(b:vim_conf_dir.'/tmp/undo', 'p', 0700) endif exec 'set undodir='. b:vim_conf_dir.'/tmp/undo' set undofile endif " format document function! FormatDocument() let save_pos = getpos(".") normal gg=G call setpos('.', save_pos) echom "formatiert.." endfunction noremap x :call XmlPretty() " reformat xml stuff function! XmlPretty() let save_pos = getpos(".") :silent! %s/<//g :silent! %s/>\rfx ma:1,$ call FixCsharp()'a function! FixCsharp() let save_pos = getpos(".") " regions entfernen; :silent! %g/^\s*#\(end\)\{0,1\}region/d :silent! %g/\.WriteException(/normal 0df,$^iLog.Exception(V= :silent! %g/\.WriteMessage(/normal 0f(ldf."ayiw0P0xlveu0iLog.elcf,(ld0$^PV= " '+ varname +' durch '{varname}' ersetzen :silent! %s/"\s*+\s*\(.\{-\}\)\s*+\s*"/{\1}/g :silent! %s/"\s*+\s*\(.\{-\}\)\s*+\s*$/{\1}" +/g :silent! %s/"\s*+\s*\(.\{-\}\)\s*);/{\1}");/g " "ersetze 'Zeilenanfang "' :silent! %s/\(^\s*\)\("[^"]*{\)/\1$\2/g :silent! %s/[^$]\(".*{\)/$\1/g " mehrere leerzeilen durch eine einzelne ersetzen: :silent! %s/\s\+$//e :silent! %s/\n\{3,}/\r\r/e :noh call setpos('.', save_pos) endfunction function! FixWhitespace() " convert tabs to spaces :retab " remove trailing whitespace :silent! %s/\s\+$//e :silent! g/\s*\s*/d " remov '//******' and '//#####' :silent! g/\/\/\(\*\|#\)*\s*$/d " remove excessive newlines :silent! %s/\n\n\n\+/ / :noh endfunction function! UndoCSharStringInterpolation() silent! s/\$"/"/g silent! s/{\(.\{-}\)}/" + \1 + "/g endfunction """" ALE start """" inoremap :ALEToggle nnoremap :ALEToggle let g:ale_linters = { \ 'cpp': ['gcc', 'cppcheck', 'clang'], \ 'perl': ['perl', 'perlcritic'], \} let b:ale_warn_about_trailing_whitespace = 1 let g:ale_sign_column_always = 1 let g:ale_cpp_clang_options = \ '-std=c++14 -Wall -pedantic -fPIC \ -I/usr/include/x86_64-linux-gnu/qt5 \ -I/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport \ -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets \ -I/usr/include/x86_64-linux-gnu/qt5/QtGui \ -I/usr/include/x86_64-linux-gnu/qt5/QtCore \ -I/usr/include/libdrm \ -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g+ \' let g:ale_cpp_gcc_options = \ '-std=c++14 -Wall -pedantic -fPIC \ -I/usr/include/x86_64-linux-gnu/qt5 \ -I/usr/include/x86_64-linux-gnu/qt5/QtPrintSupport \ -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets \ -I/usr/include/x86_64-linux-gnu/qt5/QtGui \ -I/usr/include/x86_64-linux-gnu/qt5/QtCore \ -I/usr/include/libdrm \ -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g+ \' """" ALE end """" if has("patch-7.4.354") " Indents word-wrapped lines as much as the 'parent' line set breakindent " Ensures word-wrap does not split words set formatoptions=l set lbr endif hi CursorLineNr ctermbg=black guibg=black hi CursorLine ctermbg=black guibg=black augroup CursorLine au! au VimEnter,WinEnter,BufWinEnter * setlocal cursorline au WinLeave * setlocal nocursorline augroup END packadd! matchit let g:acp_enableAtStartup = 1 let g:acp_behaviorPerlOmniLength = 0 let g:acp_behaviorPhpOmniLength = 0 let g:acp_completeoptPreview = 1 let g:acp_behaviorPythonOmniLength = 0 let g:acp_behaviorXmlOmniLength = 0 let g:acp_behaviorHtmlOmniLength = 0 let g:acp_behaviorCssOmniPropertyLength = 1 let g:acp_behaviorCssOmniValueLength = 0 highlight ExtraWhitespace ctermfg=red guifg=red ctermbg=white guibg=DarkGrey " keine trailing whitespaces in hub log files anzeigen match ExtraWhitespace /\s\+$/ let g:ale_python_flake8_options = "--max-line-length=120" if has("win32") function! CopyFormatted(line1, line2) let prev_number = &number let prev_relativenumber = &relativenumber let prev_background = &background let prev_ft = &ft setlocal number! setlocal relativenumber! setlocal background=light " wenn ft manuel gesetzt war wird das von set background zurueckgesetzt, deswegen gleich wieder setzen exe 'setlocal ft='.expand(prev_ft) execute a:line1 . "," . a:line2 . "TOhtml" %yank * !start /min powershell -noprofile "gcb | scb -as" bwipeout! if (prev_number) set number endif if (prev_relativenumber) set relativenumber endif exe 'setlocal background='.expand(prev_background) exe 'setlocal ft='.expand(prev_ft) endfunction command! -range=% HtmlClip silent call CopyFormatted(,) endif