-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc.local
206 lines (168 loc) · 5.23 KB
/
.vimrc.local
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
" Modeline and Notes {
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
" }
"Plugins {
" Vundle {
"UnBundle 'Shougo/neocomplcache'
"UnBundle 'Shougo/neosnippet'
UnBundle 'scrooloose/nerdcommenter'
UnBundle 'spf13/vim-autoclose'
UnBundle 'mhinz/vim-signify'
UnBundle 'vim-scripts/sessionman.vim'
"UnBundle 'tpope/vim-fugitive'
" }
" AG search {
"let g:agprg="ag -iG \".*\.[Ch]$\" --column"
command! -bang -nargs=* -complete=file AckCs call ack#Ack("grep<bang> -G '.*\\.cs$'", <q-args>)
command! -bang -nargs=* -complete=file AckJs call ack#Ack("grep<bang> -G '.*\\.js$'", <q-args>)
command! -bang -nargs=* -complete=file AckCpp call ack#Ack("grep<bang> -G '.*\\.[Ch]$'", <q-args>)
" }
" CtrlP {
let g:ctrlp_match_func = {'match' : 'matcher#cmatch' }
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_follow_symlinks = 1
nnoremap m :CtrlPMRUFiles<CR>
nnoremap f :CtrlPFunky<CR>
" }
"Alternate.vim {
let g:alternateNoDefaultAlternate = 1
let g:alternateRelativeFiles = 1
"let g:alternateSearchPath = 'sfr:../source,sfr:../src,sfr:../include,sfr:../inc,reg:|\(\a\+\)\.dev\\source|\1\.dev\\\1|,reg:|\(\a\+\)\.dev\\\1|\1\.dev\\source|'
"let g:alternateSearchPath = 'sfr:../source,sfr:../src,sfr:../include,sfr:../inc,reg:|\(\a\+\)\.dev/source|\1\.dev/\1|,reg:|\(\a\+\)\.dev/\1|\1\.dev/source|'
let g:alternateSearchPath = 'reg:|\(\a\+\)\.dev/source/\a\+|\1\.dev/\1|,reg:|\(\a\+\)\.dev/\1|\1\.dev/source/**|'
let g:alternateExtensions_C = "h"
let g:alternateExtensions_h = "C"
" }
"Syntastic {
let g:syntastic_check_on_open = 1
let g:syntastic_auto_loc_list = 0
"C++ {
let g:syntastic_c_checkers=['cppcheck']
let g:syntastic_cpp_checkers=['cppcheck']
let g:syntastic_h_checkers=['cppcheck']
"let g:syntastic_c_compiler = 'clang++'
"let g:syntastic_cpp_checkers=['gcc']
"}
"JS{
let g:syntastic_javascript_checkers = ['jshint'] ", 'closurecompiler']
let g:syntastic_javascript_closure_compiler_path = '/usr/share/java/closure-compiler.jar'
let g:syntastic_coffee_checkers = ['coffeelint', 'coffee']
"}
"TypeScript{
let g:syntastic_typescript_checkers = ['tslint'] ", 'closurecompiler']
"}
"}
"Startify {
set viminfo='100,n$HOME/.vim/files/viminfo
let g:startify_session_dir = '~/.vim/files/sessions'
let g:startify_bookmarks = [
\ '~/.vimrc.local', '~/.vimrc.bundles.local', './.gitignore',
\ './.gitattributes'
\ ]
"}
" YCM{
let g:ycm_key_list_previous_completion=['<Up>']
autocmd FileType javascript setlocal omnifunc=tern#Complete
" YouCompleteMe
"let g:ycm_add_preview_to_completeopt=0
"let g:ycm_confirm_extra_conf=0
"let g:ycm_complete_in_comments = 1
"let g:ycm_collect_identifiers_from_comments_and_strings = 1
"let g:ycm_collect_identifiers_from_tags_files = 0
"let g:ycm_seed_identifiers_with_syntax = 1
" }
" OmniSharp{
let g:Omnisharp_start_server = 0
let g:OmniSharp_host = "http://10.0.2.2:8080"
" }
" UltiSnips {
let g:UltiSnipsExpandTrigger = "<tab>"
let g:UltiSnipsJumpForwardTrigger = "<tab>"
let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
"let g:UltiSnipsSnippetDirectories = ["snips"]
function! g:UltiSnips_Complete()
call UltiSnips#ExpandSnippet()
if g:ulti_expand_res == 0
if pumvisible()
return "\<C-n>"
else
call UltiSnips#JumpForwards()
if g:ulti_jump_forwards_res == 0
return "\<TAB>"
endif
endif
endif
return ""
endfunction
au InsertEnter * exec "inoremap <silent> " . g:UltiSnipsExpandTrigger . " <C-R>=g:UltiSnips_Complete()<cr>"
" }
" local vimrc {
let g:localvimrc_count = 1
let g:localvimrc_persistent = 2
" }
" JS-Beautify {
au FileType typescript setlocal equalprg=tsfmt\ /dev/stdin
au FileType javascript setlocal equalprg=js-beautify\ -f\ -
au FileType html setlocal equalprg=node\ ~/.vim/bundle/js-beautify/js/bin/html-beautify.js\ -w\ 80\ -f\ -
" }
" TypeScript-tools{
" }
"}
" VIM config{
set completeopt-=preview
set colorcolumn=80
set tabstop=2
set shiftwidth=2
set softtabstop=2
set t_Co=256 " Enable 256 colors to stop the CSApprox warning and make xterm vim shine
set ff=unix
set ffs=unix,dos
" move cto beginning of line
inoremap <Home> <C-c>^i
" Blinking cursor {
let &t_ti.="\eP\e[1 q\e\\"
let &t_te.="\eP\e[0 q\e\\"
let &t_SI.="\eP\e[5 q\e\\"
let &t_EI.="\eP\e[1 q\e\\"
"}
" XAML {
au BufNewFile,BufRead *.xaml setf xml
" }
" Arrow keys{
imap A <Up>
imap B <Down>
imap C <Right>
imap D <Left>
"}
"}
" Scripts{
" Ref files {
fu! GetRefFile()
let l:refdir = finddir("ref", expand("%:p:h") . ";")
return findfile(expand("%:p:t"), l:refdir . "/**/")
endf
fu! LoadRef()
let l:filename = GetRefFile()
if filereadable(l:filename)
exec "vs" l:filename
else
echo "Ref for file " . l:filename . " not available"
endif
endf
fu! DiffRef()
let l:filename = GetRefFile()
if filereadable(l:filename)
exec "vert diffsplit" l:filename
else
echo "Ref for file " . l:filename . " not available"
endif
endf
" }
" Insert single character {
function! RepeatChar(char, count)
return repeat(a:char, a:count)
endfunction
nnoremap <Space> :<C-U>exec "normal i".RepeatChar(nr2char(getchar()), v:count1)<CR>
nnoremap <Leader><Space> :<C-U>exec "normal a".RepeatChar(nr2char(getchar()), v:count1)<CR>
"}
" }