-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ideavimrc
267 lines (217 loc) · 7.11 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
" Use vim, not vi api
set nocompatible " be iMproved, required
filetype off " required
" set :RltvNmbr
" Switch syntax highlighting on, when the terminal has colors
set noswapfile
filetype plugin on
enoremap <SPACE> <Nop>
let mapleader=" "
" set clipboard =unnamed
" set clipboard =ideaput
nnoremap <Leader>ev :e ~/.ideavimrc<CR>
map <Leader>sv :source ~/.ideavimrc<CR>
nnoremap <C-G> :action Annotate<CR>
nnoremap <Leader><Leader> @:
nnoremap <Leader>ss :action ShowSettings<CR>
nnoremap <Leader>ir :action IdeaVim.ReloadVimRc.reload<CR>
nnoremap <Leader>id :action ToggleDistractionFreeMode<CR>
nnoremap <Leader>it :action ActivateTerminalToolWindow<CR>
nnoremap <Leader>im :action MoveEditorToOppositeTabGroup<CR>
nnoremap <Leader>il :action RecentLocations<CR>
nnoremap <s-TAB> :action PreviousTab<CR>
nnoremap <TAB> :action NextTab<CR>
" Collapse/ Open
nnoremap zc :action CollapseRegion<CR>
nnoremap zo :action ExpandRegion<CR>
nnoremap zC :action CollapseAllRegions<CR>
nnoremap zO :action ExpandAllRegions<CR>
" Errors
nnoremap gn :action GotoNextError<CR>
nnoremap gp :action GotoPreviousError<CR>
" Navigation
nnoremap <Leader>ff :action SearchEverywhere<CR>
nnoremap <Leader>fu :action FindUsages<CR>
nnoremap <Leader>fh :action CallHierarchy<CR>
nnoremap <Leader>fb :action ShowNavBar<CR>
nnoremap <Leader>fr :action RecentFiles<CR>
nnoremap <Leader>fg :action FindInPath<CR>
nnoremap <Leader>fs :action FileStructurePopup<CR>
nnoremap <Leader>fn :action FileMenu<CR>
" Method
nnoremap <Leader>mu :action MethodUp<CR>
nnoremap <Leader>md :action MethodDown<CR>
" Editors
nnoremap <Leader>ex :action CloseAllEditorsButActive<CR>
nnoremap <Leader>eu :action CloseAllUnmodifiedEditors<CR>
nnoremap gs :action GotoSymbol<CR>
nnoremap gd :action GotoDeclaration<CR>
nnoremap gb :action Back<CR>
nnoremap gf :action Forward<CR>
nnoremap gi :action GotoImplementation<CR>
nnoremap gs :action GotoSuperMethod<CR>
nnoremap gt :action GotoTest<CR>
"nnoremap gc :action GotoClass<CR>
nnoremap <Leader>sb :action ShowBookmarks<CR>
" Git
nmap [c <Action>(VcsShowPrevChangeMarker)
nmap ]c <Action>(VcsShowNextChangeMarker)
" Code formatting
nnoremap <Leader>ci :action OptimizeImports<CR>
nnoremap <Leader>cq :action QuickActions<CR>
nnoremap <Leader>cr :action ReformatCode<CR>
" Debug
nnoremap <Leader>db :action ToggleLineBreakpoint<CR>
nnoremap <Leader>dv :action ViewBreakpoints<CR>
nnoremap <Leader>dk :action EvaluateExpression<CR>
" Tools
nnoremap <Leader>tt :action HideAllWindows<CR>
nnoremap <Leader>te :action ActivateTerminalToolWindow<CR>
nnoremap <Leader>ta :action HideActiveWindow<CR>
nnoremap <Leader>ts :action HideSideWindows<CR>
" Search and replace
nmap gr <Action>(RenameElement)
map // /<C-R>/
nnoremap <Leader>r *``cgn
nnoremap <Leader>R :%s/<C-R><C-W>/
imap
" File
nnoremap <Leader>bd :action CloseEditor<CR>
nmap <Leader>new :action NewFile<CR>
" IntelliJ native find and replace
inoremap <C-f> <Esc>:action Find<CR>
inoremap <C-r> <Esc>:action Replace<CR>
" Run config
nmap <Leader>rr :action Run<CR>
nmap <Leader>rc :action ChooseRunConfiguration<CR>
" Plugins
Plug 'preservim/nerdtree'
" Plug 'terryma/vim-multiple-cursors'
Plug 'tpope/vim-commentary'
" NERDTree shortcuts
set NERDTree
nmap <Leader>nt :NERDTreeToggle<CR>
" NOt working"
nmap <Leader>nf :NERDTreeFind<CR>
" ideavim remaps
nmap <C-o> <Action>(Back)
nmap <C-i> <Action>(Forward)
" nmap ; ` - This is used for idea bookmarks
" Opens new terminal
" nnoremap <leader>ik :action Terminal.OpenInTerminal<CR>
" InCRemental searching (search as you type)
set incsearch
set smarttab
set shiftroun
" Highlight search matches
set hlsearch
" Turn word wrap off
set nowrap
" Allow backspace to delete end of line, indent and start of line characters
set backspace=indent,eol,start
" Convert tabs to spaces
set expandtab
" Turn on line numbers
set relativenumber
" UTF encoding
set encoding=utf-8
" Use sustem clipboard
" https://stackoverflow.com/questions/8134647/copy-and-paste-in-vim-via-keyboard-between-different-mac-terminals
" set clipboard =unnamedplus
" Don't show intro
" set shortmess =I
set nu
set mouse=a
set ignorecase
" Overrides ignorecase if pattern contains upcase
set smartcase
" Shift to the next round tab stop.
set autoindent
set autowrite
set autoread
" CUSTOM MAPPINGS
set hidden
" set undofile
function! NumberToggle()
if(&relativenumber == 1)
set norelativenumber
else
set relativenumber
endif
endfunc
" The Leader keys
nnoremap <Leader>nn :call NumberToggle()<CR>
" Source files and edit rc
nmap <Leader>q :q<CR>
nmap <Leader>w :w<CR>
" Copy and paste
map <Leader>p "+p
map <Leader>P "+P
map <Leader>y "+y
nmap Y :%y <CR>
" Format
nnoremap <Leader>= gg=G``
" Motions
noremap J 10j
noremap K 10k
nnoremap <silent> <Leader>no :<c-u>set hlsearch!<bar>set hlsearch?<CR>
" Splits
nmap <Leader>j :split<CR>
nnoremap <Leader>k :vsplit<CR>
nnoremap <Leader>us :action Unsplit<CR>
nnoremap <Leader>mv :action MoveEditorToOppositeTabGroup<CR>
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
nnoremap <C-H> <C-W>h
" Bookmarks
nnoremap <Leader>ba :action ToggleBookmarkA<CR>
nnoremap <Leader>bb :action ToggleBookmarkB<CR>
nnoremap <Leader>bc :action ToggleBookmarkC<CR>
nnoremap <Leader>be :action ToggleBookmarkE<CR>
nnoremap <Leader>bf :action ToggleBookmarkF<CR>
nnoremap <Leader>bg :action ToggleBookmarkG<CR>
nnoremap <Leader>bh :action ToggleBookmarkH<CR>
nnoremap <Leader>bi :action ToggleBookmarkI<CR>
nnoremap <Leader>bj :action ToggleBookmarkJ<CR>
nnoremap <Leader>bk :action ToggleBookmarkK<CR>
nnoremap <Leader>bl :action ToggleBookmarkL<CR>
nnoremap <Leader>bm :action ToggleBookmarkM<CR>
nnoremap <Leader>bn :action ToggleBookmarkN<CR>
nnoremap <Leader>bo :action ToggleBookmarkO<CR>
nnoremap <Leader>bp :action ToggleBookmarkP<CR>
nnoremap <Leader>bq :action ToggleBookmarkQ<CR>
nnoremap <Leader>br :action ToggleBookmarkR<CR>
nnoremap <Leader>bs :action ToggleBookmarkS<CR>
nnoremap <Leader>bt :action ToggleBookmarkT<CR>
nnoremap <Leader>bu :action ToggleBookmarkU<CR>
nnoremap <Leader>bv :action ToggleBookmarkV<CR>
nnoremap <Leader>bw :action ToggleBookmarkW<CR>
nnoremap <Leader>bx :action ToggleBookmarkX<CR>
nnoremap <Leader>by :action ToggleBookmarkY<CR>
nnoremap <Leader>bz :action ToggleBookmarkZ<CR>
nnoremap ;a :action GotoBookmarkA<CR>
nnoremap ;b :action GotoBookmarkB<CR>
nnoremap ;c :action GotoBookmarkC<CR>
nnoremap ;e :action GotoBookmarkE<CR>
nnoremap ;f :action GotoBookmarkF<CR>
nnoremap ;g :action GotoBookmarkG<CR>
nnoremap ;h :action GotoBookmarkH<CR>
nnoremap ;i :action GotoBookmarkI<CR>
nnoremap ;j :action GotoBookmarkJ<CR>
nnoremap ;k :action GotoBookmarkK<CR>
nnoremap ;l :action GotoBookmarkL<CR>
nnoremap ;m :action GotoBookmarkM<CR>
nnoremap ;n :action GotoBookmarkN<CR>
nnoremap ;o :action GotoBookmarkO<CR>
nnoremap ;p :action GotoBookmarkP<CR>
nnoremap ;q :action GotoBookmarkQ<CR>
nnoremap ;r :action GotoBookmarkR<CR>
nnoremap ;s :action GotoBookmarkS<CR>
nnoremap ;t :action GotoBookmarkT<CR>
nnoremap ;u :action GotoBookmarkU<CR>
nnoremap ;v :action GotoBookmarkV<CR>
nnoremap ;w :action GotoBookmarkW<CR>
nnoremap ;x :action GotoBookmarkX<CR>
nnoremap ;y :action GotoBookmarkY<CR>
nnoremap ;z :action GotoBookmarkZ<CR>