Skip to content

Instantly share code, notes, and snippets.

@HybridEidolon
Last active December 14, 2015 01:59
Show Gist options
  • Save HybridEidolon/5010198 to your computer and use it in GitHub Desktop.
Save HybridEidolon/5010198 to your computer and use it in GitHub Desktop.
tentative .vimrc. Still learning. Needs gmarik/vundle and git on the local system.
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
"""""""""""""""""""""""
" Bundles for vundle
"""""""""""""""""""""""
" Vundle must manage itself
Bundle 'gmarik/vundle'
" Github repos
"Bundle 'Lokaltog/vim-powerline'
Bundle 'bling/vim-airline'
Bundle 'scrooloose/nerdtree'
"Bundle 'ciaranm/inkpot'
"Bundle 'ervandew/supertab'
"Bundle 'trapd00r/neverland-vim-theme'
Bundle 'scrooloose/syntastic'
Bundle 'airblade/vim-gitgutter'
Bundle 'altercation/vim-colors-solarized'
Bundle 'Valloric/YouCompleteMe'
" vim-scripts user on GitHub
"Bundle 'taglist.vim'
"Bundle 'OmniCppComplete'
"Bundle 'closetag.vim'
" Non-github repos (use full git pull URL)
filetype plugin indent on
" Vundle commands
" :BundleList - list bundles
" :BundleInstall(!) - install (update) bundles
" :BundleSearch(!) foo - search (or refresh cache first) for foo
" :BundleClean(!) - confirm (or auto-approve) removal of unused bundles
"
" see :h vundle
" comments after Bundle are not allowed
""""""""""""""""""""
" vim configuration
""""""""""""""""""""
set number " Line numbering
set smartindent " Smart indention
set mouse=a " enable mouse for all modes
set laststatus=2 " always show status line
set wildmenu " command-line tab completion
set showcmd " show partial commands in last line
set hlsearch " search highlighting
set ignorecase " case insensitive search
set smartcase " Smart case search (use case for case-sensitive searching
set confirm " ask for confirmation before quit
"set visualbell " visual bell instead of system beep
set textwidth=80 " no static text wrapping
set colorcolumn=+1 " static wrap ending
set cursorline " highlight current line
set backspace=2
syntax on
"set foldmethod=syntax
"set foldnestmax=1
set t_Co=256 " enable 256-colors
set encoding=utf-8 " enable unicode glyphs (for powerline)
set completeopt-=preview " disable completion preview
set tags+=~/.vim/systags " include systags
" GUI Configuration (too lazy to put in .gvimrc)
if has('gui_running')
try
"colorscheme neverland
" colorscheme inkpot
colorscheme solarized
set background=dark
catch /^VIM:185/
colorscheme evening
endtry
set guioptions-=T " remove toolbar
set guioptions-=r " remove scrollbar
endif
set expandtab shiftwidth=4 softtabstop=4 " 4-space tabs
autocmd! bufwritepost ~/.vimrc source ~/.vimrc " automatically reload .vimrc when changed
"""""""""""""""""""""""""""""
" OS-specific configuration
"""""""""""""""""""""""""""""
if has('win32') " Windows configuration
set guifont=Consolas\ 10
else
set guifont=Source\ Code\ Pro\ For\ Powerline\ 10
endif
"""""""""""""""""""""""""
" Airline configuration
"""""""""""""""""""""""""
"let g:Powerline_symbols = 'unicode'
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled=1
let g:airline#extensions#tabline#show_buffers=1
"""""""""""""""""""""""""
" Syntastic configuration
"""""""""""""""""""""""""
let g:syntastic_enable_signs = 1 " enable gutter signs
let g:syntastic_enable_balloons = 1 " enable mouse balloons
let g:syntastic_check_on_open = 1 " check for errors on open
let g:syntastic_warning_symbol = '✗'
let g:syntastic_error_symbol = '✗'
"""""""""""""""""
" Shortcuts
"""""""""""""""""
" These make up/down traverse by visual column rather than line
nmap j gj
nmap k gk
" Note: these seem to have weird issues with the gui in some cases...
" Open the NERDTree
nmap <Leader>t :NERDTreeToggle<Enter>
" Rebuild systags
nmap <Leader>sct :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q -f ~/.vim/systags /usr/include /usr/local/include<Enter>
" Rebuild CWD tags
nmap <Leader>ct :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<Enter>
" tabs
nmap <Leader>[ :tabprevious<Enter>
nmap <Leader>] :tabnext<Enter>
nmap <Leader>n :tabnew<Enter>
nmap <Leader>c :tabclose<Enter>
""""""""""""""""""""""""""""""""""
" filetype specific configuration
""""""""""""""""""""""""""""""""""
" scripting languages (ruby, python, php)
autocmd filetype ruby,python,php set expandtab shiftwidth=2 softtabstop=2
" C-family (c, cpp, cs, java, objc)
autocmd filetype c,cpp,cs,java,objc set cindent
" Text files (.txt)
autocmd bufread,bufnewfile *.txt set filetype=text
" CMake files (CMakeLists.txt)
autocmd bufread,bufnewfile CMakeLists.txt set filetype=cmake
autocmd bufread,bufnewfile *.cmake set filetype=cmake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment