-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
241 lines (192 loc) · 6.4 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
"" Use Vim settings, not Vi
"" This must be first, because it changes other options as a side effect
set nocompatible
"" Auto load vim-plug
if empty(glob("~/.vim/autoload/plug.vim"))
execute '!mkdir -p ~/.vim/autoload/; curl -fLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim'
endif
" Enable completion where available using ALE
let g:ale_completion_enabled = 1
"" vim-plug
call plug#begin("~/.vim/plugged")
" Plugins
" plugins
Plug 'AndrewRadev/splitjoin.vim'
Plug 'bronson/vim-trailing-whitespace'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'itchyny/lightline.vim'
Plug 'mattn/emmet-vim'
Plug 'raimondi/delimitmate'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'vim-scripts/Align'
Plug 'dense-analysis/ale'
Plug 'lifepillar/vim-mucomplete'
" Plug 'ervandew/supertab'
" syntax highlight / language support
Plug 'MaxMEllon/vim-jsx-pretty', { 'for': [ 'javascript', 'javascript.jsx' ] }
Plug 'cespare/vim-toml', { 'for': 'toml' }
Plug 'elixir-lang/vim-elixir', { 'for': 'elixir' }
Plug 'hashivim/vim-terraform', { 'for': 'terraform' }
Plug 'hhsnopek/vim-sugarss'
Plug 'jdonaldson/vaxe', { 'for': [ 'haxe', 'hss' ] }
Plug 'keith/swift.vim', { 'for': 'swift' }
Plug 'pangloss/vim-javascript', { 'for': [ 'javascript', 'javascript.jsx'] }
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
Plug 'tomlion/vim-solidity', { 'for': 'solidity' }
Plug 'tpope/vim-markdown', { 'for': 'markdown' }
Plug 'tpope/vim-rails', { 'for': 'ruby' }
Plug 'calviken/vim-gdscript3', { 'for': 'gdscript' }
Plug 'evanleck/vim-svelte', { 'branch': 'main' }
Plug 'pantharshit00/vim-prisma', { 'for': 'prisma' }
" colors
Plug 'jgradim/neodark.vim'
call plug#end()
filetype plugin indent on " required!
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"" General options
set number " always show line numbers
set backspace=indent,eol,start " backspace on everything
set encoding=utf-8 " default encoding for all files
set showcmd " display incomplete commands
set showmode " show current mode
set autoread " Reload files changed outside vim
set laststatus=2 " Always show the status line
"" Syntax highlight
syntax enable
"" Tab settings
set softtabstop=2 shiftwidth=2 tabstop=2
set expandtab
"" Indentation
set autoindent
set smartindent
set smarttab
"" Searching
set hlsearch " highlight searches
set incsearch " incremental search
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
"" Whitespace
set nowrap " don't wrap lines
set linebreak " wrap lines at convenient places
"" Scrolling
set scrolloff=2 " start scrolling when we're 2 lines away from margins
"" Turn off Swap Files
set noswapfile
set nobackup
set nowb
"" Mouse/trackpad scrolling in terminal Vim
set mouse=a
"" Hide mode, using lightline
set noshowmode
"" Color theme
colorscheme neodark
"" Global ignore
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
"" Disable Ex mode
nnoremap Q <Nop>
" Some servers have issues with backup files, see #649
set nobackup
set nowritebackup
" Better display for messages
set cmdheight=2
" You will have bad experience for diagnostic messages when it's default 4000.
set updatetime=300
" don't give |ins-completion-menu| messages.
set shortmess+=c
" always show signcolumns
set signcolumn=yes
" maximum number of open tabs (vim -p)
set tabpagemax=50
"" Plugin configuration
" vim-mucomplete
set completeopt+=menuone,noselect
set belloff+=ctrlg,complete
let g:mucomplete#enable_auto_at_startup = 1
" insert a tab character when there are no completions
let g:mucomplete#tab_when_no_results = 1
" cyle through completion methods with left and right keys
" inoremap <silent> <plug>(MUcompleteFwdKey) <right>
" imap <right> <plug>(MUcompleteCycFwd)
" inoremap <silent> <plug>(MUcompleteBwdKey) <left>
" imap <left> <plug>(MUcompleteCycBwd)
let g:mucomplete#chains = {
\ 'default': ['path', 'c-n', 'keyn'],
\ 'vim': ['path', 'cmd', 'keyn'],
\ }
" ctrlp
let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard']
let g:ctrlp_working_path_mode = 'a'
" indentLine
" let g:indentLine_char = '⎸'
" lightline
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [
\ [ 'mode', 'paste' ],
\ [ 'readonly', 'filepath', 'modified' ]
\ ]
\ },
\ 'inactive': {
\ 'left': [['filepath']]
\ },
\ 'component_function': {
\ 'filepath': 'FilePath'
\ },
\ }
function! FilePath()
let path = expand('%:p')
return substitute(path, getcwd()."/", '', 'i')
endfunction
" emmet
let g:user_emmet_settings = {
\ 'javascript' : {
\ 'extends' : 'jsx',
\ },
\ }
" vim-jsx (allow JSX syntax highlight in .js files)
let g:jsx_ext_required = 0
" vim-jsx-pretty
let g:vim_jsx_pretty_colorful_config = 1
" rust-vim
let g:autofmt_autosave = 1
" vim-svelte
let g:svelte_indent_script = 0
let g:svelte_indent_style = 0
" ALE
"
" npm i -g eslint typescript bash-language-server stylelint
" gem install rubocop solargraph
let g:ale_linters = {
\ 'css': ['stylelint'],
\ 'javascript': ['eslint', 'tsserver'],
\ 'json': ['eslint'],
\ 'ruby': ['ruby', 'rubocop', 'solargraph'],
\ 'sh': ['language_server'],
\ 'typescript': ['eslint', 'tsserver'],
\ }
let g:ale_fixers = {
\ 'javascript': ['eslint'],
\ 'json': ['eslint'],
\}
let g:ale_javascript_eslint_suppress_missing_config = 1
let g:ale_fix_on_save = 1
"" custom filetypes
au BufRead,BufNewFile *.hamlbars* setf haml
au BufRead,BufNewFile *.hbs setf html
au BufRead,BufNewFile *.less* setf sass
au BufRead,BufNewFile *.rabl* setf ruby
au BufRead,BufNewFile *.styl* setf sass
au BufRead,BufNewFile *.p8* setf lua
au BufRead,BufNewFile *.p8* set colorcolumn=32
au BufRead,BufNewFile .env setf sh
au BufRead,BufNewFile .env.* setf sh
au BufRead,BufNewFile Vagrantfile setf ruby
au BufRead,BufNewFile .eslintrc setf javascript
au Bufread,BufnewFile .prisma setf prisma
"" kitty compatibility
let &t_ut=''