-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ideavimrc
160 lines (121 loc) · 4.13 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 ~/.intellimacs/spacemacs.vim
" (Optional) Enable other Intellimacs modules
source ~/.intellimacs/extra.vim
source ~/.intellimacs/major.vim
source ~/.intellimacs/hybrid.vim
" (Optional) Enable which-key plugin
source ~/.intellimacs/which-key.vim
"-------------------------------------------------------------------
set NERDTree
set nu
set relativenumber
set ignorecase
set smartcase
set scrolloff=2
set clipboard+=unnamed
" set multiple-cursors
set easymotion
set commentary
set highlightedyank
" set surround
set sneak
set quickscope
set ideajoin
set visualbell
set noerrorbells
" My favorites -----------------------------------------------------
imap jj <Esc>
map <C-c> <Esc>
"--------------------------------------------------------------------
nnoremap yy "+yy
vnoremap y "+y
let mapleader = " "
set timeoutlen=1500
nmap <leader>R :source ~/.ideavimrc<cr>
" Like cmd+n --------------------------------------------------------
nmap <leader>1 :action ActivateProjectToolWindow<cr>
nmap <leader>2 :action ActivateTerminalToolWindow<cr>
nmap <leader>3 :action ActivateVersionControlToolWindow<cr>
" nmap <leader>5 :action ActivatenpmToolWindow<cr>
nmap <leader>4 :action ActivateRunToolWindow<cr>
nmap <leader>5 :action ActivateServicesToolWindow<cr>
nmap <leader>8 :action Activategithub.copilotToolWindowToolWindow<cr>
nmap <leader>0 :action ActivateGitLabMergeRequestsToolWindow<cr>
" Navigation -------------------------------------------------------
nnoremap gb :action Back<CR>
nnoremap gf :action Forward<CR>
nmap <leader>w :action SaveAll<cr>
nmap <leader>l :action RecentLocations<cr>
nmap <leader>e :action RecentFiles<cr>
" Search -----------------------------------------------------------
nmap <leader>= :action GotoFile<cr>
nmap <leader>sf :action GotoFile<cr>
nmap <leader>\ :action FindInPath<cr>
nmap <leader>st :action FindInPath<cr>
nmap <leader>/ :action Find<cr>
" Splits manipulation -----------------------------------------------
nmap <C-\> :action MoveTabRight<CR>
nmap <C--> :action MoveTabDown<CR>
nmap <C-=> :action Unsplit<CR>
nmap <C-m> :action MoveEditorToOppositeTabGroup<CR>
" sethandler <C-j> a:vim
" sethandler <C-k> a:vim
nmap <C-h> <C-w>h
nmap <C-l> <C-w>l
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
" Tabs --------------------------------------------------------------
nmap <leader>q :action CloseContent<cr>
nmap <leader>Q :action ReopenClosedTab<cr>
nmap <TAB> :action PreviousTab<CR>
nmap <S-TAB> :action NextTab<CR>
nmap H :action PreviousTab<CR>
nmap L :action NextTab<CR>
" Misc --------------------------------------------------------------
nmap <leader>u :action FindUsages<cr>
nmap <leader>i :action SelectIn<cr>
nmap <leader>f :action ReformatCode<CR>
nmap <leader>- :action FoldingGroup<CR>
nmap <leader>c :action CommentByLineComment<CR>
nmap <leader>o :action OptimizeImports<cr>
nmap <leader>p :action ActivateStructureToolWindow<cr>
" Run ---------------------------------------------------------------
nnoremap ,, :action RunClass<CR>
nnoremap ,r :action Rerun<CR>
" Delete (not cut) --------------------------------------------------
nnoremap d "_d
nnoremap D "_D
vnoremap d "_d
nnoremap c "_c
nnoremap C "_C
vnoremap c "_c
nnoremap x "_x
vnoremap x "_x
nnoremap X "_X
vnoremap X "_X
" Cut (like c, cc and C) --------------------------------------------
nnoremap m "+c
nnoremap mm "+cc
vnoremap m "+c
nnoremap M "+C
vnoremap M "+C
" recursively open and close the folds under the cursor -------------
nnoremap zC :action CollapseRegionRecursively<CR>
nnoremap zO :action ExpandRegionRecursively<CR>
" Errors ------------------------------------------------------------
nmap <leader>d :action ShowErrorDescription<cr>
nnoremap ge :action GotoNextError<CR>
nnoremap gE :action GotoPreviousError<CR>
"--------------------------------------------------------------------
nmap <leader>g :only<bar>vsplit<CR>gd
" Refactorings
" vmap T :action Refactorings.QuickListPopupAction<cr>
nmap <leader>r :action RenameElement<cr>
" nmap <leader>rg :action Generate<cr>
map <leader>R :action Replace<CR>
inoremap <C-d> <Esc>yypi
" These create newlines like o and O but stay in normal mode
nmap zj o<Esc>
nmap zk O<Esc>
nmap zJ o<Esc>k
nmap zJ O<Esc>j