Skip to content

Instantly share code, notes, and snippets.

@aita
Last active October 14, 2019 19:33
Show Gist options
  • Select an option

  • Save aita/cd3fea309bb2fbdb3d116d9ea580b7eb to your computer and use it in GitHub Desktop.

Select an option

Save aita/cd3fea309bb2fbdb3d116d9ea580b7eb to your computer and use it in GitHub Desktop.
.vimrc
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.{h,c,cc,cc,py}]
indent_style = space
indent_size = 4
[*.{ml,mli}]
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
set nocompatible
set exrc
set secure
set nobackup
set noswapfile
set number
set ruler
set laststatus=2
set display=lastline
set showmode
set showcmd
set report=0
set backspace=start,eol,indent
set autoindent
set smartindent
set ignorecase
set incsearch
set wrapscan
set ttyfast
set lazyredraw
set splitbelow
set splitright
syntax enable
filetype plugin indent on
set cursorline
hi cursorline cterm=none term=none
highlight CursorLine ctermbg=60 guibg=MediumPurple4
if has("gui_running")
colorscheme desert
set guifont=Monaco:h14
endif
let mapleader = "\<Space>"
let g:ConqueGdb_Leader = "\\"
nnoremap <silent> <Leader>ff :Files<CR>
nnoremap <silent> <Leader>fb :Buffers<CR>
nnoremap <silent> <Leader>fm :Maps<CR>
nnoremap <silent> <Leader>b :NERDTreeToggle<CR>
nnoremap <silent> <Leader>: :Gtags -f %<CR>
nnoremap <silent> <Leader>. :GtagsCursor<CR>
nnoremap <silent> <Leader>n :cn<CR>
nnoremap <silent> <Leader>p :cp<CR>
nnoremap <silent> <Leader>o :copen<CR>
nnoremap <silent> <Leader>c :cclose<CR>
" vim-plug
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
call plug#begin('~/.vim/plugged')
Plug 'sbdchd/neoformat'
Plug 'editorconfig/editorconfig-vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'vim-scripts/gtags.vim'
Plug 'dense-analysis/ale'
Plug 'vim-scripts/Conque-GDB'
Plug 'justmao945/vim-clang'
Plug 'scrooloose/nerdtree'
let g:opam_share_dir = system("opam config var share")
let g:opam_share_dir = substitute(g:opam_share_dir, '[\r\n]*$', '', '')
let g:ocp_indent_dir = g:opam_share_dir . "/ocp-indent/vim"
let g:ocp_index_dir = g:opam_share_dir . "/ocp-index/vim"
let g:merlin_dir = g:opam_share_dir . "/merlin/vim"
Plug g:ocp_indent_dir, { 'for': 'ocaml' }
Plug g:ocp_index_dir, { 'for': 'ocaml' }
Plug g:merlin_dir, { 'for': 'ocaml' }
call plug#end()
let g:neoformat_enabled_ocaml = ['ocpindent', 'ocamlformat']
augroup fmt
autocmd!
autocmd BufWritePre * undojoin | Neoformat
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment