Last active
March 2, 2018 21:18
-
-
Save McNight/6d8d23f7b5d98214196c8bddc0856232 to your computer and use it in GitHub Desktop.
My .vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Keys | |
let mapleader="," " leader is comma | |
set backspace=2 " make backspace work like most other programs | |
" Vim Plug | |
if has('nvim') | |
call plug#begin('~/.local/share/nvim/plugged') | |
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
Plug 'zchee/deoplete-jedi' | |
else | |
call plug#begin('~/.vim/plugged') | |
endif | |
Plug 'tpope/vim-surround' | |
Plug 'flazz/vim-colorschemes' | |
Plug 'vim-airline/vim-airline' | |
Plug 'tpope/vim-fugitive' | |
" Plug 'tpope/vim-sleuth' | |
Plug 'scrooloose/syntastic' | |
Plug 'def-lkb/ocp-indent-vim' | |
Plug 'rizzatti/dash.vim' | |
Plug 'raimondi/delimitmate' | |
Plug '/usr/local/opt/fzf' | |
Plug 'junegunn/fzf.vim' | |
Plug 'Procrat/oz.vim' | |
Plug 'wakatime/vim-wakatime' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'zchee/deoplete-clang' | |
Plug 'scrooloose/nerdtree' | |
Plug 'simnalamburt/vim-mundo' | |
Plug 'tpope/vim-speeddating' | |
call plug#end() | |
syntax enable | |
colorscheme molokai | |
" Tabs | |
set tabstop=4 " number of visual spaces per TAB | |
set softtabstop=4 " number of spaces in tab when editing | |
set shiftwidth=4 | |
" UI | |
set nosplitright | |
set ttyfast | |
set number " show line numbers | |
filetype indent on " load filetype-specific indent filesset wildmenu | |
set wildmenu " visual autocomplete for command menu | |
set showmatch " highlight matching [{()}] | |
set colorcolumn=80 | |
" Shortcuts modifying UI | |
nnoremap <leader><space> :nohlsearch<CR> | |
" Buffer Shortcuts | |
nmap <leader>n :bn<CR> | |
nmap <leader>p :bp<CR> | |
nmap <leader>d :bd<CR> | |
" Shortcut to rapidly toggle `set list` | |
nmap <leader>l :set list!<CR> | |
set listchars=tab:▸\ ,eol:¬ | |
" Buffers | |
set hidden " shut the fuck up about hidden buffers | |
" Search | |
set incsearch " search as characters are entered | |
set hlsearch " highlight matches | |
" Folding | |
set foldenable " enable folding | |
set foldlevelstart=10 " open most folds by default | |
set foldnestmax=10 " 10 nested fold max | |
" space open/closes folds | |
nnoremap <space> za | |
set foldmethod=indent " fold based on indent level | |
" Other shortcuts | |
" ... | |
" Plugin Extra Configurations | |
if has('nvim') | |
" Use deoplete. | |
let g:deoplete#enable_at_startup = 1 | |
let g:deoplete#sources#clang#libclang_path = "/Library/Developer/CommandLineTools/usr/lib/libclang.dylib" | |
let g:deoplete#sources#clang#clang_header = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/" | |
endif | |
" vim-airline | |
set laststatus=2 | |
set ttimeoutlen=50 | |
" Syntastic | |
" ---------------- OCaml stuff below here --------------- | |
" Load Merlin installed from OPAM | |
let g:opamshare = substitute(system('opam config var share'),'\n$','','''') | |
execute "set rtp+=" . g:opamshare . "/merlin/vim" | |
set rtp^="/Users/mcnight/.opam/system/share/ocp-indent/vim" | |
" Tell Syntastic to use Merlin to check for errors on each save | |
let g:syntastic_ocaml_checkers = ['merlin'] | |
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 = 0 | |
let g:syntastic_check_on_wq = 1 | |
" Mundo | |
" Enable persistent undo so that undo history persists across vim sessions | |
let g:mundo_close_on_revert = 1 | |
nnoremap <Leader>u :MundoToggle<CR> | |
set undofile | |
set undodir=~/.vim/undo | |
" Specific FileType Settings | |
autocmd Filetype ruby setlocal ts=2 sw=2 sts=2 expandtab | |
autocmd Filetype ocaml setlocal ts=2 sw=2 sts=2 expandtab | |
autocmd Filetype c setlocal ts=4 sw=4 sts=4 | |
" NerdTree | |
map <C-n> :NERDTreeToggle<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment