-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
81 lines (64 loc) · 1.94 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
" Use pathogen to automatically load plugins
execute pathogen#infect()
execute pathogen#helptags()
set mouse=a
set ts=2
set expandtab
set shiftwidth=2
set smarttab
set autoindent
set number
set hlsearch
set incsearch
set showmatch
set nocompatible
set splitright
" Show a print margin at 80 characters
set colorcolumn=80
" Open NerdTree with ctrl-n
map <C-n> :NERDTreeToggle<CR>
" ... ?
syntax on
filetype plugin indent on
" Use my favourite colour scheme
colorscheme distinguished
" Make crtl-u and crtl-w in insert mode undo-able
inoremap <c-u> <c-g>u<c-u>
inoremap <c-w> <c-g>u<c-w>
" Not sure what this does... look it up
let g:syntastic_enable_signs=1
let g:syntastic_auto_loc_list=1
let g:syntastic_disabled_filetypes = ['html']
let mapleader=","
" Only update the instant markdown preview occasionally instead of realtime.
let g:instant_markdown_slow = 1
" Force vim airline to use a specific theme. Avoids a non-zero exit code from
" vim when using airline.
let g:airline_theme='dark'
" Don't search through these directories when using crtl-p
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](haproxy-1.4.20|node_modules|.git|yui-compressor)$',
\ }
" Auto remove trailing whitespace when saving javascript files.
autocmd BufWritePre *.* :%s/\s\+$//e
"{{{
" Remap p so that I can paste in visual mode without overwriting the register
" I haven't found how to hide this function (yet)
function! RestoreRegister()
let @" = s:restore_reg
return ''
endfunction
function! s:Repl()
let s:restore_reg = @"
return "p@=RestoreRegister()\<cr>"
endfunction
" NB: this supports "rp that replaces the selection by the contents of @r
vnoremap <silent> <expr> p <sid>Repl()
" }}}
" *.md files are markdown
au BufRead,BufNewFile *.md set filetype=markdown
" Put backup and swp files in special directories instead of the working dir.
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
" Insert a newline without entering insert mode.
nmap <CR> o<Esc>