diff --git a/idea/.ideavimrc b/idea/.ideavimrc new file mode 100644 index 0000000..6685a09 --- /dev/null +++ b/idea/.ideavimrc @@ -0,0 +1,145 @@ +set easymotion +set surround + +let mapleader = "," +let g:mapleader = "," + +" set clipboard=unnamed,autoselect +set hlsearch +set scrolloff=3 +set ignorecase +set smartcase +set showmode +set incsearch +set history=1000 + +" source ~/.vimrc + +" general +nnoremap ,a :action GotoAction +vnoremap ,a :action GotoAction +nnoremap ,e :action SearchEverywhere +nnoremap ,s :action FileStructurePopup +nnoremap ,g :action FindInPath +nnoremap ,r :action RecentFiles + +" jump on code +nnoremap gd :action GotoDeclaration +nnoremap gs :action GotoSuperMethod +nnoremap gi :action GotoImplementation +nnoremap gf :action GotoFile +nnoremap gb :action JumpToLastChange +nnoremap gu :action ShowUsages +nnoremap gt :action GotoTest +nnoremap gh :action Back +nnoremap gl :action Forward + +" code editing +" nnoremap r :action RenameElement +nnoremap q :action ShowIntentionActions +nnoremap == :action ReformatCode +vnoremap == :action ReformatCode +nnoremap cc :action CommentByLineComment +vnoremap cc :action CommentByLineComment + +" show information +nnoremap :action QuickJavaDoc + + +" easy window navigation +" nnoremap l +" nnoremap j +" nnoremap h +" nnoremap k +" 在 Tab 间切换 Alt + h/l +nnoremap gT +nnoremap gt +" Ctrl+Shift+Tab Ctrl+Tab +nnoremap gT +nnoremap gt + +" clear the search buffer when hitting return +" nnoremap :nohlsearch + +" options +nnoremap cow :action EditorToggleUseSoftWraps +nnoremap col :action EditorToggleShowWhitespaces + +" actions +nnoremap q :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 GotoAction +nnoremap b :action ToggleLineBreakpoint + +" code navigation +nnoremap ] :action GotoImplementation +nnoremap [ :action GotoSuperMethod +nnoremap u :action FindUsages +nnoremap gt :action GotoTest +nnoremap k :action HighlightUsagesInFile +nnoremap \r :action RunClass +nnoremap \R :action Run +nnoremap \d :action DebugClass +nnoremap \D :action Debug +nnoremap \c :action CheckStyleCurrentFileAction + +" code refactoring +nnoremap rr :action RenameElement + +" unimpaired mappings +nnoremap [ Oj +nnoremap ] ok +nnoremap [q :action PreviousOccurence +nnoremap ]q :action NextOccurence +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/ / + +" 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 +" map g :action AceLineAction \ No newline at end of file