From fab514433f83ce23e01a9118b14d7785d1135c86 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Tue, 3 Jan 2023 01:23:28 +0000 Subject: [PATCH] feat(ideavim): add useful stuff --- dot_config/ideavim/ideavimrc | 117 +++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/dot_config/ideavim/ideavimrc b/dot_config/ideavim/ideavimrc index 92a47b3..1f05c29 100644 --- a/dot_config/ideavim/ideavimrc +++ b/dot_config/ideavim/ideavimrc @@ -1 +1,118 @@ " vim:ft=vim:fenc=utf-8:fdm=marker + +"" Difference between all the different maps: +"" https://stackoverflow.com/questions/3776117/what-is-the-difference-between-the-remap-noremap-nnoremap-and-vnoremap-mapping +"" Ideavim actionlist: +"" https://gist.github.com/zchee/9c78f91cc5ad771c1f5d +"" List of supported plugins: +"" https://github.com/JetBrains/ideavim/wiki/Emulated-plugins +"" https://betterprogramming.pub/the-essential-ideavim-plugins-f939b4325180 + +let mapleader = " " + +"" Emulated plugins +" use 'c|d|yia' to c|d|y inner arguments +set argtextobj +set commentary +set highlightedyank +set NERDTree +set surround +set textobj-entire +set which-key + +"" Options +set notimeout +set smartcase +set incsearch +set relativenumber +set number +set ideajoin +set showcmd +set showmode +" Stay in the mode in which the editing started +set idearefactormode=keep + +" No annoying sound on errors +set visualbell +set tm=500 + +"" Mappings +" 0 -> first non-blank character +map 0 ^ + +" Center buffer when navigating +" nmap zz +" nmap zz +nmap n nzzzv +nmap N Nzzzv + +" Workaround for unifying navigation history: +" https://youtrack.jetbrains.com/issue/VIM-44/Unify-navigation-history-between-ideavim-and-idea" +nmap (Back) +nmap (Forward) + +" Navigate project errors +map [d (GotoPreviousError) +map ]d (GotoNextError) + +" Navigate git changes +map [c (VcsShowPrevChangeMarker) +map ]c (VcsShowNextChangeMarker) + +" Show hoverdoc +map H (ShowErrorDescription) + +" Shortcutting split navigation +map h +map j +map k +map l + +" Bye bye +map q (CloseContent) +map Q (CloseAllEditors) +map h (HideAllWindows) + +" Focus project window +map e :NERDTreeToggle + +" File navigation +map ff (GotoFile) +map fC (SearchEverywhere) +map fg (FindInPath) +map fr (RecentLocations) + +" Keep visual selection +vnoremap < >gv + +" LSP stuffs +map lo (OptimizeImports) +map lf (ReformatCode) +map lr (RenameElement) +map la (ShowIntentionActions) +map gt (GotoTest) +map gs (GotoSuperMethod) + +" Debugging stuffs +map dt (ToggleLineBreakpoint) +map ds (ContextDebug) +map rs (ContextRun) +map rc (RunClass) +map rf (ChooseRunConfiguration) + +" Hello terminal :D +map t (ActivateTerminalToolWindow) + +" Open ideavimrc +map ; :e ~/.config/ideavim/ideavimrc + +" Alt+j/k for autocompletion popup +inoremap +inoremap + +" Zen mode +map zz (ToggleZenMode) + +" Vim search is simply outclassed here +map / (Find) \ No newline at end of file