From c82e183ff9bc20779cca5223a9c2e69bd78b964e Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Wed, 19 Feb 2025 10:17:36 +0200 Subject: [PATCH] chore(config): ideavim config update Signed-off-by: Ismo Vuorinen --- config/ideavim/ideavimrc | 243 +++++++++++++++++++++++++++++++-------- 1 file changed, 193 insertions(+), 50 deletions(-) diff --git a/config/ideavim/ideavimrc b/config/ideavim/ideavimrc index b3caa0d..60d1a87 100644 --- a/config/ideavim/ideavimrc +++ b/config/ideavim/ideavimrc @@ -1,57 +1,203 @@ "" Source your .vimrc "source ~/.vimrc -"" -- Suggested options -- -" Show a few lines of context around the cursor. Note that this makes the -" text scroll if you mouse-click near the start or end of the window. -set scrolloff=5 +" https://github.com/ville6000/dotfiles/blob/main/vimrc +" To get a list of Actions run `:actionlist ` +let mapleader = "\" + +set so=10 +set showmode +set showcmd +set smartcase +set incsearch +set hlsearch +set relativenumber number + +set clipboard+=unnamed + +set ideajoin +set ideamarks +set idearefactormode=normal + +" Map esc to :noh +map :noh + +nnoremap n :noh + +nmap j gj +nmap k gk + +nmap j :tabnext +nmap k :tabprevious + +nmap l b # +:nmap (Back) +:nmap (Forward) +:map H (MethodUp) +:map L (MethodDown) +:map o (FileStructurePopup) +:map m (ShowIntentionActions) + +nmap ss (GotoSymbol) + +" File management and navigation commands +nmap fl (RecentLocations) +nmap fc (FindInPath) +nmap fr (RecentFiles) +nmap fe :NERDTreeToggle +nmap fu :action FindUsages +nmap ff :action GotoFile +nmap fi (SelectIn) +nmap fp (ReplaceInPath) +nmap fo (OpenFile) +nmap fs (ManageRecentProjects) +nmap fw (CloseActiveTab) + +nmap sr :action RecentFiles +nmap se :action SearchEverywhere +nmap st (TextSearchAction) +nmap ss (GotoSymbol) +nmap sa (GotoAction) + +" Find text +nmap ft :action FindText + +nmap dx (Debug) +nmap dc (ContextDebug) +nmap dv (ViewBreakpoints) +nmap de (EditBreakpoint) +nmap dm (XDebugger.MuteBreakpoints) +nmap dt (ToggleLineBreakpoint) +nmap dC (RunToCursor) +nmap di (StepInto) +nmap do (StepOver) +nmap dr (Resume) +nmap dR (EvaluateExpression) +nmap dw (ActivateDebugToolWindow) + +nmap gd (GotoDeclaration) +nmap go (GotoSuperMethod) +nmap gD (GotoTypeDeclaration) +nmap gi (GotoImplementation) +nmap gT (GotoTest) +nmap gp :action VcsShowPrevChangeMarker +nmap gn :action VcsShowNextChangeMarker + +" Trigger tests +map tt (RiderUnitTestRunContextAction) +let g:WhichKeyDesc_tests = "t Tests" +let g:WhichKeyDesc_tests_run = "tt Run Tests" + +nmap cc :action CommentByLineComment + +nmap lf (ReformatCode) +nmap li (InspectCode) +:map lr (RenameElement) +nmap ll (Refactorings.QuickListPopupAction) + +nmap Gc (Vcs.Show.Local.Changes) +nmap Ga (Annotate) + +:map gh (ShowHoverInfo) + +nmap vv :vsplit +nmap vs :split + +nmap ww :action HideAllWindows +nmap wt :action ActivateTerminalToolWindow +nmap wd :action ActivateDatabaseToolWindow + +" Open project tree window +nmap e :action ActivateProjectToolWindow + +nnoremap cf :action ReformatCode + +" Bookmarks +nmap bm (Bookmarks) +nmap bs (ShowBookmarks) +nmap bt (ActivateBookmarksToolWindow) +nmap bb (ToggleBookmark) +nmap be (EditBookmark) +nmap bp (GotoPreviousBookmark) +nmap bn (GotoNextBookmark) + +nnoremap ge :action GotoNextError +nnoremap gE :action GotoPreviousError + +" Turn off Copilot +nmap cp :action Copilot.Toggle + +" Disable timeout for which-key +set notimeout + +" Navigate back +nmap + +" mark as a global mark/ +nnoremap ma mA +nnoremap mb mB +nnoremap mc mC +nnoremap md mD +nnoremap me mE +nnoremap mf mG +nnoremap mh mH +nnoremap mi mI +nnoremap mj mJ +nnoremap mk mK +nnoremap ml mL +nnoremap mm mM +nnoremap mn mN +nnoremap mo mO +nnoremap mp mP +nnoremap mq mQ +nnoremap mr mR +nnoremap ms mS +nnoremap mt mT +nnoremap mu mU +nnoremap mv mV +nnoremap mw mW +nnoremap mx mX +nnoremap my mY +nnoremap mz mZ + +" go to global marks +nnoremap 'a `A +nnoremap 'b `B +nnoremap 'c `C +nnoremap 'd `D +nnoremap 'e `E +nnoremap 'f `G +nnoremap 'h `H +nnoremap 'i `I +nnoremap 'j `J +nnoremap 'k `K +nnoremap 'l `L +nnoremap 'm `M +nnoremap 'n `N +nnoremap 'o `O +nnoremap 'p `P +nnoremap 'q `Q +nnoremap 'r `R +nnoremap 's `S +nnoremap 't `T +nnoremap 'u `U +nnoremap 'v `V +nnoremap 'w `W +nnoremap 'x `X +nnoremap 'y `Y +nnoremap 'z `Z + +" --- + +set cursorline " Highlight current line +set nocompatible " disable compatibility mode with vi +filetype off " disable filetype detection (but re-enable later, see below) +set undolevels=1000 " Number of undo levels +set backspace=indent,eol,start " Backspace behaviour " Don't use Ex mode, use Q for formatting. map Q gq - -"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t -"" Map \r to the Reformat Code action -"map \r (ReformatCode) - -"" Map d to start debug -"map d (Debug) - -"" Map \b to toggle the breakpoint on the current line -"map \b (ToggleLineBreakpoint) - - -" Find more examples here: https://jb.gg/share-ideavimrc - -" https://github.com/ville6000/dotfiles/blob/main/vimrc -set nocompatible " disable compatibility mode with vi -filetype off " disable filetype detection (but re-enable later, see below) - -set encoding=utf-8 " UTF-8 -set number " Show line numbers -set laststatus=2 " Always show statusline (even with only single window) -set showmatch " Highlight matching brace -set visualbell " Use visual bell (no beeping) -set hlsearch " Highlight all search results -set smartcase " Enable smart-case search -set ignorecase " Always case-insensitive -set incsearch " Searches for strings incrementally -set cindent " Use 'C' style program indenting -set expandtab " Use spaces instead of tabs -set shiftwidth=4 " Number of auto-indent spaces -set smartindent " Enable smart-indent -set smarttab " Enable smart-tabs -set softtabstop=4 " Number of spaces per Tab -set ruler " Show row and column ruler information -set cursorline " Highlight current line -set undolevels=1000 " Number of undo levels -set backspace=indent,eol,start " Backspace behaviour -set so=5 - -" move vertically by visual line (don't skip wrapped lines) -nmap j gj -nmap k gk - syntax enable filetype plugin indent on @@ -63,9 +209,6 @@ Plug 'ctrlpvim/ctrlp.vim' call plug#end() set termguicolors -set background=dark -let ayucolor="dark" -colorscheme ayu if has('gui_running') set macligatures