Skip to content

Instantly share code, notes, and snippets.

@mengzhuo
Last active September 9, 2018 15:30
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 mengzhuo/4e06e04fadaf21e86066 to your computer and use it in GitHub Desktop.
Save mengzhuo/4e06e04fadaf21e86066 to your computer and use it in GitHub Desktop.
Vimrc of mine
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'scrooloose/syntastic'
Plugin 'kien/ctrlp.vim'
Plugin 'bling/vim-airline'
Plugin 'bronson/vim-trailing-whitespace'
Plugin 'fatih/vim-go'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'SirVer/ultisnips'
Plugin 'Shougo/neocomplete'
call vundle#end()
syntax enable
filetype plugin indent on
set autoindent " same level indent
set shiftwidth=4
set modeline
set hlsearch
set backspace=indent,eol,start
set completeopt=menu,longest,preview
set fileformats=unix
set foldmethod=indent
set foldlevel=99
set relativenumber
highlight Pmenu guibg=Blue guifg=White ctermbg=Blue ctermfg=White
highlight PmenuSel guibg=White guifg=Blue ctermbg=White ctermfg=Blue
" Go
set rtp+=$GOROOT/misc/vim
let g:go_bin_path = expand("~/go/bin")
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_fmt_command = "goimports"
au FileType go nmap <leader>t <Plug>(go-test)
let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
let g:go_list_type = "quickfix"
"ctrlP settings
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = 'rca'
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,.svn,.git*,*pyc " Linux/MacOSX
let g:UltiSnipsSnippetDirectories=["UltiSnips"]
let g:UltiSnipsExpandTrigger="<c-g>"
let g:UltiSnipsJumpForwardTrigger="<c-g>"
let g:UltiSnipsJumpBackwardTrigger="<c-z>"
set encoding=utf-8
let g:solarized_termcolors=256
" Python Checks
let g:syntastic_python_checkers=['pyflakes']
let g:syntastic_error_symbol='✗'
let g:syntastic_warning_symbol='⚠'
let g:syntastic_auto_loc_list=2
" Airline
set t_Co=256
let g:airline#extensions#tabline#enabled = 1
set laststatus=2
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = ' '
let g:bufferline_echo = 0
" Buffer shortcut
map <C-j> :bnext<cr>
map <C-k> :bprevious<cr>
let g:UltiSnipsExpandTrigger ="<c-j>"
let g:neocomplete#enable_at_startup = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment