需要的插件
- IdeaVim
- IdeaVimExtension
我的配置
syntax on
# 行號設置
set number
set relativenumber
" 將tab替換為相應數量的空格
set expandtab
" 使用系統(tǒng)剪切板
set clipboard+=unnamedplus
" 使用idea 的行連接方式
set ideajoin
set ignorecase
set idearefactormode=keep
let mapleader=' '
set surround
" multiple-cursors start
set multiple-cursors
vmap <C-n> <Plug>NextWholeOccurrence
vmap <C-k> <Plug>SkipOccurrence
vmap <C-p> <Plug>RemoveOccurrence
" multiple-cursors end
" redo
noremap U <C-r>
" NERDTree config
set NERDTree
noremap tt :NERDTreeToggle<CR>
noremap tf :NERDTreeFind<CR>
noremap H ^
noremap L $
" Actions
map <leader>x <Action>(ShowIntentionActions)
" 顯示文件結構
map <leader>m <Action>(FileStructurePopup)
" 重命名 變量、類名
map <leader>a <Action>(RenameElement)
" 運行/調試
map <leader>r <Action>(RunClass)
map <leader>d <Action>(DebugClass)
" code format
map == <Action>(ReformatCode)
" 跳轉相關配置
map gd <Action>(GotoDeclaration)
map gu <Action>(GotoSuperMethod)
map gi <Action>(GotoImplementation)
map ga <Action>(GotoAction)
map gt <Action>(GotoTest)
" 抽取方法
vmap me <Action>(ExtractMethod)
map mi <Action>(ImplementMethods)
map mo <Action>(OverrideMethods)
" Refactor
map mr <Action>(Refactorings.QuickListPopupAction)
" 窗口分割
map <c-\> <Action>(SplitVertically)
map <c--> <Action>(SplitHorizontally)
map <c-m> <Action>(MoveEditorToOppositeTabGroup)
" 窗口之間跳轉
nnoremap <c-h> <c-w>h
nnoremap <c-j> <c-w>j
nnoremap <c-k> <c-w>k
nnoremap <c-l> <c-w>l
" 可視模式縮進保持選擇
vnoremap < <gv
vnoremap > >gv