" ============================================================ " .ideavimrc — IdeaVim configuration " Mirrors the Neovim setup in lua/brian/ " See docs/ideavimrc.md for the full migration reference. " " All IDE actions use :action instead of (ID). " Both are documented by IdeaVim but () in a mapping RHS " can silently fall through and type the text literally. " ============================================================ " ============================================================ " sethandler — MUST be at top level before any mappings. " IdeaVim processes these in a separate startup phase; putting " them inside an if block causes them to be silently ignored, " which makes C-h/C-l fire random IDE actions unpredictably. " ============================================================ sethandler a:vim sethandler a:vim sethandler a:vim sethandler a:vim sethandler a:vim sethandler a:vim sethandler a:vim " ============================================================ " Leader " ============================================================ let mapleader = " " let maplocalleader = " " " ============================================================ " Core options " IdeaVim does not support indentation options (shiftwidth, " tabstop, expandtab, smartindent) — configure those under " Settings → Editor → Code Style in the IDE. " ============================================================ set number set relativenumber set scrolloff=4 set sidescrolloff=8 set incsearch set hlsearch set ignorecase set smartcase set nowrap set clipboard+=unnamedplus,ideaput set timeoutlen=300 " ============================================================ " IdeaVim plugin emulation " " which-key : install "IdeaVim-Which-Key" from Marketplace first " easymotion: install "IdeaVim-EasyMotion" from Marketplace first " ============================================================ set NERDTree set surround set commentary set highlightedyank set argtextobj set matchit " set which-key " uncomment after installing IdeaVim-Which-Key " set easymotion " uncomment after installing IdeaVim-EasyMotion " ============================================================ " NvimTree-style navigation " " focus the Project tool window (file tree) " focus the editor — no panels opened or closed " e toggle the tree panel " ============================================================ nnoremap :action ActivateProjectToolWindow nnoremap :action FocusEditor nnoremap e :NERDTree " ============================================================ " Split navigation (mirrors keymaps.lua C-hjkl wincmd) " ============================================================ nnoremap k nnoremap j nnoremap wh h nnoremap wl l nnoremap wj j nnoremap wk k nnoremap wp p nnoremap v :action SplitVertically nnoremap h :action SplitHorizontally nnoremap se :action ChangeSplitOrientation nnoremap xs :action Unsplit " ============================================================ " File / buffer / search (Telescope equivalents) " ============================================================ nnoremap sf :action GotoFile nnoremap :action Switcher nnoremap sb :action Switcher nnoremap sg :action FindInPath nnoremap so :action RecentFiles nnoremap sds :action FileStructurePopup nnoremap sw :action FindUsages nnoremap sd :action ActivateProblemsViewToolWindow nnoremap sm :action ShowBookmarks nnoremap / :action Find " ============================================================ " LSP equivalents (mirrors lua/brian/lsp.lua) " ============================================================ nnoremap gd :action GotoDeclaration nnoremap gD :action GotoDeclaration nnoremap gi :action GotoImplementation nnoremap gR :action FindUsages nnoremap gt :action GotoTypeDeclaration nnoremap K :action QuickJavaDoc nnoremap ca :action ShowIntentionActions nnoremap rn :action RenameElement nnoremap D :action ActivateProblemsViewToolWindow nnoremap df :action ShowErrorDescription nnoremap rs :action RestartIde nnoremap [d :action GotoPreviousError nnoremap ]d :action GotoNextError " ============================================================ " Tab / buffer management " " is NOT mapped to NextTab — Tab == C-i in terminal, " which is the jumplist-forward key. Use gt / gT natively. " ============================================================ nnoremap x :action CloseContent nnoremap qt :action CloseAllEditorsButActive " ============================================================ " Git (mirrors lazygit + telescope git pickers) " ============================================================ nnoremap lg :action ActivateVersionControlToolWindow nnoremap gc :action Vcs.ShowTabbedFileHistory nnoremap gcf :action Annotate nnoremap gb :action Git.Branches nnoremap gs :action Vcs.Show.Shelf nnoremap gf :action GotoFile " ============================================================ " Angular component file switching " GotoRelatedFile opens a popup: .ts / .html / .scss / .spec.ts " Requires the Angular plugin to be installed. " ============================================================ nnoremap ot :action GotoRelatedFile nnoremap oh :action GotoRelatedFile nnoremap oc :action GotoRelatedFile nnoremap os :action GotoRelatedFile " ============================================================ " Save / quit " ============================================================ nnoremap :action SaveAll nnoremap sa :action SaveAll nnoremap :action CloseContent " ============================================================ " Pure-vim mappings — identical behaviour in nvim and IdeaVim " ============================================================ " Disable accidental space movement nnoremap vnoremap " Clear search highlights nnoremap :noh " Vertical scroll and center nnoremap zz nnoremap zz " Find next/prev and center nnoremap n nzzzv nnoremap N Nzzzv " Delete without yanking nnoremap x "_x nnoremap dd "_dd " Keep yank register when pasting over selection vnoremap p "_dP " Move lines up/down nnoremap :m .+1== nnoremap :m .-2== vnoremap :m '>+1gv=gv vnoremap :m '<-2gv=gv " Replace word under cursor (forward) nnoremap j *``cgn " Yank to system clipboard explicitly nnoremap y "+y vnoremap y "+y nnoremap Y "+Y " Line start/end shortcuts nnoremap gh 0 vnoremap gh 0 nnoremap gl $ vnoremap gl $ " Toggle line wrap nnoremap lw :set wrap! " Increment / decrement nnoremap + nnoremap - " Sort selected lines (unique) vnoremap st :sort u " Toggle case of selection vnoremap ~ g~