-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ideavimrc
160 lines (150 loc) · 5.39 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
source ~/.vimrc
set which-key
nnoremap <Space>wv :vertical splitv<CR>
nnoremap <Space>ws :split<CR>
nnoremap <Space>wd :close<CR>
let mapleader=" "
set notimeout
let g:WhichKey_ShowVimActions = "true"
"set timeoutlen=500
set showmode
set relativenumber number
set showcmd
set commentary
set visualbell
nmap <leader>g :action GotoDeclaration<cr>
nmap <leader>b :action Back<cr>
nmap <leader>f :action Forward<cr>
nmap <Leader>pu :action Vcs.Push<cr>
nmap <leader>p :action GotoFile<cr>
"nmap <leader>y :action ExpressionTypeInfo<cr>
""" Editing and Reloading the Config
set clipboard+=unnamed
set clipboard+=ideaput
nnoremap \e :e ~/.ideavimrc<CR>
nnoremap \r :action IdeaVim.ReloadVimRc.reload<CR>
""" The Escape button
map <C-c> <Esc>
""" Distraction Free Mode
nnoremap <c-z> :action ToggleDistractionFreeMode<CR>
""" Terminal
nnoremap <c-t> :action ActivateTerminalToolWindow<CR>
nnoremap <leader>t :action Terminal.OpenInTerminal<CR>
""" Navigation
nnoremap <c-\> :action SplitVertically<CR>
nnoremap <c--> :action SplitHorizontally<CR>
nnoremap <c-=> :action Unsplit<CR>
nnoremap <c-m> :action MoveEditorToOppositeTabGroup<CR>
sethandler <c-j> a:vim
sethandler <c-k> a:vim
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <TAB> :action PreviousTab<CR>
nnoremap <s-TAB> :action NextTab<CR>
nnoremap <Leader>en :action EditSourceInNewWindow<CR>
nnoremap <Leader>n :action NextWindow<CR>
nnoremap <Leader>q :action CloseContent<CR>
nnoremap <Leader>qa :action CloseAllEditors<CR>
nnoremap <Leader>ff :action SelectInProjectView<CR>
"" Plugins --------------------------------
""" Surround Plugin --------------------------------
" Emulates vim-surround. Mappings to easily delete, change and add such surroundings in pairs
" Basic Commands:
" cs Change surroundings
" cst Change surroundings tag
" ds Delete surroundings
" dst Delete surroundings tag
" ys Surround text object
" See https://github.com/tpope/vim-surround/blob/master/doc/surround.txt for details
set surround
nmap "" ysiw"
nmap '' ysiw'
""" easy motion plugin --------------------------------
" Emulates vim-easymotion
" Make sure to install IdeaVim-EasyMotion and AceJump Plugins
" Basic Commands:
" easy-motion-s Search backward
" easy-motion-f Search forward
" See https://github.com/AlexPl292/IdeaVim-EasyMotion#supported-commands for details
Plug 'easymotion/vim-easymotion'
map <leader>s <Plug>(easymotion-s2)
map <leader>J <Plug>(easymotion-s)
map <leader>j <Plug>(easymotion-s2)
""" NERDTree plugin --------------------------------
" Emulates NERDTree
" Basic Commands:
" Ctrl-n Open NERDTree (mapped bellow)
" qu Close the NERDTree windowe
" o Open files, directories and bookmarks
" go Open selected file, but leave cursor in the NERDTree
" i Open selected file in a split window
" gi Same as i, but leave the cursor on the NERDTree
" s Open selected file in a new vsplit
" gs Same as s, but leave the cursor on the NERDTree
" <C-J> Jump down to next sibling of the current directory
" <C-K> Jump up to previous sibling of the current directory
" R Recursively refresh the current root
" m Display the NERDTree menu
" See https://github.com/JetBrains/ideavim/wiki/NERDTree-support for details
set NERDTree
map <c-n> :NERDTreeToggle<CR>
let g:NERDTreeMapActivateNode='l'
let g:NERDTreeMapJumpParenth='h'
""" Commentary plugin --------------------------------
Plug 'tpope/vim-commentary'
""" Editing source code
set ideajoin
set idearefactormode=keep
vnoremap < <gv
vnoremap > >gv
"""map º [[
"""map ´ ]]
nnoremap [[ :action MethodUp<CR>
nnoremap ]] :action MethodDown<CR>
nnoremap zc :action CollapseRegion<CR>
nnoremap zo :action ExpandRegion<CR>
nnoremap <leader>zc :action CollapseAllRegions<CR>
nnoremap <leader>zo :action ExpandAllRegions<CR>
nnoremap <leader>c :action CommentByLineComment<CR>
nnoremap <leader>r :action Refactorings.QuickListPopupAction<CR>
nnoremap <Leader>= :action ReformatCode<CR>
nnoremap <leader>o :action OptimizeImports<CR>
nnoremap <c-r> :action RecentFiles<CR>
nnoremap <leader>l :action RecentLocations<CR>
nnoremap <leader>h :action LocalHistory.ShowHistory<CR>
nnoremap ge :action GotoNextError<CR>
nnoremap gE :action GotoPreviousError<CR>
"nnoremap <leader>s :write<CR>
""" Searching and Source Code Navigation
set incsearch
nnoremap <c-/> :action FindInPath<CR>
nnoremap <c-a> :action GotoAction<CR>
nnoremap <c-f> :action GotoFile<CR>
nnoremap <leader>u :action FindUsages<CR>
"nnoremap <leader>s :action GotoRelated<CR>
nnoremap <leader>h :action CallHierarchy<CR>
nnoremap <leader>b :action ShowNavBar<CR>
nnoremap <c-s> :action FileStructurePopup<CR>
nnoremap <c-o> :action GotoSymbol<CR>
"""nnoremap gc :action GotoClass<CR>
""nnoremap gi :action GotoImplementation<CR>
"""nnoremap gd :action GotToDeclaration<CR>
"""nnoremap gp :action GotToSuperMethod<CR>
"""nnoremap gt :action GotoTest<CR>
"""nnoremap gb :action Back<CR>
"""nnoremap gf :action Forward<CR>
""" Tool windows
nnoremap <c-p> :action JumpToLastWindow<CR>
nnoremap <c-x> :action HideAllWindows<CR>
""" Running and Debugging
nnoremap ,r :action ContextRun<CR>
nnoremap ,c :action RunClass<CR>
nnoremap ,f :action ChooseRunConfiguration<CR>
nnoremap ,t :action ActivateRunToolWindow<CR>
nnoremap ,u :action Rerun<CR>
nnoremap ,f :action RerunFailedTests<CR>
nnoremap ,b :action ToggleLineBreakpoint<CR>
nnoremap ,d :action ContextDebug<CR>
nnoremap ,n :action ActivateDebugToolWindow<CR>