" see more https://blog.einverne.info/post/2020/12/my-idea-vimrc-config.html " enable plugin set easymotion set surround set multiple-cursors set nu " 相对行号 set rnu " set clipboard=unnamed,autoselect " Use comma as leader key, there are other modifier keys in this config, " like space, \, t(in normal mode for toggle something), " g(in normal mode for goto somewhere) let mapleader = "," let g:mapleader = "," " https://github.com/JetBrains/ideavim/blob/master/doc/set-commands.md set hlsearch set incsearch set scrolloff=5 set ignorecase set smartcase " 当前模式 set showmode set history=10000 " source ~/.vimrc noremap r :source ~/.ideavimrc " general nnoremap f :action ReformatCode nnoremap g :action FindInPath vnoremap g :action FindInPath nnoremap r :action RenameElement nnoremap o :action RecentProjectListGroup nnoremap d :action ChooseDebugConfiguration nnoremap w :action CloseAllEditorsButActive " screen management " Vertical split screen nnoremap \ v nnoremap - s nnoremap h nnoremap l nnoremap j nnoremap k " Redo nnoremap U " go to somewhere (g in normal mode for goto somewhere) nnoremap ga :action GotoAction nnoremap gc :action GotoClass nnoremap gd :action GotoDeclaration nnoremap gs :action GotoSuperMethod nnoremap gi :action GotoImplementation nnoremap gf :action GotoFile nnoremap gm :action GotoSymbol nnoremap gl :action JumpToLastChange nnoremap gu :action ShowUsages nnoremap gt :action GotoTest nnoremap gp :action FindInPath nnoremap gr :action RecentFiles " cmd + [ and cmd + ] " nnoremap gh :action Back " nnoremap gl :action Forward " code editing nnoremap == :action ReformatCode vnoremap == :action ReformatCode " nnoremap \i :action OptimizeImports " vnoremap \i :action OptimizeImports " nnoremap \r :action RenameElement nnoremap q :action ShowIntentionActions nnoremap cc :action CommentByLineComment vnoremap cc :action CommentByLineComment " show information nnoremap :action QuickJavaDoc " 在 Tab 间切换 Alt/Option + h/l nnoremap h gT nnoremap l gt " Ctrl+Shift+Tab Ctrl+Tab nnoremap gT nnoremap gt " clear the search buffer when hitting return nnoremap :nohlsearch " show information nnoremap :action QuickJavaDoc " options nnoremap cow :action EditorToggleUseSoftWraps nnoremap col :action EditorToggleShowWhitespaces nnoremap ta :action Annotate nnoremap tb :action ToggleLineBreakpoint nnoremap tm :action ToggleBookmark nnoremap tp :action ActivateProjectToolWindow " actions nnoremap q :action CloseContent nnoremap w :action CloseContent nnoremap Q :action ReopenClosedTab nnoremap \ :action VimFilePrevious nnoremap e :action SearchEverywhere nnoremap E :action Switcher nnoremap t :action FileStructurePopup nnoremap T :action GotoSymbol nnoremap a :action Annotate nnoremap b :action ToggleLineBreakpoint nnoremap u :action FindUsages nnoremap k :action HighlightUsagesInFile " Run and debug nnoremap \r :action RunClass nnoremap \R :action Run nnoremap \d :action DebugClass nnoremap \D :action Debug nnoremap \c :action CheckStyleCurrentFileAction " unimpaired mappings nnoremap [ Oj nnoremap ] ok nnoremap [q :action PreviousOccurrence nnoremap ]q :action NextOccurrence nnoremap [m :action MethodUp nnoremap ]m :action MethodDown nnoremap [c :action VcsShowPrevChangeMarker nnoremap ]c :action VcsShowNextChangeMarker " built-in navigation to navigated items works better " nnoremap :action Back " nnoremap :action Forward " but preserve ideavim defaults nnoremap g nnoremap g " built in search looks better " nnoremap / :action Find " but preserve ideavim search nnoremap g/ :action FindInPath noremap ' :action Replace noremap g' :action ReplaceInPath nnoremap [[ :action MethodUp nnoremap ]] :action MethodDown " easy motion" map , (easymotion-prefix) "Turn on case insensitive feature let g:EasyMotion_smartcase = 1 "Use upper target labels and type as a lower case let g:EasyMotion_use_upper = 0 " move to character nmap f (easymotion-s2) xmap f (easymotion-s2) omap f (easymotion-s2) " move to word nmap F (easymotion-bd-w) xmap F (easymotion-bd-w) omap F (easymotion-bd-w) " move to line " nmap gl (easymotion-bd-jk) " xmap gl (easymotion-bd-jk) " omap gl (easymotion-bd-jk) " acejump" " Press `f` to activate AceJump nnoremap f :action AceAction " Press `F` to activate Target Mode " 在 Target 模式下会跳转到目标,并选中目标整个Word" nnoremap F :action AceTargetAction " Press `g` to activate Line Mode " nnoremap g :action AceLineAction " kick intellij commands " nnoremap R :action ChooseRunConfiguration nnoremap D :action ChooseRunConfiguration " nnoremap F5 :action StepInto " nnoremap F6 :action StepOver " nnoremap F8 :action Resume " window nnoremap s; :action CloseActiveTab nnoremap so :action MoveEditorToOppositeTabGroup " multiple cursors " , , , g