-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.ideavimrc
110 lines (101 loc) · 3.24 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
nnoremap \e :e ~/.ideavimrc<CR>
nnoremap \r :action IdeaVim.ReloadVimRc.reload<CR>
set clipboard^=unnamed,unnamedplus
set lazyredraw
set ignorecase
set incsearch
set smartcase
set idearefactormode=keep
set ideajoin
set ideamarks
set textobj-indent
" Common keymap
noremap ; :
nnoremap L $
nnoremap H ^
let mapleader = " "
" Tabs
nmap <S-Tab> :tabprev<CR>
nmap <Tab> :tabnext<CR>
" Split window
nmap ss :split<CR><C-w>w
nmap sv :vsplit<CR><C-w>w
map sh <C-w>h
map sk <C-w>k
map sj <C-w>j
map sl <C-w>l
" Plugins
Plug 'easymotion/vim-easymotion'
map <Leader> <Plug>(easymotion-prefix)
Plug 'preservim/nerdtree'
nnoremap <leader><leader>n :NERDTreeFocus<CR>
nnoremap <leader><leader>t :NERDTreeToggle<CR>
nnoremap <leader><leader>f :NERDTreeFind<CR>
Plug 'tpope/vim-surround'
Plug 'terryma/vim-multiple-cursors'
"set multiple-cursors
" 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
" 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. ñ
nmap <S-C-n> <Plug>AllWholeOccurrences
xmap <S-C-n> <Plug>AllWholeOccurrences
nmap g<S-C-n> <Plug>AllOccurrences
xmap g<S-C-n> <Plug>AllOccurrences
" IntelliJ actions mapping
map ,a <Action>(GotoAction)
" code navigation
map ,,f <Action>(OpenFile)
map ,g <Action>(GotoFile)
map ,f <Action>(FindInPath)
map <S-M-s> <Action>(ChangesView.Shelve)
map <leader>z <Action>(ToggleDistractionFreeMode)
map <leader><leader>s <Action>(SelectInProjectView)
map <leader>o <Action>(FileStructurePopup)
map <leader>u :action FindUsages<CR>
map <leader>a <Action>(Annotate)
map <leader>hf <Action>(Vcs.ShowTabbedFileHistory)
map <leader>hs <Action>(Vcs.ShowHistoryForBlock)
map <leader>g <Action>(ActivateVersionControlToolWindow)
map <S-Space> <Action>(GotoNextError)
map <leader>pw <Action>(OpenProjectWindows)
map <leader>pm <Action>(ManageRecentProjects)
map gc <Action>(GotoClass)
map gi <Action>(GotoImplementation)
map gd <Action>(GotoDeclaration)
map gp <Action>(GotoSuperMethod)
map gsb <Action>(GotoSymbol)
map tt <Action>(GotoTest)
map gb <Action>(Back)
map gf <Action>(Forward)
map gm <Action>(ToggleBookmark)
map gsm <Action>(ShowBookmarks)
map <leader>m <Action>(MoveEditorToOppositeTabGroup)
nnoremap <leader>zc :action CollapseAllRegions<CR>
nnoremap <leader>zo :action ExpandAllRegions<CR>
" refactoring
map <leader><leader>t <Action>(Refactorings.QuickListPopupAction)
map <leader>r <Action>(RenameElement)
map gl <Action>(ReformatCode)
map <leader>lt <Action>(Javascript.Linters.EsLint.Fix)
" test
map <leader><leader>r <Action>(Run)
map <leader><leader>c <Action>(RunClass)
map <leader>tc <Action>(CreateRunConfiguration)
map <leader>tf <Action>(RerunFailedTests)
" debugging
map <leader>e :action EvaluateExpression<CR>
map <leader>b <Action>(ToggleLineBreakpoint)
map <leader>d <Action>(Debug)
map <leader>c <Action>(Stop)
map <leader>,r <Action>(Replace)
" terminal
map ,t <Action>(ActivateTerminalToolWindow)
map ,c <Action>(osmedile.intellij.stringmanip.WordsAndCamelToConstantStyleCaseAction)