Skip to content

Instantly share code, notes, and snippets.

@Heasummn
Last active September 10, 2016 01:20
Show Gist options
  • Save Heasummn/51b72c375aa82601d89352ee94e0ab1e to your computer and use it in GitHub Desktop.
Save Heasummn/51b72c375aa82601d89352ee94e0ab1e to your computer and use it in GitHub Desktop.
vim config
" Set everything to a default
set nocompatible
let g:dotvim = "~/.vim/"
" Enable and use Pathogen
execute pathogen#infect()
call pathogen#helptags()
" Colors
syntax enable
set background=dark
colorscheme solarized
" Editor
set showcmd
set cursorline
set number
filetype indent on " load filetype-specific indent files
set wildmenu
set lazyredraw
set showmatch
set clipboard=unnamedplus " All yanking and pasting happens from clipboard
" Backups
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set writebackup
" Rebind ctrl-s to save, because old habits die hard
noremap <silent> <C-S> :update<CR>
vnoremap <silent> <C-S> <C-C>:update<CR>
inoremap <silent> <C-S> <C-O>:update<CR>
" Syntax stuff
filetype plugin on
set omnifunc=syntaxcomplete#Complete
set completeopt+=longest
" Spacing
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab " Convert tabs to spaces
" Disable GUI features
:set guioptions-=m "remove menu bar
:set guioptions-=T "remove toolbar
:set guioptions-=r "remove right-hand scroll bar
:set guioptions-=L "remove left-hand scroll bar
" Navigation
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" Plugin specific
" Ctrl-p
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" Theme
let g:enable_bold_font = 1
" NERD Tree
map <C-n> :NERDTreeToggle<CR>
" Airline
set laststatus=2
set ttimeoutlen=50
" YCM
let g:ycm_server_python_interpreter = '/usr/bin/python2'
let g:ycm_global_ycm_extra_conf = g:dotvim.'/ycm.py'
let g:ycm_extra_conf_vim_data = ['&filetype']
let g:ycm_seed_identifiers_with_syntax = 1
" Syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_ocaml_checkers = ['merlin']
let g:syntastic_ignore_files = ['\m\c\.ml[ly]$']
" Racer
let g:racer_cmd = "/home/heasummn/Applications/racer/target/release/racer"
let $RUST_SRC_PATH="/home/heasummn/.rust_local/rust/src/"
" Merlin
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
execute "set rtp+=" . g:opamshare . "/merlin/vim/bin"
execute "helptags " . g:opamshare . "/merlin/vim/doc"
def FlagsForFile(filename, **kwargs):
flags = [
'-Wall',
'-Wextra',
'-Werror'
'-pedantic',
'-I',
'.',
'-isystem',
'/usr/include',
'-isystem',
'/usr/local/include',
]
data = kwargs['client_data']
filetype = data['&filetype']
if filetype == 'c':
flags += ['-xc']
elif filetype == 'cpp':
flags += ['-xc++']
flags += ['-std=c++11']
else:
flags = []
return {
'flags': flags,
'do_cache': True
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment