-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
74 lines (61 loc) · 1.83 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
set nocompatible " be iMproved, required
filetype off " required
syntax enable
set hlsearch
set ignorecase " ignore case on search
set smartcase " except when input has capital
set incsearch " hl while typing
set background=dark
set number
set splitbelow " sp opens below
set splitright " vs opens right
" binds
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
map <c-h> <c-w>h
set pastetoggle=<F3>
nnoremap <F2> :set nonumber!<CR>
nnoremap <F4> :noh<CR>
nnoremap <F5> :! python %<CR>
nnoremap <F6> :! python -m unittest %<CR>
nnoremap <F7> :! py.test<CR>
" edit vimrc
nnoremap <leader>ev <C-w><C-s><C-l>:e $MYVIMRC<CR>
" gui config
if has("gui_macvim")
set guifont=Monaco:h14
else
set guifont=DejaVu\ Sans\ Mono\ 12
endif
set guioptions-=T "remove toolbar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L "remove left-hand scroll bar
" keep .swp outside of working directory
set backup
set backupdir=~/.vim/backup//
set directory=~/.vim/swap//
set undodir=~/.vim/undo//
set writebackup
" syntastic config
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" python
autocmd FileType python setlocal tabstop=8 expandtab shiftwidth=4 softtabstop=4
\ formatoptions=croqj textwidth=79
let python_highlight_all=1
let python_slow_sync=1
" ruby
autocmd FileType ruby setlocal expandtab tabstop=2 shiftwidth=2 softtabstop=2
\ autoindent textwidth=119
" javascript
autocmd Filetype javascript setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
" watch vimrc for changes and reload
augroup reload_vimrc " {
autocmd!
autocmd BufWritePost $MYVIMRC source $MYVIMRC
augroup END " }