-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathideavimrc
executable file
·135 lines (106 loc) · 3.14 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
" vim: foldmethod=marker:foldlevel=0
set nobell
set visualbell
" Options {{{
" Delete comment character when joining commented lines
set formatoptions+=j
set hlsearch
set scrolloff=3
set ignorecase smartcase
set showmode
set history=100
set rnu
" Vim-surround emulation
set surround
}}}
" ESC/Leader mappings {{{
inoremap jk <esc>
let mapleader=","
}}}
" Copy/Paste with system clipboard {{{
"noremap <leader>p "+gP
"noremap <leader>y "+y
noremap <leader>y "*y
noremap <leader>Y "*Y
noremap <leader>p "*p
noremap <leader>P "*P
}}}
" Default Folding {{{
set foldenable
set foldlevelstart=5
" }}}
" Text Selection {{{
" highlight last inserted text
nnoremap gV `[v`]
" quote/bracket/paren visual selection
vnoremap <leader>" <esc>`>a"<esc>`<i"<esc>
vnoremap <leader>( <esc>`>a)<esc>`<i(<esc>
vnoremap <leader>[ <esc>`>a]<esc>`<i[<esc>
}}}
" Buffer/Window Mangement {{{
" CTRL+movement keys switch windows
map <C-H> <C-W>h
map <C-J> <C-W>j
map <C-K> <C-W>k
map <C-L> <C-W>l
nnoremap <a-h> gT
nnoremap <a-l> gt
nnoremap <c-s-tab> gT
nnoremap <c-tab> gt
" }}}
noremap <leader>ba :action BuildAll<CR>
noremap <leader>bp :action BuildProject<CR>
noremap <leader>ga :action GotoAction<CR>
noremap <leader>gs :action GotoSymbol<cr>
noremap <leader>gc :action GotoClasses<cr>
noremap <leader>gf :action GotoFiles<cr>
nnoremap <leader>rr :action RenameElement<cr>
nnoremap <leader>t :action FileStructurePopup<cr>
nnoremap <leader>u :action FindUsages<cr>
" built-in navigation to navigated items works better
nnoremap <c-o> :action Back<cr>
nnoremap <c-i> :action Forward<cr>
" but preserve ideavim defaults
nnoremap g<c-o> <c-o>
nnoremap g<c-i> <c-i>
nnoremap gd :action GotoDeclaration
nnoremap <leader>= :action ReformatCode<CR>
nnoremap <C-CR> :action ShowIntentionActions<CR>
" Other Ideas {{{
" options
"nnoremap cow :action EditorToggleUseSoftWraps<cr>
"nnoremap col :action EditorToggleShowWhitespaces<cr>
" actions
"nnoremap <space>q :action CloseContent<cr>
"nnoremap <space>Q :action ReopenClosedTab<cr>
"nnoremap <space>\ :action VimFilePrevious<cr>
"nnoremap <space>e :action SearchEverywhere<cr>
"nnoremap <space>E :action Switcher<cr>
"nnoremap <space>t :action FileStructurePopup<cr>
"nnoremap <space>b :action ToggleLineBreakpoint<cr>
" code navigation
"nnoremap <space>] :action GotoImplementation<cr>
"nnoremap <space>[ :action GotoSuperMethod<cr>
"nnoremap <space>u :action FindUsages<cr>
"nnoremap <space>gt :action GotoTest<cr>
"nnoremap <space>k :action HighlightUsagesInFile<cr>
"nnoremap \r :action RunClass<cr>
"nnoremap \R :action Run<cr>
"nnoremap \d :action DebugClass<cr>
"nnoremap \D :action Debug<cr>
"nnoremap \c :action CheckStyleCurrentFileAction<cr>
" unimpaired mappings
"nnoremap [<space> O<esc>j
"nnoremap ]<space> o<esc>k
"nnoremap [q :action PreviousOccurence<cr>
"nnoremap ]q :action NextOccurence<cr>
"nnoremap [m :action MethodUp<cr>
"nnoremap ]m :action MethodDown<cr>
"nnoremap [c :action VcsShowPrevChangeMarker<cr>
"nnoremap ]c :action VcsShowNextChangeMarker<cr>
" built in search looks better
"nnoremap / :action Find<cr>
" but preserve ideavim search
"nnoremap g/ /
}}}
" For more some more hints: https://ikenox.info/blog/getting-started-ideavim/