Repository navigation
Expand file tree
/
Copy path_vimrc
More file actions
329 lines (308 loc) · 9.97 KB
/
Copy path_vimrc
File metadata and controls
329 lines (308 loc) · 9.97 KB
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
" __ __ ______ __ __
" | \ | \ \ \ / \
" | ▓▓ | ▓▓\▓▓▓▓▓▓ ▓▓\ / ▓▓
" | ▓▓ | ▓▓ | ▓▓ | ▓▓▓\ / ▓▓▓
" \▓▓\ / ▓▓ | ▓▓ | ▓▓▓▓\ ▓▓▓▓
" \▓▓\ ▓▓ | ▓▓ | ▓▓\▓▓ ▓▓ ▓▓
" \▓▓ ▓▓ _| ▓▓_| ▓▓ \▓▓▓| ▓▓
" \▓▓▓ | ▓▓ \ ▓▓ \▓ | ▓▓
" \▓ \▓▓▓▓▓▓\▓▓ \▓▓
silent! call plug#begin()
Plug 'nikvdp/ejs-syntax'
Plug 'tpope/vim-commentary'
Plug 'mattn/emmet-vim'
Plug 'vimwiki/vimwiki'
Plug 'zyedidia/vim-snake'
Plug 'vim-scripts/L9'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'qpkorr/vim-renamer'
Plug 'majutsushi/tagbar'
Plug 'dense-analysis/ale'
Plug 'Omnisharp/omnisharp-vim'
Plug 'tpope/vim-dispatch'
Plug 'RRethy/vim-illuminate'
Plug 'prabirshrestha/asyncomplete.vim'
Plug 'gruvbox-community/gruvbox'
Plug 'itchyny/lightline.vim'
Plug 'shinchu/lightline-gruvbox.vim'
Plug 'maximbaz/lightline-ale'
Plug 'nickspoons/vim-sharpenup'
Plug 'tpope/vim-fugitive'
Plug 'vimoxide/vim-cinnabar'
Plug 'tpope/vim-dadbod'
Plug 'tpope/vim-jdaddy'
Plug 'tpope/vim-jdaddy'
Plug 'isaiahfisher/vim-cinnabar-defined'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'othree/yajs.vim'
Plug 'maxmellon/vim-jsx-pretty'
call plug#end()
let mapleader=","
colorscheme cinnabar-defined
"{{{Omnisharp settings
let g:OmniSharp_start_without_solution=1
let g:OmniSharp_server_stdio=1
"sets the linters for ale
set signcolumn=yes
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 = '·'
" Update symantic highlighting on BufEnter and InsertLeave
let g:OmniSharp_highlight_types = 3
let g:OmniSharp_popup_position = 'peek'
set completeopt=menuone,noinsert,noselect,popuphidden
set completepopup=highlight:Pmenu,border:off
let g:asyncomplete_auto_completeopt = 0
let g:OmniSharp_timeout = 5
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
" All sharpenup mappings will begin with `<Space>os`, e.g. `,osgd` for
" :OmniSharpGotoDefinition
let g:sharpenup_map_prefix = ',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
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_highlight_groups = {
\ 'ExcludedCode': 'NonText'
\}
"This line handles vim-OmniCompletion
inoremap <expr> <Tab> pumvisible() ? '<C-n>' : getline('.')[col('.')-2] =~# '[[:alnum:].-_#$]' ? '<C-x><C-o>' : '<Tab>'
"}}}
"{{{ALE Settings
let g:ale_linters = {
\ 'cs': ['OmniSharp'],
\ 'javascript': ['eslint'],
\ 'vue': ['eslint']
\}
"sets the fixers for ale
let g:ale_fixers = {
\ 'javascript': ['eslint'],
\ 'typescript': ['tslint', 'prettier'],
\ 'vue': ['eslint'],
\ 'scss': ['prettier'],
\ 'html': ['prettier'],
\}
"allows ale to autofix formatting on file save
let g:ale_fix_on_save = 1
"}}}
"{{{Lightline settings
let g:lightline = {
\ 'colorscheme': 'gruvbox',
\ '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 "
""}}}
"{{{Prettier settings
"these settings set prettier to format my code
au FileType javascript setlocal formatprg=prettier
au FileType javascript.jsx setlocal formatprg=prettier
au FileType typescript setlocal formatprg=prettier\ --parser\ typescript
au FileType html setlocal formatprg=js-beautify\ --type\ html
au FileType scss setlocal formatprg=prettier\ --parser\ css
au FileType css setlocal formatprg=prettier\ --parser\ css
"}}}
"{{{Settings
"buffer becomes hidden when focus is lost
set hid
set belloff=all
set updatetime=1000
set encoding=utf-8
scriptencoding utf-8
"for regex
set magic
set nocompatible
"this line allows text to wrap on screen edge
set wrap
"This line turns on syntax highlighting.
syntax enable
"this group makes tabs work and spacing nice
set tabstop=4
set softtabstop=0
set shiftwidth=4
set expandtab
set smarttab
set backspace=indent,eol,start
set ai "auto-indent
"show last used command in the corner
set showcmd
"highlight cursor
set cursorline
"lets autocomplete play nice
set wildmenu
"ignores compiled files
set wildignore+=*.o,*~,*.pyc
"removes needless graphical redraws
set lazyredraw
"highlight matching braces of any sort
set showmatch
"this group helps improve vim searching.
set incsearch "search as characters are entered
set hlsearch "highlights matches
"this group handles how vim folds code blocks.
set foldenable
set foldlevelstart=10
set foldnestmax=10
set foldmethod=indent
"fullscreens gvim
au GUIEnter * simalt ~x
"This line allows me to use the system clipboard inside of vim
set clipboard=unnamed
"this group turns on line numbers and position numbers by default.
set number
set ruler
autocmd BufEnter *.txt set ft=text
autocmd BufEnter *.JSON set ft=JSON
autocmd BufEnter *.xml set ft=xml
autocmd BufEnter *.cshtml set ft=html
autocmd BufEnter *.html set ft=html
autocmd BufEnter *.css set ft=css
autocmd BufEnter *.ejs set ft=ejs
"sets vim to auto read outside edits to a file
set autoread
"enables Emmet for only HTML, css, and php filetypes
let g:user_emmet_install_global = 0
autocmd FileType html,css,php EmmetInstall
"saves backups, undos, and swaps to a special folder
" BACKUPS: uncomment and change directory to configure backups management
" set backupdir=C:\Users\isaia\backups\\
" set directory=C:\Users\isaia\backups\\
" set undodir=C:\Users\isaia\backups\\
" BACKUPS:
"this will allow special syntax for ip addresses.
syn match ipaddr /\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)/
hi link ipaddr Identifier
set diffexpr=
"}}}
"{{{Remaps
"making things a bit faster to edit the vimrc
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
"tabbing management tab
map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
map <leader>t<leader> :tabnext<CR>
map <leader>tg :tabprev<CR>
"Q can now be used to format current paragraph
vmap Q gq
vmap Q gqap
"preventing windows from doing windows things
silent! vunmap <C-X>
"this group allows us to ignore random wrap issues caused by vim
"ignoring 'imaginary' lines and jumping to the next 'real' line.
nnoremap j gj
nnoremap k gk
"this line is subject to change, highlights last inserted text
nnoremap gV `[v`]
"this line makes going into command mode easier.
inoremap ii <esc>
"This is for tagbar
nmap <leader>tb :TagbarToggle<CR>
" CTAGS: replace with proper path when configuring new machine.
let g:tagbar_ctags_bin = 'C:\Users\isaia\Vim\ctags58\ctags.exe'
"this line automatically opens NERDTree on start if no file is selected.
"au vimEnter * if !argc() | NERDTree | endif
let g:NERDTreeHijackNetrw=1
"this code allows tagBar to open automatically for certain fileTyles.
au FileType cs call SetTagBar()
au FileType javascript call SetTagBar()
au FileType c call SetTagBar()
au FileType python call SetTagBar()
"function that opens tagbar
function! SetTagBar()
:call tagbar#autoopen(0)
endfunction
"this line handles bulk file renaming
nmap <leader>f :Renamer<CR>
"}}}
"{{{Custom Splash Screen - enabled by uncommenting line 292
fun! Start()
"Create a new unnamed buffer to display our splash screen inside of.
enew
" Set some options for this buffer to make sure that does not act like a
" normal winodw.
setlocal
\ bufhidden=wipe
\ buftype=nofile
\ nobuflisted
\ nocursorcolumn
\ nocursorline
\ nolist
\ nonumber
\ noswapfile
\ norelativenumber
" Place your custom splash screen or message here.
exec ":r ~/Vim/.splashASCII.txt"
" When we are done writing out message set the buffer to readonly.
setlocal
\ nomodifiable
\ nomodified
" Just like with the default start page, when we switch to insert mode
" a new buffer should be opened which we can then later save.
nnoremap <buffer><silent> e :enew<CR>
nnoremap <buffer><silent> i :enew <bar> startinsert<CR>
nnoremap <buffer><silent> o :enew <bar> startinsert<CR>
endfun
" The number of files in the argument list of the current window.
" If there are 0 then that means this is a new session and we want to display
" our custom splash screen.
" SPLASHSCREEN: uncomment between these lines for custom splash screen.
" if argc() == 0
" autocmd VimEnter * call Start()
" endif
" SPLASHSCREEN:
"}}}