-
Notifications
You must be signed in to change notification settings - Fork 3
/
ideavimrc
210 lines (171 loc) · 4.93 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
set ignorecase
set clipboard+=unnamed
" set keep-english-in-normal
" 回到insert模式时恢复输入法
set keep-english-in-normal-and-restore-in-insert
set hlsearch
set incsearch
set smartcase
" set which-key
set timeoutlen=10000
" plugins
set surround
set commentary
set multiple-cursors
set argtextobj
set textobj-entire
set textobj-indent
set ReplaceWithRegister
set highlightedyank
set exchange
set ideajoin
set ideamarks
set NERDTree
Plug 'easymotion/vim-easymotion'
let g:EasyMotion_do_mapping=0
set easymotion
nmap s <Plug>(easymotion-s)
let mapleader=","
let g:WhichKeyDesc_windows="<leader>w Windows"
nmap yp <Action>(CopyReference)
" ReplaceWithRegister
nmap gr <Plug>ReplaceWithRegisterOperator
nmap grr <Plug>ReplaceWithRegisterLine
xmap gr <Plug>ReplaceWithRegisterVisual
" 搜索
nmap <leader>fm :action RecentChangedFiles<CR>
nmap <leader>ff :action SearchEverywhere<CR>
nmap <leader>fr :action FindInPath<CR>
nmap <leader>fc :action GotoClass<CR>
nmap <leader>fb :action ShowBookmarks<CR>
nmap <leader>fw :w<cr>
nmap <leader>fe :NERDTreeFind<CR>
xmap < <gv
xmap > >gv
nnoremap * *<c-o>
" tab页
nmap <silent> <leader>tn :action NewScratchFile<cr>
nmap <learer>tr :action ReopenClosedTab<CR>
nmap <leader>to <Action>(CloseAllEditorsButActive)
nmap <silent> <leader>1 1gt
nmap <silent> <leader>2 2gt
nmap <silent> <leader>3 3gt
nmap <silent> <leader>4 4gt
nmap <silent> <leader>5 5gt
nmap <silent> <leader>6 6gt
nmap <silent> <leader>7 7gt
nmap <silent> <leader>8 8gt
nmap <silent> <leader>9 9gt
nmap <silent> <left> <Action>(PreviousTab)
nmap <silent> <right> <Action>(NextTab)
nmap <leader>i <Action>(ActivateStructureToolWindow)
nmap <leader>q :action CloseContent<CR>
" nmap <leader>dr <Action>(Debugger.ReloadFile)
nmap <leader>d <Action>(ActivateStructureToolWindow)
nmap <leader>n :noh<cr>
nmap <leader>vs <Action>(IdeaVim.ReloadVimRc.reload)
nmap <leader>vc :set ic!<cr>
nmap <leader>vw <Action>(EditorToggleUseSoftWraps)
nmap <leader>e :NERDTreeToggle<CR>
map <leader>ss :action $EditorTranslateAction<CR>
map <leader>sa :action $EditorTranslateAction<CR>
map <leader>sr :action $TranslateAndReplaceAction<CR>
nmap gu :action GotoSuperMethod<CR>
nmap gn :action GotoImplementation<CR>
nmap gy :action GotoTypeDeclaration<CR>
nmap gb :action ShowUsages<CR>
" code
map <leader>cf :action ReformatCode<CR>
map <leader>cr <Action>(RenameElement)
map <leader>cm <Action>(ChangeSignature)
map <leader>cg <Action>(Generate)
map <leader>ci :action Inline<CR>
map <leader>cc <Action>(ShowIntentionActions)
map <leader>ca <Action>(ShowErrorDescription)
" run
nmap <leader>rc :action CompileDirty<CR>
nmap <leader>rD :action Debug<CR>
nmap <leader>rd :action DebugClass<CR>
nmap <leader>rD :action Run<CR>
nmap <leader>rr :action RunClass<CR>
" other
nmap <leader><space> <Action>(ShowErrorDescription)
" windows multiple0-cursors key maps
nmap <c-n> <A-n>
xmap <c-n> <A-n>
xmap <c-x> <A-x>
xmap <c-p> <A-p>
" mac multiple0-cursors key maps
nmap <m-n> <A-n>
nmap <m-x> <A-x>
nmap <m-p> <A-p>
xmap <m-n> <A-n>
xmap <m-x> <A-x>
xmap <m-p> <A-p>
" history
sethandler <c-o> n-v:vim i:vim
sethandler <c-i> n-v:vim i:vim
nmap <c-o> <Action>(Back)
nmap <c-i> <Action>(Forward)
imap <m-p> <Action>(ParameterInfo)
imap <c-p> <Action>(ParameterInfo)
imap <A-p> <Action>(ParameterInfo)
" imap <c-k> <Action>(AcceptInlineCompletionAction)
nmap H ^
nmap L $
xmap H ^
xmap L $
omap H ^
omap L $
nmap Y ^y$
omap ij i"
omap aj a"
omap oj o"
xmap ij i"
xmap aj a"
xmap oj o"
imap <m-j> <c-n>
imap <m-k> <c-p>
noremap <leader>vv :e ~/.ideavimrc<CR>
" window keymapping
nmap <leader>ws :vsplit<CR>
nmap <leader>wS :split<CR>
nmap <c-h> <c-w>h
nmap <c-l> <c-w>l
nmap <c-j> <c-w>j
nmap <c-k> <c-w>j
" git
map <leader>gu <Action>(Vcs.RollbackChangedLines)
map <leader>gb <Action>(Annotate)
map <leader>gg <Action>(VcsShowCurrentChangeMarker)
map <leader>gv <Action>(Compare.SameVersion)
map <leader>gL <Action>(Vcs.ShowTabbedFileHistory)
map <leader>gl <Action>(Vcs.Show.Log)
xmap <leader>gl <Action>(Vcs.ShowHistoryForBlock)
nmap ma <Action>(ToggleBookmark)
nmap mA <Action>(ToggleBookmarkWithMnemonic)
nmap <leader>mc <Action>(CompileFile)
nmap <leader>mr <Action>(Debugger.ReloadFile)
nmap <leader>me :action EvaluateExpression<CR>
vmap <leader>me :action EvaluateExpression<CR>
" navicat
nmap [g <Action>(VcsShowPrevChangeMarker)
nmap ]g <Action>(VcsShowNextChangeMarker)
nmap [e :action GotoPreviousError<CR>
nmap ]e :action GotoNextError<CR>
" templates
vnoremap <c-j> <esc>:action NextTemplateVariable<CR>i
vnoremap <c-k> <esc>:action PreviousTemplateVariable<CR>i
inoremap <C-j> <c-o>:action NextTemplateVariable<CR>i
inoremap <C-k> <c-o>:action PreviousTemplateVariable<CR>i
imap <c-n> <Action>(CodeCompletion)
let g:NERDTreeMapActivateNode='l'
let g:NERDTreeMapCloseDir='h'
let g:NERDTreeMapToggleZoom='z'
" debug
nmap <F10> <Action>(ToggleLineBreakpoint)
nmap <S-F9> <Action>(RunToCursor)
nmap <F12> <Action>(Stop)
" visual select
xmap v <Action>(EditorSelectWord)
xmap V <Action>(EditorUnSelectWord)