-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_vimrc
155 lines (115 loc) · 3.44 KB
/
dot_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
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
Plug 'junegunn/vim-easy-align'
Plug 'SirVer/ultisnips', { 'tag': '3.2' } | Plug 'honza/vim-snippets'
" On-demand loading
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
" A plugin of NERDTree showing git status
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'ryanoasis/vim-devicons'
" Using a non-master branch
"Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go'
" Plugin outside ~/.vim/plugged with post-update hook
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" Youcompleteme
Plug 'valloric/youcompleteme'
Plug 'vim-scripts/c.vim'
Plug 'vim-scripts/bash-support.vim'
Plug 'tpope/vim-surround'
Plug 'scrooloose/syntastic'
let g:syntastic_go_checkers = ['go', 'golint', 'errcheck']
Plug 'majutsushi/tagbar'
Plug 'bling/vim-airline'
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-fugitive'
Plug 'scrooloose/nerdcommenter'
Plug 'airblade/vim-gitgutter'
Plug 'yedamao/vim-dict', { 'branch': 'main', 'do': 'go install github.com/yedamao/dict@latest' }
Plug 'tpope/vim-obsession'
Plug 'madox2/vim-ai'
Plug 'jpalardy/vim-slime'
Plug 'github/copilot.vim'
Plug 'christoomey/vim-tmux-navigator'
Plug 'ianding1/leetcode.vim'
" Initialize plugin system
call plug#end()
let mapleader = ","
" Plugin Settings --- {{{
let g:slime_target = "tmux"
let g:slime_default_config = {"socket_name": "default", "target_pane": "{last}"}
let g:airline#extensions#obsession#enabled = 1
let g:leetcode_solution_filetype="golang"
let g:leetcode_browser="chrome"
let g:UltiSnipsExpandTrigger="<c-j>"
" Youcompleteme settings
" share gopls with vim-go
let g:ycm_gopls_args = ['-remote=auto']
let g:ycm_gopls_binary_path = [$GOPATH.'/gopls']
" Tagbar settings
" support openapi
let g:tagbar_type_yaml = {
\ 'ctagstype': 'openapi',
\ 'kinds': [
\ 'p:paths',
\ 'd:schema',
\ 'P:parameter',
\ 'R:response',
\ ],
\}
" go debug settings
nnoremap <leader>ds :GoDebugStart<cr>
nnoremap <leader>dp :GoDebugStop<cr>
nnoremap <leader>db :GoDebugBreakpoint<cr>
let g:go_debug_mappings = {
\ '(go-debug-continue)': {'key': 'c', 'arguments': '<nowait>'},
\ '(go-debug-stop)': {'key': 'q'},
\ '(go-debug-next)': {'key': 'n', 'arguments': '<nowait>'},
\ '(go-debug-step)': {'key': 's'},
\}
let g:go_debug_windows = {
\ 'vars': 'leftabove 60vnew',
\ 'stack': 'leftabove 20new',
\ 'goroutines': 'botright 10new',
\}
" }}}
" Basic Settings --- {{{
set relativenumber
set number
set cursorline
" show existing tab with 2 spaces width
set tabstop=2
" when indenting with '>', use 2 spaces width
set shiftwidth=2
" On pressing tab, insert 4 spaces
set expandtab
set encoding=UTF-8
syntax on
filetype plugin indent on
" }}}
" Mappings --- {{{
" jk to exit insert mode
inoremap <esc> <nop>
inoremap jk <esc>
" search
nnoremap <leader>f :Files<cr>
nnoremap <leader>g :exe "Ag " . expand("<cword>")<cr>
" }}}
" Edit and reload $MYVIMRC --- {{{
nnoremap <leader>ev :vsplit $MYVIMRC<cr>
augroup reloadVimrcGroup
autocmd!
autocmd BufWrite $MYVIMRC :echom "$MYVIMRC changed!"
autocmd BufWrite $MYVIMRC :source $MYVIMRC
augroup END
" }}}
" Vimscript file settings --- {{{
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" }}}