-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc_remote
More file actions
414 lines (356 loc) · 12.5 KB
/
.vimrc_remote
File metadata and controls
414 lines (356 loc) · 12.5 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
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
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
" Modeline {{{
" vim: sw=2 ts=2 sts=2 tw=78 foldmarker={{{,}}} foldlevel=0 foldmethod=marker
" }}}
" Header {{{
set shell=/bin/bash
filetype plugin indent on
" }}}
" Settings {{{
syntax on
scriptencoding utf-8
set autoindent
set backspace=indent,eol,start
set backup " Backups are nice ...
set completeopt+=menu
set completeopt+=menuone " Show the completions UI even with only 1 item
set completeopt+=noinsert " Insert text automatically
set completeopt-=preview " Documentation preview window
set completeopt-=longest " Insert the longest common text
set completeopt+=noselect " Highlight the first completion automatically
set cursorline
set encoding=utf-8
set encoding=utf8
set expandtab
set ffs=unix
set fileencoding=utf-8
"set foldexpr=nvim_treesitter#foldexpr()
set foldlevelstart=20
set foldmethod=syntax
set hidden
set history=1000
set hlsearch
set ignorecase
set incsearch
set iskeyword-=#
set iskeyword-=-
set iskeyword-=.
set keywordprg=:help
set lazyredraw
set linespace=0
set list
set list
set mousehide
set mps+=<:>
set nocompatible
set nojoinspaces
set nospell
set noswapfile
set nowrap
set nu
set pastetoggle=<F12>
set regexpengine=1
set rnu
set sbr= lcs=tab:!-,trail:~ " List mode and non-text characters
set scrolljump=1
set scrolloff=10
set signcolumn=yes
set shiftwidth=2
set shortmess+=c
set shortmess+=filmnrxoOtT
set showmatch
set smartcase
set softtabstop=2
set spelllang=en_us
set spf=~/.vimspell.en.add
set splitbelow
set splitright
set tabstop=2
set tags=~/.vimtags
set ttimeout
set ttimeoutlen=0
set viewoptions=folds,options,cursor,unix,slash
set virtualedit=
set whichwrap=b,s,[,]
set wildmenu
set wildmode=list:longest,full
set winminheight=0
set sessionoptions=blank,buffers,curdir,folds,tabpages,winsize
set runtimepath^=~/.vim/bundle/ctrlp.vim
" }}}Environment
" Plugins {{{
call plug#begin('~/.local/share/nvim/plugged')
" Editing {{{
Plug 'SirVer/ultisnips'
Plug 'git://github.com/tpope/vim-abolish.git'
Plug 'honza/vim-snippets'
Plug 'michaeljsmith/vim-indent-object'
Plug 'svermeulen/vim-subversive'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
" }}}
" Programming {{{
" General {{{
Plug 'nvim-lua/completion-nvim'
" }}}
" Other languages {{{
Plug 'elzr/vim-json'
" }}}
" }}}
" Git / Tree / Undo / Tmux / etc {{{
Plug 'airblade/vim-gitgutter'
Plug 'christoomey/vim-tmux-navigator'
Plug 'christoomey/vim-tmux-runner'
Plug 'farmergreg/vim-lastplace'
Plug 'itchyny/vim-gitbranch'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'mbbill/undotree'
Plug 'mhinz/vim-startify'
Plug 'tmux-plugins/vim-tmux'
Plug 'tpope/vim-fugitive'
" }}}
" Support {{{
Plug 'Konfekt/FastFold'
Plug 'bling/vim-bufferline'
Plug 'embear/vim-localvimrc'
Plug 'flazz/vim-colorschemes'
Plug 'tpope/vim-dispatch'
" }}}
call plug#end()
" }}}
" Functions {{{
" Undo {{{
function! InitializeDirectories()
let parent = $HOME
let prefix = 'vim'
let dir_list = {
\ 'backup': 'backupdir',
\ 'swap': 'directory' }
if has('persistent_undo')
let dir_list['undo'] = 'undodir'
endif
" To specify a different directory in which to place the vimbackup,
" vimviews, vimundo, and vimswap files/directories, add the following to
" your .vimrc.before.local file:
let common_dir = parent . '/.' . prefix
for [dirname, settingname] in items(dir_list)
let directory = common_dir . dirname . '/'
if exists("*mkdir")
if !isdirectory(directory)
call mkdir(directory)
endif
endif
if !isdirectory(directory)
echo "Warning: Unable to create backup directory: " . directory
echo "Try: mkdir -p " . directory
else
let directory = substitute(directory, " ", "\\\\ ", "g")
exec "set " . settingname . "=" . directory
endif
endfor
endfunction
call InitializeDirectories()
" }}}
" Diff ignore white space {{{
function! DiffW()
let opt = ""
if &diffopt =~ "icase"
let opt = opt . "-i "
endif
if &diffopt =~ "iwhite"
let opt = opt . "-w " " swapped vim's -b with -w
endif
silent execute "!diff -a --binary " . opt .
\ v:fname_in . " " . v:fname_new . " > " . v:fname_out
endfunction
set diffexpr=DiffW()
" }}}
" FZF {{{
function! s:build_quickfix_list(lines)
call setqflist(map(copy(a:lines), '{ "filename": v:val }'))
copen
cc
endfunction
" }}}
" }}}
" Style {{{
set statusline+=%#warningmsg#
set statusline+=%*
let g:jellybeans_use_term_italics = 1
colorscheme jellybeans
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
highlight Normal ctermbg=233
highlight CursorLine term=bold cterm=bold
highlight CursorLineNr term=bold cterm=bold
highlight ExtraWhitespace ctermbg=red guibg=red
highlight ExtraWhitespace ctermbg=darkgreen guibg=lightgreen
highlight ExtraWhitespace ctermbg=darkgreen guibg=darkgreen
highlight NormalFloat ctermbg=Black guibg=Grey40
match ExtraWhitespace /\s\+$\|\s\+$\| \+\ze\t\|\s\+\%#\@<!$\|[^ ]*\s+,/
let g:lightline = {
\ 'colorscheme': 'jellybeans',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'currentfunction', 'readonly', 'filename', 'modified' ] ],
\ 'right': [ [ 'lineinfo' ],
\ [ 'percent' ],
\ [ 'branchname', 'charvaluehex', 'filetype', 'cocstatus' ] ]
\ },
\ 'component_function': {
\ 'cocstatus': 'StatusDiagnostic',
\ 'branchname': 'gitbranch#name',
\ 'currentfunction': 'CocCurrentFunction'
\ },
\ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
\ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" },
\ 'enable': { 'tabline': 0 },
\ }
" }}}
" Init {{{
autocmd FileType netrw set nolist
autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
autocmd FileType xhtml,xml ru ftplugin/html/autoclosetag.vim
autocmd FileType org set nolist sw=2 ts=2 sts=2 nowrap tw=800 foldlevel=0
" FZF {{{
command! -bang -nargs=* Rg call fzf#vim#grep('rg --column --no-heading --line-number --color=always -- '.shellescape(<q-args>), 1, fzf#vim#with_preview('up:70%'), <bang>0)
command! -bang -nargs=* GFiles call fzf#vim#gitfiles('', fzf#vim#with_preview('up:70%'), <bang>0)
command! -bang -nargs=* Marks call fzf#vim#marks({'options': ['--preview', 'coderay {4..-1}']}, <bang>0)
command! -bang -nargs=* GGrep
\ call fzf#vim#grep(
\ 'git grep --line-number '.shellescape(<q-args>), 0,
\ <bang>0 ? fzf#vim#with_preview({'options': '--no-hscroll'},'up:60%')
\ : fzf#vim#with_preview({'options': '--no-hscroll'},'down:50%'),
\ <bang>0)
" }}}
" Undo {{{
if isdirectory(expand("~/.vim/bundle/undotree/"))
nnoremap <Leader>u :UndotreeToggle<CR>
" If undotree is opened, it is likely one wants to interact with it.
let g:undotree_SetFocusWhenToggle=1
endif
if has('persistent_undo')
set undofile " So is persistent undo ...
set undolevels=10000 " Maximum number of changes that can be undone
set undoreload=10000 " Maximum number lines to save for undo on a buffer reload
endif
" }}}
" }}}
" Lets {{{
let $PAGER=''
let b:csv_arrange_leftalign = 1
let g:C_Ctrl_j = 'off'
let g:UltiSnipsExpandTrigger = "<Tab>"
let g:UltiSnipsJumpForwardTrigger = "<Tab>"
let g:UltiSnipsJumpBackwardTrigger = "<S-Tab>"
let g:go_fmt_autosave=0
let g:rainbow_active = 1
let g:vim_json_syntax_conceal = 0
let g:yankring_clipboard_monitor = 0
let maplocalleader="\<space>"
let mapleader = ","
let python_highlight_all=1
let yankring_replace_n_pkey = ''
let $FZF_DEFAULT_OPTS = "--bind ctrl-a:select-all --preview-window down"
let $FZF_PREVIEW_COMMAND = 'coderay {}'
let g:fzf_action = {'ctrl-q': function('s:build_quickfix_list'), 'ctrl-t': 'tab split', 'ctrl-x': 'split', 'ctrl-v': 'vsplit' }
let g:fzf_buffers_jump = 1
let g:fzf_history_dir = '~/.local/share/fzf-history'
let g:completion_auto_change_source = 1
let g:completion_enable_snippet = 'UltiSnips'
let g:completion_matching_smart_case = 1
let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy']
let g:completion_trigger_on_delete = 1
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_root_markers = ['.idea']
let g:ctrlp_working_path_mode = 'ra'
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/](node_modules|assets|migrations|lib)$',
\ 'file': '\v\.(jar|orig|html|pyc)$',
\ }
let g:gitgutter_map_keys = 0
let g:gitgutter_override_sign_column_highlight = 0
let g:lens#disabled_filetypes = ['nerdtree', 'fzf']
let g:lens#height_resize_min = 800
let g:lens#height_resize_max = 800
let g:lens#width_resize_min = 800
let g:lens#width_resize_max = 800
let g:localvimrc_ask=0
let g:localvimrc_sandbox=0
let g:netrw_altv = 1
let g:netrw_banner = 0
let g:netrw_browse_split = 1
let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+,\(^\|\s\s\)ntuser\.\S\+'
let g:netrw_liststyle = 3
let g:netrw_winsize = 75
let g:notes_directories = ['~/Documents/Notes']
let g:notes_list_bullets = ['√', '•', '▸', '¿', '▹', '▪', '▫', 'x']
let g:notes_suffix = '.txt'
let g:startify_change_to_dir = 0
let g:startify_change_to_vcs_root = 1
let g:startify_custom_header = []
let test#enabled_runners = ["python#nose"]
let test#strategy = "vtr"
let g:instant_rst_port = 8905
let g:instant_rst_browser = 'google_chrome'
let g:gutentags_ctags_tagfile = '/Users/borischurzin/.vimtags'
let g:gutentags_exclude_filetypes = ['javascript', 'gitcommit', 'gitconfig', 'gitrebase', 'gitsendemail', 'git', 'sh', 'text', '']
let g:gutentags_ctags_executable = '/usr/local/bin/ctags'
let g:gutentags_project_info = [{"type": "python"}]
let g:gutentags_file_list_command = 'git ls-files'
let g:org_export_emacs="/usr/local/bin/emacs"
let g:org_todo_keywords = ['TODO', 'IN_PROGRESS', 'SCHEDULED', 'WAITING', '|', 'OBSOLETE', 'DELEGATED', 'DONE']
let g:utl_cfg_hdl_scm_http_system="silent !open '%u'"
" }}}
" Mappings {{{
cmap w!! w !sudo tee % >/dev/null
nnoremap _s :%s/\s\+$//<CR>
noremap \ "+y
nnoremap <Leader>y :YRShow<CR>
nnoremap Y y$
nnoremap <C-P> :GFiles!<CR>
nnoremap <Leader><C-P> :Telescope git_files<CR>
nnoremap <Leader>; :Buffers!<CR>
nnoremap <Leader>.; :Telescope buffers<CR>
nnoremap <Leader>h :History<CR>
nnoremap <Leader>.h :Telescope oldfiles<CR>
nnoremap <Leader>L :Lines<CR>
nnoremap <Leader>l :BLines<CR>
imap <C-S> <C-O>:Snippets!<CR>
nnoremap <leader>f :Rg!<CR>
nnoremap <silent> <Leader><S-F> :Rg! <C-R><C-W><CR>
nnoremap <Leader>g :Lspsaga lsp_finder<CR>
nnoremap <Leader>m :Lspsaga show_line_diagnostics<CR>
nnoremap <Leader>t :Telescope treesitter<CR>
"nnoremap <Leader>i :PyrightOrganizeImports<CR>
nnoremap <leader>i :silent! ImportName<CR>
nnoremap <leader><S-I> :silent! w<CR>:silent! !isort %<CR>
nnoremap <leader>p :let @+=expand("%")<CR>
nnoremap <leader><S-P> :let @+=expand("%:t:r")<CR>
nnoremap <leader><C-p> :let @+=join([expand("%"), line('.')], ':')<CR>
nnoremap <silent> <leader>/ :set invhlsearch<CR>
nnoremap <silent> <leader><leader> <C-^>
nnoremap <silent> [n :cprev<CR>
nnoremap <silent> ]n :cnext<CR>
nnoremap <silent> { :lprev<CR>
nnoremap <silent> } :lnext<CR>
nnoremap <Leader>.<tab> :Telescope file_browser<Enter>
nnoremap <Leader><CR> :NERDTreeToggle<Enter>
nnoremap <Leader><tab> :NERDTreeToggle<Enter>
nnoremap <silent> <leader>u :MundoToggle<CR>
nnoremap <silent> <leader>rn <cmd>lua require('lspsaga.rename').rename()<CR>
nnoremap <Space> <Nop>
nnoremap <C-H> <C-W>h
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
nnoremap j gj
nnoremap k gk
nmap S <plug>(SubversiveSubstituteToEndOfLine)
nmap s <plug>(SubversiveSubstitute)
nmap ss <plug>(SubversiveSubstituteLine)
vnoremap zc :fold<CR>
vnoremap . :normal .<CR>
vnoremap < <gv
vnoremap > >gv
" }}}