Skip to content

Instantly share code, notes, and snippets.

Created January 14, 2015 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/4db329eac58c90a93722 to your computer and use it in GitHub Desktop.
Save anonymous/4db329eac58c90a93722 to your computer and use it in GitHub Desktop.
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'tComment'
Plugin 'tpope/vim-pathogen'
Plugin 'jdevera/vim-protobuf-syntax'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
Plugin 'localvimrc'
Plugin 'sickill/vim-monokai'
Plugin 'mattn/webapi-vim'
Plugin 'mattn/gist-vim'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'majutsushi/tagbar'
" Plugin 'itchyny/lightline.vim'
Plugin 'fatih/vim-go'
call vundle#end() " required
call pathogen#infect()
filetype plugin indent on " required
filetype plugin on
" set UTF-8 encoding
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
set autoindent
set smartindent
set tabstop=2
set shiftwidth=2
set expandtab
set textwidth=120
set number
set showmatch
set hlsearch
let g:ycm_key_invoke_completion = '<C-Space>'
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf = 1
" Enhanced keyboard mappings
"
" in normal mode F2 will save the file
nmap <F2> :w<CR>
" in insert mode F2 will exit insert, save, enters insert again
imap <F2> <ESC>:w<CR>i
" switch between header/source with F4
map <F3> <C-W>w
map <F4> :e %:p:s,.h$,.X123X,:s,.cc$,.h,:s,.X123X$,.cc,<CR>
inoremap <C-@> <C-Space>
if !has("gui_running")
inoremap <C-@> <C-x><C-o>
endif
map <F7> :make<CR>
map <S-F7> :make clean all<CR>
map <F8> :make! run<CR>
map <F10> :sh<CR>
map <C-n> :NERDTreeToggle<CR>
" goto definition with F12
map <F12> <C-]>
set nobackup
set nowb
set noswapfile
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
let g:localvimrc_sandbox=0
let g:localvimrc_persistent=2
set completeopt=menu,longest
set nospell
set t_Co=256
colorscheme monokai
set laststatus=2
let g:gist_post_anonymous = 1
let g:gist_post_private = 1
autocmd FileType python set omnifunc=pythoncomplete#Complete
augroup filetype
au! BufRead,BufNewFile *.proto setfiletype proto
augroup end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment