-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ideavimrc
executable file
·270 lines (208 loc) · 7.55 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
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
" Base settings
"" ========================================================
let mapleader = " "
set number
set relativenumber
set scrolloff=999
set showmode
set showcmd
set incsearch
" set hlsearch
set ignorecase
set smartcase
set clipboard+=unnamed
" Paste from global
nnoremap <leader>p "+p
xnoremap <leader>p "+p
" Copy into global
nnoremap <leader>y "+y
xnoremap <leader>y "+y
set visualbell
" Plugins
"" ========================================================
set idearefactormode=keep
" set sneak
set surround
set ideajoin
set highlightedyank
set NERDTree
let g:NERDTreeMapActivateNode='l'
let g:NERDTreeMapJumpParent='h'
set easymotion
let g:EasyMotion_do_mapping = 0
set notimeout
set quickscope
" Harpoon
nmap <leader>; :action ShowHarpoon<CR>
nmap <leader>a :action AddToHarpoon<cr>
nmap <leader>1 :action GotoHarpoon1<cr>
nmap <leader>2 :action GotoHarpoon2<cr>
nmap <leader>3 :action GotoHarpoon3<cr>
nmap <leader>4 :action GotoHarpoon4<cr>
nmap <leader>5 :action GotoHarpoon5<cr>
"" Key mappings
"" ========================================================
" CamelCase word navigation
map <C-w> [w
map <C-e> ]w
map <C-b> [b
" Enter/shift-enter
noremap <Esc> <nop>
nmap <S-Enter> O<Esc>
nmap <CR> o<Esc>
" Move line up/down
nnoremap <A-j> :m +1<CR>
nnoremap <A-k> :m -2<CR>
inoremap <A-j> <Esc>:m +1<CR>gi
inoremap <A-k> <Esc>:m -2<CR>gi
" Quick escape in insert mode
inoremap jk <Esc>
" Tab navigation
nnoremap <A-l> :tabnext<CR>
nnoremap <A-h> :tabprev<CR>
" Pane navigation
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
nnoremap <C-k> <C-w>k
nnoremap <C-j> <C-w>j
" Jump between methods
map [[ <Action>(MethodUp)
map ]] <Action>(MethodDown)
" Easy visual indentation
vnoremap < <gv
vnoremap > >gv
" Execute macro saved in 'q' register
nnoremap qj @q
" Popup navigation
" nnoremap <C-j> <Action>(PopupMenu-selectNext)
" nnoremap <C-k> <Action>(PopupMenu-selectPrev)
"^$ The symbol is too hard to press
map gh ^
map gl $
"" Leader commands
"" ========================================================
" Scrolling
" nmap <C-d> <C-d>zz
" nmap <C-u> <C-u>zz
" vmap <C-d> <C-d>zz
" vmap <C-u> <C-u>zz
" Visual around a whole function
" map vaf [[f{va{V
" Yank around a whole function
" map yaf [[f{va{Vy
" Change around method name
map cam vf)c<Esc>a
" Comment lines
map gc <action>(CommentByLineComment)
" Jump around with easymotion
map s <Plug>(easymotion-s)
" Open NERDTree (use q to exit)
map <leader>x :NERDTreeToggle<CR>
" Folding
map <leader>zc :action CollapseAllRegions<CR>
map <leader>zo :action ExpandAllRegions<CR>
" Window splits
map <leader>wv <Action>(SplitVertically)
map <leader>ws <Action>(SplitHorizontally)
map <leader>wu <Action>(Unsplit)
map <leader>wm <Action>(MoveEditorToOppositeTabGroup)
" Display options
map <leader>dd <action>(ToggleDistractionFreeMode)
map <leader>dz <action>(ToggleZenMode)
map <leader>df <action>(ToggleFullScreen)
" Actions
" map <leader>am <action>(ShowIntentionActions)
" map <leader>as <action>(SearchEverywhere)
map <leader>gg <action>(Generate)
map <leader>ra <action>(ChooseRunConfiguration)
map <leader>rt <action>(RunClass)
" File navigation
" search files
map <leader>sf <action>(GotoFile)
" search recent buffers
map <leader><leader> <Action>(RecentFiles)
" search grep
map <leader>sg <action>(FindInPath)
" Close active tab
map <leader>q <action>(CloseContent)
" Refactoring
map <leader>rn <Action>(RenameElement)
map <leader>rm <Action>(ExtractMethod)
map <leader>rv <Action>(IntroduceVariable)
map <leader>rf <Action>(IntroduceField)
map <leader>rs <Action>(ChangeSignature)
map <leader>rr <Action>(Refactorings.QuickListPopupAction)
" Go to code
nmap <leader>gd <Action>(GotoDeclaration)
nmap <leader>gy <Action>(GotoTypeDeclaration)
nmap <leader>gi <Action>(GotoImplementation)
nmap <leader>gu <Action>(ShowUsages)
nmap <leader>gt <Action>(GotoTest)
nmap <leader>gf <Action>(Back)
nmap <leader>gb <Action>(Forward)
" Git windows
map <leader>gc <Action>(CheckinProject)
map <leader>gs <Action>(ActivateVersionControlToolWindow)
map <leader>gb <Action>(Git.Branches)
" Errors
map <leader>en <Action>(GotoNextError)
map <leader>ep <Action>(GotoPreviousError)
" Format
map <leader>f <Action>(ReformatCode)
" Which-key settings
set which-key
let g:WhichKey_FontSize = "17"
let g:WhichKey_FontFamily = "JetBrains Mono"
let g:WhichKey_PrefixColor = "#55BADD"
let g:WhichKey_SortOrder = "by_key_prefix_first"
let g:WhichKeyDesc_leader = "<leader> Leader key"
let g:WhichKeyDesc_leader = "<leader>x Open file explorer"
let g:WhichKeyDesc_leader = "<leader>s Open services"
let g:WhichKeyDesc_easymotion = "s Jump with Easymotion"
let g:WhichKeyDesc_comment = "<leader>c Comment line"
let g:WhichKeyDesc_fold = "<leader>z Folding"
let g:WhichKeyDesc_fold_all = "<leader>zc Fold all regions"
let g:WhichKeyDesc_unfold_all = "<leader>zo Unfold all regions"
let g:WhichKeyDesc_window = "<leader>w Window splits"
let g:WhichKeyDesc_window_split_vertically = "<leader>wv Split vertically"
let g:WhichKeyDesc_window_split_horizontally = "<leader>wh Split horizontally"
let g:WhichKeyDesc_window_split_unsplit = "<leader>wu Unsplit"
let g:WhichKeyDesc_window_split_move_editor = "<leader>wm Move editor to opposite tab group"
let g:WhichKeyDesc_display = "<leader>d Display options"
let g:WhichKeyDesc_zen_mode = "<leader>dz Toggle Zen mode"
let g:WhichKeyDesc_df_mode = "<leader>dd Toggle Distraction-Free mode"
let g:WhichKeyDesc_fullscreen = "<leader>df Toggle full screen"
let g:WhichKeyDesc_action= "<leader>a Actions"
let g:WhichKeyDesc_action_context_menu = "<leader>am Open context menu"
let g:WhichKeyDesc_action_search = "<leader>as Open command modal"
let g:WhichKeyDesc_file_quickLook = "<leader><leader> Recent files"
let g:WhichKeyDesc_file_nav = "<leader>f File navigation"
let g:WhichKeyDesc_file_nav_goto_file = "<leader>ff Go to file"
let g:WhichKeyDesc_file_nav_goto_content = "<leader>fc Search for file content"
let g:WhichKeyDesc_file_nav_show_recent_files = "<leader>fr Show recent files"
let g:WhichKeyDesc_file_nav_show_recent_locations = "<leader>fl Show recent locations"
let g:WhichKeyDesc_close_tab = "<leader>q Close active tab"
let g:WhichKeyDesc_format = "<leader>f Format"
let g:WhichKeyDesc_refactoring = "<leader>r Refactoring menu"
let g:WhichKeyDesc_refactoring_rename = "<leader>rn Rename element"
let g:WhichKeyDesc_refactoring_method = "<leader>rm Extract method"
let g:WhichKeyDesc_refactoring_variable = "<leader>rv Introduce variable"
let g:WhichKeyDesc_refactoring_field = "<leader>rf Introduce field"
let g:WhichKeyDesc_refactoring_signature = "<leader>rs Change signature"
let g:WhichKeyDesc_refactoring_all = "<leader>rr Open refactorings list"
let g:WhichKeyDesc_refactoring_generate = "<leader>rg Generate"
let g:WhichKeyDesc_goto = "<leader>g Go to X"
let g:WhichKeyDesc_goto_declaration = "<leader>gd Go to Definition"
let g:WhichKeyDesc_goto_type_declaration = "<leader>gy Go to Type Definition"
let g:WhichKeyDesc_goto_implementation = "<leader>gi Go to Implementation"
let g:WhichKeyDesc_goto_usages = "<leader>gu Go to Usages"
let g:WhichKeyDesc_goto_test = "<leader>gt Go to Test"
let g:WhichKeyDesc_goto_back = "<leader>gb Go Back"
let g:WhichKeyDesc_goto_forward = "<leader>gf Go Forward"
let g:WhichKeyDesc_git = "<leader>g Git operations"
let g:WhichKeyDesc_git_commit = "<leader>gc Open Git commit dialog"
let g:WhichKeyDesc_git_status = "<leader>gs Open Git status dialog"
let g:WhichKeyDesc_git_branches = "<leader>gb Open Git branches list"
let g:WhichKeyDesc_errors = "<leader>e Error navigation"
let g:WhichKeyDesc_errors_next = "<leader>en Go to next error in solution"
let g:WhichKeyDesc_errors_prev = "<leader>ep Go to previous error in solution"