-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
371 lines (264 loc) · 8.19 KB
/
.vimrc
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
" .vimrc
set nocompatible " be iMproved, required
filetype off " required
" Vundle
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
" Plugin 'SirVer/ultisnips'
Plugin 'garbas/vim-snipmate'
Plugin 'honza/vim-snippets'
Plugin 'christoomey/vim-tmux-navigator'
" Arduino
Plugin 'sudar/vim-arduino-syntax'
call vundle#end() " required
filetype plugin indent on " required
" VIM PLUG
call plug#begin('~/.vim/plugged')
" FZF
" https://github.com/junegunn/fzf.vim
Plug 'junegunn/fzf'
Plug '/usr/local/opt/fzf'
Plug 'rking/ag.vim'
Plug 'terryma/vim-smooth-scroll'
Plug 'yuttie/comfortable-motion.vim'
Plug 'posva/vim-vue'
Plug 'pangloss/vim-javascript'
Plug 'MaxMEllon/vim-jsx-pretty'
Plug 'jxnblk/vim-mdx-js'
" Git Gutter
Plug 'airblade/vim-gitgutter'
Plug 'vim-scripts/CSSMinister'
" Ack
" Plug 'mileszs/ack.vim'
" let Vundle manage Vundle, required
Plug 'VundleVim/Vundle.vim'
" NerdTree plugin
Plug 'scrooloose/nerdtree'
Plug 'prettier/vim-prettier'
Plug 'kristijanhusak/vim-carbon-now-sh'
"Ale
Plug 'w0rp/ale'
"Airline
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
"ELm Vim
Plug 'elmcast/elm-vim'
"TypeScript
Plug 'Shougo/vimproc.vim', {'do' : 'make'}
Plug 'leafgarland/typescript-vim'
Plug 'Quramy/tsuquyomi'
" Vim Commentary plugin
Plug 'tpope/vim-commentary'
" Vim Surround plugin
Plug 'tpope/vim-surround'
" Vim Repeat plugin
Plug 'tpope/vim-repeat'
" plugin on GitHub repo
Plug 'tpope/vim-fugitive'
" Plug 'christoomey/vim-conflicted'
" Autoclose bracket,paren,tag, etc
Plug 'Raimondi/delimitMate'
"color schemes
Plug 'altercation/vim-colors-solarized'
Plug 'joshdick/onedark.vim'
"Install vimux
"Plugin benmills/vimux
Plug 'christoomey/vim-tmux-navigator'
call plug#end()
filetype plugin indent on " required
" set tab stuff
set tabstop=2
set softtabstop=0 expandtab
set shiftwidth=2
set smarttab
" set smartindent
set smartindent
" set leader to ,
let mapleader=","
" set hlsearch
set hlsearch
" Set paths for all ctrlp
" set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" Set working path
let g:ctrlp_working_path_mode = 'r'
syntax enable
set background=dark
colorscheme onedark
let g:onedark_terminal_italics = 1
let &t_8f="\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b="\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
" let g:solarized_termcolors = 256
" let g:solarized_italics = 1
" colorscheme solarized
" relative numbering
set relativenumber
set number
"Map save to control + s
" inoremap <c-s> <Esc>:Update<CR>
" nnoremap <c-s> <Esc>:Update<CR>
inoremap <c-s> <Esc>:w!<CR>
nnoremap <c-s> <Esc>:w!<CR>
" disable those arrow keys bro
inoremap <Up> <NOP>
inoremap <Down> <NOP>
inoremap <Left> <NOP>
inoremap <Right> <NOP>
" Smoothscroll mappings
" noremap <silent> <c-u> :call smooth_scroll#up(&scroll, 0, 2)<CR>
" noremap <silent> <c-d> :call smooth_scroll#down(&scroll, 0, 2)<CR>
" noremap <silent> <c-b> :call smooth_scroll#up(&scroll*2, 0, 4)<CR>
" noremap <silent> <c-f> :call smooth_scroll#down(&scroll*2, 0, 4)<CR>
" Allow Edits in Nerdtree
set modifiable
" NERDTree
" nmap <C-n> :NERDTreeToggle<CR>
map <leader>nt :NERDTreeToggle<CR>
map <leader>nr :NERDTree<CR>
map <leader>nf :NERDTreeFind<CR>
map <leader>ntz :NERDTree Z:\<CR>
map <leader>ntk :NERDTree K:\<CR>
let NERDTreeShowHidden=1
"TMUX
let g:tmux_navigator_no_mappings = 1
nnoremap <silent> <c-h> :TmuxNavigateLeft<cr>
nnoremap <silent> <c-j> :TmuxNavigateDown<cr>
nnoremap <silent> <c-k> :TmuxNavigateUp<cr>
nnoremap <silent> <c-l> :TmuxNavigateRight<cr>
" nnoremap <silent> <c-h> :TmuxNavigatePrevious<cr>
let g:tmux_navigator_save_on_switch = 1
" SnipMate
imap <tab> <Plug>snipMateNextOrTrigger
nmap <leader>snip :SnipMateOpenSnippetFiles<cr>
" UltiSnips
"
" autocmd FileType javascript UltiSnipsAddFiletypes javascript-node
" let g:UltiSnipsSnippetDirectories=["UltiSnips"]
" let g:UltiSnipsExpandTrigger="<tab>"
" let g:UltiSnipsJumpForwardTrigger="<c-b>"
" let g:UltiSnipsJumpBackwardTrigger="<c-z>"
" let g:UltiSnipsEditSplit="horizontal"
" let g:UltiSnipsListSnippets='<leader>snip'
"Non Plugin Specific Key Mappings
nmap <leader>b ^
nmap <leader>e $
" Map FZF
map <leader>t :execute "FZF"<CR>
" Maps for navigating tabs
map ¬ :tabn<CR>
map ˙ :tabp<CR>
" Quick edit vimrc
map <leader>rc :execute "tabnew " . $MYVIMRC<CR>
map <leader>rs :execute "source " . $MYVIMRC<CR>
map <leader>rz :execute "source ~/.zshrc"<CR>
" Paste helper
set pastetoggle=<F2>
" Place the swap files somewhere else!
set swapfile
set dir=~/tmp
set nofoldenable
" Remove Trailing Whitespace
autocmd BufWritePre *.js %s/\s\+$//e"
" Go to matching element by pressing % inside element
runtime macros/matchit.vim
"Ale config
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
" Put this in vimrc or a plugin file of your own.
" After this is configured, :ALEFix will try and fix your JS code with ESLint.
let g:ale_fixers = {
\ 'javascript': ['eslint'],
\}
" Set this setting in vimrc if you want to fix files automatically on save.
" This is off by default.
" let g:ale_fix_on_save = 1
" Allow airline to show ale errors
let g:airline#extensions#ale#enabled = 1
" Prettier Config
let g:prettier#exec_cmd_async = 1
let g:prettier#autoformat = 0
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue PrettierAsync
let g:prettier#quickfix_enabled = 0
let g:prettier#config#single_quote = 'true'
let g:prettier#config#trailing_comma = 'es5'
let g:prettier#config#jsx_bracket_same_line = 'false'
let g:ale_sign_error = '✘'
let g:ale_sign_warning = '⚠'
highlight ALEErrorSign ctermbg=NONE ctermfg=red
highlight ALEWarningSign ctermbg=NONE ctermfg=yellow
" Paste helper
set pastetoggle=<F2>
" Place the swap files somewhere else!
set swapfile
set dir=~/tmp
set nofoldenable
" Remove Trailing Whitespace
autocmd BufWritePre *.js %s/\s\+$//e"
" Go to matching element by pressing % inside element
runtime macros/matchit.vim
set spellfile=$HOME/Documents/vim/spell/en.utf-8.add
autocmd BufNewFile,BufRead *.md set spell | set lbr | set nonu
let g:markdown_fenced_languages = ['html', 'json', 'css', 'javascript', 'elm', 'vim']
"Ale config
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
" Put this in vimrc or a plugin file of your own.
" After this is configured, :ALEFix will try and fix your JS code with ESLint.
let g:ale_fixers = {
\ 'javascript': ['eslint'],
\}
" Set this setting in vimrc if you want to fix files automatically on save.
" This is off by default.
let g:ale_fix_on_save = 1
" Allow airline to show ale errors
let g:airline#extensions#ale#enabled = 1
" Prettier Config
let g:prettier#exec_cmd_async = 1
let g:prettier#autoformat = 0
autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue PrettierAsync
let g:prettier#quickfix_enabled = 0
let g:prettier#config#single_quote = 'true'
let g:prettier#config#trailing_comma = 'es5'
let g:prettier#config#jsx_bracket_same_line = 'false'
"Silver Searcher
if executable('ag')
let g:ackprg = 'ag --vimgrep'
endif
let g:ackprg = 'ag --nogroup --nocolor --column'
" CarbonNowSh
let g:carbon_now_sh_browser = 'google-chrome'
map <leader>ss :CarbonNowSh<CR>
"Ag
let g:ag_working_path_mode="r"
" Set lower update time for Git Gutter
set updatetime=100
vnoremap <C-c> :w !pbcopy<CR><CR> noremap <C-v> :r !pbpaste<CR><CR>
" nnoremap K :Ag! "\b<C-R><C-W>\b"<CR>:cw<CR>
" Css color commands
" <leader>x - convert to hex
" <leader>r - convert to rgb
" <leader>h - convert to hsl
" <leader>ra
" <leader>ha - convert to hsla
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
highlight htmlArg cterm=italic
highlight Comment cterm=italic
highlight Type cterm=italic