Replies: 51 comments 48 replies
-
Yours looks way more impressing that mine - https://github.com/leeturner/vimrc/blob/master/ideavimrc I don't think I have seen the |
Beta Was this translation helpful? Give feedback.
-
This is mine: https://github.com/citizenmatt/dotfiles/blob/master/ideavimrc Nothing too scary. Set up defaults/vim-sensible type stuff, enable most of the ideavim extensions and add a few maps to IntelliJ actions. |
Beta Was this translation helpful? Give feedback.
-
My ~/.ideavimrc and ~/.vimrc: https://gist.github.com/vlasovskikh/23df313739ad00e57c0935d54c346806 |
Beta Was this translation helpful? Give feedback.
-
This is mine: https://gist.github.com/plateauu/2850b551c934f4168fa4f6b56e8fb087 |
Beta Was this translation helpful? Give feedback.
-
This is mine: https://github.com/q843705423/ideavimrc/blob/master/.ideavimrc |
Beta Was this translation helpful? Give feedback.
-
https://gist.github.com/yaoqiangpersonal/ecf4a5b7bbe6c6d40edf2432f39288da |
Beta Was this translation helpful? Give feedback.
-
https://gist.github.com/chylex/9a456a062bd19e29361fe8aeb90a8410 |
Beta Was this translation helpful? Give feedback.
-
nice share. |
Beta Was this translation helpful? Give feedback.
-
I love this thread 😄 Mine: https://github.com/ddadon10/dotfiles/blob/trunk/.vimrc#L82 Pretty standard, I also replaced vim back/forward with the one from IntellIJ |
Beta Was this translation helpful? Give feedback.
-
This is mine: https://gist.github.com/wangrunlin/bb97f80377db44a6fbb195eaa9759d83 |
Beta Was this translation helpful? Give feedback.
-
Here's mine: |
Beta Was this translation helpful? Give feedback.
-
Hey, does anyone knows how to map |
Beta Was this translation helpful? Give feedback.
-
Oh wow! Mapping CLion actions to vim shortcuts just made my day in a major way. I've set my <leader> to space bar and use this configuration in CLion: https://gist.github.com/d3rp/a24072e28224725a6e5359d303aba908 |
Beta Was this translation helpful? Give feedback.
-
my, with some emacs-like shortcuts |
Beta Was this translation helpful? Give feedback.
-
How can I map leader+leader to "Search Everywhere" in normal mode? Thanks. |
Beta Was this translation helpful? Give feedback.
-
Here is my personal ideavimrc .... |
Beta Was this translation helpful? Give feedback.
-
Hi guys, I just made a summary of 38 comments (till now) about this discussion, and made this new and powerful You can start building your config on my base, hoping this config will help you. This config includes
" vim settings
set scrolloff=5
set history=1000
" status bar
set showmode
" leader
map <space> <nop>
let mapleader="\<space>"
" find and replace
set hlsearch
set incsearch
set ignorecase
set smartcase
set gdefault
nmap <leader>nh :noh<CR>
" ideavim settings
set ideajoin
set ideamarks
set idearefactormode=normal
set ideastatusicon=gray
" better HJKL
map H ^
map L $
map J }
map K {
" better escape
imap jk <Esc>
" location
nmap <C-i> <Action>(Back)
nmap <C-o> <Action>(Forward)
" buffer (buffer < window < tab)
nmap <leader>xx <Action>(CloseContent)
nmap <leader>xa <Action>(CloseAllEditors)
nmap <leader>xo <Action>(CloseAllEditorsButActive)
nmap <leader>xp <Action>(CloseAllUnpinnedEditors)
" window
nmap <C-Tab> <Action>(PreviousTab)
nmap <Tab> <Action>(NextTab)
nmap <leader>p <Action>(PinActiveEditorTab)
nmap <leader>1 <Action>(GoToTab1)
nmap <leader>2 <Action>(GoToTab2)
nmap <leader>3 <Action>(GoToTab3)
nmap <leader>4 <Action>(GoToTab4)
nmap <leader>5 <Action>(GoToTab5)
nmap <leader>6 <Action>(GoToTab6)
nmap <leader>7 <Action>(GoToTab7)
nmap <leader>8 <Action>(GoToTab8)
nmap <leader>9 <Action>(GoToTab9)
" tab
map <leader>sh <Action>(MoveTabLeft)
map <leader>sj <Action>(MoveTabDown)
map <leader>sk <Action>(MoveTabUp)
map <leader>sl <Action>(MoveTabRight)
map <leader>sH <Action>(SplitHorizontally)
map <leader>sV <Action>(SplitVertically)
nmap <C-p> <Action>(JumpToLastWindow)
nmap <M-i> <Action>(PrevSplitter)
nmap <M-o> <Action>(NextSplitter)
nmap <C-k> <C-w>k
nmap <C-j> <C-w>j
nmap <C-h> <C-w>h
nmap <C-l> <C-w>l
nmap <leader>ww <Action>(HideAllWindows)
nmap <leader>wk <Action>(StretchSplitToTop)
nmap <leader>wj <Action>(StretchSplitToBottom)
nmap <leader>wh <Action>(StretchSplitToLeft)
nmap <leader>wl <Action>(StretchSplitToRight)
nmap <leader>wm <Action>(MaximizeEditorInSplit)
nmap <leader>wu <Action>(UnsplitAll)
" menu
nmap <leader>mm <Action>(MainMenu)
nmap <leader>ma <Action>(AnalyzeMenu)
nmap <leader>mb <Action>(BuildMenu)
nmap <leader>mc <Action>(CodeMenu)
nmap <leader>mf <Action>(FindMenuGroup)
nmap <leader>mg <Action>(GoToMenu)
nmap <leader>ms <Action>(ScopeViewPopupMenu)
nmap <leader>mt <Action>(EditorTabPopupMenu)
nmap <leader>mw <Action>(ToolWindowsGroup)
" file
nmap <leader>of <Action>(OpenFile)
nmap <leader>yp <Action>(CopyAbsolutePath)
nmap <leader>rf <Action>(RecentFiles)
nmap <leader>rl <Action>(RecentLocations)
nmap <leader>rp <Action>(ManageRecentProjects)
nmap <leader>sh <Action>(LocalHistory.ShowHistory)
nmap <leader>sf <Action>(ShowFilePath)
nmap <leader>si <Action>(SelectIn)
nmap <leader>fp <Action>(FindInPath)
nmap <leader>rp <Action>(ReplaceInPath)
nmap <leader>sw <Action>($SearchWeb)
" tag
nmap <leader>fu <Action>(FindUsages)
nmap <leader>fs <Action>(FileStructurePopup)
nmap <leader>su <Action>(ShowUsages)
nmap <leader>hl <Action>(HighlightUsagesInFile)
nmap <leader>qp <Action>(QuickPreview)
nmap <leader>qd <Action>(QuickDefinition)
nmap <leader>qD <Action>(QuickTypeDefinition)
" code
map <leader>c <Action>(CommentByLineComment)
map <leader>C <Action>(CommentByBlockComment)
nmap <leader>qf <Action>(ShowIntentionActions)
nmap <leader>se <Action>(ShowErrorDescription)
nmap <leader>om <Action>(OverrideMethods)
nmap <leader>im <Action>(ImplementMethods)
nmap <leader>fc <Action>(ReformatCode)
nmap <leader>ic <Action>(InspectCode)
nmap <leader>so <Action>(SelectAllOccurrences)
nmap <leader>gc <Action>(Generate)
nmap <leader>gt <Action>(GoToTest)
" run
nmap <leader>rc <Action>(ContextRun)
nmap <leader>rx<Action>(chooseRunConfiguration)
nmap <leader>rr <Action>(Rerun)
nmap <leader>rt <Action>(RunTests)
nmap <leader>rs <Action>(Stop)
" debug
nmap <leader>dc <Action>(ContextDebug)
nmap <leader>dx <Action>(Debug)
nmap <leader>db <Action>(ToggleLineBreakpoint)
nmap <leader>de <Action>(EditBreakpoint)
nmap <leader>dv <Action>(ViewBreakpoints)
" build
nmap <leader>bb <Action>(BuildMenu)
" refactor
nmap <leader>rn <Action>(RenameElement)
nmap <leader>re <Action>(Refactorings.QuickListPopupAction)
nmap <leader>uw <Action>(Unwrap)
nmap <leader>sw <Action>(SurroundWith)
nmap <leader>sd <Action>(SafeDelete)
nmap <leader>oi <Action>(OptimizeImports)
" hierarchy
nmap <leader>hc <Action>(CallHierarchy)
nmap <leader>hm <Action>(MethodHierarchy)
nmap <leader>ht <Action>(TypeHierarchy)
" collapse
nmap zz <Action>(ExpandCollapseToggleAction)
nmap za <Action>(CollapseAllRegions)
nmap zA <Action>(ExpandAllRegions)
" zen
nmap <leader>z <Action>(ToggleZenMode)
" []
nmap [b <Action>(PreviousTab)
nmap ]b <Action>(NextTab)
nmap [g <Action>(GotoPreviousError)
nmap ]g <Action>(GotoNextError)
nmap [u <Action>(GotoPrevElementUnderCaretUsage)
nmap ]u <Action>(GotoNextElementUnderCaretUsage)
nmap [o <Action>(PreviousOccurence)
nmap ]o <Action>(NextOccurence)
nmap [m <Action>(MethodUp)
nmap ]m <Action>(MethodDown)
nmap [c <Action>(JumpToLastChange)
nmap ]c <Action>(JumpToNextChange)
" goto
nmap <leader>a <Action>(GotoAction)
nmap ga <Action>(GotoAction)
nmap gc <Action>(GotoClass)
nmap gf <Action>(GotoFile)
nmap gs <Action>(GotoSymbol)
nmap gt <Action>(GoToTest)
nmap gT <Action>(TextSearchAction)
nmap go <Action>(GotoSuperMethod)
nmap gd <Action>(GotoDeclaration)
nmap gD <Action>(GotoTypeDeclaration)
nmap gi <Action>(GotoImplementation)
nmap gI <Action>(QuickImplementations)
nmap gn <Action>(ShowNavBar)
" terminal
nmap <leader>tt <Action>(ActivateTerminalToolWindow)
nmap <leader>tc <Action>(Terminal.OpenInTerminal)
" bookmark
nmap mm <Action>(ToggleBookmark)
nmap ms <Action>(ShowBookmarks)
" todo
nmap <leader>to <Action>(ActivateTODOToolWindow)
" task
nmap <leader>ts <Action>(tasks.goto)
" idea join
nmap \\jl <Action>(EditorJoinLines)
" gist
nmap \\cg <Action>(Github.Create.Gist)
" vcs
nmap <leader>v <Action>(VcsGroups)
" open IdeaVim settings
nmap \\v <Action>(VimActions)
" text-object (bundle plugin)
set vim-paragraph-motion
set textobj-indent
set textobj-entire
set argtextobj
" jump-motion (required idea plugin: IdeaVim-EasyMotion, AceJump)
set easymotion
" highlight yank (bundle plugin)
set highlightedyank
let g:highlightedyank_highlight_duration = "1000"
let g:highlightedyank_highlight_color = "rgba(57, 197, 187, 155)"
" translation (required idea plugin: Translation)
nmap \\tt <Action>($ShowTranslationDialogAction)
nmap \\ts <Action>($TranslateTextComponent)
nmap \\ti <Action>($InclusiveTranslateAction)
nmap \\te <Action>($ExclusiveTranslateAction)
" string manipulate (required idea plugin: String Manipulation)
nmap <leader>ss <Action>(osmedile.intellij.stringmanip.PopupChoiceAction)
" code screenshot (required idea plugin: Code Screenshots)
nmap <leader>cs <Action>(one.util.ideaplugin.screenshoter.CopyImageAction)
" surround (bundle plugin)
" usage: https://github.com/tpope/vim-surround
set surround
" exchange (bundle plugin)
" usage: https://github.com/tommcdo/vim-exchange
set exchange
" nerdtree (bundle plugin)
set NERDTree
" replace with register (bundle plugin)
" usage: https://github.com/vim-scripts/ReplaceWithRegister
set ReplaceWithRegister
" continuous shift
xnoremap < <gv
xnoremap > >gv
" alias
nmap <C-a> ggVG"+y
|
Beta Was this translation helpful? Give feedback.
-
I've updated mine over the last few months, you can find it here It's all leader based, and tries to use mnemonic keys to do stuff. For example I have a bunch more. I notice that having these mnemonic keys really helps me to remember the actions when I need them. |
Beta Was this translation helpful? Give feedback.
-
I would love to see a vimScript function that executes an action inside the function. De we have an example on how to do that? The reason I want to learn the syntax of that is because I want to use the same mapping to toggle the Problems panel. My current function is not working. let mapleader = " "
""" Defaults
set showmode
set incsearch
set ignorecase
set smartcase
set number
set relativenumber
set backspace=indent,eol,start
""" Keymaps
inoremap jj <Esc>
nmap <leader>p <Action>(SearchEverywhere)
nmap <leader>k <Action>(QuickJavaDoc)
nmap <leader>d <Action>(ShowErrorDescription)
nmap <leader>da <Action>(ShowIntentionActions)
""" nmap <leader>e <Action>(ActivateProblemsViewToolWindow)
let g:problems_view_open = 0
function! ToggleProblemsView()
if g:problems_view_open
"""call feedkeys(':Action(HideActiveWindow)<CR>', 'n')
execute :action HideActiveWindow<CR>
let g:problems_view_open = 0
else
"""call feedkeys(':Action(ActivateProblemsViewToolWindow)<CR>', 'n')
execute :action ActivateProblemsViewToolWindow<CR>
let g:problems_view_open = 1
endif
endfunction
nmap <leader>e :call ToggleProblemsView()<CR>
""" Window management & navigation
nmap <leader>sr <Action>(SplitVertically)
nmap <C-h> <C-w><C-h>
nmap <C-l> <C-w><C-l>
""" Search symbols in file or project
nmap <leader>fs <Action>(FileStructurePopup)
nmap <leader>ps <Action>(GotoSymbol)
""" Refactoring and formatting
nmap <leader>r <Action>(RefactoringMenu)
vmap <leader>r <Action>(RefactoringMenu)
nmap <leader>fc <Action>(ReformatCode)
map <C-j> <Action>(MoveLineDown)
map <C-k> <Action>(MoveLineUp) |
Beta Was this translation helpful? Give feedback.
-
Love the package! Here's my config:
|
Beta Was this translation helpful? Give feedback.
-
@AlexPl292 Do you have your keymap settings uploaded anywhere? |
Beta Was this translation helpful? Give feedback.
-
anyone know how to map the actions: up/down move completion item selection |
Beta Was this translation helpful? Give feedback.
-
here is my config: https://github.com/ved-leachim/.ideavimrc " base configuration
set showmode
set incsearch
set nu
set relativenumber
set ignorecase
set smartcase
set clipboard+=unnamed
" keymaps
" the leader key
let mapleader=" "
" the escape button
nnoremap <C-c> <Esc>
" redo
nnoremap U <C-r>
" comfort shortcuts
nnoremap <C-d> yyp
" terminal
nnoremap <C-t> :action ActivateTerminalToolWindow<CR>
nnoremap <leader>t :action Terminal.OpenInTerminal<CR>
" zen-mode
nnoremap <C-z> :action ToggleDistractionFreeMode<CR>
" find
nnoremap <C-f> :action GotoFile<CR>
nnoremap <C-r> :action RecentFiles<CR>
" navigation
nnoremap J }
nnoremap K {
nnoremap sv :action SplitVertically<CR>
nnoremap ss :action SplitHorizontally<CR>
nnoremap sm :action MoveEditorToOppositeTabGroup<CR>
nnoremap sh <c-w>h
nnoremap sl <c-w>l
nnoremap sj <c-w>j
nnoremap sk <c-w>k
nnoremap <TAB> :action PreviousTab<CR>
nnoremap <S-TAB> :action NextTab<CR>
nnoremap ;q :action CloseContent<CR>
nnoremap ;a :action CloseAllEditors<CR>
" code interactions
nnoremap <leader>c :action CommentByLineComment<CR>
nnoremap <leader>C :action CommentByBlockComment<CR>
nnoremap <leader>r :action RenameElement<CR>
nnoremap <leader>f :action ReformatCode<CR>
nnoremap <leader>re :action Refactorings.QuickListPopupAction<CR>
nnoremap <leader>su :action ShowUsages<CR>
nnoremap <leader>sU :action FindUsages<CR>
nnoremap <leader>m :action CollapseRegion<CR>
nnoremap <leader>M :action ExpandRegion<CR>
nnoremap <leader>am :action CollapseAllRegions<CR>
nnoremap <leader>aM :action ExpandAllRegions<CR>
" code information
nnoremap <leader>d :action ShowHoverInfo<CR>
nnoremap <leader>e :action ShowErrorDescription<CR>
" code navigation
nnoremap gi :action GotoImplementation<CR>
" code selection
nnoremap <S-j> :action MoveLineDown<CR>
nnoremap <S-k> :action MoveLineUp<CR>
" debugging
nnoremap <leader>dc :action Debug<CR>
nnoremap <leader>ds :action Stop<CR>
nnoremap <leader>db :action ToggleLineBreakpoint<CR>
" run
nnoremap <leader>rc :action ContextRun<CR>
nnoremap <leader>rx :action ChooseRunConfiguration<CR>
nnoremap <leader>rr :action Rerun<CR>
nnoremap <leader>rt :action RunTests<CR>
nnoremap <leader>rs :action Stop<CR>
"---------- plugins ----------
" easy motion
Plug 'easymotion/vim-easymotion'
map <leader>J <Plug>(easymotion-s)
map <leader>j <Plug>(easymotion-f)
Plug 'preservim/nerdtree'
map <c-n> :NERDTree<CR>
":NERDTreeFocus
":NERDTreeToggle
map <c-n>n :NERDTreeClose<CR>
":NERDTreeFind
":NERDTreeRefreshRoot |
Beta Was this translation helpful? Give feedback.
-
When my focus (cursor) is in the terminal-debug-view, I cannot bring the focus back into the editor without using my mouse. Did someone solve this problem? |
Beta Was this translation helpful? Give feedback.
-
Easymotion motions instead of default |
Beta Was this translation helpful? Give feedback.
-
This is mine: https://github.com/KURANADO2/ideavim-config/blob/main/.ideavimrc |
Beta Was this translation helpful? Give feedback.
-
https://gist.github.com/ilovejs/b80d0661f961b0b9ded4ef1d7d58c6f2 |
Beta Was this translation helpful? Give feedback.
-
Here's my configuration. I have added bits and pieces to the file over time. Still room for improvements, and I find new things to add to it all the time. https://github.com/OptimusCrime/ideavim/blob/master/ideavimrc |
Beta Was this translation helpful? Give feedback.
-
As much as I want to eagerly read others' configs and expand mine, I was looking for a systematic scalable approach that adheres to Vim grammar. AFAIK SpaceVim managed to do such a thing. |
Beta Was this translation helpful? Give feedback.
-
Hi! Here you can share your cool
~/.ideavimrc
config or find some new ideas.Here you can find my personal configuration: https://gist.github.com/AlexPl292/50a3ff4cef1badcbb23436b22cbd3cf4
Beta Was this translation helpful? Give feedback.
All reactions