-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugins.vim
219 lines (183 loc) · 8.47 KB
/
plugins.vim
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
"-------------------------------------------------------------------------------
" Color scheme
"-------------------------------------------------------------------------------
" Color Scheme settings for 256 color
if &t_Co == '256'
let g:solarized_termcolors= 256
let g:gruvbox_termcolors= 256
let g:gruvbox_italicize_comments= 0
endif
set background=dark
"colorscheme solarized
"colorscheme vividchalk
colorscheme gruvbox
" Color Scheme for 16 colors
if &t_Co == '16'
colorscheme default
endif
"-------------------------------------------------------------------------------
" NERDTree
"-------------------------------------------------------------------------------
let NERDTreeShowHidden=1
"-------------------------------------------------------------------------------
" tern_for_vim
"-------------------------------------------------------------------------------
let g:tern_map_keys=1
"-------------------------------------------------------------------------------
" Yankring
"-------------------------------------------------------------------------------
let g:yankring_replace_n_pkey = '<leader>['
let g:yankring_replace_n_nkey = '<leader>]'
nmap <leader>y :YRShow<cr>
let g:yankring_history_dir = '~/.vim/cache'
"-------------------------------------------------------------------------------
" Airline
"-------------------------------------------------------------------------------
set laststatus=2
let g:airline_powerline_fonts = 1
let g:airline_theme='gruvbox'
let g:airline#extensions#tabline#enabled = 1
"-------------------------------------------------------------------------------
" Indent Guides
"-------------------------------------------------------------------------------
let g:indent_guides_start_level = 2
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_guide_size = 1
let g:indent_guides_color_change_percent = 5
"-------------------------------------------------------------------------------
" ctrlp
"-------------------------------------------------------------------------------
let g:ctrlp_cache_dir = '~/.vim/cache/ctrlp'
"-------------------------------------------------------------------------------
" vim-ruby
"-------------------------------------------------------------------------------
let ruby_spellcheck_strings = 1
"-------------------------------------------------------------------------------
" Omni completion
"-------------------------------------------------------------------------------
" Enable omni completion.
autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" Using tern for javascript
"autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
autocmd FileType javascript setlocal omnifunc=tern#Complete
" Ruby syntax
"-----------------------------------------------------------------------------
augroup Ruby
autocmd!
autocmd FileType ruby,eruby nested setlocal cinwords=do
autocmd FileType ruby,eruby nested let g:rubycomplete_buffer_loading=1
autocmd FileType ruby,eruby nested let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby nested let g:rubycomplete_classes_in_global=1
" Other ruby
autocmd BufNewFile,BufRead *.cap nested setlocal filetype=ruby
autocmd BufNewFile,BufRead *.html.erb nested setlocal filetype=eruby.html
autocmd BufNewFile,BufRead *.js.erb nested setlocal filetype=eruby.javascript
autocmd BufNewFile,BufRead *.rb.erb nested setlocal filetype=eruby.ruby
autocmd BufNewFile,BufRead *.sh.erb nested setlocal filetype=eruby.sh
autocmd BufNewFile,BufRead *.yml.erb nested setlocal filetype=eruby.yaml
autocmd BufNewFile,BufRead *.txt.erb nested setlocal filetype=eruby.text
augroup END
"-------------------------------------------------------------------------------
" NeoComplete
"-------------------------------------------------------------------------------
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#force_overwrite_completefunc = 1
let g:neocomplete#data_directory = '~/.vim/backup/neocomplcache'
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#auto_completion_start_length = 2
let g:neocomplete#manual_completion_start_length = 0
let g:neocomplete#min_keyword_length = 3
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#enable_auto_close_preview = 1
let g:neocomplete#enable_insert_char_pre = 1
" AutoComplPop like behavior.
let g:neocomplete#enable_auto_select = 1
let g:neocomplete#keyword_patterns = {}
let g:neocomplete#keyword_patterns._ = '\h\w*'
let g:neocomplete#keyword_patterns.perl = '\h\w*->\h\w*\|\h\w*::\w*'
let g:neocomplete#sources#omni#input_patterns = {}
let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?'
let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
" For perlomni.vim setting " https://github.com/c9s/perlomni.vim
let g:neocomplete#sources#omni#input_patterns.perl = '[^. \t]->\%(\h\w*\)\?\|\h\w*::\%(\h\w*\)\?'
let g:neocomplete#force_omni_input_patterns = {}
let g:neocomplete#force_omni_input_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::\w*'
let g:neocomplete#enable_omni_fallback = 0
let g:neocomplete#same_filetypes = {}
" In gitconfig buffers, completes from all buffers.
let g:neocomplete#same_filetypes.gitconfig = '_'
" In default, completes from all buffers.
let g:neocomplete#same_filetypes._ = '_'
" TODO bring them to bindings
function! s:my_cr_function()
"return neocomplete#close_popup() . "\<CR>"
" For no inserting <CR> key.
return pumvisible() ? neocomplete#close_popup() : "\<CR>"
endfunction
inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
" <CR>: close popup and save indent.
inoremap <silent> <CR> <C-r>=<SID>my_cr_function()<CR>
" Close popup by <Space>.
"inoremap <expr><Space> pumvisible() ? neocomplete#close_popup() : "\<Space>"
" <TAB>: completion (use smart TAB instead)
" inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><C-h> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#close_popup()
" For smart TAB completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ neocomplete#start_manual_complete()
function! s:check_back_space() "{{{
let col = col('.') - 1
return !col || getline('.')[col - 1] =~ '\s'
endfunction"}}}
"-------------------------------------------------------------------------------
" NeoSnippet
"-------------------------------------------------------------------------------
" Tell NeoSnippet about the other snippets
let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
let g:neosnippet#data_directory= '~/.vim/cache/neosnippet'
" Plugin key-mappings.
imap <C-k> <Plug>(neosnippet_expand_or_jump)
smap <C-k> <Plug>(neosnippet_expand_or_jump)
xmap <C-k> <Plug>(neosnippet_expand_target)
" SuperTab like snippets behavior.
imap <expr><TAB> pumvisible() ? "\<C-n>"
\ : neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\ : "\<TAB>"
smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
\ "\<Plug>(neosnippet_expand_or_jump)"
\: "\<TAB>"
" For snippet_complete marker.
if has('conceal')
set conceallevel=2 concealcursor=i
endif
"-------------------------------------------------------------------------------
" Syntastic
"-------------------------------------------------------------------------------
let g:syntastic_error_symbol = '✗✗'
let g:syntastic_warning_symbol = '⚠⚠'
let g:syntastic_style_error_symbol = '✗'
let g:syntastic_style_warning_symbol = '⚠'
let g:syntastic_auto_loc_list = 1 " Close the location-list when errors are gone
let g:syntastic_loc_list_height = 5
" Ruby syntax checking and lint
let g:syntastic_ruby_checkers = ['mri']
if executable('rubocop')
let g:syntastic_ruby_checkers = g:syntastic_ruby_checkers + ['rubocop']
let g:syntastic_ruby_rubocop_args = '--display-cop-names'
endif
if executable('ruby-lint')
let g:syntastic_ruby_checkers = g:syntastic_ruby_checkers + ['rubylint']
endif
if executable('jshint')
let g:syntastic_javascript_checkers = ['jshint']
endif