-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ideavimrc
178 lines (134 loc) · 4.57 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
" .ideavimrc is a configuration file for IdeaVim plugin. It uses
" the same commands as the original .vimrc configuration.
" You can find a list of commands here: https://jb.gg/h38q75
" Find more examples here: https://jb.gg/share-ideavimrc
:set relativenumber
:set number
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" Do incremental searching.
set incsearch
" Don't use Ex mode, use Q for formatting.
map Q gq
" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins
" Highlight copied text
Plug 'machakann/vim-highlightedyank'
" Commentary plugin
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'preservim/nerdtree'
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
"" Map \r to the Reformat Code action
"map \r <Action>(ReformatCode)
"" Map <leader>d to start debug
"map <leader>d <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
"map \b <Action>(ToggleLineBreakpoint)
"" -- Custom key mappings --
"" https://www.youtube.com/watch?v=WwO18Ag_xno&ab_channel=IgorBabko
" leader key
let mapleader = ' '
" move to the next character occurrence
noremap ' ;
" redo
noremap U <C-r>
" map black whole register
noremap \ "_
" paste over without overwriting default register
xnoremap p P
" sync Vim clipboard with OS clipboard
set clipboard^=unnamed,unnamedplus
" jump between angle brackets
set matchpairs+=<:>
" smart line joining
set ideajoin
" open config
noremap <leader>cc :edit ~/.ideavimrc<cr>
" source config
noremap <leader>cs :source ~/.ideavimrc<cr>:nohlsearch<cr>
" highlight search results
set hlsearch
" remove search highlights
nnoremap <Esc> :nohlsearch<cr>
" case-insensitive search
set ignorecase
" enable case-sensitive search when uppercased letter is present
set smartcase
" search while typing
set incsearch
map <leader>tt :action ActivateTerminalToolWindow<CR>
map <leader>pp :action ActivateProjectToolWindow<CR>
" go to the left split
map <leader>wh <C-w>h
" go to the bottom split
map <leader>wj <C-w>j
" go to the top split
map <leader>wk <C-w>k
" go to the right split
map <leader>wl <C-w>l
map <leader>wv <Action>(SplitVertically)
map <leader>wb <Action>(SplitHorizontally)
map <leader>ww <Action>(Unsplit)
map <leader>wa <Action>(UnsplitAll)
map <leader>sc <Action>(GotoClass)
map <leader>sf <Action>(GotoFile)
map <leader>ss <Action>(GotoSymbol)
map <leader>sa <Action>(GotoAction)
map <leader>gd <Action>(GotoDeclaration)
map <leader>gy <Action>(GotoTypeDeclaration)
map <leader>gi <Action>(GotoImplementation)
map <leader>gt <Action>(GotoTest)
map <leader>gm <Action>(GotoSuperMethod)
map <leader>gl <Action>(GotoLine)
map <leader>ug <Action>(FindUsages)
map <leader>uu <Action>(ShowUsages)
map <leader>vs <Action>(ViewSource)
map <leader>im <Action>(QuickImplementations)
map <leader>td <Action>(QuickTypeDefinition)
map <leader>ti <Action>(ExpressionTypeInfo)
map <leader>sh <Action>(ShowHoverInfo)
map <leader>oo <Action>(FileStructurePopup)
map <S-f> <Action>(Find)
map <S-r> <Action>(Replace)
map <leader>ff <Action>(FindInPath)
map <leader>fr <Action>(ReplaceInPath)
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)
map <leader>aa <Action>(ShowIntentionActions)
map <leader>sw <Action>(SurroundWith)
map <S-space> <Action>(Generate)
map <S-k> <Action>(EditorDuplicateLines)
map <C-[> <Action>(EditorCompleteStatement)
map <leader>en <Action>(GotoNextError)
map <leader>ep <Action>(GotoPreviousError)
map <leader>lc <Action>(JumpToLastChange)
map <leader>ll <Action>(RecentLocations)
map <C-;> <Action>(RecentFiles)
map <S-k> <Action>(Forward)
map <S-l> <Action>(Back)
map <A-[> <Action>(MethodUp)
map <A-]> <Action>(MethodDown)
map <leader><leader> <Action>(ReformatCode)
map <leader>oi <Action>(OptimizeImports)
map <leader>ra <Action>(RearrangeCode)
map <C-j> <Action>(MoveLineDown)
map <C-k> <Action>(MoveLineUp)
map <C-i> <Action>(MoveStatementDown)
map <C-o> <Action>(MoveStatementUp)
map <leader>ca <Action>(CopyAbsolutePath)
map <leader>cn <Action>(CopyFileName)
map <leader>cp <Action>(CopyContentRootPath)
map <leader>fs <Action>(NewScratchFile)
map <leader>qq <Action>(CloseContent)
map <leader>qa <Action>(CloseAllEditors)
map <leader>nf <Action>(NewFile)
map <leader>nd <Action>(NewDir)
map <leader>re <Action>(RenameFile)
map <leader>of <Action>(OpenFile)
map <leader>ri <Action>(RestartIde)