-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.after
138 lines (110 loc) · 3.28 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
" make Python follow PEP8 ( http://www.python.org/dev/peps/pep-0008/ )
au FileType python set softtabstop=4 tabstop=4 shiftwidth=4
au FileType php set softtabstop=4 tabstop=4 shiftwidth=4
au FileType javascript set softtabstop=4 tabstop=4 shiftwidth=4
au FileType vue set softtabstop=4 tabstop=4 shiftwidth=4
au FileType es6 set softtabstop=4 tabstop=4 shiftwidth=4
au FileType scss set softtabstop=4 tabstop=4 shiftwidth=4
au FileType css set softtabstop=4 tabstop=4 shiftwidth=4
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
set t_Co=256
" Default gui color scheme
color desert256
set guifont=Source\ Code\ Pro\ for\ Powerline:h11
set guioptions=aAce
set wrap
""" vim-test config (https://github.com/janko-m/vim-test)
let test#project_root = "/Users/miks/code/captomatic-api"
" Run vim-test in iterm
let test#strategy = "iterm"
" Map vim-test to CMD+SHIFT+R shortcut
map <D-R> :TestNearest<CR>
function! SnippetsFilename(...)
let template = get(a:000, 0, "$1")
let arg2 = get(a:000, 1, "")
let basename = expand('%:t:r')
if basename == ''
return arg2
else
return substitute(template, '$1', basename, 'g')
endif
endf
function! PromptRemoveTrainingWhitespace()
let has_trailing_spaces=!!search('\v\s+$', 'cwn')
if has_trailing_spaces
if ! exists("b:remove_trailing_whitespace")
let has_trailing_spaces=!!search('\v\s+$', 'cwn')
if has_trailing_spaces
let choice = confirm("Remove trailing whitespace?", "&Yes\n&No")
if choice == 1
call Trim()
let b:remove_trailing_whitespace = 1
else
let b:remove_trailing_whitespace = 0
endif
endif
elseif b:remove_trailing_whitespace == 1
call Trim()
endif
endif
endfunction
function! Trim()
let cur_linenr = line('.')
let cur_col = col('.')
let _s=@/
%s/\s\+$//e
let @/=_s
nohl
call cursor(cur_linenr, cur_col)
endfunction
autocmd BufWritePre * call PromptRemoveTrainingWhitespace()
:au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>120v.\+', -1)
" ruby files settings
augroup filetype_ruby
if has("balloon_eval")
" Annoying plugins keep turning ballooneval on
autocmd BufEnter *.rb setlocal noballooneval
endif
augroup END
if has("gui_macvim")
set transparency=7
" Allow to select multiple lines with shift
let macvim_hig_shift_movement = 1
let g:solarized_menu=0
color solarized
" Don't beep
set visualbell
" Start without the toolbar
set guioptions-=T
let g:ctrlp_regexp = 1
let g:RspecBin = "spring rspec"
let g:ctrlp_abbrev = {
\ 'gmode': 't',
\ 'abbrevs': [
\ {
\ 'pattern': ' ',
\ 'expanded': '.*',
\ 'mode': 'pfrz',
\ }
\ ]
\ }
let g:ctrlp_use_caching = 0
let g:ctrlp_user_command = ['.git', 'cd %s && rg --hidden --files', 'find %s -type f']
" for ctrlp plugin to open selection in new tab
let g:ctrlp_prompt_mappings = {
\ 'AcceptSelection("e")': [],
\ 'AcceptSelection("t")': ['<cr>', '<c-m>'],
\ }
" if file is already opened jump to it
let g:ctrlp_jump_to_buffer = 2
endif
" disable copy on select
set go-=a
set hidden
set ignorecase
set smartcase
" Sort tags by name
let Tlist_Sort_Type = "name"
let Tlist_WinWidth = 40