需要的插件
我的配置
syntax on
# 行号设置
set number
set relativenumber
" 将tab替换为相应数量的空格
set expandtab
" 使用系统剪切板
set clipboard+=unnamedplus
" 使用idea 的行连接方式
set ideajoin
set ignorecase
set idearefactormode=keep
let mapleader=' '
set easymotion
set surround
" multiple-cursors start
set multiple-cursors
vmap <C-j> <Plug>NextWholeOccurrence
vmap g<C-j> <Plug>NextOccurrence
vmap <C-x> <Plug>SkipOccurrence
vmap <C-k> <Plug>RemoveOccurrence
vmap <S-C-j> <Plug>AllWholeOccurrences
vmap g<S-C-j> <Plug>AllOccurrences
" multiple-cursors end
" Which-key
set which-key
set notimeout
" redo
map U <C-r>
" NERDTree config
set NERDTree
map tt :NERDTreeToggle<CR>
map tc :NERDTreeClose<CR>
map tf :NERDTreeFocus<CR>
map H ^
map L $
" Actions
map <leader>g <Action>(EditorCompleteStatement)
map <leader>x <Action>(ShowIntentionActions)
map <leader>s <Action>(SearchEverywhere)
map <leader>f <Action>(FindInPath)
" 跳转到类
map <leader>o <Action>(GotoClass)
" 显示文件结构
map <leader>m <Action>(FileStructurePopup)
" 展示类继承关系
map <leader>h <Action>(TypeHierarchy)
" 复制一行
map <leader>d <Action>(EditorDuplicate)
" 复制选中的行
vmap <leader>d <Action>(EditorDuplicateLines)
map <leader>n <Action>(Generate)
map <leader>e <Action>(GotoNextError)
" 重命名 文件
map <leader>A <Action>(RenameFile)
" 重命名 变量、类名
map <leader>a <Action>(RenameElement)
map <leader>r <Action>(RunClass)
map <leader>R <Action>(DebugClass)
map <leader>b <Action>(ToggleLineBreakpoint)
map <leader>/ <Action>(CommentByLineComment)
vmap <leader>/ <Action>(CommentByBlockComment)
" 退出
map <leader>c <Action>(CloseContent)
map <leader>C <Action>(CloseAllEditors)
map == <Action>(ReformatCode)
" 跳转相关配置
map gd <Action>(GotoDeclaration)
map gu <Action>(GotoSuperMethod)
map gi <Action>(GotoImplementation)
map ga <Action>(GotoAction)
map gt <Action>(GotoTest)
" 抽取方法
map me <Action>(ExtractMethod)
map mi <Action>(ImplementMethods)
map mo <Action>(OverrideMethods)
map <s-tab> <Action>(PreviousTab)
map <tab> <Action>(NextTab)
" Refactor
map mr <Action>(Refactorings.QuickListPopupAction)
map <leader>ip <Action>(IntroduceParameter)
map <leader>iv <Action>(IntroduceVariable)
map <leader>ic <Action>(IntroduceConstant)
map <leader>if <Action>(IntroduceField)
" 窗口分割
map <c-\> <Action>(SplitVertically)
map <c--> <Action>(SplitHorizontally)
map <c-m> <Action>(MoveEditorToOppositeTabGroup)
sethandler <c-j> a:vim
sethandler <c-k> a:vim
" 窗口之间跳转
nmap <c-h> <c-w>h
nmap <c-j> <c-w>j
nmap <c-k> <c-w>k
nmap <c-l> <c-w>l
" 终端
sethandler <c-t> a:vim
map <c-t> <Action>(Terminal.OpenInTerminal)
map <leader>t <Action>(ActivateTerminalToolWindow)