Last active
March 10, 2023 23:41
-
-
Save lpld/8dc1c6f3e942c5685f65566756ca7d27 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source ~/.vimrc | |
set visualbell | |
set noerrorbells | |
set surround | |
set relativenumber | |
" disable mappings from .vimrc | |
inoremap <C-U> <C-U> | |
inoremap <CR> <CR> | |
" in vim i use Tab to switch buffers | |
nnoremap <Tab> gt | |
nnoremap <S-Tab> gT | |
" similar to my vim Nerd tree mapping | |
nnoremap <Leader>n :action ActivateProjectToolWindow<CR> | |
" misc actions | |
nnoremap <Leader>z :action HideAllWindows<CR> | |
nnoremap <Leader>x :q<CR> | |
inoremap ;; <Esc>:action EditorCompleteStatement<CR> | |
" build and debug actions | |
nnoremap <Leader>Bp :action ViewBreakpoints<CR> | |
nnoremap <Leader>bP :action EditBreakpoint<CR> | |
nnoremap <Leader>bp :action ToggleLineBreakpoint<CR> | |
nnoremap <Leader>bB :action Compile<CR> | |
nnoremap <Leader>bb :action CompileDirty<CR> | |
nnoremap <Leader>bm :action Maven.ExecuteGoal<CR> | |
nnoremap <Leader>bM :action ActivateMavenProjectsToolWindow<CR> | |
nnoremap <Leader>bx :action RunClass<CR> | |
nnoremap <Leader>bX :action DebugClass<CR> | |
nnoremap <Leader>br :action Run<CR> | |
nnoremap <Leader>bR :action ChooseRunConfiguration<CR> | |
nnoremap <Leader>bd :action Debug<CR> | |
nnoremap <Leader>bD :action ChooseDebugConfiguration<CR> | |
nnoremap <Leader>bc :action CreateRunConfiguration<CR> | |
nnoremap <Leader>bC :action editRunConfigurations<CR> | |
" version control actions | |
nnoremap ]v :action VcsShowNextChangeMarker<CR> | |
nnoremap [v :action VcsShowPrevChangeMarker<CR> | |
nnoremap <Leader>vd :action VcsShowCurrentChangeMarker<CR> | |
nnoremap <Leader>vr :action Vcs.RollbackChangedLines<CR> | |
nnoremap <Leader>vu :action Vcs.UpdateProject<CR> | |
nnoremap <Leader>vp :action Vcs.Push<CR> | |
nnoremap <Leader>vc :action Vcs.QuickListPopupAction<CR> | |
nnoremap <Leader>vb :action Git.Branches<CR> | |
nnoremap <Leader>vv :action ActivateVersionControlToolWindow<CR> | |
nnoremap <Leader>va :set norelativenumber<CR>:action Annotate<CR> | |
" extract actions | |
nnoremap <Leader>ei :action ExtractInterface<CR> | |
nnoremap <Leader>es :action ExtractSuperclass<CR> | |
nnoremap <Leader>en :action ExtractClass<CR> | |
nnoremap <Leader>em :action ExtractMethod<CR> | |
vnoremap <Leader>em <Esc>gvhh:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action ExtractMethod<CR> | |
nnoremap <Leader>ev :action IntroduceVariable<CR> | |
vnoremap <Leader>ev <Esc>gvhh:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action IntroduceVariable<CR> | |
nnoremap <Leader>ef :action IntroduceField<CR> | |
vnoremap <Leader>ef <Esc>gvhh:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action IntroduceField<CR> | |
nnoremap <Leader>ep :action IntroduceParameter<CR> | |
vnoremap <Leader>ep <Esc>gvhh:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action IntroduceParameter<CR> | |
nnoremap <Leader>ec :action IntroduceConstant<CR> | |
vnoremap <Leader>ec <Esc>gvhh:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action IntroduceConstant<CR> | |
" 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>ff :action ReformatCode<CR> | |
vnoremap <Leader>ff <Esc>gvhh:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action ReformatCode<CR>gv | |
nnoremap <Leader>fi :action OptimizeImports<CR> | |
nnoremap <Leader>fa :action ShowIntentionActions<CR><Esc> | |
" navigation ans search | |
nnoremap <Leader>su :action ShowUsages<CR> | |
nnoremap <Leader>sU :action FindUsages<CR> | |
nnoremap <Leader>si :action GotoImplementation<CR> | |
nnoremap <Leader>ss :action GotoSuperMethod<CR> | |
nnoremap <Leader>sd :action QuickImplementations<CR> | |
nnoremap <Leader>st :action GotoTypeDeclaration<CR> | |
nnoremap <Leader>sp :action Scala.TypeInfo<CR>:action ExpressionTypeInfo<CR> | |
vnoremap <Leader>sp <Esc>gvhh:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action Scala.TypeInfo<CR>:action ExpressionTypeInfo<CR>gv | |
nnoremap <Leader>sq :action Scala.GoToImplicit<CR> | |
vnoremap <Leader>sq <Esc>gvhh:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action Scala.GoToImplicit<CR> | |
nnoremap <Leader>sQ :action Scala.ShowImplicitParameters<CR> | |
nnoremap <Leader>sb :action ShowNavBar<CR> | |
nnoremap <Leader>sn :action SelectIn<CR> | |
nnoremap <Leader>se :action ShowErrorDescription<CR> | |
" ideavim regex are a bit buggy, cannot use regex from vimrc | |
nnoremap ]c /\\<trait\>\\\|\\<class\>\\\|\\<object\>\\\|\\<interface\>\\\|\\<enum\><CR>w:nohlsearch<CR> | |
nnoremap [c b?\\<trait\>\\\|\\<class\>\\\|\\<object\>\\\|\\<interface\>\\\|\\<enum\><CR>w:nohlsearch<CR> | |
nnoremap ]d /\\<def\><CR>w:nohlsearch<CR> | |
nnoremap [d b?\\<def\><CR>w:nohlsearch<CR> | |
nnoremap ]e :action GotoNextError<CR> | |
nnoremap [e :action GotoPreviousError<CR> | |
" hierarchy actions | |
nnoremap <Leader>hh :action TypeHierarchy<CR> | |
nnoremap <Leader>hm :action MethodHierarchy<CR> | |
nnoremap <Leader>hc :action CallHierarchy<CR> | |
nnoremap <Leader>hd :action ShowUmlDiagramPopup<CR> | |
" generate actions | |
nnoremap <Leader>ge :action GenerateEquals<CR> | |
nnoremap <Leader>gg :action GenerateGetter<CR> | |
nnoremap <Leader>gs :action GenerateSetter<CR> | |
nnoremap <Leader>ga :action GenerateGetterAndSetter<CR> | |
nnoremap <Leader>gc :action GenerateConstructor<CR> | |
nnoremap <Leader>gt :action Actions.ActionsPlugin.GenerateToString<CR> | |
nnoremap <Leader>go :action OverrideMethods<CR> | |
nnoremap <Leader>gi :action ImplementMethods<CR> | |
nnoremap <Leader>gd :action DelegateMethods<CR> | |
" bookmarks (a bit similar to vim marks) | |
nnoremap <Leader>m :action ToggleBookmarkWithMnemonic<CR> | |
nnoremap <Leader>' :action ShowBookmarks<CR> | |
nnoremap <Leader>` :action ShowBookmarks<CR> | |
nnoremap ]b :action GotoNextBookmark<CR> | |
nnoremap [b :action GotoPreviousBookmark<CR> | |
" fix visual selection bug | |
nnoremap gv gvh | |
" override settings from vimrc | |
vnoremap v v | |
vnoremap <C-v> <C-v> | |
" toggle relative numbers | |
nnoremap <F3> :set relativenumber!<CR> | |
" comment a line, similar to tpope/vim-commentary | |
nnoremap gcc :action CommentByLineComment<CR> | |
vnoremap gc :<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action CommentByLineComment<CR>gv | |
nnoremap gcap vap:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>:action CommentByLineComment<CR>gv | |
" lombok | |
nnoremap <Leader>ld :action defaultLombokData<CR> | |
nnoremap <Leader>le :action defaultLombokEqualsAndHashcode<CR> | |
nnoremap <Leader>lg :action defaultLombokGetter<CR> | |
nnoremap <Leader>ll :action defaultLombokLogger<CR> | |
nnoremap <Leader>ls :action defaultLombokSetter<CR> | |
nnoremap <Leader>lt :action defaultLombokToString<CR> | |
nnoremap <Leader>lr ?\\<class\>\\\|\\<enum\><CR>:nohlsearch<CR>[email protected]<Esc> | |
" this still doesn't work :( | |
nnoremap <Leader>/ /\\< \> | |
nnoremap <Leader>? ?\\< \> |
@aowoWolf This is a workaround for a couple Ideavim bugs. You can find more details here: https://youtrack.jetbrains.net/issue/VIM-862 (see comments).
BTW, looks like they all must be fixed by now. Need to check this out and update my configs.
Hei, where i can't find action list from phpstorm, to create my mapping?
Thanks.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a question,what does this code mean?^_^
<Esc>gvhh:<bs><bs><bs><bs><bs>action VimVisualSwapSelections<cr>