Skip to content

Instantly share code, notes, and snippets.

@mateusdotcc
Last active April 10, 2025 13:40
Show Gist options
  • Save mateusdotcc/f0ee2b5085b7a7ff6be83a902eec3302 to your computer and use it in GitHub Desktop.
Save mateusdotcc/f0ee2b5085b7a7ff6be83a902eec3302 to your computer and use it in GitHub Desktop.
My ideavim config
" see all commands for mapping with :actionlist
" https://github.com/JetBrains/ideavim?tab=readme-ov-file#executing-ide-actions
let mapleader=" "
set ideajoin
set noshowcmd
set ideastatusicon=gray
set scrolloff=10
set clipboard^=unnamed,unnamedplus
set hlsearch
set ignorecase
set incsearch
set smartcase
set commentary
set surround
set highlightedyank
"PLUGINS SETUPS
set NERDTree
let g:NERDTreeMapActivateNode='l'
let g:NERDTreeMapJumpParent='h'
set multiple-cursors
map mc <A-n>
map mx <A-x>
map mp <A-p>
map <Leader>j <Action>(AceAction)
map <C-a>p <Action>(FrameSwitchAction)
"NAVIGATION
nmap <Leader>bb <Action>(RecentFiles)
nmap <Leader>pt <Action>(ActivateProjectToolWindow)
nmap <Leader>wu <Action>(ReopenClosedTab)
nmap <Leader>ga <Action>(Annotate)
nmap <Leader>gb <Action>(Git.Branches)
" paste over without overwriting default register
xnoremap p P
"remove highlights
noremap <Esc> :nohlsearch<cr>
" HOTKEYS
map <Leader>ra <Action>(RearrangeCode)
map <Leader>sw <Action>(SurroundWith)
map <S-space> <Action>(Generate)
"map <C-[> <Action>(EditorCompleteStatement)
map <Leader>cf <Action>(ReformatCode)
map <Leader>cap <Action>(CopyAbsolutePath)
map <Leader>cfn <Action>(CopyFileName)
map <Leader>crp <Action>(CopyContentRootPath)
map <Leader>qq <Action>(CloseContent)
map <Leader>qa <Action>(CloseAllEditors)
map <Leader>nf <Action>(NewFile)
map <Leader>nd <Action>(NewDir)
map <Leader>ri <Action>(RestartIde)
nmap <Leader>su <Action>(ShowUsages)
nmap <Leader>vs <Action>(ViewSource)
nmap <Leader>fc <Action>(GotoClass)
nmap <Leader>f <Action>(GotoFile)
nmap <Leader>fs <Action>(GotoSymbol)
nmap <Leader>fa <Action>(GotoAction)
nmap <Leader>gD <Action>(GotoTypeDeclaration)
nmap <Leader>gi <Action>(GotoImplementation)
nmap <Leader>im <Action>(QuickImplementations)
nmap <Leader>td <Action>(QuickTypeDefinition)
nmap <Leader>shi <Action>(ShowHoverInfo)
nmap ]e <Action>(GotoNextError)
nmap [e <Action>(GotoPreviousError)
nmap gb <Action>(Back)
nmap gf <Action>(Forward)
nmap <Leader>ca <Action>(ShowIntentionActions)
nmap <Leader>ft <Action>(ActivateTerminalToolWindow)
nmap <Leader>h <Action>(Vcs.ShowTabbedFileHistory)
nmap <Leader>l <Action>(EditorToggleShowLineNumbers)
vmap <Leader>i <Action>(ShowIntentionActions)
vmap <Leader>cA <Action>(Refactorings.QuickListPopupAction)
" vmap <Leader>c <Action>(CopyAsPlainText)
vmap <S-j> <Action>(MoveLineDown)
vmap <S-k> <Action>(MoveLineUp)
nmap <C-i> <Action>(MoveStatementDown)
nmap <C-o> <Action>(MoveStatementUp)
nmap <Leader>e <Action>(EditSourceInNewWindow)
nmap <Leader>n <Action>(NextWindow)
nmap <Leader>x <Action>(HideActiveWindow)
nmap <Leader>, <Action>(ProjectView.ShowExcludedFiles)
nmap <Leader>cr <Action>(RenameElement)
map <leader>cR <Action>(RenameFile)
nmap <Leader>oi <Action>(OptimizeImports)
nmap <Leader>uh <Action>(ToggleInlayHintsGloballyAction)
nmap <Leader>oo <Action>(ActivateStructureToolWindow)
nmap <Leader>q <Action>(ServiceView.ActivateRunDashboardServiceViewContributor)
nmap <Leader>xx <Action>(QuickFixes)
nmap <Leader>xX <Action>(ActivateProblemsViewToolWindow)
nmap <S-e> <Action>(ShowErrorDescription)
map [[ <Action>(MethodUp)
map ]] <Action>(MethodDown)
nmap << :tabm-1
nmap >> :tabm+1
" Sonar
nmap <Leader>st <Action>(ActivateSonarQubeforIDEToolWindow)
" Surround
map <Leader>sw <Action>(SurroundWith)
" Refactoring
nmap <Leader>rn <Action>(RenameElement)
nmap <Leader>rf <Action>(RenameFile)
nmap <Leader>rs <Action>(ChangeSignature)
nmap <Leader>rm <Action>(Move)
nmap <Leader>rc <Action>(CopyElement)
" Search
nmap <Leader>ff <Action>(FindInPath)
nmap <Leader>fu <Action>(FindUsages)
" Save all
nmap <Leader>w <Action>(SaveAll)
" AI
map <Leader>ac <Action>(ActivateAIAssistantToolWindow)
map <Leader>ai <Action>(CallInlineCompletionAction)
map <Leader>aa <Action>(AIAssistant.Editor.AskAiAssistantInEditor)
map <Leader>aj <Action>(ActivateElectroJunToolWindowToolWindow)
map <Leader>agc <Action>(Vcs.LLMCommitMessageAction)
" String manipulation
nmap <leader>ss<Action>(osmedile.intellij.stringmanip.PopupChoiceAction)
vmap U <Action>(osmedile.intellij.stringmanip.ToUpperCaseAction)
vmap u <Action>(osmedile.intellij.stringmanip.ToLowerCaseAction)
vmap gac <Action>(StringManipulation.ToCamelCase)
" Window
map <c-h> <c-w>h
map <c-l> <c-w>l
map <c-j> <c-w>j
map <c-k> <c-w>k
nmap <Leader>sm <Action>(MoveEditorToOppositeTabGroup)<cr>
nmap <Leader>wm <Action>(MaximizeEditorInSplit)
nmap <Leader>wq <Action>(HideActiveWindow)
map <Leader><tab>] <Action>(NextTab)
map <Leader><tab>[ <Action>(PreviousTab)
map <Leader>cp <Action>(CloseProject)
" Split window
nmap <Leader>sh :split<cr>
nmap <Leader>sv :vsplit<cr>
nmap <Leader>ss <Action>(MoveEditorToOppositeTabGroup)
nmap <Leader>sH <Action>(MoveTabDown)
nmap <Leader>sV <Action>(MoveTabRight)
nmap <Leader>ww <Action>(Unsplit)
nmap <Leader>wa <Action>(UnsplitAll)
nmap <Leader>fm <Action>(MaximizeToolWindow)
" Bookmarks
nmap <Leader>bp <Action>(ToggleBookmark)
" nmap ]b <Action>(GotoNextBookmark)
" nmap [b <Action>(GotoPreviousBookmark)
" Git
nmap <Leader>cc <Action>(CheckinProject)
nmap <Leader>gg <Action>(ActivateVersionControlToolWindow)
nmap <Leader>pr <Action>(Github.Create.Pull.Request)
nmap <Leader>PR <Action>(ActivatePullRequestsToolWindow)
nmap <Leader>ro <Action>(ChangesView.Revert)
nmap <Leader>go <Action>(uk.co.ben_gibson.git.link.ui.actions.menu.BrowserAction)
" Folding
map zf <Action>(ExpandCollapseToggleAction)
map za <Action>(CollapseAllRegions)
map zA <Action>(ExpandAllRegions)
xmap zs <Action>(CollapseSelection)<ESC>
" Open .ideavimrc
noremap <Leader>iv :edit ~/.ideavimrc<cr>
" Source config
noremap <Leader>cs :source ~/.ideavimrc<cr>:nohlsearch<cr>
" select the entire function
" nmap vaf v/{<CR>%V
" move to the beginning of the next word
" map w [w
" move to the end of the next word
" map e ]w
" move to the beginning of the previous word
" map b [b
" move to the end of the previous word
" map ge ]b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment