Skip to content

Instantly share code, notes, and snippets.

@amaslenn
Last active February 26, 2017 16:18
Show Gist options
  • Save amaslenn/5f0287c76d28d75ccdbb to your computer and use it in GitHub Desktop.
Save amaslenn/5f0287c76d28d75ccdbb to your computer and use it in GitHub Desktop.
Vim config
" Vundle and friends
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'flazz/vim-colorschemes'
call vundle#end()
filetype plugin indent on
" colorscheme
colorscheme Monokai
" settings
set number
set encoding=utf8
syntax enable
" handle trainling white spaces
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
endfunc
autocmd BufWrite *.p? :call DeleteTrailingWS() " perl/python
autocmd BufWrite *.go :call DeleteTrailingWS() " golang
autocmd BufWrite *.js :call DeleteTrailingWS() " javascript
" jump to the last position when reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment