-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc-omni
253 lines (218 loc) · 6.28 KB
/
vimrc-omni
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
" From: https://github.com/OmniSharp/omnisharp-vim/wiki/Example-config
"
" vim-plug: {{{
call plug#begin('~/.vim/plugged')
Plug 'OmniSharp/omnisharp-vim'
" Mappings, code-actions available flag and statusline integration
Plug 'nickspoons/vim-sharpenup'
" Linting/error highlighting
Plug 'dense-analysis/ale'
" Vim FZF integration, used as OmniSharp selector
Plug 'junegunn/fzf'
Plug 'junegunn/fzf.vim'
" Autocompletion
Plug 'prabirshrestha/asyncomplete.vim'
" Colorscheme
Plug 'gruvbox-community/gruvbox'
Plug 'adrian5/oceanic-next-vim'
" Statusline
Plug 'itchyny/lightline.vim'
Plug 'shinchu/lightline-gruvbox.vim'
Plug 'maximbaz/lightline-ale'
" Snippet support
Plug 'sirver/ultisnips'
Plug 'honza/vim-snippets'
call plug#end()
" }}}
" Settings: {{{
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set history=50 " keep 50 lines of command line history
set re=0
" modelines have historically been a source of security/resource
" vulnerabilities -- disable by default, even when 'nocompatible' is set
set nomodeline
filetype indent plugin on
syntax enable
set encoding=utf-8
scriptencoding utf-8
set completeopt=menuone,noinsert,noselect,popuphidden
set completepopup=highlight:Pmenu,border:off
set backspace=indent,eol,start
set expandtab
set shiftround
set shiftwidth=4
set softtabstop=-1
set tabstop=4
set textwidth=80
set title
set number
set hidden
set nofixendofline
set nostartofline
set splitbelow
set splitright
set hlsearch
set incsearch
set laststatus=2
set noruler
set noshowmode
set signcolumn=yes
" larger commandline since its used for lint messages
set cmdheight=2
set mouse=a
set updatetime=1000
" remap to call fzf
noremap <silent> <c-p> :Files<CR>
" manually set cursor modes since windows terminal does not do it
" automatically
"
" enter vim
autocmd VimEnter * silent !echo -ne "\e[2 q"
" otherwise
let &t_EI .= "\<Esc>[2 q"
" insert mode
let &t_SI .= "\<Esc>[5 q"
" 1 or 0 -> blinking block
" 2 -> solid block
" 3 -> blinking underscore
" 4 -> solid underscore
" Recent versions of xterm (282 or above) also support
" 5 -> blinking vertical bar
" 6 -> solid vertical bar
" leave vim
autocmd VimLeave * silent !echo -ne "\e[5 q"
" stop using arrow keys!
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
" }}}
" Colors: {{{
augroup ColorschemePreferences
autocmd!
" These preferences clear some gruvbox background colours, allowing transparency
autocmd ColorScheme * highlight Normal ctermbg=NONE guibg=NONE
autocmd ColorScheme * highlight SignColumn ctermbg=NONE guibg=NONE
autocmd ColorScheme * highlight Todo ctermbg=NONE guibg=NONE
augroup END
set background=dark
colorscheme oceanicnext
" }}}
" ALE: {{{
let g:ale_sign_error = '✘'
let g:ale_sign_warning = '⚠'
let g:ale_sign_info = '•'
let g:ale_sign_style_error = '•'
let g:ale_sign_style_warning = '•'
highlight ALEError term=reverse cterm=undercurl ctermfg=167 gui=undercurl guisp=Red
highlight ALEErrorSign ctermfg=Red
highlight ALEWarning term=reverse cterm=undercurl ctermfg=221
highlight ALEWarningSign ctermfg=Yellow
highlight ALEInfo term=reverse cterm=undercurl ctermfg=68
highlight ALEInfoSign ctermfg=Blue
let g:ale_linters = { 'cs': ['OmniSharp'] }
nmap <silent> [g <Plug>(ale_previous_wrap)
nmap <silent> ]g <Plug>(ale_next_wrap)
" }}}
" Asyncomplete: {{{
let g:asyncomplete_auto_popup = 1
let g:asyncomplete_auto_completeopt = 0
" }}}
" Sharpenup: {{{
" All sharpenup mappings will begin with `<Space>os`, e.g. `<Space>osgd` for
" :OmniSharpGotoDefinition
let g:sharpenup_map_prefix = '<Space>os'
let g:sharpenup_statusline_opts = { 'Text': '%s (%p/%P)' }
let g:sharpenup_statusline_opts.Highlight = 0
augroup OmniSharpIntegrations
autocmd!
autocmd User OmniSharpProjectUpdated,OmniSharpReady call lightline#update()
augroup END
" }}}
" Lightline: {{{
let g:lightline = {
\ 'colorscheme': 'one',
\ 'active': {
\ 'right': [
\ ['linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok'],
\ ['lineinfo'], ['percent'],
\ ['fileformat', 'fileencoding', 'filetype', 'sharpenup']
\ ]
\ },
\ 'inactive': {
\ 'right': [['lineinfo'], ['percent'], ['sharpenup']]
\ },
\ 'component': {
\ 'sharpenup': sharpenup#statusline#Build()
\ },
\ 'component_expand': {
\ 'linter_checking': 'lightline#ale#checking',
\ 'linter_infos': 'lightline#ale#infos',
\ 'linter_warnings': 'lightline#ale#warnings',
\ 'linter_errors': 'lightline#ale#errors',
\ 'linter_ok': 'lightline#ale#ok'
\ },
\ 'component_type': {
\ 'linter_checking': 'right',
\ 'linter_infos': 'right',
\ 'linter_warnings': 'warning',
\ 'linter_errors': 'error',
\ 'linter_ok': 'right'
\ }
\}
" Use unicode chars for ale indicators in the statusline
let g:lightline#ale#indicator_checking = "\uf110 "
let g:lightline#ale#indicator_infos = "\uf129 "
let g:lightline#ale#indicator_warnings = "\uf071 "
let g:lightline#ale#indicator_errors = "\uf05e "
let g:lightline#ale#indicator_ok = "\uf00c "
" }}}
" OmniSharp: {{{
nmap <silent> gdv :OmniSharpGotoDefinition vsplit<CR>
nmap <silent> gdt :OmniSharpGotoDefinition tabedit<CR>
let g:OmniSharp_popup_position = 'peek'
if has('nvim')
let g:OmniSharp_popup_options = {
\ 'winhl': 'Normal:NormalFloat'
\}
else
let g:OmniSharp_popup_options = {
\ 'highlight': 'Normal',
\ 'padding': [0, 0, 0, 0],
\ 'border': [1]
\}
endif
let g:OmniSharp_popup_mappings = {
\ 'sigNext': '<C-n>',
\ 'sigPrev': '<C-p>',
\ 'pageDown': ['<C-f>', '<PageDown>'],
\ 'pageUp': ['<C-b>', '<PageUp>']
\}
let g:OmniSharp_want_snippet = 0
let g:OmniSharp_highlight_groups = {
\ 'NamespaceName': 'OcBlue',
\ 'FieldName': 'OcOrange',
\ 'StructName': 'OcOrange',
\ 'Keyword': 'OcLilac',
\ 'ControlKeyword': 'OcOrange',
\ 'ClassName': 'Todo',
\ 'LocalName': 'Todo',
\ 'ParameterName': 'OcAqua',
\ 'PropertyName': 'OcBlue',
\ 'Operator': 'OcBrown',
\ 'ExcludedCode': 'NonText',
\ 'XmlDocCommentName': 'NonText',
\ 'XmlDocCommentText': 'NonText',
\ 'XmlDocCommentDelimiter': 'NonText',
\ 'XmlDocCommentAttributeName': 'NonText',
\ 'XmlDocCommentAttributeValue': 'NonText',
\ 'XmlDocCommentAttributeEntityReference': 'NonText',
\ 'XmlDocCommentAttributeQuotes': 'NonText',
\ 'PreprocessorKeyword': 'Comment',
\ 'PreprocessorText': 'Comment'
\}
" }}}