Skip to content

Instantly share code, notes, and snippets.

@dlintw
Created January 19, 2017 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlintw/7cb20cb2c15600e8bf531ee6f084e77d to your computer and use it in GitHub Desktop.
Save dlintw/7cb20cb2c15600e8bf531ee6f084e77d to your computer and use it in GitHub Desktop.
Simplified vim settings with 'dein' plugin manager
" vim:et sta sw=2 ts=2
" d=~/.vim/dein/repos/github.com/Shougo/dein.vim ; mkdir -p $d
" git clone https://github.com/Shougo/dein.vim $d
scriptencoding utf-8
" let big5 file happier under utf8 environment
set fileencodings=ucs-bom,utf-8,big5,gbk,latin1
set nocompatible
set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim
call dein#begin('~/.vim/dein')
call dein#add('~/.vim/dein/repos/github.com/Shougo/dein.vim')
call dein#add('vim-scripts/VOom')
call dein#add('tomasr/molokai')
call dein#end()
call dein#save_state()
filetype plugin indent on
syntax enable
if dein#check_install()
call dein#install()
endif
"putty settings http://blog.cochard.me/2014/09/putty-and-solarized-colors.html
colorscheme molokai
set ruler " show line/column number
set colorcolumn=80 " gq$ to wrap current line
" RightTrim spaces
" :call St<tab> to call this function
autocmd BufWritePre *.{c,cp,cpp,h,mak,py,rst,sh,txt} call StripTrailingWhite()
autocmd BufWritePre {Makefile,.vimrc,PKGBUILD} call StripTrailingWhite()
au BufRead *.cp set syntax=cpp " treat .cp as .cpp
function! StripTrailingWhite()
let l:winview = winsaveview()
silent! %s/\s\+$//
call winrestview(l:winview)
endfunction
" Best Tutorial: http://feihu.me/blog/2014/intro-to-vim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment