Skip to content

Instantly share code, notes, and snippets.

@ZeekoZhu
Last active January 4, 2023 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZeekoZhu/dadbcb4264dbbe40cbbf5ad8ee1c5480 to your computer and use it in GitHub Desktop.
Save ZeekoZhu/dadbcb4264dbbe40cbbf5ad8ee1c5480 to your computer and use it in GitHub Desktop.
IdeaVim config
nmap <Space> <Nop>
let mapleader = " "
" Options
set ignorecase
set smartcase
set scrolloff=5 " 5 lines above/below cursor when scrolling
set clipboard+=ideaput
set clipboard+=unnamedplus
set ideajoin
set relativenumber number
set hlsearch
set visualbell
set noerrorbells
" Plugins
Plug 'vim-scripts/argtextobj.vim'
let g:argtextobj_pairs = "(:),{:},[:],<:>"
Plug 'tommcdo/vim-exchange'
set surround
set easymotion
set NERDTree
" use track action ids discover more actions
" Navigation
nmap <leader>h :action Back<cr>
nmap <leader>l :action Forward<cr>
nmap <leader>gg :action GotoDeclaration<cr>
nmap <leader>gd :action GotoTypeDeclaration<cr>
nmap <leader>gi :action GotoImplementation<cr>
nmap <leader>gm :action GotoSuperMethod<cr>
nmap <leader>gs :action GotoSymbol<cr>
nmap <leader>gf :action GotoFile<cr>
nmap <leader>gr :action RecentChangedFiles<cr>
nmap s <Plug>(easymotion-s)
vmap s <Plug>(easymotion-s)
" Error navigation
nmap <leader>ej :action GotoNextError<cr>
nmap <leader>ek :action GotoPreviousError<cr>
nmap <leader>el :action ShowErrorDescription<CR>
nmap <leader>ef :action Javascript.Linters.EsLint.Fix<cr>
" Tab management
nmap H :action PreviousTab<cr>
nmap L :action NextTab<cr>
nmap <leader>tx :action CloseEditor<cr>
nmap <leader>ta :action CloseAllEditorsButActive<cr>
nmap <leader>th :action SplitHorizontally<cr>zz
nmap <leader>tj :action SplitVertically<cr>zz
nmap <leader>tm :action MoveEditorToOppositeTabGroup<cr>
nmap <leader>to :action ChangeSplitOrientation<cr>
nmap <leader>tu :action UnsplitAll<cr>
nmap <A-l> :action NextSplitter<cr>
nmap <a_h> :action_prev_splitter<cr>
" Version control
nmap <leader>vu :action Vcs.UpdateProject<cr>
nmap <leader>vp :action Vcs.Push<cr>
nmap <leader>vb :action Annotate<cr>
nmap <leader>vr :action GitMachete.SyncCurrentToParentByRebaseAction<cr>
nmap <leader>vm :action GitMachete.OpenMacheteTabAction<cr>
" Misc
nmap <leader>rg :action Generate<cr>
nmap <leader>rs :action StringManipulation.Group.Main<cr>
vmap <leader>rs :action StringManipulation.Group.Main<cr>
nmap <TAB> :action HideAllWindows<cr>

Required Plugins

  • AceJump
  • IdeaVim-EasyMotion

Space as Leader

Use <SPACE> <key1> <key2> to Inoke IDE actions.

  • <SPACE> g <key> Goto xxxx

    • g goto declaration or usage
    • d goto type declaration
    • i goto implementation
    • m goto super method
    • s search and goto symbol
    • f search and goto file
    • r goto recent changed files
  • <SPACE> e <key> Error navigation

    • j goto next error
    • k goto previous error
    • f fix all eslint errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment