-
Notifications
You must be signed in to change notification settings - Fork 1
/
.ideavimrc
99 lines (81 loc) · 2.7 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
" Use space as leader
let mapleader = ' '
" The timeout counts for all multikey bindings meaning it must be set to some
" reasonably high number as we otherwise time out...
set timeoutlen=500
set number
set incsearch hlsearch
set ignorecase smartcase
set clipboard=unnamed
set scrolloff=5
set showmode
set surround
inoremap kj <Esc>
" Refresh configuration
nnoremap <leader>hR :source ~/.ideavimrc<cr>
" Toggle comments with gcc (or gc in selection)
nnoremap gcc :action CommentByLineComment<cr>
vnoremap gc :action CommentByLineComment<cr>
" File operations
nnoremap <leader>f. :action FindInPath<cr>
nnoremap <leader>fr :action RenameFile<cr>
" 'Buffers'
nnoremap <leader>bx :action CloseActiveTab<cr>
nnoremap <leader>bs :action SaveAll<cr>
" Code
nnoremap <leader>cD :action ShowUsages<cr>
nnoremap <leader>cf :action ReformatCode<cr>
" > Refactorings
nnoremap <leader>cri :action OptimizeImports<cr>
nnoremap <leader>cre :action RenameElement<cr>
nnoremap <leader>crr :action Refactorings.QuickListPopupAction<cr>
" Debugging
nnoremap <leader>dd :action Debug<cr>
nnoremap <leader>dc :action ChooseDebugConfiguration<cr>
" > Breakpoints
nnoremap <leader>db :action ToggleLineBreakpoint<cr>
nnoremap <leader>dr :action ViewBreakpoints<cr>
" Running
nnoremap <leader>rr :action Run<cr>
nnoremap <leader>rc :action ChooseRunConfiguration<cr>
" Window
nnoremap <leader>wh :action VimWindowSplitHorizontal<cr>
nnoremap <leader>wv :action VimWindowSplitVertical<cr>
nnoremap <leader>wh :action VimWindowLeft<cr>
nnoremap <leader>wj :action VimWindowDown<cr>
nnoremap <leader>wk :action VimWindowUp<cr>
nnoremap <leader>wl :action VimWindowRight<cr>
nnoremap <leader>wth :action PreviousTab<cr>
nnoremap <leader>wtl :action NextTab<cr>
" Project
nnoremap <leader>pt :action SelectIn<cr>
" Git
nnoremap <leader>ga :action Annotate<cr>
" Go to
nnoremap ga :action GotoAction<cr>
nnoremap gi :action GotoImplementation<cr>
nnoremap gs :action GotoSuperMethod<cr>
nnoremap gd :action GotoDeclaration<cr>
nnoremap gt :action GotoTest<cr>
nnoremap gu :action FindUsages<cr>
nnoremap gr :action GotoRelated<cr>
" Standard VIM-bindings
nmap <c-i> :action Forward<CR>
nmap <c-o> :action Back<CR>
" Toggles
nnoremap <leader>tb :action Annotate<cr>
" Errors
nnoremap <leader>en :action GotoNextError<cr>
nnoremap <leader>ep :action GotoPreviousError<cr>
" Multi cursors
set multiple-cursors
nmap <C-n> <Plug>NextWholeOccurrence
xmap <C-n> <Plug>NextWholeOccurrence
nmap g<C-n> <Plug>NextOccurrence
xmap g<C-n> <Plug>NextOccurrence
nmap <C-x> <Plug>SkipOccurrence
xmap <C-x> <Plug>SkipOccurrence
nmap <C-p> <Plug>RemoveOccurrence
xmap <C-p> <Plug>RemoveOccurrence
nmap <C-S-p> :action EditorCloneCaretAbove<CR>
nmap <C-S-n> :action EditorCloneCaretBelow<CR>