Skip to content

Instantly share code, notes, and snippets.

@r1walz
Last active October 11, 2019 21:06
Show Gist options
  • Save r1walz/ec76765f77dcc5078bdf08a96b5c3187 to your computer and use it in GitHub Desktop.
Save r1walz/ec76765f77dcc5078bdf08a96b5c3187 to your computer and use it in GitHub Desktop.
configuration file for vim
set background=dark
syntax enable
set mouse=n
set number
set wildmenu
set ruler
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
set ignorecase
set smartcase
set incsearch
set showmatch
set smarttab
set shiftwidth=8
set tabstop=8
set ai
set si
set wrap
match ErrorMsg '\%>68v.\+\|\s\+$\| \+\ze\t'
fun! CleanExtraSpaces()
let save_cursor = getpos(".")
let old_query = getreg('/')
silent! %s/\s\+$//e
call setpos('.', save_cursor)
call setreg('/', old_query)
endfun
if has("autocmd")
autocmd BufWritePre *.txt,*.js,*.py,*.wiki,*.sh,*.coffee :call CleanExtraSpaces()
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment