-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathideavimrc
More file actions
129 lines (107 loc) · 3.43 KB
/
ideavimrc
File metadata and controls
129 lines (107 loc) · 3.43 KB
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
"===[ Global Settings ]=== {{{1
set incsearch
set ignorecase
set smartcase
set hlsearch
set history=10000
set visualbell
set ideajoin
set surround "surround plugin emulation
set multiple-cursors "emulates multiple cursors
set commentary "emulates commentary plugin
"1}}}
"===[ Misc Keys ]=== {{{1
let mapleader=","
let g:mapleader=","
let g:localLeader=","
" Use ; for : in normal and visual mode, less keystrokes
nnoremap ; :
vnoremap ; :
inoremap jj <ESC>
nnoremap <leader>r :source ~/.ideavimrc <CR>
"Clear highlights from search
nnoremap <Leader>/ :nohls<CR>
"indenta de manera correcta todo el archivo
nnoremap <Leader>= 1G=G
"1}}}
" ===[ IDEA Actions ]=== {{{1
nnoremap gc :action GotoClass<CR>
nnoremap gd :action GotoDeclaration<CR>
nnoremap gi :action GotoImplementation<CR>
nnoremap gl :action JumpToLastChange<CR>
nnoremap gf :action Forward<CR>
nnoremap gb :action Back<CR>
nnoremap gu :action ShowUsages<CR>
nnoremap == :action ReformatCode<CR>
vnoremap == :action ReformatCode<CR>
nnoremap <leader>dt :action ToggleDistractionFreeMode<CR>
nnoremap <c-\> :action SplitVertically<CR>
nnoremap <c--> :action SplitHorizontally<CR>
vnoremap <leader>s :action StringManipulation.Sort<CR>
" built in search looks better
nnoremap ,e :action SearchEverywhere<CR>
nnoremap / :action Find<cr>
" but preserve ideavim search
nnoremap g/ /
" refactoring actions
nnoremap <Leader>ri :action Inline<CR>
nnoremap <Leader>rr :action RenameElement<CR>i
nnoremap <Leader>rj :action MemberPushDown<CR>
nnoremap <Leader>rk :action MemberPullUp<CR>
nnoremap <Leader>rs :action ChangeSignature<CR>
nnoremap <Leader>rd :action SafeDelete<CR>
nnoremap <Leader>rm :action Move<CR>
nnoremap <Leader>rc :action CopyElement<CR>
" fix actions
nnoremap <Leader>fi :action OptimizeImports<CR>
nnoremap <Leader>fa :action ShowIntentionActions<CR><Esc>
"run
nnoremap <Leader>pr :action Run<cr>
nnoremap <Leader>pd :action Debug<cr>
nnoremap <Leader>br :action ToggleLineBreakpoint<cr>
nnoremap <Leader>pc :action ChooseRunConfiguration<CR>
nnoremap <leader>dD :action ChooseDebugConfiguration<CR>
" similar to my vim Nerd tree mapping
nnoremap <Leader>nt :action ActivateProjectToolWindow<CR>
" git vim fugitive
nnoremap <leader>gb :action Annotate<CR>
"1}}}
" ===[ Motion ]=== {{{1
"one screen line at a time (instead of vim line)
nnoremap j gj
nnoremap k gk
nnoremap J <c-F>
nnoremap K <c-B>
inoremap jk <esc>
"windows navigation
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-l> <c-w>l
noremap <c-h> <c-w>h
nnoremap <c-s-tab> gT
nnoremap <c-tab> gt
nnoremap <s-left>q :action ReopenClosedTab<cr>
nnoremap <leader>q :action CloseContent<cr>
"this are to get used to NOT use arrow keys in insert mode (good practice is
"to exit to normal mode and move using normal keysnormal keys
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
" Move to next error after make
nnoremap <leader>ne :cnext<cr>
nnoremap <leader>pe :cprevious<cr>
nnoremap <leader>l :action RecentLocations<CR>
nnoremap <leader>h :action LocalHistory.ShowHistory<CR>
nnoremap ge :action GotoNextError<CR>
nnoremap gE :action GotoPreviousError<CR>
" 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
nmap <C-x> <Plug>SkipOccurrence
xmap <C-x> <Plug>SkipOccurrence
nmap <C-p> <Plug>RemoveOccurrence
xmap <C-p> <Plug>RemoveOccurrence
"1}}}