This commit is contained in:
Julian Scharrenbach 2017-12-19 14:44:56 +01:00
parent 5a73bab821
commit 5b0cdd0687

23
.vimrc
View File

@ -29,6 +29,8 @@ set noexpandtab
set tabstop=2
set sw=2
set so=7 "set 7 lines to the cursor when moving vertically with j/k
set foldcolumn=1 "add a bit of extra margin to the left
set smarttab
set smartindent
@ -49,6 +51,11 @@ filetype plugin on
filetype indent on
filetype on
" With a map leader it's possible to do extra key combinations
" like <leader>w saves the current file
let mapleader=" "
let g:mapleader=" "
" settings for vim 7
if version >= 700
set spellfile=~/.vimspell.de.add,~/.vimspell.en.add
@ -58,6 +65,22 @@ endif
hi LineTooLong cterm=bold ctermbg=red guibg=LightYellow
match LineTooLong /\%>80v.\+/
"useful mappings for managing tabs
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
map <leader>t<leader> :tabnext
" Delete trailing white space on save, useful for some filetypes ;)
fun! CleanExtraSpaces()
let save_cursor = getpos(".")
let old_query = getreg('/')
silent! %s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfun
" grep will sometimes skip displaying the file name
set grepprg=grep\ -nH\ $*