-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.after
104 lines (79 loc) · 3.16 KB
/
vimrc.after
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
color vividchalk
set background=dark
set guifont=Monaco:h12
" let g:NERDTreeWinPos = "right"
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
autocmd User Rails let b:surround_{char2nr('-')} = "<% \r %>" " displays <% %> correctly
:set cpoptions+=$ " puts a $ marker for the end of words/lines in cw/c$ commands
:set relativenumber
"Janus/Fugitive extensions
nnoremap <Leader>gsl :Git stash list<CR>
nnoremap <Leader>gsp :Git stash pop<CR>
let g:syntastic_ruby_checkers = ['mri', 'rubocop']
let g:syntastic_aggregate_errors = 1 " aggregate all checkers' output
let g:syntastic_always_populate_loc_list = 1 " so :lnext & :lprev work
" plain annotations
map <silent> <F10> !xmpfilter -a<cr>
nmap <silent> <F10> V<F10>
imap <silent> <F10> <ESC><F10>a
" Test::Unit assertions; use -s to generate RSpec expectations instead
map <silent> <S-F10> !xmpfilter -u<cr>
nmap <silent> <S-F10> V<S-F10>
imap <silent> <S-F10> <ESC><S-F10>a
" Annotate the full buffer
" I actually prefer ggVG to %; it's a sort of poor man's visual bell
nmap <silent> <F11> mzggVG!xmpfilter -a<cr>'z
imap <silent> <F11> <ESC><F11>
" assertions
nmap <silent> <S-F11> mzggVG!xmpfilter -u<cr>'z
imap <silent> <S-F11> <ESC><S-F11>a
" Add # => markers
vmap <silent> <F12> !xmpfilter -m<cr>
nmap <silent> <F12> V<F12>
imap <silent> <F12> <ESC><F12>a
" Remove # => markers
vmap <silent> <S-F12> ms:call RemoveRubyEval()<CR>
nmap <silent> <S-F12> V<S-F12>
imap <silent> <S-F12> <ESC><S-F12>a
" Use :Rrunner instead of vim-vroom
nmap <leader>r :Rrunner<CR>
nmap <leader>R :.Rrunner<CR>
function! RemoveRubyEval() range
let begv = a:firstline
let endv = a:lastline
normal Hmt
set lz
execute ":" . begv . "," . endv . 's/\s*# \(=>\|!!\).*$//e'
normal 'tzt`s
set nolz
redraw
endfunction
set diffopt=vertical
autocmd BufNewFile,BufRead \*.{md,mdwn,mkd,mkdn,mark\*} set filetype=markdown
autocmd Filetype php setlocal ts=4 sw=4 noexpandtab
" use ';' to prefix command line mode rather than ':' (and its shift)
map ; :
" double ';' to get its original behavior
noremap ;; ;
" vim-i18n commands
" cf https://github.com/stefanoverna/vim-i18n#vim-mapping
vmap <Leader>z :call I18nTranslateString()<CR>
vmap <Leader>dt :call I18nDisplayTranslation()<CR>
" Enable seeing-is-believing mappings only for Ruby
augroup seeingIsBelievingSettings
autocmd!
autocmd FileType ruby nmap <buffer> <Enter> <Plug>(seeing-is-believing-mark-and-run)
autocmd FileType ruby xmap <buffer> <Enter> <Plug>(seeing-is-believing-mark-and-run)
autocmd FileType ruby nmap <buffer> <F4> <Plug>(seeing-is-believing-mark)
autocmd FileType ruby xmap <buffer> <F4> <Plug>(seeing-is-believing-mark)
autocmd FileType ruby imap <buffer> <F4> <Plug>(seeing-is-believing-mark)
autocmd FileType ruby nmap <buffer> <F5> <Plug>(seeing-is-believing-run)
autocmd FileType ruby imap <buffer> <F5> <Plug>(seeing-is-believing-run)
augroup END
set statusline=%{fugitive#statusline()}\ %f\ %rLine:%l/%L[%p%%]Col:%vBuf:#%n[%b][0x%B]
" So that file writes trigger actions in Docker containers
set backupcopy=yes
" Make current line really visible & obvious
set cursorline