-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathideavimrc
More file actions
143 lines (116 loc) · 3.15 KB
/
ideavimrc
File metadata and controls
143 lines (116 loc) · 3.15 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
130
131
132
133
134
135
136
137
138
139
140
141
142
" setting leader key
let mapleader=" "
let g:mapleader=" "
set updatetime=300
set timeoutlen=300
" line numbers
set number
set relativenumber
" disable wrap
set nowrap
" quick save and quit
nnoremap <A-w> :w<CR>
nnoremap <A-q> :q<CR>
nnoremap <leader>wq :wq<CR>
" quick copy from primiary clipboard
xnoremap <leader>y "+y
nnoremap <leader>y "+yiw
nnoremap <c-y> yiw
inoremap <A-c> <C-o>yiw
inoremap <A-v> <C-r>"
" map Q to q for ex mode is not usable for me
map Q q
" tabs
nnoremap <silent> <leader>nt :tabnew<CR>
nnoremap <silent> <A-p> <cmd>tabprevious<CR>
nnoremap <silent> <A-n> <cmd>tabnext<CR>
inoremap <silent> <A-p> <cmd>tabprevious<CR>
inoremap <silent> <A-n> <cmd>tabnext<CR>
" map alt + n -> tab n
nnoremap <A-1> 1gt
nnoremap <A-2> 2gt
nnoremap <A-3> 3gt
nnoremap <A-4> 4gt
nnoremap <A-5> 5gt
inoremap <silent> <A-1> <C-o>1gt
inoremap <silent> <A-2> <C-o>2gt
inoremap <silent> <A-3> <C-o>3gt
inoremap <silent> <A-4> <C-o>4gt
inoremap <silent> <A-5> <C-o>5gt
" emacs like kemap in insert mode
inoremap <c-a> <home>
inoremap <c-e> <end>
inoremap <c-f> <right>
inoremap <c-b> <left>
inoremap <c-k> <c-o>D
cnoremap <c-a> <home>
cnoremap <c-b> <left>
cnoremap <c-e> <end>
" move line down/up
nnoremap <A-j> :m .+1<cr>==
nnoremap <A-k> :m .-2<cr>==
inoremap <A-j> <esc>:m .+1<cr>==gi
inoremap <A-k> <esc>:m .-2<cr>==gi
vnoremap <A-j> :m '>+1<cr>gv
vnoremap <A-k> :m '<-2<cr>gv
" switch between window
nnoremap <A-o> <C-w><C-w>
inoremap <A-o> <C-o><C-w><C-w>
"better intent
vnoremap < <gv
vnoremap > >gv
"========================
" Action Mapper
"========================
" code format
:map <leader>cf <Action>(ReformatCode)
" code action
:map ca <Action>(ShowIntentionActions)
:map cv <Action>(IntroduceVariable)
:map cr <Action>(RefactoringMenu)
:map cl <Action>(Refactorings.QuickListPopupAction)
" code navigation
:map gr <Action>(ShowUsages)
:map gR <Action>(FindUsages)
:map gi <Action>(GotoImplementation)
:map gd <Action>(GotoDeclaration)
:map gD <Action>(GotoSuperMethod)
:map gu <Action>(FindUsages)
:map [d <Action>(GotoPreviousError)
:map ]d <Action>(GotoNextError)
" fold
:map za <Action>(ExpandCollapseToggleAction)
" vsc
:map <leader>hp <Action>(VcsShowCurrentChangeMarker)
:map <leader>hr <Action>(Vcs.RollbackChangedLines)
:map [h <Action>(VcsShowPrevChangeMarker)
:map ]h <Action>(VcsShowNextChangeMarker)
:map <leader>gb <Action>(Annotate)
" git actions
:map <leader>gg <Action>(ActivateVersionControlToolWindow)
:map <leader>gc <Action>(CheckinProject)
:map <leader>gf <Action>(Vcs.ShowTabbedFileHistory)
" find file
:map <leader>f <Action>(GotoFile)
:map <leader>/ <Action>(FindInPath)
:map <leader>b <Action>(RecentFiles)
" outline
:map <leader>o <Action>(ActivateStructureToolWindow)
" dignostic
:map <C-k> <Action>(ShowErrorDescription)
" fix c-o can not back
:map <C-o> <Action>(Back)
:map <f2> <Action>(RenameElement)
"========================
" Plugins
"========================
Plug 'preservim/nerdtree'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'vim-easymotion'
"Find Actions
:map <leader>hh <Action>(GotoAction)
" Exploerer
:map <leader>nn :NERDTreeToggle<CR>
:map <leader>nf ::NERDTreeFind<CR>
nmap <C-s> <Plug>(easymotion-sn)