-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdot_ideavimrc
202 lines (169 loc) · 6.8 KB
/
dot_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
set scrolloff=10
set number
set relativenumber
set showmode
set showcmd
set incsearch
set nohlsearch
set ignorecase
set visualbell
" Use system clipboard
set clipboard+=unnamedplus
let mapleader = " "
" plugins
set highlightedyank
set sneak
set nerdtree
set surround
" Easymotion settings
set easymotion
set notimeout
" Which-key settings
set which-key
let g:WhichKey_FontSize = 16
let g:WhichKey_CommandColor = "#41ead4"
let g:WhichKey_PrefixColor = "#f335b2"
let g:WhichKey_SortOrder = "by_key_prefix_first"
let g:WhichKeyDesc_leader = "<leader> Leader key"
"" Key mappings
"" ========================================================
inoremap jk <Esc>
" Tab navigation
nnoremap <A-n> :tabnext<CR>
nnoremap <A-p> :tabprev<CR>
" Pane navigation
nnoremap <A-h> <C-w>h
nnoremap <A-l> <C-w>l
nnoremap <A-k> <C-w>k
nnoremap <A-j> <C-w>j
" Jump between methods
nnoremap [[ <Action>(MethodUp)
nnoremap ]] <Action>(MethodDown)
" Easy visual indentation
vnoremap < <gv
vnoremap > >gv
" Execute macro saved in 'q' register
nnoremap qj @q
" Move up/down and center cursor on screen
nnoremap <C-u> <C-u>zz
nnoremap <C-d> <C-d>zz
nnoremap <C-b> <C-b>zz
nnoremap <C-f> <C-f>zz
nnoremap n nzzzv
nnoremap N Nzzzv
"jump to errors
nnoremap [d :action GotoPreviousError<cr>
nnoremap ]d :action GotoNextError<cr>
"" Leader commands
"" ========================================================
map <leader>vd <Action>(ToggleDistractionFreeMode)
map <leader>vt <Action>(ActivateTerminalToolWindow)
map <leader>ve <Action>(ActivateEditorToolWindow)
let g:WhichKeyDesc_views = "<leader>v Views"
let g:WhichKeyDesc_views_distraction_free = "<leader>vd Toggle distraction free mode"
let g:WhichKeyDesc_views_terminal = "<leader>vt Toggle terminal window"
let g:WhichKeyDesc_views_editor = "<leader>ve Toggle editor window"
" Jump around with easymotion
map <leader>j <Plug>(easymotion-s)
let g:WhichKeyDesc_easymotion = "<leader>j Jump with Easymotion"
" Open NERDTree (use q to exit)
map <leader>x :NERDTreeToggle<CR>
let g:WhichKeyDesc_leader = "<leader>x Open file explorer"
" Folding
map <leader>zc :action CollapseAllRegions<CR>
map <leader>zo :action ExpandAllRegions<CR>
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"
" Window splits
map <leader>wv <Action>(SplitVertically)
map <leader>ws <Action>(SplitHorizontally)
map <leader>wu <Action>(Unsplit)
map <leader>wm <Action>(MoveEditorToOppositeTabGroup)
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"
" Actions
map <leader>cc <action>(CommentByLineComment)
map <leader>ca <action>(ShowIntentionActions)
map <leader>cs <action>(SearchEverywhere)
map <leader>cf <action>(ReformatCode)
map <leader>co <action>(OptimizeImports)
let g:WhichKeyDesc_code= "<leader>c Code"
let g:WhichKeyDesc_code_comment = "<leader>cc Comment line"
let g:WhichKeyDesc_code_context_menu = "<leader>ca Code action"
let g:WhichKeyDesc_code_search = "<leader>cs command modal"
let g:WhichKeyDesc_code_format = "<leader>cf Format code"
let g:WhichKeyDesc_code_imports = "<leader>co Optimize imports"
" File navigation
map <leader>ff <action>(GotoFile)
map <leader>fr <action>(RecentFiles)
map <leader>fc <action>(FindInPath)
map <leader>fl <action>(RecentLocations)
map <leader>fs <action>(NewScratchFile)
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"
" Close active tab
map <leader>q <action>(CloseContent)
let g:WhichKeyDesc_close_tab = "<leader>q Close active tab"
" 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)
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"
" 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)
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"
" Git windows
map <leader>gc <Action>(CheckinProject)
map <leader>gs <Action>(ActivateVersionControlToolWindow)
map <leader>gb <Action>(Git.Branches)
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"
" Errors
map <leader>en <Action>(ReSharperGotoNextErrorInSolution)
map <leader>ep <Action>(ReSharperGotoPrevErrorInSolution)
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"
" Testing
map <leader>tt <Action>(RunClass)
map <leader>ts <Action>(Stop)
map <leader>td <Action>(DebugClass)
map <leader>tb <Action>(ToggleLineBreakpoint)
map <leader>ta <Action>(Run)
let g:WhichKeyDesc_test = "<leader>t Testing"
let g:WhichKeyDesc_test_run = "<leader>tt Run test"
let g:WhichKeyDesc_test_stop = "<leader>ts Stop tests"
let g:WhichKeyDesc_test_debug = "<leader>td Debug test"
let g:WhichKeyDesc_test_breakpoint = "<leader>tb Toggle breakpoint"
let g:WhichKeyDesc_test_all = "<leader>ta Run all tests"