|
vim mode... 分享一个 idea 的配置
```
" ref: .ideavimrc https://github.com/JetBrains/ideavim/discussions/303
" ref: https://github.com/JetBrains/ideavim/wiki/set-commands
" base configuration
" :actionlist
set showmode
set incsearch
set hlsearch
set nu
set relativenumber
set ignorecase
set smartcase
set clipboard+=unnamed
" keymaps
" the leader key
let mapleader=" "
" redo
nnoremap U
" zen-mode
nnoremap :action ToggleDistractionFreeMode
" find
nnoremap :action GotoFile
nnoremap :action RecentFiles
" navigation
nnoremap J }
nnoremap K {
nnoremap sv :action SplitVertically
nnoremap ss :action SplitHorizontally
nnoremap sm :action MoveEditorToOppositeTabGroup
nnoremap sh h
nnoremap sl l
nnoremap sj
nnoremap sk k
nnoremap jp :action PreviousTab
" S => right shift
nnoremap jn :action NextTab
nnoremap ;q :action CloseContent
nnoremap ;a :action CloseAllEditors
" code interactions
nnoremap c :action CommentByLineComment
nnoremap C :action CommentByBlockComment
nnoremap r :action RenameElement
nnoremap f :action ReformatCode
nnoremap re :action Refactorings.QuickListPopupAction
nnoremap su :action ShowUsages
nnoremap sU :action FindUsages
nnoremap m :action CollapseRegion
nnoremap M :action ExpandRegion
nnoremap am :action CollapseAllRegions
nnoremap aM :action ExpandAllRegions
" goto start with g
" goto LSP start with s
nnoremap ge :action GotoNextError
nnoremap gE :action GotoNextError
nnoremap ga :action GotoAction
nnoremap gc :action GotoClass
nnoremap gi :action GotoImplementation
nnoremap si :action LSP.GotoImplementation
nnoremap go :action GotoSuperMethod
nnoremap gd :action GotoDeclaration
nnoremap sd :action LSP.GotoDeclaration
nnoremap sr :action LSP.GotoReference
nnoremap st :action LSP.GotoTypeDefinition
nnoremap gf :action GotoSymbol
nnoremap gt :action GotoTest
nnoremap gT :action TextSearchAction
nnoremap gs :action copilot.chat.show
" code selection
nnoremap :action MoveLineDown
nnoremap :action MoveLineUp
" debugging
nnoremap d :action Debug
nnoremap dc :action DebugClass
nnoremap ds :action Stop
nnoremap db :action ToggleLineBreakpoint
" run
nnoremap rc :action ContextRun
nnoremap rx :action ChooseRunConfiguration
nnoremap rr :action Rerun
nnoremap rt :action RunTests
nnoremap rs :action Stop
" search
nnoremap :action SearchEverywhere
"---------- plugins ----------
" easy motion
set easymotion
map f (easymotion-s)
" commentary
" gcc | gcm
Plugin 'tpope/vim-commentary'
set commentary
``` |