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:
xxxxxxxxxx1
apt update2
apt 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:
xxxxxxxxxx1
mkdir -p /opt/vim/bundle2
# a fancy file tree (envoked by CTRL+k):3
git clone https://github.com/scrooloose/nerdtree /opt/vim/bundle/nertdtree4
5
# this pimps the status line6
git clone https://github.com/itchyny/lightline.vim /opt/vim/bundle/lightline7
8
# this is for smart copy and paste (without automatic indent and messing around with :set paste)9
git clone https://github.com/ConradIrwin/vim-bracketed-paste /opt/vim/bundle/bracketed-paste10
11
# make some often used shell commands available12
git clone https://github.com/tpope/vim-eunuch.git /opt/vim/bundle/eunuch13
14
# extended syntax checks15
git clone https://github.com/vim-syntastic/syntastic.git /opt/vim/bundle/syntastic16
17
# optimzize colors18
git clone https://github.com/altercation/vim-colors-solarized.git /opt/vim/bundle/colors-solarizedUnd hier noch die globale vimrc:
xxxxxxxxxx1
"2
" File managed by salt.ovtec.it (packages/vim).3
" Your changes will be overwritten.4
"5
6
runtime! debian.vim7
8
if exists('g:loaded_sensible') || &compatible9
finish10
else11
let g:loaded_sensible = 112
endif13
14
if has('autocmd')15
filetype plugin indent on16
endif17
if has('syntax') && !exists('g:syntax_on')18
syntax enable19
endif20
21
set autoindent22
set autoread23
set background=dark24
set backspace=indent,eol,start25
set cmdheight=226
set complete=i27
set expandtab " enable this to use whitespaces instead of tabs28
set formatoptions=qtj29
set hidden30
set incsearch31
set iskeyword+=_,$,@,%,#,-32
set laststatus=233
set lazyredraw34
set modeline35
set modelines=236
set nobackup37
set nohlsearch38
set nrformats=octal,hex,alpha39
set ruler40
set shiftwidth=241
set showcmd42
set showmatch43
set showmode44
set smarttab45
set softtabstop=246
set tabstop=247
set ttimeout48
set ttimeoutlen=10049
set visualbell50
set wildmenu51
52
" Use <C-L> to clear the highlighting of :set hlsearch.53
if maparg('<C-L>', 'n') ==# ''54
nnoremap <silent> <C-L> :nohlsearch<C-R>=has('diff')?'<Bar>diffupdate':''<CR><CR><C-L>55
endif56
57
if !&scrolloff58
set scrolloff=159
endif60
if !&sidescrolloff61
set sidescrolloff=562
endif63
set display+=lastline64
65
if &encoding ==# 'latin1' && has('gui_running')66
set encoding=utf-867
endif68
69
if &listchars ==# 'eol:$'70
set listchars=tab:>-,trail:-,extends:>,precedes:<,nbsp:+71
endif72
73
if has('path_extra')74
setglobal tags-=./tags tags-=./tags; tags^=./tags;75
endif76
77
if &shell =~# 'fish$'78
set shell=/bin/bash79
endif80
81
if &history < 100082
set history=100083
endif84
if &tabpagemax < 5085
set tabpagemax=5086
endif87
if !empty(&viminfo)88
set viminfo^=!89
endif90
set sessionoptions-=options91
92
" Allow color schemes to do bright colors without forcing bold.93
if &t_Co == 8 && $TERM !~# '^linux\|^Eterm'94
set t_Co=1695
endif96
97
" I don't remember what that does98
inoremap <C-U> <C-G>u<C-U>99
100
" next and previous buffer / file101
nnoremap <C-N> :next<Enter>102
nnoremap <C-P> :prev<Enter>103
104
" toggle displaying listchars105
nnoremap <F3> :set list!<Enter>106
107
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif108
au BufRead,BufNewFile *.sls setfiletype sls109
au FileType yaml,yml,sls setlocal ts=2 sts=2 sw=2 ai expandtab fo-=c fo-=r fo-=o110
"au FileType * setlocal ts=2 sts=2 sw=2 ai expandtab fo-=c fo-=r fo-=o111
112
" Load plugins113
execute pathogen#infect('bundle/{}', '/opt/vim/bundle/{}')114
115
" colorscheme116
let g:solarized_termcolors=256117
colorscheme solarized118
119
" syntastic syntax checker120
set statusline+=%#warningmsg#121
set statusline+=%{SyntasticStatuslineFlag()}122
set statusline+=%*123
let g:syntastic_always_populate_loc_list = 1124
let g:syntastic_auto_loc_list = 1125
let g:syntastic_check_on_open = 1126
let g:syntastic_check_on_wq = 0127
128
" vim:set ft=vim et sw=2: