-
Notifications
You must be signed in to change notification settings - Fork 0
/
ideavimrc
228 lines (206 loc) · 6.39 KB
/
ideavimrc
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
"leader key 空格不执行任何操作"
nnoremap <SPACE> <Nop>
let mapleader = " "
set hlsearch
set incsearch
set smartcase
set ignorecase
set showmode
set scrolloff=5 "滚动时保持几行可见"
set relativenumber " 显示从当前行数的前后行数
" Idea specific settings ------------------
set ideajoin "eg: join comment auto remove // etc."
set ideaput "default on. enable native IJ paste
set idearefactormode=visual
set visualbell
" plugins
set ideamarks
"set easymotion
set surround
set argtextobj
set multiple-cursors
set multicursor
set highlightedyank
set textobj-entire
"set keep-english-in-normal
set NERDTree
set ReplaceWithRegister
set repeat
set exchange
set quickscope
set vim-paragraph-motion
set matchit
set commentary
set textobj-indent
" handler"
sethandler <C-6> a:vim
sethandler <C-S-6> a:vim
sethandler <C-A> a:vim
sethandler <C-B> a:ide
sethandler <C-D> a:vim
sethandler <C-E> a:vim
sethandler <C-F> a:ide
sethandler <C-G> a:ide
sethandler <C-H> a:vim
sethandler <C-I> a:vim
sethandler <C-J> a:vim
sethandler <C-K> a:vim
sethandler <C-L> a:vim
sethandler <C-N> a:vim
sethandler <C-O> a:vim
sethandler <C-P> a:vim
sethandler <C-R> a:vim
sethandler <C-S> a:vim
sethandler <C-T> a:ide
sethandler <C-V> a:ide
sethandler <C-W> a:vim
" multiple-cursors
map <C-g> <Plug>NextOccurrence
" xmap <C-g> <Plug>NextWholeOccurrence
nmap <C-x> <Plug>SkipOccurrence
xmap <C-x> <Plug>SkipOccurrence
"nmap <C-p> <Plug>RemoveOccurrence
"xmap <C-p> <Plug>RemoveOccurrence
nmap <M-C-g> <Plug>AllWholeOccurrences
xmap <M-C-g> <Plug>AllWholeOccurrences
" clear search highlight
nnoremap <Esc> <Esc>:noh<CR>
" plugin settings
map s <Action>(AceAction)
nmap S ysiw
let g:argtextobj_pairs="(:),{:},<:>,[:]"
" edit
inoremap <C-d> <Delete>
" Make Y behave the same way as D and C.
nnoremap Y y$
nnoremap vv V
vnoremap p P
" select last change text"
nnoremap gp `[v`]
" Increase or decrease numbers"
nnoremap + <C-a>
nnoremap - <C-x>
" goto last edit position"
nnoremap gI gi
" clipboard"
" 将复制寄存器中的内容放置到粘贴寄存器中"
map <leader>yo :let @+ = @0<CR>
" move
inoremap <C-a> <Esc>I
inoremap <C-e> <End>
" ^$ The symbol is too hard to press
nnoremap <C-a> ^
nnoremap <C-e> $
vnoremap <C-a> ^
vnoremap <C-e> $
vnoremap H ^
vnoremap L $
nnoremap t F
" view
nnoremap gf :action FileStructurePopup<CR>
nnoremap gl :action GotoUrlAction<CR>
nnoremap <leader>e :action SelectInProjectView<CR>
nnoremap <leader>x :action CloseContent<CR>
nnoremap <leader>ha :action HideAllWindows<CR>
nnoremap <leader>lw :action JumpToLastWindow<CR>
nnoremap <leader>cl :action ConsoleView.ClearAll<CR>
nnoremap <leader>a :action GotoAction<CR>
nnoremap <leader>f :action GotoFile<CR>
nnoremap <leader>ss :action GotoSymbol<CR>
nnoremap <leader><space> :action GotoSymbol<CR>
vnoremap <leader><space> :action GotoSymbol<CR>
nnoremap q :action ShowIntentionActions<CR>
vnoremap q :action ShowIntentionActions<CR>
" goto/navigate
nnoremap g; :action JumpToLastChange<CR>
nnoremap gi :action GotoImplementation<CR>
nnoremap gd :action GotoDeclaration<CR>
nnoremap gt :action GotoTypeDeclaration<CR>
nnoremap ga :action Annotate<CR>
nnoremap H :action PreviousTab<CR>
nnoremap L :action NextTab<CR>
" nnoremap H :action Back<CR>
" nnoremap L :action Forward<CR>
vnoremap <C-O> <Esc>:action Back<CR>
vnoremap <C-I> <Esc>:action Forward<CR>
nnoremap <C-O> :action Back<CR>
nnoremap <C-I> :action Forward<CR>
nnoremap [e :action GotoPreviousError<cr>
nnoremap ]e :action GotoNextError<cr>
nnoremap <leader>se :action ShowErrorDescription<CR>
if &ide =~? 'DataGrip'
nnoremap [[ :action StatementUp<cr>
nnoremap ]] :action StatementDown<cr>
else
nnoremap [[ :action MethodUp<cr>
nnoremap ]] :action MethodDown<cr>
endif
" refactor
nnoremap R :action RenameElement<CR>
nnoremap <leader>uw :action Unwrap<CR>
" 需要到实现类中按此快捷键才能触发
nnoremap <leader>im :action ImplementMethods<CR>
nnoremap <leader>om :action OverrideMethods<CR>
inoremap <C-i> :action ImplementMethods<CR>
nnoremap <leader>sw :action SurroundWith<CR>
vnoremap <leader>sw :action SurroundWith<CR>
nnoremap <leader>cs :action ChangeSignature<CR>
nnoremap <leader>sd :action SafeDelete<CR>
nnoremap <A-j> :action MoveStatementDown<CR>
nnoremap <A-k> :action MoveStatementUp<CR>
vnoremap <A-j> :action MoveStatementDown<CR>
vnoremap <A-k> :action MoveStatementUp<CR>
" code
nnoremap == :action ReformatCode<CR>
vnoremap = :action ReformatCode<CR>
nnoremap <leader>cr :action CopyReference<CR>
"mybatis sql log: restore sql"
vnoremap <leader>sq :action ar<CR>
" git"
nnoremap <leader>gg :action Git.Branches<CR>
noremap <leader>go :action Vcs.QuickListPopupAction<CR>
noremap <leader>gf :action Git.Fetch<CR>
noremap <leader>gsl :action Vcs.Show.Log<CR>
nnoremap <leader>gss :action Git.Stash<CR>
nnoremap <leader>gsu :action Git.Unstash<CR>
nnoremap <leader>gsh :action Vcs.ShowTabbedFileHistory<CR>
nnoremap <leader>glh :action LocalHistory.ShowHistory<CR>
" run
nnoremap <Leader>ru :action Run<CR>
" 重新运行控制台上次执行的程序(如果上一次是jrebel debug运行的, 这一次也会jrebel debug运行)"
nnoremap <Leader>re :action Rerun<CR>
" jrebel debug 工具栏选择的程序"
nnoremap <Leader>rj :action JRebel Debug<CR>
nnoremap <Leader>ra :action JRebel Debug<CR>
" 在当前上下文 debug 当前程序"
nnoremap <Leader>rd :action DebugClass<CR>
" 在当前上下文运行. eg: run http, run main, 光标需要定位到运行的位置"
nnoremap <Leader>rr :action RunClass<CR>
nnoremap <Leader>` :action RunAnything<CR>
vnoremap <Leader>` :action RunAnything<CR>
" debug
nnoremap <Leader>dd :action ChooseDebugConfiguration<CR>
nnoremap <Leader>db :action ToggleLineBreakpoint<CR>
" 单步"
nnoremap <Leader>ds :action StepOver<CR>
" resume "
nnoremap <Leader>dr :action Resume<CR>
"Run to Cursor "
nnoremap <Leader>dc :action RunToCursor<CR>
" Step Out "
nnoremap <Leader>do :action StepOut<CR>
" Step Into "
nnoremap <Leader>di :action SmartStepInto<CR>
" 跳转到执行点"
nnoremap <Leader>dg :action ShowExecutionPoint<CR>
nnoremap <Leader>dm :action XDebugger.MuteBreakpoints<CR>
nnoremap <Leader>dp :action Debugger.PopFrame<CR>
nnoremap <Leader>dt :action Debugger.ForceEarlyReturn<CR>
nnoremap <Leader>de :action EvaluateExpression<CR>
" datagrip"
nnoremap <Leader>rt :action DatabaseView.Refresh<CR>
" vim debug"
nnoremap <Leader>vt :action VimFindActionIdAction<CR>
nnoremap <Leader>va :action VimActions<CR>
"quit
nnoremap <Leader>qq :action CloseProject<CR>