-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
637 lines (523 loc) · 20.9 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
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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
" This is Gary Bernhardt's edited by Maximilien Cuony .vimrc file
" vim:set ts=2 sts=2 sw=2 expandtab:
" Boostrap autoload
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.vim/bundle')
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" BASIC EDITING CONFIGURATION
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nocompatible
" allow unsaved background buffers and remember marks/undo for them
set hidden
" remember more commands and search history
set history=10000
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set autoindent
set laststatus=2
set showmatch
set incsearch
set hlsearch
" make searches case-sensitive only if they contain upper-case characters
set ignorecase smartcase
" highlight current line
set cursorline
set cmdheight=2
set switchbuf=useopen
set numberwidth=5
set showtabline=2
set winwidth=79
set shell=bash
" Prevent Vim from clobbering the scrollback buffer. See
" http://www.shallowsky.com/linux/noaltscreen.html
set t_ti= t_te=
" keep more context when scrolling off the end of a buffer
set scrolloff=15
" Store temporary files in a central spot
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
" display incomplete commands
set showcmd
" Enable highlighting for syntax
syntax on
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
" use emacs-style tab completion when selecting files, etc
set wildmode=longest,list
" make tab completion for files/buffers act like bash
set wildmenu
let mapleader=" "
set nu
set foldcolumn=2
set autoindent
set foldmethod=marker
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" CUSTOM AUTOCMDS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
augroup vimrcEx
" Clear all autocmds in the group
autocmd!
autocmd FileType text setlocal textwidth=78
" Jump to last cursor position unless it's invalid or in an event handler
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
"for ruby, autoindent with two spaces, always expand tabs
autocmd FileType ruby,haml,eruby,yaml,html,htmldjango,javascript,sass,cucumber set ai sw=4 sts=4 et
autocmd FileType python set sw=4 sts=4 et
autocmd! BufRead,BufNewFile *.sass setfiletype sass
autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:>
autocmd BufRead *.markdown set ai formatoptions=tcroqn2 comments=n:>
" Indent p tags
autocmd FileType html,eruby if g:html_indent_tags !~ '\\|p\>' | let g:html_indent_tags .= '\|p\|li\|dt\|dd' | endif
" Don't syntax highlight markdown because it's often wrong
autocmd! FileType mkd setlocal syn=off
augroup END
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" COLOR
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set t_Co=256 " 256 colors
set background=dark
":color ir_black
color archman
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MISC KEY MAPS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <leader>y "*y
" Move around splits with <c-hjkl>
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
" Insert a hash rocket with <c-l>
imap <c-l> <space>=><space>
" Can't be bothered to understand ESC vs <c-c> in insert mode
imap <c-c> <esc>
" Clear the search buffer when hitting return
nnoremap <leader><leader> <c-^>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MISC COMMANDS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
cmap w!! w !sudo tee % > /dev/null
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" MULTIPURPOSE TAB KEY
" Indent if we're at the beginning of a line. Else, do completion.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<tab>"
else
return "\<c-p>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
inoremap <s-tab> <c-n>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" OPEN FILES IN DIRECTORY OF CURRENT FILE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
cnoremap %% <C-R>=expand('%:h').'/'<cr>
map <leader>e :edit %%
map <leader>v :view %%
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" RENAME CURRENT FILE
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! RenameFile()
let old_name = expand('%')
let new_name = input('New file name: ', expand('%:.:h') . '/')
if new_name != '' && new_name != old_name
exec ':saveas ' . new_name
exec ':silent !rm ' . old_name
redraw!
endif
endfunction
map <leader>m :call RenameFile()<cr>
function! RandomHexString()
let string_length = input('String length: ')
let random_string = system('cat /dev/urandom | tr -dc "0-9a-f" | head -c '.shellescape(string_length))
call setline(line('.'), getline('.') . random_string)
return random_string
endfunction
function! RandomString()
let string_length = input('String length: ')
let random_string = system('cat /dev/urandom | tr -dc "0-9A-z" | head -c '.shellescape(string_length))
call setline(line('.'), getline('.') . random_string)
return random_string
endfunction
map <leader>rhs :call RandomHexString()<CR>
map <leader>rs :call RandomString()<CR>
command! -range Sha :call append(line('.'), system('echo '.shellescape(join(getline(<line1>, <line2>), '\n')) . "| sha1sum | awk '{print $1}'"))
command! InsertTime :normal a<c-r>=strftime('%F %H:%M:%S %z')<cr>
""colorscheme desert
"" Status line full path for filename
function LightlineFilename()
let root = fnamemodify(get(b:, 'git_dir'), ':h')
let path = expand('%:p')
if path[:len(root)+1] ==# root
return path[len(root)+1:]
endif
return expand('%')
endfunction
"set statusline+=%{gutentags#statusline()}
" Bootstrap autoreload
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall
endif
call plug#begin('~/.vim/plugged')
Plug 'liuchengxu/space-vim-dark'
Plug 'kyoz/purify', { 'rtp': 'vim' }
Plug 'https://github.com/preservim/nerdtree'
Plug 'https://github.com/Xuyuanp/nerdtree-git-plugin.git'
Plug 'https://github.com/tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'https://github.com/ryanoasis/vim-devicons'
Plug 'https://github.com/millermedeiros/vim-statline.git'
Plug 'https://github.com/tpope/vim-fugitive'
let g:statline_fugitive = 1
let g:fugitive_gitlab_domains = ['https://git.arcanite.ch', 'https://git.polylan.ch']
"Plug 'https://github.com/junegunn/gv.vim'
Plug 'https://github.com/Legrems/gv.vim'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'https://github.com/vim-syntastic/syntastic.git'
let g:syntastic_auto_loc_list=0
let g:syntastic_enable_loc_list=0
let g:syntastautoenvic_enable_highlighting=1
let g:syntastic_error_symbol='✗→'
let g:syntastic_style_error_symbol='✗→'
let g:syntastic_warning_symbol='⚠→'
let g:syntastic_style_warning_symbol='⚠→'
let g:syntastic_aggregate_errors=1
let g:Powerline_symbols = 'unicode'
let g:syntastic_python_checkers=['flake8', 'pyflakes', 'pep8', 'py3kwarn']
let g:syntastic_python_checker_args='--ignore=E501'
let g:syntastic_python_flake8_post_args='--ignore=E501,E128'
let g:syntastic_python_pep8_post_args='--ignore=E501,E128'
let g:syntastic_check_on_open=1
Plug 'https://github.com/vim-python/python-syntax'
let g:python_highlight_all=1
Plug 'https://github.com/gioele/vim-autoswap'
Plug 'https://github.com/airblade/vim-gitgutter'
let g:gitgutter_eager = 0 " only update on read/write
let g:gitgutter_sign_column_always = 0
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'https://github.com/junegunn/fzf.vim'
let g:fzf_commits_log_options = '--format="%C(yellow)%h%d %s %C(cyan)(%aN) %C(black)%C(bold)%cr"'
let g:fzf_preview_command = 'bat --color=always --plain {-1}'
let g:fzf_preview_git_status_preview_command =
\ "[[ $(git diff --cached -- {-1}) != \"\" ]] && git diff --cached --color=always -- {-1} | delta || " .
\ "[[ $(git diff -- {-1}) != \"\" ]] && git diff --color=always -- {-1} | delta || " .
\ g:fzf_preview_command
let g:fzf_preview_directory_files_command = "rg --files --no-ignore-vcs -g\'!.git\'"
Plug 'https://github.com/shumphrey/fugitive-gitlab.vim'
Plug 'https://tpope.io/vim/surround.git'
Plug 'https://github.com/saltstack/salt-vim'
Plug 'https://github.com/jiangmiao/auto-pairs'
Plug 'https://github.com/mattn/emmet-vim'
Plug 'https://github.com/itchyny/lightline.vim'
let g:lightline = {
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'filename', 'readonly', 'modified' ],
\ [ 'gitdiff' ] ],
\ 'right': [ [ 'lineinfo' ],
\ [ 'gitbranch' ] ]
\ },
\ 'inactive': {
\ 'left': [ [ 'filename', 'gitversion' ] ],
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead',
\ 'filename': 'LightlineFilename',
\ },
\ 'component_expand': {
\ 'gitdiff': 'lightline#gitdiff#get',
\ },
\ 'component_type': {
\ 'gitdiff': 'middle',
\ },
\ }
Plug 'https://github.com/preservim/nerdcommenter'
" Add spaces after comment delimiters by default
let g:NERDSpaceDelims = 0
" Use compact syntax for prettified multi-line comments
let g:NERDCompactSexyComs = 1
" Align line-wise comment delimiters flush left instead of following code indentation
let g:NERDDefaultAlign = 'left'
" Allow commenting and inverting empty lines (useful when commenting a region)
let g:NERDCommentEmptyLines = 1
" Enable trimming of trailing whitespace when uncommenting
let g:NERDTrimTrailingWhitespace = 1
" Enable NERDCommenterToggle to check all selected lines is commented or not
let g:NERDToggleCheckAllLines = 1
"Plug 'https://github.com/mcchrish/nnn.vim'
"nnoremap <leader>nn :NnnPicker -de '%:p:h'<CR>
let g:nnn#action = {
\ '<c-t>': 'tab-split',
\ '<c-x>': 'split',
\ '<c-v>': 'vsplit' }
Plug 'https://github.com/terryma/vim-multiple-cursors'
Plug 'https://github.com/tpope/vim-obsession'
Plug 'https://github.com/Konfekt/FastFold'
nmap zuz <Plug>(FastFoldUpate)
let g:fastfold_savehook = 1
let g:fastfold_fold_command_suffixes = ['x', 'X', 'a', 'A', 'o', 'O', 'c', 'C']
let g:fastfold_fold_movement_commands = [']z', '[z', 'zj', 'zk']
Plug 'https://github.com/majutsushi/tagbar'
let g:tagbar_autofocus=1
map <c-t> :TagbarToggle<CR>
Plug 'https://github.com/ap/vim-css-color'
Plug 'https://github.com/vifm/vifm.vim'
Plug 'https://github.com/gregsexton/gitv', {'on': ['Gitv']}
Plug 'stevearc/vim-arduino'
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
Plug 'posva/vim-vue'
" set to 1, nvim will open the preview window after entering the markdown buffer
" default: 0
let g:mkdp_auto_start = 0
" set to 1, the nvim will auto close current preview window when change
" from markdown buffer to another buffer
" default: 1
let g:mkdp_auto_close = 1
" set to 1, the vim will refresh markdown when save the buffer or
" leave from insert mode, default 0 is auto refresh markdown as you edit or
" move the cursor
" default: 0
let g:mkdp_refresh_slow = 0
" set to 1, the MarkdownPreview command can be use for all files,
" by default it can be use in markdown file
" default: 0
let g:mkdp_command_for_global = 0
" set to 1, preview server available to others in your network
" by default, the server listens on localhost (127.0.0.1)
" default: 0
let g:mkdp_open_to_the_world = 0
" use custom IP to open preview page
" useful when you work in remote vim and preview on local browser
" more detail see: https://github.com/iamcco/markdown-preview.nvim/pull/9
" default empty
let g:mkdp_open_ip = ''
" specify browser to open preview page
" default: ''
function OpenMarkdownPreview (url)
execute "silent ! firefox --new-window " . a:url
endfunction
let g:mkdp_browserfunc = 'OpenMarkdownPreview'
" set to 1, echo preview page url in command line when open preview page
" default is 0
let g:mkdp_echo_preview_url = 0
" a custom vim function name to open preview page
" this function will receive url as param
" default is empty
let g:mkdp_browserfunc = ''
" options for markdown render
" mkit: markdown-it options for render
" katex: katex options for math
" uml: markdown-it-plantuml options
" maid: mermaid options
" disable_sync_scroll: if disable sync scroll, default 0
" sync_scroll_type: 'middle', 'top' or 'relative', default value is 'middle'
" middle: mean the cursor position alway show at the middle of the preview page
" top: mean the vim top viewport alway show at the top of the preview page
" relative: mean the cursor position alway show at the relative positon of the preview page
" hide_yaml_meta: if hide yaml metadata, default is 1
" sequence_diagrams: js-sequence-diagrams options
" content_editable: if enable content editable for preview page, default: v:false
" disable_filename: if disable filename header for preview page, default: 0
let g:mkdp_preview_options = {
\ 'mkit': {},
\ 'katex': {},
\ 'uml': {},
\ 'maid': {},
\ 'disable_sync_scroll': 0,
\ 'sync_scroll_type': 'middle',
\ 'hide_yaml_meta': 1,
\ 'sequence_diagrams': {},
\ 'flowchart_diagrams': {},
\ 'content_editable': v:false,
\ 'disable_filename': 0
\ }
" use a custom markdown style must be absolute path
" like '/Users/username/markdown.css' or expand('~/markdown.css')
let g:mkdp_markdown_css = ''
" use a custom highlight style must absolute path
" like '/Users/username/highlight.css' or expand('~/highlight.css')
let g:mkdp_highlight_css = ''
" use a custom port to start server or random for empty
let g:mkdp_port = ''
" preview page title
" ${name} will be replace with the file name
let g:mkdp_page_title = '「${name}」'
" recognized filetypes
" these filetypes will have MarkdownPreview... commands
let g:mkdp_filetypes = ['markdown']
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
"Plug 'pwntester/octo.vim'
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " We recommend updating the parsers on update
Plug 'nvim-lua/popup.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim'
Plug 'fannheyward/telescope-coc.nvim'
Plug 'https://github.com/ludovicchabant/vim-gutentags.git'
Plug 'https://github.com/dbeniamine/cheat.sh-vim'
" API testing
"Plug 'baverman/vial'
"Plug 'baverman/vial-http'
Plug 'emaniacs/vim-rest-console'
Plug 'mbbill/undotree'
let g:vrc_output_buffer_name = '__VRC_OUTPUT.json'
let g:python3_host_prog = "/home/legrems/miniconda3/bin/python"
let g:vial_python = 'python3'
set hidden
filetype plugin on
call plug#end()
set clipboard=unnamedplus
set mouse=a
set encoding=UTF-8
set autoread
set modifiable
" CursorLine
" hi Cursor gui=reverse guibg=NONE guifg=NONE
" hi CursorLine gui=reverse cterm=reverse
nnoremap <leader>ct :set cursorline!<CR>
" Folding
set foldnestmax=10
set foldmethod=indent
set nofoldenable
set splitbelow
set splitright
set relativenumber
" Custom shortcuts
"-------------------------------------------------------------------------------------------|
" Modes | Normal | Insert | Command | Visual | Select | Operator | Terminal | Lang-Arg |
" [nore]map | @ | - | - | @ | @ | @ | - | - |
" n[nore]map | @ | - | - | - | - | - | - | - |
" n[orem]ap! | - | @ | @ | - | - | - | - | - |
" i[nore]map | - | @ | - | - | - | - | - | - |
" c[nore]map | - | - | @ | - | - | - | - | - |
" v[nore]map | - | - | - | @ | @ | - | - | - |
" x[nore]map | - | - | - | @ | - | - | - | - |
" s[nore]map | - | - | - | - | @ | - | - | - |
" o[nore]map | - | - | - | - | - | @ | - | - |
" t[nore]map | - | - | - | - | - | - | @ | - |
" l[nore]map | - | @ | @ | - | - | - | - | @ |
"-------------------------------------------------------------------------------------------"
" Search in files
nnoremap <C-F> :Ag<CR>
"nnoremap <C-F> :CocCommand fzf-preview.ProjectGrep<space>
" Git status
" Old layout in the bottom
"nnoremap <C-c> :15Gstatus<CR>
" New layout vertical
nnoremap <C-c> :vertical topleft Git <bar> vertical resize 50<CR>
" Search file name
"nnoremap <C-G> :Files<CR>
" Ignore ignored files => all files
"nnoremap <C-G> :CocCommand fzf-preview.DirectoryFiles --no-ignore-vcs<CR>
nnoremap <C-G> :CocCommand fzf-preview.GitFiles<CR>
" Search git file name
"nnoremap <C-X> :GFiles<CR>
nnoremap <C-X> :CocCommand fzf-preview.DirectoryFiles<CR>
"nnoremap <C-X> :CocCommand fzf-preview.GitFiles<CR>
" Search buffers
" nnoremap <C-B> :Buffers<CR>
nnoremap <C-B> :CocCommand fzf-preview.Buffers<CR>
" Open Flake8 error
"nnoremap <C-E> :Errors<CR>
nnoremap <C-E> :CocCommand fzf-preview.MruFiles<CR>
" Force write as unix type (/n instead of /r/n)
nnoremap <C-s> :w! ++ff=unix<CR>
" Force quit
nnoremap <C-q> :q!<CR>
" Split diff
" nnoremap <C-d> :Gdiffsplit<CR>
nnoremap <C-d> :tab Git diff %<CR>
nnoremap <C-p> :tab Git diff<CR>
nnoremap <C-o> :UndotreeToggle<CR>
if has("persistent_undo")
let target_path = expand('~/.undodir')
" create the directory and any parent directories
" if the location does not exist.
if !isdirectory(target_path)
call mkdir(target_path, "p", 0700)
endif
let &undodir=target_path
set undofile
endif
" Using git-delta
" Buffer
" Bind a command to exclude some file extensions in the Ag search
" command! -bang -nargs=* Ag call fzf#vim#ag(<q-args>, '--ignore="*.js,*html"', fzf#vim#with_preview(), <bang>0)
"" F1-12 Shortcuts
nnoremap <F1> :tabprevious<CR>
nnoremap <F2> :tabnext<CR>
nnoremap <F3> :GV<CR>
nnoremap <F4> :tab Git show -
nnoremap <F5> :Git rebase -i HEAD~
nnoremap <leader>gp :Git pull<CR>
nnoremap <leader>gnb :Git checkout -b
" Fold / unfold with space
nnoremap <space> za
vnoremap <space> zf
nnoremap <leader>dl <HOME>d$
nnoremap <c-left> :bprevious<CR>
nnoremap <c-right> :bnext<CR>
"nnoremap <c-k> :bprevious<CR>
"nnoremap <c-j> :bnext<CR>
nnoremap <TAB> :bnext<CR>
nnoremap <S-TAB> :bprevious<CR>
" Goto file under location
nnoremap <leader>gf :vertical wincmd f<CR>
nnoremap <Return> o<ESC>
nnoremap <BS> O<ESC>
"nnoremap <leader>ra <cmd>CocCommand rest-client.request<CR>
nnoremap <leader>ra <cmd>call VrcQuery()<CR>
nnoremap <leader>rr <cmd>source $MYVIMRC<CR>
nnoremap <leader>ww <cmd>Telescope coc commands<CR>
nnoremap <leader>/ <cmd>Telescope search_history<CR>
nnoremap <leader>ch <cmd>Telescope command_history<CR>
"nnoremap <leader>ch <cmd>CocCommand fzf-preview.CommandPalette<CR>
nnoremap <leader>gk <cmd>CocCommand fzf-preview.GitActions<CR>
"nnoremap <leader>gc <cmd>Telescope git_commits<CR>
nnoremap <leader>gc <cmd>lua require('telescope.custom').my_git_commits()<CR>
"nnoremap <leader>gc <cmd>CocCommand fzf-preview.GitLogs<CR>
nnoremap <leader>gbb <cmd>Telescope git_branches<CR>
nnoremap <leader>gbc <cmd>lua require('telescope.custom').my_git_bcommits()<CR>
"nnoremap <leader>gb <cmd>CocCommand fzf-preview.GitBranches<CR>
"nnoremap <leader>gss <cmd>Telescope git_status<CR>
nnoremap <leader>gss <cmd>lua require('telescope.custom').my_git_status()<CR>
"nnoremap <leader>gss <cmd>CocCommand fzf-preview.GitStatus<CR>
nnoremap <leader>gsh <cmd>Telescope git_stash<CR>
"nnoremap <leader>gsc <cmd>CocCommand fzf-preview.GitStashes<CR>
"nnoremap <leader>iss <cmd>! glab issue list<CR>
" Copy into temp file
vmap <leader>y :w! /tmp/vimtmp<CR>
" Read from temp file
nmap <leader>p :r! cat /tmp/vimtmp<CR>
" Copy filename + line number into clipboard
nmap <leader>oo :call setreg('+', expand("%:h") . "/" . expand("%:t") . "#L" . line("."))<CR>
nmap <leader>xx :%!xxd<CR>
nnoremap <Leader>n :noh<CR>
colorscheme space-vim-dark
hi Normal ctermbg=NONE guibg=NONE
hi LineNr ctermbg=NONE guibg=NONE
hi SignColumn ctermbg=NONE guibg=NONE
hi Comment guifg=#5C6370 ctermfg=59
" Load custom telescope modification
lua require('telescope.custom')
" Load telescope-coc extension
lua require('telescope').load_extension('coc')