-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathideavimrc
121 lines (95 loc) · 3.22 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
"" .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
" Source your .vimrc
source ~/.ide-vimrc
"" -- 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'
"" -- 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)
" ================================
" bewlow is my own settings
" ================================
" move to errors
nmap [q <Action>(GotoPreviousError)
nmap ]q <Action>(GotoNextError)
" show hover info
nmap <Leader>k <Action>(ShowHoverInfo)
" map default completion to vim shorcut
"imap <C-n> <ESC>:action HippieCompletion<CR>a
"imap <C-p> <ESC>:action HippieBackwardCompletion<CR>a
set surround
" reload ideavimrc
nmap <Leader>sv :<C-u>source ~/.ideavimrc<CR>
"
" search
" nnoremap / :<C-u>action Find<CR>
" code jump
nnoremap <C-o> :<C-u>action Back<CR>
nnoremap <C-i> :<C-u>action Forward<CR>
nnoremap <C-S-o> <C-o>
nnoremap <C-S-i> <C-i>
" method definition
nnoremap [m :<C-u>action MethodUp<CR>
nnoremap ]m :<C-u>action MethodDown<CR>
" vcs
nmap [c <Action>(VcsShowPrevChangeMarker)
nmap ]c <Action>(VcsShowNextChangeMarker)
nmap gi <Action>(GotoImplementation)
nmap gu <Action>(FindUsages)
nmap <Leader>gd <Action>(GotoDeclaration)
nmap <Leader>gt <Action>(GotoTypeDeclaration)
nmap <Leader>gs <Action>(GotoSuperMethod)
nmap <Leader>ts <Action>(GotoTest)
" search IDE Actions
nmap <Leader>fa <Action>(GotoAction)
" search everywhere alias of Shift*2
nmap <Leader>ff <Action>(SearchEverywhere)
" find in files
nmap <Leader>fp <Action>(FindInPath)
" tab
nmap <Leader>q <Action>(CloseContent)
nmap <Leader>Q <Action>(ReopenCloedTab)
nmap <Leader>bc <Action>(CloseAllEditorsButActive)
nmap <Leader>bC <Action>(CloseAllEditors)
" window
" alias of cmd+1
nmap <Leader>e <Action>(ActivateProjectToolWindow)
nmap <Leader>la <Action>(ShowIntentionActions)
nmap <Leader>ls <Action>(ActivateStructureToolWindow)
nmap <Leader>ps <Action>(FileStructurePopup)
nmap <Leader>o <Action>(EditorEscape)
nmap <Leader>th <Action>(ActivateTerminalToolWindow)
nmap <Leader>H <Action>(HideAllWindows)
" file edit
nmap <Leader>G <Action>(Generate)
nmap <Leader>gn <Action>(NewClass)
" comment
nmap <Leader>/ <Action>(CommentByLineComment)
" refactor
nmap <Leader>cr <Action>(RenameElement)
nmap <Leader>cs <Action>(ChangeSignature)
nmap <Leader>cts <Action>(ChangeTypeSignature)
nmap <Leader>= <Action>(ReformatCode)
nmap [b <Action>(PreviousTab)
nmap ]b <Action>(NextTab)
" jumptochange
nmap <Leader>g; <Action>(JumpToLastChange)
nmap <Leader>g, <Action>(JumpToNextChange)