-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ideavimrc
143 lines (125 loc) · 4.54 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
set clipboard=unnamedplus
set incsearch
set hlsearch
set ignorecase
set smartcase
set showmode
" Changing the leader key before loading plugins!
let mapleader = ' '
" noremap \ ,
" Easymotion
" nmap <leader><leader> <Plug>(easymotion-prefix)
" vmap <leader><leader> <Plug>(easymotion-prefix)
" IdeaVim specific
set clipboard+=ideaput
" https://github.com/JetBrains/ideavim/wiki/%60ideajoin%60-examples
set ideajoin
" Emulated Vim plugins
" https://github.com/JetBrains/ideavim/blob/master/doc/emulated-plugins.md
set easymotion
set surround
set multiple-cursors
set commentary
set ReplaceWithRegister
set argtextobj
set exchange
set textobj-entire
set highlightedyank
set NERDTree
let g:highlightedyank_highlight_duration = "200"
" Reread the configuration file
noremap \` :source ~/.ideavimrc<cr>
" Yank from cursor to end of line like 'C' and 'D'
nnoremap Y y$
" Clear the highlighting of search matches
nnoremap <c-l> :nohlsearch<cr>
" Live templates
inoremap <c-i> <c-o>:action InsertLiveTemplate<cr>
" Navigation
" Built-in jumping to previously visited locations works better
nnoremap <c-o> :action Back<cr>
nnoremap <c-i> :action Forward<cr>
" TOP ROW
nnoremap <leader>q :action QuickJavaDoc<cr>
nnoremap <leader>w :action RecentChangedFiles<cr>
nnoremap <leader>e :action RecentFiles<cr>
nnoremap <leader>E :action RecentLocations<cr>
nnoremap <leader>r :action RenameElement<cr>
nnoremap <leader>t :action GotoTest<cr>
nnoremap <leader>T :action GotoRelated<cr>
nnoremap <leader>u :action ShowUsages<cr>
nnoremap <leader>U :action FindUsages<cr>
nnoremap <leader>i :action GotoImplementation<cr>
nnoremap <leader>I :action QuickImplementations<cr>
nnoremap <leader>o :action GotoSuperMethod<cr>
nnoremap <leader>p :action FindInPath<cr>
nnoremap <leader>p :action FindInPath<cr>
vnoremap <leader>p :action FindInPath<cr>
nnoremap <leader>P :action ReplaceInPath<cr>
vnoremap <leader>P :action ReplaceInPath<cr>
" Open external tools groups window.
" nnoremap \e :action ExternalToolsGroup<cr>
" Open 'External Tools' group window.
nnoremap \e :action ExternalTools_External Tools<cr>
" Run luastyle external tool.
" nnoremap \e :action Tool_External Tools_luastyle<cr>
nnoremap \r :action Refactorings.QuickListPopupAction<cr>
nnoremap \y :action ShowUmlDiagramPopup<cr>
nnoremap \Y :action ShowUmlDiagram<cr>
nnoremap \i :action OptimizeImports<cr>
nnoremap \o :action ReformatCode<cr>
vnoremap \o :action ReformatCode<cr>
" MIDDLE ROW
nnoremap <leader>a :action GotoAction<cr>
nnoremap <leader>s :action GotoSymbol<cr>
vnoremap <leader>s :action GotoSymbol<cr>
nnoremap <leader>d :action Compare.SameVersion<cr>
" vnoremap <leader>d :action Compare.Selected<cr>
nnoremap <leader>f :action GotoFile<cr>
vnoremap <leader>f :action GotoFile<cr>
nnoremap <leader>g :action Annotate<cr>
nnoremap <leader>k :action CallHierarchy<cr>
nnoremap <leader>h :action TypeHierarchy<cr>
nnoremap <leader>j :action ActivateStructureToolWindow<cr>
nnoremap <leader>J :action FileStructurePopup<cr>
nnoremap \s :action SurroundWith<cr>
vnoremap \s :action SurroundWith<cr>
nnoremap \f :action Run<cr>
nnoremap \F :action ChooseRunConfiguration<cr>
nnoremap \d :action Debug<cr>
nnoremap \D :action ChooseDebugConfiguration<cr>
nnoremap \g :action Vcs.QuickListPopupAction<cr>
nnoremap \h :action Stop<cr>
" BOTTOM ROW
nnoremap <leader>z :action CopyPaths<cr>
nnoremap <leader>x :action CopyReference<cr>
nnoremap <leader>c :action GotoClass<cr>
vnoremap <leader>c :action GotoClass<cr>
nnoremap <leader>b :action ToggleLineBreakpoint<cr>
nnoremap <leader>B :action ViewBreakpoints<cr>
nnoremap <leader>n :action ActivateProjectToolWindow<cr>
nnoremap <leader>m :action ToggleBookmark<cr>
nnoremap <leader>M :action ShowBookmarks<cr>
nnoremap <leader>/ :action Find<cr>
vnoremap <leader>/ :action Find<cr>
nnoremap <leader>? :action Replace<cr>
vnoremap <leader>? :action Replace<cr>
nnoremap \c :action Resume<cr>
" UNIMPAIRED
nnoremap [<space> O<esc>j
nnoremap ]<space> o<esc>k
nnoremap [e :action MoveLineUp<cr>
nnoremap ]e :action MoveLineDown<cr>
nnoremap [r :action MoveStatementUp<cr>
nnoremap ]r :action MoveStatementDown<cr>
nnoremap [c :action VcsShowPrevChangeMarker<cr>
nnoremap ]c :action VcsShowNextChangeMarker<cr>
nnoremap ]l :action GotoNextError<cr>
nnoremap [l :action GotoPreviousError<cr>
vnoremap [u :action osmedile.intellij.stringmanip.URLEncodeAction<cr>
vnoremap ]u :action osmedile.intellij.stringmanip.URLDecodeAction<cr>
" Smart selection (not working)
" vnoremap + :action SmartSelect<cr>
" nnoremap + :action SmartSelect<cr>
" vnoremap - :action SmartUnSelect<cr>
" nnoremap - :action SmartUnSelect<cr>