ansible-role-system/files/vimrc.local
Denis Knauf 3beb52ad22 init
2021-04-10 22:11:19 +02:00

90 lines
1.9 KiB
Plaintext

"execute pathogen#infect()
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
endif
if has("autocmd")
filetype indent on
endif
set background=dark
set showcmd
set showmatch
set smartcase
set incsearch
syntax on
" Einrücken immer um ein Tab der Breite 2
set ts=2
set sts=2
set sw=2
set noexpandtab
set modeline
set modelines=5
set listchars=tab:>.,trail:.,eol:$
"set list
"paste-mode"
map <f5> :set paste!<cr>
imap <f5> <c-o>:set paste!<cr>
map ,p :set paste!<cr>
"Zeilenenden aufräumen"
map <f9> :%s/\s\+$//<cr>
"list-mode (Am Ende der Zeile ein $)"
map ,l :set list!<cr>
"Wrap (automatischer Zeilenumbruch)"
map ,w :set wrap!<cr>
"Zeilennummern"
map ,n :set number!<cr>
"Cursor durch vert-/hori-linien über den ganzen Puffer anzeugen"
map ,c :set cuc! cul!<cr>
function! ToggleVirtualedit()
if &virtualedit == ''
set virtualedit=all
else
set virtualedit=
endif
endfunction
map ,v :call ToggleVirtualedit()<cr>
"
" Philips Erweiterungen:
"
highlight TabHighlight ctermbg=darkgrey
highlight TooLongLines ctermbg=darkred ctermfg=yellow
" Coding standard window addition function
function! AddCodingStandard()
if !exists("w:cs_lines_id")
let w:cs_lines_id = matchadd("TooLongLines", "^.\\{101,}")
endif
if !exists("w:cs_tab_id")
let w:cs_tab_id = matchadd("TabHighlight", "\t")
endif
endfunction
" Coding standard removal function
function! RemoveCodingStandard()
if exists("w:cs_lines_id")
call matchdelete(w:cs_lines_id)
unlet w:cs_lines_id
endif
if exists("w:cs_tab_id")
call matchdelete(w:cs_tab_id)
unlet w:cs_tab_id
endif
endfunction
autocmd BufWinEnter * call AddCodingStandard()
autocmd BufWinLeave * call RemoveCodingStandard()
" tags (Welches Wort steht wo (in welcher Datei ...))
set tags=./tags
" gnuplot (highlighting)
au BufNewFile,BufRead *.plt,.gnuplot setf gnuplot