Skip to content

Instantly share code, notes, and snippets.

@Anudin
Last active October 4, 2022 12:51
Show Gist options
  • Select an option

  • Save Anudin/76ffd6d1c2c7e0d855632c207b74bd04 to your computer and use it in GitHub Desktop.

Select an option

Save Anudin/76ffd6d1c2c7e0d855632c207b74bd04 to your computer and use it in GitHub Desktop.
Anudin's IdeaVim configuration, baseline happy
" Required IntelliJ plugins: IdeaVim, IdeaVim-EasyMotion (AceJump)
let mapleader=" "
" Most plugins seem to be activated by default, be explicit just to be sure
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-surround'
Plug 'dbakker/vim-paragraph-motion'
Plug 'michaeljsmith/vim-indent-object'
Plug 'vim-scripts/argtextobj.vim'
Plug 'chrisbra/matchit'
Plug 'easymotion/vim-easymotion'
" I use IntelliJs native multiple cursors feature or Vim macros instead of:
" vim-multiple-cursors / vim-visual-multi
"" -- Plugin options --
let g:argtextobj_pairs="[:],(:),<:>"
let g:EasyMotion_do_mapping = 0
map <Leader>j <Plug>(easymotion-bd-fn)
let g:EasyMotion_use_upper = 1
let g:EasyMotion_keys = 'ASDFGHJKLWEIORUVN'
let g:EasyMotion_smartcase = 1
let g:EasyMotion_space_jump_first = 1 " Currently not supported, might be worth a contribution
"" -- Options --
set ideavimsupport=
set showmode
set ideamarks
set ideajoin
set scrolloff=5
set incsearch
set nu
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
"" Discover action ids with "IdeaVim: track action Ids"
map gi <Action>(GotoImplementation)
" These are bound by default and are already where you'd expect them in Vim
" map gd <Action>(GotoDeclaration)
" map K <Action>(QuickJavaDoc)
" Use <C-w> s/v to create splits (C = Ctrl)
" Use <C-w> h/j/k/l to navigate splits
map <Leader>b <Action>(ToggleLineBreakpoint)
map <Leader>f <Action>(OptimizeImports) <bar> <Action>(ReformatCode)
map <Leader>n <Action>(RenameElement)
map <Leader>p <Action>(SelectInProjectView)
map <Leader>r <Action>(Refactorings.QuickListPopupAction)
map <Leader>v <Action>(IntroduceVariable)
map <Leader><Leader>r <Action>(Run)
map <Leader><Leader>d <Action>(Debug)
map <Leader><Leader>s <Action>(Stop)
map <Leader><Leader>cr <Action>(ChooseRunConfiguration)
map <Leader><Leader>cd <Action>(ChooseDebugConfiguration)
" I use the standard IntelliJ mappings for these:
" ActivateProjectToolWindow
" CheckinProject
" SearchEverywhere
" Find more examples here: https://jb.gg/share-ideavimrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment