From 1d1ec0138f2cf2091226062b8ed6f1fa5554edc1 Mon Sep 17 00:00:00 2001 From: Michel Fedde Date: Sun, 23 Feb 2025 18:26:42 +0100 Subject: [PATCH] Adds new ideavimrc --- .ideavimrc | 239 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 202 insertions(+), 37 deletions(-) diff --git a/.ideavimrc b/.ideavimrc index 7af9b6a..c76349a 100644 --- a/.ideavimrc +++ b/.ideavimrc @@ -1,43 +1,208 @@ -" .ideavimrc is a configuration file for IdeaVim plugin. It uses -" the same commands as the original .vimrc configuration. -" You can find a list of commands here: https://jb.gg/h38q75 -" Find more examples here: https://jb.gg/share-ideavimrc +"" .ideavimrc - Matt Chapman + + +"" Base Settings +"" ======================================================== + +set scrolloff=10 +set linenumber +set showmode +set showcmd + +set smartcase +set incsearch +set hlsearch + +set visualbell + +" Use system clipboard +set clipboard+=unnamed let mapleader = " " -"" -- 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 -set clipboard+=unnamed -" Do incremental searching. -set incsearch +"" Plugin Settings +"" ======================================================== -" Don't use Ex mode, use Q for formatting. -map Q gq - -" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins - -" Highlight copied text -Plug 'machakann/vim-highlightedyank' -" Commentary plugin -Plug 'tpope/vim-commentary' - -Plug 'preservim/nerdtree' - - -"" -- 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) - -map e :NERDTreeToggle -map f :NERDTreeFind +set surround +set highlightedyank +set sneak +set nerdtree let g:NERDTreeMapActivateNode = "l" -let g:NERDTreeMapCloseDir = "h" \ No newline at end of file +let g:NERDTreeMapCloseDir = "h" + +" Easymotion settings +set easymotion +set notimeout + +" Which-key settings +set which-key +let g:WhichKey_FontSize = 16 +let g:WhichKey_CommandColor = "#41ead4" +let g:WhichKey_PrefixColor = "#f335b2" +let g:WhichKey_SortOrder = "by_key_prefix_first" + +let g:WhichKeyDesc_leader = " Leader key" + +let g:WhichKeyDesc_leader = "x Open file explorer" + +let g:WhichKeyDesc_easymotion = "j Jump with Easymotion" +let g:WhichKeyDesc_easymotion_prefix = "" + +let g:WhichKeyDesc_comment = "c Comment line" + +let g:WhichKeyDesc_fold = "z Folding" +let g:WhichKeyDesc_fold_all = "zc Fold all regions" +let g:WhichKeyDesc_unfold_all = "zo Unfold all regions" + +let g:WhichKeyDesc_window = "w Window splits" +let g:WhichKeyDesc_window_split_vertically = "wv Split vertically" +let g:WhichKeyDesc_window_split_horizontally = "wh Split horizontally" +let g:WhichKeyDesc_window_split_unsplit = "wu Unsplit" +let g:WhichKeyDesc_window_split_move_editor = "wm Move editor to opposite tab group" + + +let g:WhichKeyDesc_display = "d Display options" +let g:WhichKeyDesc_zen_mode = "dz Toggle Zen mode" +let g:WhichKeyDesc_df_mode = "dd Toggle Distraction-Free mode" +let g:WhichKeyDesc_fullscreen = "df Toggle full screen" + +let g:WhichKeyDesc_action= "a Actions" +let g:WhichKeyDesc_action_context_menu = "am Open context menu" +let g:WhichKeyDesc_action_search = "as Open command modal" + +let g:WhichKeyDesc_file_quickLook = " Recent files" + +let g:WhichKeyDesc_file_nav = "f File navigation" +let g:WhichKeyDesc_file_nav_goto_file = "ff Go to file" +let g:WhichKeyDesc_file_nav_goto_content = "fc Search for file content" +let g:WhichKeyDesc_file_nav_show_recent_files = "fr Show recent files" +let g:WhichKeyDesc_file_nav_show_recent_locations = "fl Show recent locations" + +let g:WhichKeyDesc_close_tab = "q Close active tab" + +let g:WhichKeyDesc_refactoring = "r Refactoring menu" +let g:WhichKeyDesc_refactoring_rename = "rn Rename element" +let g:WhichKeyDesc_refactoring_method = "rm Extract method" +let g:WhichKeyDesc_refactoring_variable = "rv Introduce variable" +let g:WhichKeyDesc_refactoring_field = "rf Introduce field" +let g:WhichKeyDesc_refactoring_signature = "rs Change signature" +let g:WhichKeyDesc_refactoring_all = "rr Open refactorings list" + +let g:WhichKeyDesc_goto = "g Go to X" +let g:WhichKeyDesc_goto_declaration = "gd Go to Definition" +let g:WhichKeyDesc_goto_type_declaration = "gy Go to Type Definition" +let g:WhichKeyDesc_goto_implementation = "gi Go to Implementation" +let g:WhichKeyDesc_goto_usages = "gu Go to Usages" +let g:WhichKeyDesc_goto_test = "gt Go to Test" +let g:WhichKeyDesc_goto_back = "gb Go Back" +let g:WhichKeyDesc_goto_forward = "gf Go Forward" + +let g:WhichKeyDesc_git = "g Git operations" +let g:WhichKeyDesc_git_commit = "gc Open Git commit dialog" +let g:WhichKeyDesc_git_status = "gs Open Git status dialog" +let g:WhichKeyDesc_git_branches = "gb Open Git branches list" + +let g:WhichKeyDesc_errors = "e Error navigation" +let g:WhichKeyDesc_errors_next = "en Go to next error in solution" +let g:WhichKeyDesc_errors_prev = "ep Go to previous error in solution" + + +"" Key mappings +"" ======================================================== + +inoremap jj + +" Tab navigation +nnoremap :tabnext +nnoremap :tabprev + +" Pane navigation +nnoremap h +nnoremap l +nnoremap k +nnoremap j + +" Jump between methods +nnoremap [[ (MethodUp) +nnoremap ]] (MethodDown) + +" Easy visual indentation +vnoremap < >gv + +" Execute macro saved in 'q' register +nnoremap qj @q + +" Popup navigation +inoremap (PopupMenu-selectNext) +inoremap (PopupMenu-selectPrev) + + +"" Leader commands +"" ======================================================== + +" Comment lines +map c (CommentByLineComment) + +" Jump around with easymotion +map j (easymotion-s) + +" Open NERDTree (use q to exit) +map x :NERDTreeToggle + +" Folding +map zc :action CollapseAllRegions +map zo :action ExpandAllRegions + +" Window splits +map wv (SplitVertically) +map ws (SplitHorizontally) +map wu (Unsplit) +map wm (MoveEditorToOppositeTabGroup) + +" Display options +map dd (ToggleDistractionFreeMode) +map dz (ToggleZenMode) +map df (ToggleFullScreen) + +" Actions +map am (ShowIntentionActions) +map as (SearchEverywhere) + +" File navigation +map ff (GotoFile) +map fr (RecentFiles) +map fc (FindInPath) +map (RecentFiles) +map fl (RecentLocations) +map fs (NewScratchFile) + +" Close active tab +map q (CloseContent) + +" Refactoring +map rn (RenameElement) +map rm (ExtractMethod) +map rv (IntroduceVariable) +map rf (IntroduceField) +map rs (ChangeSignature) +map rr (Refactorings.QuickListPopupAction) + +" Go to code +nmap gd (GotoDeclaration) +nmap gy (GotoTypeDeclaration) +nmap gi (GotoImplementation) +nmap gu (ShowUsages) +nmap gt (GotoTest) +nmap gf (Back) +nmap gb (Forward) + +" Git windows +map gc (CheckinProject) +map gs (ActivateVersionControlToolWindow) +map gb (Git.Branches) + +" Errors +map en (ReSharperGotoNextErrorInSolution) +map ep (ReSharperGotoPrevErrorInSolution) \ No newline at end of file