-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ideavimrc
212 lines (186 loc) · 6.15 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
" unmap space, by default it will move the cursor to the left 1 char
nnoremap <space> <Nop>
let mapleader="\<Space>"
" ****************************************
" Vim Config
" ****************************************
" Greatest remap EVER!!
" Let me explain, this remap while in visual mode
" will delete what is currently highlighted and replace it
" with what is in the register BUT it will YANK (delete) it
" to a VOID register. Meaning I still have what I originally had
" when I pasted. I don't loose the previous thing I YANKED!
vnoremap <leader>pp "_dP
" ******************************************
" REMAP Y and P for clipboard usages
" * for main clipboard
" + for vim clipboard?
" *****************************************
" noremap <Leader>y "*y
" noremap <Leader>p "*p
" noremap <Leader>Y "+y
" noremap <Leader>P "+p
" ****************************************
" Plugins
" ****************************************
set multiple-cursors
set commentary
set NERDTree
set easymotion
set surround
set showmode
set textobj-entire
" set ReplaceWithRegister
set sneak
set highlightedyank
set which-key
" ****************************************
" Basic
" ****************************************
set number " Line numbers
set relativenumber " Relative line numbers
set hlsearch " Highlight whole word when searching
set ignorecase " Ignore case when searching...
set smartcase " ...except when search query contains a capital letter
set scrolloff=5
set so=5
set history=1000
set incsearch " search as soon as you type
set nu
set visualbell
set exchange
" set clipboard=unnamed " Copy to system clipboard
set clipboard+=unnamed " Copy to system clipboard
set g:highlightedyank_highlight_duration = 500
" show relative line numbers in normal mode only
" augroup linea
" autocmd!
" autocmd InsertEnter * set norelativenumber
" autocmd InsertLeave * set relativenumber
" augroup END
""" Idea specific settings ------------------
set notimeout
set showmode
set showcmd
set ideajoin
set ideastatusicon=gray
set idearefactormode=keep
" ******************************************
" Remap Ctrl + h,j,k,l to move between windows
" *****************************************
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" remap gt and gT to move between tabs
nnoremap <S-h> gT
nnoremap <S-l> gt
map <leader>w <c-w>
map <leader>wd <c-w>c
" Fix multple cursor issue
" Remap multiple-cursors shortcuts to match terryma/vim-multiple-cursors
nmap <C-n> <Plug>NextWholeOccurrence
xmap <C-n> <Plug>NextWholeOccurrence
nmap g<C-n> <Plug>NextOccurrence
xmap g<C-n> <Plug>NextOccurrence
xmap <C-x> <Plug>SkipOccurrence
xmap <C-p> <Plug>RemoveOccurrence
" Note that the default <A-n> and g<A-n> shortcuts don't work on Mac due to dead keys.
" <A-n> is used to enter accented text e.g. ñ
" Feel free to pick your own mappings that are not affected. I like to use <leader>
nmap <leader><C-n> <Plug>AllWholeOccurrences
xmap <leader><C-n> <Plug>AllWholeOccurrences
nmap <leader>g<C-n> <Plug>AllOccurrences
xmap <leader>g<C-n> <Plug>AllOccurrences
" Using C-n and C-p to select
" inoremap <expr> j ((pumvisible())?("\<C-n>"):("j"))
" inoremap <expr> k ((pumvisible())?("\<C-p>"):("k"))
" ******************************************
" Remap for idea features
" *****************************************
map <C-W>q :q<CR>
nnoremap <Leader>/ :nohl<CR>
map K <Action>(ShowHoverInfo)
map <leader>d <Action>(Debug)
map <leader>c <Action>(Stop)
map <leader>uz <Action>(ToggleDistractionFreeMode)
map <leader>ss <Action>(FileStructurePopup)
" map <leader><space> <Action>(GotoFile)
map <leader>ff <Action>(GotoFile)
map <leader>fT <Action>(ActivateTerminalToolWindow)
noremap <C-/> <Action>(ActiveTerminalToolWindow)
map <leader>cr <Action>(RenameElement)
map <leader>cf <Action>(ReformatCode)
map <leader>sg <Action>(FindInPath)
map <leader>aa <Action>(copilot.chat.show)
map <leader>aq <Action>(copilot.chat.inline)
" Popup navigation
inoremap <C-j> <Action>(PopupMenu-selectNext)
inoremap <C-k> <Action>(PopupMenu-selectPrev)
map <leader>s <Action>(SelectInProjectView)
map <leader>ghB <Action>(Annotate)
map <leader>ghb <Action>(GitToolBox.BlameDetails)
map <leader>gb <Action>(Annotate)
map <leader>uw <Action>(EditorToggleUseSoftWraps)
map <leader>h <Action>(Vcs.ShowTabbedFileHistory)
map <S-Space> <Action>(GotoNextError)
map <leader>bd <Action>(CloseContent)
map <leader>bD <Action>(CloseAllEditors)
map <leader>bo <Action>(CloseAllEditorsButActive)
map <leader>uz <Action>(ToggleZenMode)
map <leader>db <Action>(ToggleLineBreakpoint)
map <leader>o <Action>(FileStructurePopup)
map <leader>ss <Action>(FileStructurePopup)
map gh <Action>(QuickJavaDoc)
map ge <Action>(ShowErrorDescription)
map gm <Action>(HideAllWindows)
map gr <Action>(FindUsages)
map gI <Action>(GotoImplementation)
map gpi <Action>(QuickImplementations)
map gpd <Action>(QuickImplementations)
map gq <Action>(ShowIntentionActions)
map gy <Action>(GotoTypeDeclaration)
map ]e <Action>(ReSharperGotoNextErrorInSolution)
map [e <Action>(ReSharperGotoPrevErrorInSolution)
map <C-/> <Action>(ActivateTerminalToolWindow)
" ******************************************
" Remap for conflicts
" *****************************************
sethandler <C-2> a:ide
sethandler <C-S-2> a:ide
sethandler <C-6> a:ide
sethandler <C-S-6> a:ide
sethandler <C-A> a:ide
sethandler <C-C> a:ide
sethandler <C-E> a:ide
sethandler <C-G> a:ide
sethandler <C-M> a:ide
sethandler <C-S> a:ide
sethandler <C-T> a:ide
sethandler <C-X> a:ide
sethandler <C-Y> a:ide
sethandler <C-[> a:ide
sethandler <C-\> a:ide
sethandler <C-]> a:ide
sethandler <C-P> a:ide
sethandler <S-j> a:ide
sethandler <C-H> n:vim i-x-v:ide
sethandler <C-J> n:vim i-x-v:ide
sethandler <C-K> n:vim i-x-v:ide
sethandler <C-L> n:vim i-x-v:ide
sethandler <C-I> a:vim
sethandler <C-B> a:vim
sethandler <C-D> a:vim
sethandler <C-F> n:vim i-x-v:ide
sethandler <C-N> a:vim
sethandler <C-O> a:vim
sethandler <C-R> a:vim
sethandler <C-U> a:vim
sethandler <C-V> a:vim
sethandler <C-W> a:vim
" ******************************************
" NERD Tree Keybinding
" ******************************************
" Toggle NERDTree and go to file with Find
" map NERDTree to Ctrl+Shift+E
nnoremap <leader>e :NERDTreeToggle<CR>