-
Notifications
You must be signed in to change notification settings - Fork 74
/
vimrc
344 lines (275 loc) · 8.79 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
let mapleader = "\<Space>"
" auto install vim-plug and plugins
if empty(glob('~/.local/share/nvim/site/autoload/plug.vim'))
silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" https://github.com/chrisbra/matchit
:packadd! matchit
call plug#begin('~/.vim/plugged')
"" MUST BE
" Plug 'tpope/vim-sensible'
" git support
" Plug 'tpope/vim-fugitive'
Plug 'honza/vim-snippets'
" advanced welcome screen
Plug 'mhinz/vim-startify'
" Plug 'neomake/neomake'
Plug 'ntpeters/vim-better-whitespace'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-surround'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'scrooloose/nerdtree'
Plug 'preservim/nerdcommenter'
Plug 'tpope/vim-repeat'
Plug 'nanotech/jellybeans.vim'
Plug 'dyng/ctrlsf.vim'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-projectionist'
Plug 'dense-analysis/ale'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
"Plug 'antoinemadec/coc-fzf', {'branch': 'release'}
Plug 'tpope/vim-endwise'
Plug 'rlue/vim-barbaric'
"Plug 'Raimondi/delimitMate'
"" PROBABLY USEFULL
" multi cursor
" Plug 'mg979/vim-visual-multi', {'branch': 'master'}
Plug 'AndrewRadev/splitjoin.vim'
" database access
Plug 'tpope/vim-dadbod'
"Plug 'cohama/lexima.vim'
Plug 'jpalardy/vim-slime', {'branch': 'main'}
Plug 'editorconfig/editorconfig-vim'
Plug 'puremourning/vimspector'
Plug 'wellle/targets.vim'
Plug 'nvim-lua/plenary.nvim'
Plug 'windwp/nvim-spectre'
Plug 'OmniSharp/omnisharp-vim'
" Plug 'kassio/neoterm'
" Plug 'tpope/vim-dispatch'
""LANGAUGE SPECIFIC
Plug 'sheerun/vim-polyglot'
Plug 'tpope/vim-rails'
" Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-bundler'
" Plug 'tpope/vim-haml'
" Plug 'slim-template/vim-slim'
Plug 'pantharshit00/vim-prisma'
" Plug 'lxhillwind/leader-clipboard'
" Plug 'ConradIrwin/vim-bracketed-paste'
" Plug 'hashivim/vim-terraform'
" Plug 'chr4/nginx.vim'
Plug 'janko-m/vim-test'
" Plug 'jlanzarotta/bufexplorer'
Plug 'lepture/vim-jinja'
" Plug 'Shougo/vimproc.vim', {'do' : 'make'}
" Plug 'isobit/vim-caddyfile'
" Targets.vim comes with five kinds for text objects:
" Pair text objects
" Quote text objects
" Separator text objects
" Argument text objects
" Tag text objects
" Plug 'othree/html5.vim'
" Plug 'digitaltoad/vim-pug'
" Plug 'elixir-editors/vim-elixir'
" Plug 'vim-erlang/vim-erlang-runtime'
" Plug 'vim-erlang/vim-erlang-compiler'
" Auto close parentheses and repeat by dot dot dot...
Plug 'c-brenn/phoenix.vim'
" Plug 'jwalton512/vim-blade'
Plug 'noahfrederick/vim-composer'
Plug 'noahfrederick/vim-laravel'
" Plug 'rhysd/vim-clang-format'
" Plug 'tpope/vim-ragtag'
" Plug 'eagletmt/ghcmod-vim'
" Plug 'eagletmt/ghcmod-vim'
" Plug 'neovimhaskell/haskell-vim'
Plug 'pangloss/vim-javascript'
Plug 'maxmellon/vim-jsx-pretty'
Plug 'udalov/kotlin-vim'
" Plug 'moll/vim-node'
" Plug 'mattn/emmet-vim', { 'for': 'html' }
" Plug 'xolox/vim-misc'
" Plug 'xolox/vim-easytags'
" Plug 'Valloric/MatchTagAlways'
" Plug 'plasticboy/vim-markdown'
Plug 'dhruvasagar/vim-table-mode'
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() } }
" Plug 'michaeljsmith/vim-indent-object'
" Clojure
" Plug 'guns/vim-clojure-static', { 'for': 'clojure' }
" Plug 'tpope/vim-leiningen', { 'for': 'clojure' }
" Plug 'tpope/vim-classpath', { 'for': 'clojure' }
" Plug 'tpope/vim-fireplace', { 'for': 'clojure' }
" Plug 'venantius/vim-eastwood', { 'for': 'clojure' }
" Plug 'kovisoft/slimv', { 'for': ['clojure', 'scheme', 'racket'] }
" Plug 'wlangstroth/vim-racket', { 'for': 'racket' }
" Plug 'chrisbra/csv.vim'
Plug 'ekalinin/Dockerfile.vim'
" \ 'coc-docker', https://github.com/neoclide/coc.nvim/pull/2756
" \ 'coc-tabnine',
" https://github.com/phpactor/coc-phpactor use when become popular
let g:coc_global_extensions = [
\ 'coc-cspell-dicts',
\ 'coc-markdownlint',
\ 'coc-omnisharp',
\ 'coc-phpactor',
\ 'coc-spell-checker',
\ 'coc-tsserver',
\ 'coc-prettier',
\ 'coc-html',
\ 'coc-lists',
\ 'coc-xml',
\ 'coc-sh',
\ 'coc-css',
\ 'coc-stylelintplus',
\ 'coc-vimlsp',
\ 'coc-go',
\ 'coc-elixir',
\ 'coc-json',
\ 'coc-eslint',
\ 'coc-pyright',
\ 'coc-java',
\ 'coc-java-debug',
\ 'coc-jest',
\ 'coc-solargraph',
\ 'coc-yaml',
\ 'coc-highlight',
\ 'coc-snippets',
\ 'coc-diagnostic',
\ 'coc-yank',
\ 'coc-git',
\]
call plug#end()
syntax on
filetype plugin on
" https://github.com/vim/vim/blob/master/runtime/doc/russian.txt
" Enable hotkeys for Russian layout
set langmap=ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz
silent! colorscheme jellybeans
" set visualbell
" set completeopt=noinsert,menuone,noselect
" set complete+=kspell
if has('mouse')
set mouse=a
endif
" if has("clipboard")
" set clipboard=unnamed " copy to the system clipboard
" if has("unnamedplus") " X11 support
" set clipboard+=unnamedplus
" endif
" endif
" Don't redraw while executing macros (good performance config)
" set lazyredraw
" set ttyfast
" set shortmess+=c
" set cursorline
" set hidden
" set nofoldenable
" set wrap
" set linebreak
set number
set hlsearch
set ignorecase
" set smartcase
" Turn backup off, since most stuff is in SVN, git et.c anyway...
" set nobackup
" set nowritebackup
" set nowb
" set noswapfile
" set showcmd " display incomplete commands
" set autowrite " Automatically :write before running commands
" Use one space, not two, after punctuation.
" set nojoinspaces
" set softtabstop=4
" new line indent: use spaces instead of tab
" set smarttab
" set smartindent
" set expandtab
" set softtabstop=2
" set tabstop=2
" new line indent: how many spaces for one tab
" set shiftwidth=2
"set tabstop=2
" current line indent: how many spaces for one tab
"set softtabstop=2
" set updatetime=300
" set splitbelow
" set cmdheight=2
" " TODO: replace with "number" when new neovim will be released
set signcolumn=yes
set scrolloff=3
" Keep undo history across sessions, by storing in file.
"silent !mkdir /tmp/.vim/backups > /dev/null 2>&1
set undodir=/tmp/.vim/backups
set undofile
""" Basics Keymaps
" Turn off linewise keys. Normally, the `j' and `k' keys move the cursor down one entire line. with line wrapping on, this can cause the cursor to actually skip a few lines on the screen because it's moving from line N to line N+1 in the file. I want this to act more visually -- I want `down' to mean the next line on the screen
" nmap j gj
" nmap k gk
nnoremap <expr> k (v:count == 0 ? 'gk' : 'k')
nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
" TODO: improve n+1 line moving by russian keys
nnoremap <expr> л (v:count == 0 ? 'gk' : 'k')
nnoremap <expr> о (v:count == 0 ? 'gj' : 'j')
noremap <C-m> :make<CR>
" Map ctrl-movement keys to window switching
map <C-k> <C-w><Up>
map <C-j> <C-w><Down>
map <C-l> <C-w><Right>
map <C-h> <C-w><Left>
vmap "y "*y
nmap "y "*y
nmap "Y "*Y
nmap "p "*p
nmap "P "*P
" highlight last inserted text
nnoremap gV `[v`]
noremap <Leader>s :update<CR>
" Edit .vimrc
map <leader>vl :vsp $MYVIMRC<CR>
map <leader>vr :source $MYVIMRC<CR>
vmap gcc <plug>NERDCommenterToggle
nmap gcc <plug>NERDCommenterToggle
let g:NERDDefaultAlign = 'left'
let g:NERDSpaceDelims = 1
" https://github.com/tpope/vim-endwise/issues/11
execute "inoremap {<CR> {<CR>}<ESC>O"
autocmd FileType scss setl iskeyword+=@-@
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_toc_autofit = 1
let g:slime_target = "neovim"
" nmap <C-F>f <Plug>CtrlSFPrompt
" vmap <C-F>f <Plug>CtrlSFVwordPath
" vmap <C-F>F <Plug>CtrlSFVwordExec
" nmap <C-F>n <Plug>CtrlSFCwordPath
" nmap <C-F>p <Plug>CtrlSFPwordPath
" nnoremap <C-F>o :CtrlSFOpen<CR>
" nnoremap <C-F>t :CtrlSFToggle<CR>
" inoremap <C-F>t <Esc>:CtrlSFToggle<CR>
let g:vim_markdown_folding_disabled = 1
" format the entire file
" nnoremap ff :normal! gg=G``<CR>
" set text wrapping toggles
" nmap <silent> <leader>tw :set invwrap<CR>:set wrap?<CR>
" find merge conflict markers
" nmap <silent> <leader>fc <ESC>/\v^[<=>]{7}( .*\|$)<CR>
nmap <silent> // :nohlsearch<CR>
" noremap <leader>hl :set hlsearch! hlsearch?<CR>
" Allows you to enter sudo pass and save the file
" " when you forgot to open your file with sudo
" cmap w!! %!sudo tee > /dev/null %
nmap <leader>fr <Plug>CtrlSFPrompt
nnoremap <leader>S :lua require('spectre').open()<CR>
"set spell spelllang=en_us,ru_ru
source ~/dotfiles/files/vim-configs/ale.vim
source ~/dotfiles/files/vim-configs/coc.vim
source ~/dotfiles/files/vim-configs/fzf.vim
source ~/dotfiles/files/vim-configs/nerdtree.vim
source ~/dotfiles/files/vim-configs/coc-fzf.vim
source ~/dotfiles/files/vim-configs/coc-plugins.vim
source ~/dotfiles/files/vim-configs/test.vim