1
0
Fork 0

Compare commits

...

7 Commits

1 changed files with 102 additions and 82 deletions

View File

@ -55,6 +55,7 @@ sethandler <C-O> a:vim
sethandler <C-P> a:vim
sethandler <C-U> a:vim
sethandler <C-W> a:vim
sethandler <C-S-W> a:vim
" Enable plugins (https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins)
Plug 'argtextobj.vim'
@ -96,17 +97,15 @@ xnoremap H ]b
noremap <A-b> ge
noremap <A-S-b> gE
" Navigate and close tabs
" Navigate editor tabs
noremap <A-h> gT
noremap <A-l> gt
inoremap <A-h> <C-o>gT
inoremap <A-l> <C-o>gt
noremap <C-w> :action CloseContent<CR>
" Increment/decrement numbers
nnoremap <Bar>+ <C-a>
nnoremap <Bar>- <C-x>
noremap <Bar>+ <C-a>
noremap <Bar>- <C-x>
" Edit from cursor to start/end of parenthesized block
nnoremap c) c])
@ -138,53 +137,83 @@ nnoremap gp `[v`]
xnoremap p P
xnoremap P p
" Navigate back/forward
nmap <BS> <Action>(Back)
nmap <S-BS> <Action>(Forward)
" Show parameter info
nmap <A-p> <Action>(ParameterInfo)
imap <A-p> <Action>(ParameterInfo)
" Rebind commands that will be repurposed
" Toggle comments
nmap <C--> <Action>(CommentByLineComment)
vmap <C--> <Action>(CommentByBlockComment)
nmap <D--> <C-->
vmap <D--> <C-->
" Navigate back/forward
nmap <BS> <Action>(Back)
nmap <S-BS> <Action>(Forward)
" Navigate to previous/next method
nnoremap [ [m
xnoremap [ [m
nnoremap ] ]m
xnoremap ] ]m
" Alternative bindings for square bracket commands
nnoremap g[ [
xnoremap g[ [
nnoremap g] ]
xnoremap g] ]
" Manage editor tabs
noremap <C-w> :action CloseContent<CR>
noremap <C-S-w> :action ReopenClosedTab<CR>
noremap \\ <C-w>
noremap \\s :action MoveTabDown<CR>
noremap \\S <C-w>s
noremap \\u :action Unsplit<CR>
noremap \\U :action UnsplitAll<CR>
noremap \\v :action MoveTabRight<CR>
noremap \\V <C-w>v
noremap \\qa :action CloseAllEditors<CR>
noremap \\qh :action CloseAllToTheLeft<CR>
noremap \\ql :action CloseAllToTheRight<CR>
noremap \\qo :action CloseAllEditorsButActive<CR>
" Rebind repurposed commands
nnoremap GG G
nnoremap dG dG
nnoremap cG cG
nnoremap M m
nnoremap Z z
noremap \\ <C-w>
" Repurpose 'Enter' for statement completion (requires a custom version of IdeaVIM)
nmap <Enter> :action EditorCompleteStatement<CR>
nmap <Enter> <Action>(EditorCompleteStatement)
" Repurpose special characters for navigation
nmap ( :raction GotoPreviousError<CR>
nmap ) :raction GotoNextError<CR>
nmap [ :raction MethodUp<CR>
nmap ] :raction MethodDown<CR>
nmap { :raction JumpToLastChange<CR>
nmap } :raction JumpToNextChange<CR>
" Repurpose 'g' for navigation (:raction requires a custom version of IdeaVIM)
nmap gb :raction GotoNextBookmark<CR>
nmap gB :raction GotoPreviousBookmark<CR>
nmap gd :action GotoDeclaration<CR>
nmap gD :action GotoTypeDeclaration<CR>
nmap gD <Action>(GotoTypeDeclaration)
nmap ge :raction VcsShowNextChangeMarker<CR>
nmap gE :raction VcsShowPrevChangeMarker<CR>
nmap gi :action GotoImplementation<CR>
nmap gf <Action>(EditSource)
nmap gi <Action>(GotoImplementation)
map gj :raction EditorCloneCaretBelow<CR>
map gk :raction EditorCloneCaretAbove<CR>
nmap gr :action RecentLocations<CR>
nmap gR :action RecentChangedFiles<CR>
nmap gs :action GotoSuperMethod<CR>
nmap gS :action ShowSiblings<CR>
nmap gr <Action>(RecentLocations)
nmap gR <Action>(RecentChangedFiles)
nmap gs <Action>(GotoSuperMethod)
nmap gS <Action>(ShowSiblings)
map gt :raction KM.GotoNextTypeInFile<CR>
map gT :raction KM.GotoPreviousTypeInFile<CR>
nmap gu :action ShowUsages<CR>
nmap gU :action FindUsages<CR>
map gz :action NextSplitter<CR>
map gZ :action PrevSplitter<CR>
nmap gu <Action>(ShowUsages)
nmap gU <Action>(FindUsages)
map gz <Action>(NextSplitter)
map gZ <Action>(PrevSplitter)
nmap g( :raction KM.GotoPreviousErrorInOtherMode<CR>
nmap g) :raction KM.GotoNextErrorInOtherMode<CR>
@ -200,69 +229,60 @@ nmap GT gT
map Gz gz
map GZ gZ
" Repurpose 'z' for view actions, debugger, and tab management
map za :action Annotate<CR>
map zb :action ViewBreakpoints<CR>
map zc :action EditorContextInfo<CR>
map zd :action QuickJavaDoc<CR>
map ze :action ShowErrorDescription<CR>
map zf :action SelectInProjectView<CR>
" Repurpose 'z' for view actions and debugger
map za <Action>(Annotate)
map zb <Action>(ViewBreakpoints)
map zc <Action>(EditorContextInfo)
map zd <Action>(QuickJavaDoc)
map ze <Action>(ShowErrorDescription)
map zf <Action>(SelectInProjectView)
map zht :action TypeHierarchy<CR>
map zhm :action MethodHierarchy<CR>
map zhc :action CallHierarchy<CR>
map zht <Action>(TypeHierarchy)
map zhm <Action>(MethodHierarchy)
map zhc <Action>(CallHierarchy)
map zm :action ShowBookmarks<CR>
map zp :action QuickImplementations<CR>
map zP :action QuickTypeDefinition<CR>
map zm <Action>(ShowBookmarks)
map zp <Action>(QuickImplementations)
map zP <Action>(QuickTypeDefinition)
map zqa :action CloseAllEditors<CR>
map zqh :action CloseAllToTheLeft<CR>
map zql :action CloseAllToTheRight<CR>
map zqo :action CloseAllEditorsButActive<CR>
map zqq :action CloseContent<CR>
map zqu :action ReopenClosedTab<CR>
map zr <Action>(RunToCursor)
map zR <Action>(ForceRunToCursor)
map zr :action RunToCursor<CR>
map zR :action ForceRunToCursor<CR>
map zsd :action MoveTabDown<CR>
map zsr :action MoveTabRight<CR>
map zsu :action Unsplit<CR>
map zsU :action UnsplitAll<CR>
map zt :action ExpressionTypeInfo<CR>
map zx :action EvaluateExpression<CR>
map zt <Action>(ExpressionTypeInfo)
map zx <Action>(EvaluateExpression)
" Repurpose 'm' for refactoring (normal mode)
nmap md :action SafeDelete<CR>
nmap mg :action Generate<CR>
nmap mi :action Inline<CR>
nmap mn :action RenameElement<CR>
nmap mo :action OverrideMethods<CR>
nmap ms :action ChangeSignature<CR>
nmap mS :action NewScratchFile<CR>
nmap md <Action>(SafeDelete)
nmap me <Action>(Move)
nmap mg <Action>(Generate)
nmap mi <Action>(Inline)
nmap mn <Action>(RenameElement)
nmap mo <Action>(OverrideMethods)
nmap ms <Action>(ChangeSignature)
nmap mS <Action>(NewScratchFile)
" Repurpose 'm' for refactoring (normal / visual mode)
nmap mc :action IntroduceConstant<CR>
xmap mc :action IntroduceConstant<CR>
nmap mf :action IntroduceField<CR>
xmap mf :action IntroduceField<CR>
nmap mm :action ExtractMethod<CR>
xmap mm :action ExtractMethod<CR>
nmap mM :action ExtractFunction<CR>
xmap mM :action ExtractFunction<CR>
nmap mp :action IntroduceParameter<CR>
xmap mp :action IntroduceParameter<CR>
nmap mP :action IntroduceProperty<CR>
xmap mP :action IntroduceProperty<CR>
nmap mr :action Refactorings.QuickListPopupAction<CR>
xmap mr :action Refactorings.QuickListPopupAction<CR>
nmap mv :action IntroduceVariable<CR>
xmap mv :action IntroduceVariable<CR>
nmap mw :action SurroundWith<CR>
xmap mw :action SurroundWith<CR>
nmap mc <Action>(IntroduceConstant)
xmap mc <Action>(IntroduceConstant)
nmap mf <Action>(IntroduceField)
xmap mf <Action>(IntroduceField)
nmap mm <Action>(ExtractMethod)
xmap mm <Action>(ExtractMethod)
nmap mM <Action>(ExtractFunction)
xmap mM <Action>(ExtractFunction)
nmap mp <Action>(IntroduceParameter)
xmap mp <Action>(IntroduceParameter)
nmap mP <Action>(IntroduceProperty)
xmap mP <Action>(IntroduceProperty)
nmap mr <Action>(Refactorings.QuickListPopupAction)
xmap mr <Action>(Refactorings.QuickListPopupAction)
nmap mt <Action>(InsertLiveTemplate)
xmap mt <Action>(SurroundWithLiveTemplate)
nmap mv <Action>(IntroduceVariable)
xmap mv <Action>(IntroduceVariable)
nmap mw <Action>(SurroundWith)
xmap mw <Action>(SurroundWith)
" Actions for custom version of AceJump
set acejump
map <Space> :action AceVimAction_JumpAllEditors<CR>
map <Space> <Action>(AceVimAction_JumpAllEditors)