-
Notifications
You must be signed in to change notification settings - Fork 8
/
vimrc
263 lines (216 loc) · 6.32 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
" Vim Config File
"
" author: Miles Z. Sterrett <[email protected]>
set nocompatible " Prevent vim from emulating vi bugs and limitations
filetype off " required for Vundle
call plug#begin('~/.vim/plugged')
Plug 'ibhagwan/fzf-lua', {'branch': 'main'}
" optional for icon support
Plug 'nvim-tree/nvim-web-devicons'
Plug 'nvim-tree/nvim-tree.lua'
Plug 'sheerun/vim-polyglot'
Plug 'janko-m/vim-test'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-rake'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-heroku'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-ragtag'
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-cucumber'
Plug 'tpope/vim-haml'
Plug 'tpope/vim-markdown'
Plug 'tpope/vim-projectionist'
Plug 'tomtom/quickfixsigns_vim'
Plug 'tomtom/tcomment_vim'
Plug 'tomtom/tlib_vim'
Plug 'janx/vim-rubytest'
Plug 'mattn/gist-vim'
Plug 'altercation/vim-colors-solarized'
Plug 'preservim/vimux'
Plug 'christoomey/vim-tmux-navigator'
Plug 'vim-scripts/AutoClose'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'lukas-reineke/indent-blankline.nvim'
Plug 'c-brenn/phoenix.vim'
Plug 'dense-analysis/ale'
" themes
Plug 'ajmwagar/vim-deus'
Plug 'arcticicestudio/nord-vim'
Plug 'junegunn/seoul256.vim'
Plug 'sainnhe/forest-night'
Plug 'sainnhe/sonokai'
call plug#end()
" 256 colors
set t_Co=256
" Tab and Indent Settings
set autoindent
set tabstop=2
set shiftwidth=2
set softtabstop=2
set expandtab
set smarttab
set smartindent
set backspace=indent,eol,start
set title " set terminal title
set history=50 " keep 50 commands, etc in history
set hidden " More effective buffer handling
set showmatch " Breifly show matching brace/parenthese/bracket
set autoread " Auto-reload changed files
set ruler " each window will contain a status line with cursor position
set showcmd " display an incomplete command in the lower right corner
set number " show line numbers
set scrolloff=3 " scroll before the border
set noswapfile
set hlsearch " highlight search terms
set incsearch " search as you type
set ignorecase
set smartcase " case-smart searching
set colorcolumn=80
" File-type highlighting and configuration
syntax on
filetype plugin on
filetype indent on
" Important!! for color schemes
if exists('+termguicolors')
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
" MUST OCCUR BEFORE colorscheme call!
" configuration for forest-night
let g:forest_night_enable_italic = 1
let g:forest_night_disable_italic_comment = 1
" MUST OCCUR BEFORE colorscheme call!
"configuration for deus scheme
let g:deus_termcolors=256
" MUST OCCUR BEFORE colorscheme call!
"configuration for sonokai scheme
let g:sonokai_style = 'maia'
let g:sonokai_enable_italic = 1
let g:sonokai_disable_italic_comment = 1
" seoul256 (dark):
" Range: 233 (darkest) ~ 239 (lightest)
" Default: 237
let g:seoul256_background = 234
colo seoul256
" Set colorscheme and background
set background=dark
colorscheme seoul256
" extended matching
runtime macros/matchit.vim
" more useful tab completion
set wildmenu
set wildmode=list:longest,list:full
" Shed light on hidden things
set list
set listchars=tab:»»,trail:•
set wrap
set linebreak
set showbreak=↳
" Highlight trailing whitespace characters and tabs not used for indention
highlight WhitespaceErrors ctermbg=Red guibg=Red
match WhitespaceErrors /\s\+$\|[^\t]\@<=\t\+/
" Remove trailing whitespace
noremap <silent> <Leader>rtw :%s/\s\+$//g<CR>``
" Map F9 to set foldmethod to syntax
map <F9> :set foldmethod=syntax<CR>
" Map ,cd to change to the directory of the file being edited
map ,cd :cd %:p:h<CR>
" Use the mouse in terminal Vim!
set mouse=a
if !has('nvim')
set ttymouse=xterm2
endif
" Swap ` and '. ` is more useful in every situation
" that I can imagine!
noremap ' `
noremap ` '
" Take care of forgetting to use sudo with :w!!
cmap w!! %!sudo tee > /dev/null %
augroup mkd
autocmd BufRead *.mkd,*.md,*.markdown set ai formatoptions=tcroqn2 comments=n:>
augroup END
autocmd BufRead,BufNewFile *.es6 setfiletype javascript
autocmd BufNewFile,BufRead *.html.slim set filetype=slim
" ALE linters
let g:ale_linters = {
\ 'javascript': ['eslint'],
\ 'ruby': ['rubocop'],
\}
let g:ale_linters_explicit = 1
" JSX highlighting in regular JS files
let g:jsx_ext_required = 0
" quickfixsigns
let g:quickfixsigns_classes=['qfl', 'vcsdiff', 'breakpoints']
" rails.vim projections
let g:rails_projections = {
\ "features/*.feature": {"command": "feature"},
\ "features/step_definitions/*.rb": {"command": "step"},
\ "app/services/*.rb": {
\ "command": "service",
\ "test": [
\ "spec/services/%s_spec.rb"
\ ]
\ },
\ "app/interactors/*.rb": {
\ "command": "interactor",
\ "test": [
\ "spec/interactors/%s_spec.rb"
\ ]
\ },
\ "app/forms/*.rb": {
\ "command": "form",
\ "test": [
\ "spec/forms/%s_spec.rb"
\ ]
\ },
\ "app/lib/*.rb": {
\ "command": "lib",
\ "test": [
\ "spec/lib/%s_spec.rb"
\ ]
\ }
\ }
" Split faster
nmap <silent> vv :vsp<CR>
nmap <silent> ss :sp<CR>
" AutoClose remapping
nmap <Leader>x <Plug>ToggleAutoCloseMappings
"Map esc to jj
inoremap jj <esc>
" CtrlP -> FZF
nnoremap <c-P> <cmd>lua require('fzf-lua').files()<CR>
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](\.git|node_modules|doc)$',
\ 'file': '\v\.(exe|so|dll)$',
\ 'link': '',
\ }
let g:vroom_clear_screen=0
let g:vroom_use_vimux=1
let g:vroom_use_binstubs=0
let g:vroom_use_bundle_exec=1
let g:vroom_rspec_version='3.x'
let g:vroom_use_colors=0
" Arduino
" Default: /Applications/Arduino.app/Contents/Resources/Java
let g:vim_arduino_library_path = '/Users/mileszs/code/Arduino'
" Default: result of `$(ls /dev/tty.* | grep usb)`
let g:vim_arduino_serial_port = '/dev/tty.usbmodem1411'
" vim-test
let test#strategy = "vimux"
noremap tsl :TestNearest<CR>
noremap ts; :TestFile<CR>
noremap ts' :TestSuite<CR>
noremap tss :TestLast<CR>
" Ignore deprecation warnings so I can see the results
let test#ruby#rspec#options = '--deprecation-out /dev/null'
" github
" source /Users/mileszs/.vimgithubrc
let g:python3_host_prog = '/usr/local/bin/python3' " -- Set python 3 provider