Skip to content

Instantly share code, notes, and snippets.

@ijingo
Created August 5, 2016 02:38
Show Gist options
  • Save ijingo/a9533d6dd914ce39c0e58281153e8721 to your computer and use it in GitHub Desktop.
Save ijingo/a9533d6dd914ce39c0e58281153e8721 to your computer and use it in GitHub Desktop.
vimrc
" Vundel initialization
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'altercation/vim-colors-solarized'
Bundle 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
Bundle 'derekwyatt/vim-scala'
" Plugin 'itchyny/lightline.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'Lokaltog/powerline-fonts'
Bundle 'kshenoy/vim-signature'
Bundle 'majutsushi/tagbar'
Bundle 'octol/vim-cpp-enhanced-highlight'
Bundle 'scrooloose/nerdcommenter'
Plugin 'sjl/gundo.vim'
Plugin 'vim-scripts/indexer.tar.gz'
Plugin 'vim-scripts/DfrankUtil'
Plugin 'vim-scripts/vimprj'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'rhysd/vim-clang-format'
Plugin 'fatih/vim-go'
Plugin 'Lokaltog/vim-easymotion'
call vundle#end()
" Go tags
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
" YouCompleteMe Settings
let g:ycm_global_ycm_extra_conf = "~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py"
" nnoremap <F5> :YcmShowDetailedDiagnostic<CR>
" nerdcommenter Settings
let g:NERDSpaceDelims=1
" indexer ctags settings
let g:indexer_ctagsCommandLineOptions="--c++-kinds=+p+l+x+c+d+e+f+g+m+n+s+t+u+v --fields=+iaSl --extra=+q"
" vim-clang-format settings
let g:clang_format#code_style = "google"
let g:clang_format#command = "clang-format-3.6"
" map to <Leader>cf in C++ code"
autocmd FileType c,cpp,objc nnoremap <buffer><Leader>cf :<C-u>ClangFormat<CR>
autocmd FileType c,cpp,objc vnoremap <buffer><Leader>cf :ClangFormat<CR>
" Toggle auto formatting:"
" nmap <Leader>C :ClangFormatAutoToggle<CR>
" tarbar
nmap <F9> :TagbarToggle<CR>
let g:tarbar_autofocus = 1
" vim-easymotion
let g:EasyMotion_smartcase = 1
let g:EasyMotion_startofline = 0 " keep cursor colum when JK motion
" enable powerline-fonts
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
syntax enable
syntax on
filetype plugin indent on
set ruler
set cursorline
set cursorcolumn
set autoindent
set smartindent
set cindent
set tabstop=2
set showmatch
set softtabstop=2
set shiftwidth=2
set expandtab
set shiftround
set hlsearch
set incsearch
set number
set laststatus=2
set nofoldenable
set foldmethod=syntax
" colorscheme: solarized
set t_Co=256
set background=dark
colorscheme solarized
" Customed Hotkey
let mapleader=";"
inoremap ( ()<left>
inoremap ' ''<left>
inoremap " ""<left>
imap <C-a> <ESC>^i
imap <C-e> <ESC>$a
nmap <C-j> $a;<NL>
nmap <F4> :set hlsearch! hlsearch?<CR>
nmap <F5> :NERDTreeToggle<CR>
nmap <F7> :GundoToggle<CR>
nmap <F8> :TagbarToggle<CR>
nmap <leader>a 0
nmap <leader>e $
vnoremap <leader>y "+y
nmap <leader>p "+p
nmap <Leader><leader>h <Plug>(easymotion-linebackward)
nmap <Leader><Leader>j <Plug>(easymotion-j)
nmap <Leader><Leader>k <Plug>(easymotion-k)
nmap <Leader><leader>l <Plug>(easymotion-lineforward)
nmap <Leader><leader>. <Plug>(easymotion-repeat)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment