-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
56 lines (50 loc) · 1.66 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"setlocal spell spelllang=en_gb
" Set color scheme
colorscheme elflord
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
" Enable syntax highlighting
syntax on
" Enable line numbering
set number
" Enable ruler
set ruler
set rtp+=/Users/Will/.opam/system/share/ocp-index/vim
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
Plug 'rgrinberg/vim-ocaml'
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
Plug 'xolox/vim-misc'
Plug 'xolox/vim-notes'
call plug#end()
" let g:vim_markdown_folding_disabled = 1
"
map <F2> :w<CR> :!ocamlc % && ocaml %<CR>
set backspace=2
let g:livepreview_previewer = 'open -a Preview'
set modeline
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" Vim 7.3 persistent undo
if has('persistent_undo')
let myundodir = '$HOME/.vim/undodir/'
silent call system('mkdir -p ' . myundodir)
let &undodir = expand(myundodir) " where to save undo histories
set undofile " Save undos after file closes
set undolevels=1000 " How many undos
set undoreload=10000 " number of lines to save for undo
endif