Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/bryanadamss/.ideavimrc

My IdeaVim conf
https://github.com/bryanadamss/.ideavimrc

Last synced: 7 days ago
JSON representation

My IdeaVim conf

Awesome Lists containing this project

README

        

# .ideavimrc
My IdeaVim conf base on [https://github.com/JetBrains/ideavim/discussions/303#discussioncomment-7664118](https://github.com/JetBrains/ideavim/discussions/303#discussioncomment-7664118)

```
" .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
" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins
"" -- 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)

" 参考:https://github.com/JetBrains/ideavim/discussions/303#discussioncomment-7664118
" vim settings
" 设置你的视图或窗口中顶部和底部的“保留”行数为5行
set scrolloff=5
" 历史记录条数
set history=1000
" Do incremental searching.-增量搜索,在搜索模式下输入字符时,Vim 将会立即跳转到文档中第一个符合你所输入的内容的位置
set incsearch

" Don't use Ex mode, use Q for formatting.
" 不用Q进入Ex模式,而是用来做格式化
map Q gq

" status bar
set showmode

" leader
map
let mapleader="\"

" find and replace
set hlsearch
set incsearch
set ignorecase
set smartcase
set gdefault
nmap nh :noh

" 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

" location
nmap (Back)
nmap (Forward)

" buffer (buffer < window < tab)
nmap xx (CloseContent)
nmap xa (CloseAllEditors)
nmap xo (CloseAllEditorsButActive)
nmap xp (CloseAllUnpinnedEditors)

" window
nmap (PreviousTab)
nmap (NextTab)
nmap p (PinActiveEditorTab)

nmap 1 (GoToTab1)
nmap 2 (GoToTab2)
nmap 3 (GoToTab3)
nmap 4 (GoToTab4)
nmap 5 (GoToTab5)
nmap 6 (GoToTab6)
nmap 7 (GoToTab7)
nmap 8 (GoToTab8)
nmap 9 (GoToTab9)

" tab
map sh (MoveTabLeft)
map sj (MoveTabDown)
map sk (MoveTabUp)
map sl (MoveTabRight)
map sH (SplitHorizontally)
map sV (SplitVertically)

nmap (JumpToLastWindow)
nmap (PrevSplitter)
nmap (NextSplitter)
nmap k
nmap j
nmap h
nmap l

nmap ww (HideAllWindows)
nmap wk (StretchSplitToTop)
nmap wj (StretchSplitToBottom)
nmap wh (StretchSplitToLeft)
nmap wl (StretchSplitToRight)
nmap wm (MaximizeEditorInSplit)
nmap wu (UnsplitAll)

" menu
nmap mm (MainMenu)
nmap ma (AnalyzeMenu)
nmap mb (BuildMenu)
nmap mc (CodeMenu)
nmap mf (FindMenuGroup)
nmap mg (GoToMenu)
nmap ms (ScopeViewPopupMenu)
nmap mt (EditorTabPopupMenu)
nmap mw (ToolWindowsGroup)

" file
nmap of (OpenFile)
nmap yp (CopyAbsolutePath)
nmap rf (RecentFiles)
nmap rl (RecentLocations)
nmap rp (ManageRecentProjects)
nmap sh (LocalHistory.ShowHistory)
nmap sf (ShowFilePath)
nmap si (SelectIn)
nmap fp (FindInPath)
nmap rp (ReplaceInPath)
nmap sw ($SearchWeb)

" tag
nmap fu (FindUsages)
nmap fs (FileStructurePopup)
nmap su (ShowUsages)
nmap hl (HighlightUsagesInFile)
nmap qp (QuickPreview)
nmap qd (QuickDefinition)
nmap qD (QuickTypeDefinition)

" code
map c (CommentByLineComment)
map C (CommentByBlockComment)
nmap qf (ShowIntentionActions)
nmap se (ShowErrorDescription)
nmap om (OverrideMethods)
nmap im (ImplementMethods)
nmap fc (ReformatCode)
nmap ic (InspectCode)
nmap so (SelectAllOccurrences)
nmap gc (Generate)
nmap gt (GoToTest)

" run
nmap rc (ContextRun)
nmap rx (chooseRunConfiguration)
nmap rr (Rerun)
nmap rt (RunTests)
nmap rs (Stop)

" debug
nmap dc (ContextDebug)
nmap dx (Debug)
nmap db (ToggleLineBreakpoint)
nmap de (EditBreakpoint)
nmap dv (ViewBreakpoints)

" build
nmap bb (BuildMenu)

" refactor
nmap rn (RenameElement)
nmap re (Refactorings.QuickListPopupAction)
nmap uw (Unwrap)
nmap sw (SurroundWith)
nmap sd (SafeDelete)
nmap oi (OptimizeImports)

" hierarchy
nmap hc (CallHierarchy)
nmap hm (MethodHierarchy)
nmap ht (TypeHierarchy)

" collapse
nmap zz (ExpandCollapseToggleAction)
nmap za (CollapseAllRegions)
nmap zA (ExpandAllRegions)

" zen
nmap z (ToggleZenMode)

" []
nmap [b (PreviousTab)
nmap ]b (NextTab)
nmap [g (GotoPreviousError)
nmap ]g (GotoNextError)
nmap [u (GotoPrevElementUnderCaretUsage)
nmap ]u (GotoNextElementUnderCaretUsage)
nmap [o (PreviousOccurence)
nmap ]o (NextOccurence)
nmap [m (MethodUp)
nmap ]m (MethodDown)
nmap [c (JumpToLastChange)
nmap ]c (JumpToNextChange)

" goto
nmap a (GotoAction)
nmap ga (GotoAction)
nmap gc (GotoClass)
nmap gf (GotoFile)
nmap gs (GotoSymbol)
nmap gt (GoToTest)
nmap gT (TextSearchAction)
nmap go (GotoSuperMethod)
nmap gd (GotoDeclaration)
nmap gD (GotoTypeDeclaration)
nmap gi (GotoImplementation)
nmap gI (QuickImplementations)
nmap gn (ShowNavBar)

" terminal
nmap tt (ActivateTerminalToolWindow)
nmap tc (Terminal.OpenInTerminal)

" bookmark
nmap mm (ToggleBookmark)
nmap ms (ShowBookmarks)

" todo
nmap to (ActivateTODOToolWindow)

" task
nmap ts (tasks.goto)

" idea join
nmap \\jl (EditorJoinLines)

" gist
nmap \\cg (Github.Create.Gist)

" vcs
nmap v (VcsGroups)

" open IdeaVim settings
nmap \\v (VimActions)

" continuous shift
xnoremap < >gv

" alias
" ctrl+a 全选复制
nmap ggVG"+y

" 插件相关
" text-object (bundle plugin)
Plug 'dbakker/vim-paragraph-motion'
Plug 'michaeljsmith/vim-indent-object'
Plug 'kana/vim-textobj-entire'
Plug 'vim-scripts/argtextobj.vim'

" jump-motion (required idea plugin: IdeaVim-EasyMotion, AceJump)
" 需要额外安装IdeaVim-EasyMotion, AceJump插件,使用w快速跳转
Plug 'easymotion/vim-easymotion'

" sneak(bundle plugin)-使用s{char}{char}搜索
Plug 'justinmk/vim-sneak'

" highlight yank (bundle plugin)-高亮拷贝的文本
Plug 'machakann/vim-highlightedyank'
let g:highlightedyank_highlight_duration = "1000"

" Commentary(bundle plugin)-用gc gcc 实现注释
Plug 'tpope/vim-commentary'

" multiple (bundle plugin)-多光标编辑
Plug 'terryma/vim-multiple-cursors'

" translation (required idea plugin: Translation)
" 翻译,需要在Marketplace额外安装Translation插件
" nmap \\tt ($ShowTranslationDialogAction)
" nmap \\ts ($TranslateTextComponent)
" nmap \\ti