Skip to content

Instantly share code, notes, and snippets.

@kmtr
Last active March 6, 2016 00:13
Show Gist options
  • Save kmtr/1298ea1bdb7d3836e2a4 to your computer and use it in GitHub Desktop.
Save kmtr/1298ea1bdb7d3836e2a4 to your computer and use it in GitHub Desktop.
scriptencoding utf-8
if &compatible
set nocompatible
endif
"$ mkdir -p ~/.vim/dein/repos/github.com/Shougo/dein.vim
"$ clone https://github.com/Shougo/dein.vim.git ~/.vim/dein/repos/github.com/Shougo/dein.vim
set runtimepath+=~/.vim/dein/repos/github.com/Shougo/dein.vim
call dein#begin(expand('~/.vim/dein'))
call dein#add('Shougo/dein.vim')
call dein#add('Lokaltog/vim-easymotion')
call dein#add('Shougo/unite.vim')
call dein#add('ctrlpvim/ctrlp.vim')
call dein#add('digitaltoad/vim-jade')
call dein#add('fatih/vim-go.git')
call dein#add('gilligan/vim-lldb')
call dein#add('godlygeek/tabular')
call dein#add('justinmk/vim-dirvish')
call dein#add('kchmck/vim-coffee-script')
call dein#add('kien/rainbow_parentheses.vim')
call dein#add('majutsushi/tagbar')
call dein#add('mxw/vim-jsx')
call dein#add('othree/html5.vim')
call dein#add('rust-lang/rust.vim')
call dein#add('racer-rust/vim-racer')
call dein#add('scrooloose/syntastic')
call dein#add('soramugi/auto-ctags.vim')
call dein#add('thinca/vim-quickrun')
call dein#add('thinca/vim-splash')
"call dein#add('tpope/vim-fugitive.git')
"call dein#add('xhr/vim-io')
"colorschema
call dein#add('altercation/vim-colors-solarized')
call dein#add('fatih/molokai')
call dein#add('jonathanfilip/vim-lucius')
call dein#add('nanotech/jellybeans.vim')
call dein#add('vim-scripts/darktango.vim')
call dein#end()
filetype plugin indent on
syntax on
set encoding=utf-8
set textwidth=0
set tabstop=4 shiftwidth=4 softtabstop=0
set smartindent shiftround expandtab
set ignorecase smartcase wrapscan
set nobackup
set noundofile
set foldmethod=syntax foldlevel=100
set number
set cursorline
set hlsearch
set modeline
set completeopt-=preview
set noundofile
if &t_Co > 1
"set t_Co=256
"let g:rehash256 = 1
"let g:molokai_original = 1
"colorscheme molokai
colorscheme lucius
set background=light
endif
let loaded_matchparen=1
set visualbell noerrorbells t_vb=
set tags+=.git/tags
"plugins
let g:EasyMotion_leader_key = '<Space><Space>'
let g:splash#path = expand('~/.vim_splash')
let g:auto_ctags_directory_list = ['.git']
"rainbow_parentheses
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 9
let g:rbpt_loadcmd_toggle = 0
"Dirvish (filer)
let g:dirvish_hijack_netrw = 1
let g:dirvish_relative_paths = 1
"quickrun
let g:quickrun_config = {
\ '_': {
\ 'outputter/error/error' : 'quickfix',
\ 'outputter/buffer/split' : ':botright',
\ 'outputter/buffer/close_on_empty' : 1,
\ 'outputter/error/success' : 'buffer',
\ 'outputter' : 'error'
\ }
\}
set splitbelow
nnoremap <silent> qr :QuickRun<CR>
"ctrlp
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.jpg,*.png,*.tiff,*/.git/*,*/Godep/*,*/node_modules/*:
if executable('ag')
let g:ctrlp_use_caching = 0
let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup -g ""'
endif
let g:ctrlp_custom_ignore = '\v[\/](node_modules|build|Godeps)$'
"let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'}
" go get github.com/mattn/files
"let g:ctrlp_user_command = 'files -a %s'
augroup vimrc
autocmd!
autocmd VimEnter * RainbowParenthesesToggle
autocmd Syntax * RainbowParenthesesLoadRound
autocmd Syntax * RainbowParenthesesLoadSquare
autocmd Syntax * RainbowParenthesesLoadBraces
autocmd FileType make setlocal noexpandtab
"set filetype
"gyp
autocmd BufNewFile,BufRead *.gyp setf json
"coffeekup
autocmd BufNewFile,BufRead *.ck setf coffee
autocmd BufNewFile,BufReadPost *.coffee setl shiftwidth=2 expandtab
augroup END
"vim-go
augroup filetype-go
autocmd!
autocmd FileType go setlocal tabstop=3
autocmd FileType go setlocal shiftwidth=3
autocmd FileType go let g:auto_ctags = 1
autocmd FileType go let g:go_fmt_fail_silently = 1
autocmd FileType go let g:go_highlight_functions = 1
autocmd FileType go let g:go_highlight_methods = 1
autocmd FileType go let g:go_highlight_structs = 1
autocmd FileType go let g:go_highlight_operators = 1
autocmd FileType go let g:go_highlight_build_constraints = 1
autocmd FileType go let g:go_play_open_browser = 0
autocmd FileType go let g:go_fmt_command = 'goimports'
autocmd FileType go nmap <leader>r <Plug>(go-run)
autocmd FileType go nmap <leader>b <Plug>(go-build)
autocmd FileType go nmap <leader>tr <Plug>(go-test)
autocmd FileType go nmap <leader>tf <Plug>(go-test-func)
autocmd FileType go nmap <leader>c <Plug>(go-coverage)
autocmd FileType go nmap <Leader>df <Plug>(go-def)
autocmd FileType go nmap <Leader>ds <Plug>(go-def-split)
autocmd FileType go nmap <Leader>dv <Plug>(go-def-vertical)
autocmd FileType go nmap <Leader>dt <Plug>(go-def-tab)
autocmd FileType go nmap <Leader>gd <Plug>(go-doc)
autocmd FileType go nmap <Leader>gv <Plug>(go-doc-vertical)
autocmd FileType go nmap <Leader>s <Plug>(go-implements)
autocmd FileType go nmap <Leader>i <Plug>(go-info)
autocmd FileType go nmap <Leader>e <Plug>(go-rename)
autocmd FileType go hi goErr term=bold ctermfg=13 gui=bold guifg=#ef5939
autocmd FileType go :highlight goErr cterm=bold ctermfg=202
autocmd FileType go :match goErr /\<err\>/
autocmd FileType go ia iferr if<Space>err<Space>!=<Space>nil<Space>{<CR>return err<CR>}
autocmd FileType go ia httpwr w<Space>http.ResponseWriter,<Space>r<Space>*http.Request
augroup END
"ocaml
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
execute 'set rtp+=' . g:opamshare . '/merlin/vim'
execute 'set rtp^=' . g:opamshare . '/ocp-indent/vim'
function! s:ocaml_format()
let now_line = line('.')
exec ':%! ocp-indent'
exec ':' . now_line
endfunction
augroup ocaml_format
autocmd!
autocmd BufWrite,FileWritePre,FileAppendPre *.mli\= call s:ocaml_format()
augroup END
set hidden
let g:racer_cmd = expand($HOME) . '/.cargo/bin/racer'
let $RUST_SRC_PATH=expand($HOME) . '/rust/src/rustc-1.6.0/src'
"syntastic
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0
let g:syntastic_mode_map = { 'mode': 'passive', 'active_filetypes': ['go', 'ocaml'] }
let g:syntastic_go_checkers = ['go', 'golint', 'govet', 'errcheck']
let g:syntastic_ocaml_checkers = ['merlin']
let g:syntastic_loc_list_height = 3
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
"key map
"let mapleader = ' '
map! <C-a> <Home>
map! <C-e> <End>
map! <C-f> <Right>
map! <C-b> <Left>
nmap <silent> <Esc><Esc> :nohlsearch<CR><esc>
nmap <F8> :TagbarToggle<CR>
"map <F11> :lcd %:p:h<CR>
"LLDB
let g:lldb_map_Lrun = '<leader>lr'
let g:lldb_map_Lbreakpoint = '<leader>lb'
let g:lldb_map_Lcontinue = '<leader>lc'
let g:lldb_map_Lnext = '<leader>ln'
let g:lldb_map_Lstep = '<leader>ls'
let g:lldb_map_Lstepin = '<leader>li'
nnoremap <silent> <leader>lv :Lframe variable<CR>
vmap <Leader>y "+y
nmap <silent> <Leader>p :set paste<CR>"+p:set nopaste<CR>
command! -nargs=? -complete=dir -bang CD call s:ChangeCurrentDir('<args>', '<bang>')
function! s:ChangeCurrentDir(directory, bang)
if a:directory == ''
lcd %:p:h
else
execute 'lcd' . a:directory
endif
if a:bang == ''
pwd
endif
endfunction
" Change current directory.
nnoremap <silent> <Space>cd :<C-u>CD<CR>
set mouse=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment