Mein VIM-Setup (vimrc und Plugins)
| Tastenkürzel | Aktion |
|---|---|
| STRG+N | nächste Datei öffnen (wenn Vim mit mehreren Dateien gestartet wurde) |
| STRG+P | vorherige Datei öffnen (wenn Vim mit mehreren Dateien gestartet wurde) |
| F3 | Tabs als >- anzeigen umschalten |
Folgende Pakete müssen installiert sein:
xxxxxxxxxxapt
updateapt install vim-common vim-nox vim-runtime vim-tiny vim-scripts vim-addon-manager vim-pathogenFür Fancy-Aussehen, Syntax-Checks und so weiter habe ich diese Vim-Addons installiert:
xxxxxxxxxxmkdir
-p /opt/vim/bundle# a fancy file tree (envoked by CTRL+k):git clone https://github.com/scrooloose/nerdtree /opt/vim/bundle/nertdtree# this pimps the status linegit clone https://github.com/itchyny/lightline.vim /opt/vim/bundle/lightline# this is for smart copy and paste (without automatic indent and messing around with :set paste)git clone https://github.com/ConradIrwin/vim-bracketed-paste /opt/vim/bundle/bracketed-paste# make some often used shell commands availablegit clone https://github.com/tpope/vim-eunuch.git /opt/vim/bundle/eunuch# extended syntax checksgit clone https://github.com/vim-syntastic/syntastic.git /opt/vim/bundle/syntastic# optimzize colorsgit clone https://github.com/altercation/vim-colors-solarized.git /opt/vim/bundle/colors-solarizedUnd hier noch die globale vimrc:
xxxxxxxxxx"" File managed by salt.ovtec.it (packages/vim)." Your changes will be overwritten." runtime! debian.vim if exists('g:loaded_sensible') || &compatible finishelse let g:loaded_sensible = 1endif if has('autocmd') filetype plugin indent onendifif has('syntax') && !exists('g:syntax_on') syntax enableendif set autoindentset autoreadset background=darkset backspace=indent,eol,startset cmdheight=2set complete=iset expandtab " enable this to use whitespaces instead of tabsset formatoptions=qtjset hiddenset incsearchset iskeyword+=_,$,@,%,#,-set laststatus=2set lazyredrawset modelineset modelines=2set nobackupset nohlsearchset nrformats=octal,hex,alphaset rulerset shiftwidth=2set showcmdset showmatchset showmodeset smarttabset softtabstop=2set tabstop=2set ttimeoutset ttimeoutlen=100set visualbellset wildmenu " Use <C-L> to clear the highlighting of :set hlsearch.if maparg('<C-L>', 'n') ==# '' nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>endif if !&scrolloff set scrolloff=1endifif !&sidescrolloff set sidescrolloff=5endifset display+=lastline if &encoding ==# 'latin1' && has('gui_running') set encoding=utf-8endif if &listchars ==# 'eol:$' set listchars=tab:>-,trail:-,extends:>,precedes:<,nbsp:+endif if has('path_extra') setglobal tags-=./tags tags-=./tags; tags^=./tags;endif if &shell =~# 'fish$' set shell=/bin/bashendif if &history < 1000 set history=1000endifif &tabpagemax < 50 set tabpagemax=50endifif !empty(&viminfo) set viminfo^=!endifset sessionoptions-=options " Allow color schemes to do bright colors without forcing bold.if &t_Co == 8 && $TERM !~# '^linux\|^Eterm' set t_Co=16endif " I don't remember what that doesinoremap <C-U> <C-G>u<C-U> " next and previous buffer / filennoremap <C-N> :next<Enter>nnoremap <C-P> :prev<Enter> " toggle displaying listcharsnnoremap <F3> :set list!<Enter> au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endifau BufRead,BufNewFile *.sls setfiletype slsau FileType yaml,yml,sls setlocal ts=2 sts=2 sw=2 ai expandtab fo-=c fo-=r fo-=o"au FileType * setlocal ts=2 sts=2 sw=2 ai expandtab fo-=c fo-=r fo-=o " Load pluginsexecute pathogen#infect('bundle/{}', '/opt/vim/bundle/{}') " colorschemelet g:solarized_termcolors=256colorscheme solarized " syntastic syntax checkerset statusline+=%#warningmsg#set statusline+=%{SyntasticStatuslineFlag()}set statusline+=%*let g:syntastic_always_populate_loc_list = 1let g:syntastic_auto_loc_list = 1let g:syntastic_check_on_open = 1let g:syntastic_check_on_wq = 0 " vim:set ft=vim et sw=2: