Last active
February 26, 2017 16:18
-
-
Save amaslenn/5f0287c76d28d75ccdbb to your computer and use it in GitHub Desktop.
Vim config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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