Skip to content

Instantly share code, notes, and snippets.

@PisecesPeng
Last active March 18, 2025 14:18
Show Gist options
  • Save PisecesPeng/9fabf2a1c1834bd35bf02c2bcb904708 to your computer and use it in GitHub Desktop.
Save PisecesPeng/9fabf2a1c1834bd35bf02c2bcb904708 to your computer and use it in GitHub Desktop.

Revisions

  1. PisecesPeng revised this gist May 29, 2023. 1 changed file with 4 additions and 6 deletions.
    10 changes: 4 additions & 6 deletions .ideavimrc
    Original file line number Diff line number Diff line change
    @@ -243,17 +243,15 @@ inoremap <C-h> <Left>
    inoremap <C-j> <Down>
    inoremap <C-k> <Up>
    inoremap <C-l> <Right>
    " inoremap <C-b> <Esc>[bi
    " inoremap <C-w> <Esc><Right>[wi
    " inoremap <C-e> <Esc>ea
    inoremap <C-w> <Esc><Right>]wa
    inoremap <C-S-w> <Esc><Left>]ba
    " 插入模式移动
    " 插入模式转换普通模式
    inoremap jk <Esc>
    " 插入模式转换普通模式
    " 切割窗口
    nnoremap sx :split<Return>
    nnoremap sy :vsplit<Return>
    " nnoremap <C-w> <C-w>w
    " 切割窗口
    " 保存行(不含换行符)
    nnoremap yir ^v$y
    @@ -290,8 +288,8 @@ nnoremap vsm va{<Esc>v%:action EditorSelectWord<CR>
    nnoremap vsf /\.<CR>Nv/(<CR>%
    " 选中方法调用
    " 选中单词(按驼峰命名规则匹配)
    nnoremap <C-w> <Esc>[w]wv[b
    nnoremap <C-S-w> <Esc>]bv[b
    nnoremap <C-w> [w
    nnoremap <C-S-w> [b
    vnoremap <C-w> <Esc>[w]wv[b
    vnoremap <C-S-w> <Esc>]bv[b
    " 选中单词(t按驼峰命名规则匹配)
  2. PisecesPeng revised this gist May 26, 2023. 1 changed file with 21 additions and 13 deletions.
    34 changes: 21 additions & 13 deletions .ideavimrc
    Original file line number Diff line number Diff line change
    @@ -25,13 +25,6 @@ set NERDTree
    " set quickscope
    " 增强段落移动
    set vim-paragraph-motion
    " 普通模式自动切换为英文输入法
    set keep-english-in-normal
    " 取消vim操作声音
    set visualbell
    set noerrorbells
    " 开启模式显示
    set showmode
    """ Plugins --------------------------------
    """ Plugin settings -------------------------
    " 高亮时间
    @@ -68,16 +61,18 @@ vmap v <Action>(EditorSelectWord)
    " 选择模式缩小选择范围
    vmap V <Action>(EditorUnSelectWord)
    " 上/下一个tab
    nmap <Tab> <Action>(NextTab)
    nmap <S-Tab> <Action>(PreviousTab)
    nmap <C-Tab> <Action>(NextTab)
    nmap <C-S-Tab> <Action>(PreviousTab)
    vmap <C-Tab> <Action>(NextTab)
    vmap <C-S-Tab> <Action>(PreviousTab)
    " 开启新一行
    imap <S-CR> <Action>(EditorStartNewLine)
    imap <S-D-CR> <Action>(EditorStartNewLineBefore)
    nmap <S-CR> <Action>(EditorStartNewLine)
    nmap <S-D-CR> <Action>(EditorStartNewLineBefore)
    " 开启新一行
    " 最近编辑
    nmap <S-D-e> <Action>(RecentLocations)
    " 打开切换窗口
    map <S-D-e> <Action>(Switcher)
    " navigate back/forward
    map <D-[> <Action>(Back)
    map <D-]> <Action>(Forward)
    @@ -109,6 +104,16 @@ map <Leader>hl <Action>(HighlightUsagesInFile)
    " 重构动作更具确定性
    " set idearefactormode=keep

    " 普通模式自动切换为英文输入法
    set keep-english-in-normal

    " 取消vim操作声音
    set visualbell
    set noerrorbells

    " 开启模式显示
    set showmode

    " Do incremental searching
    set incsearch

    @@ -278,9 +283,12 @@ nnoremap vs} ^V%
    nnoremap vs] ^V%
    nnoremap vs; ^V/;<CR>
    " 框选指定符号结束的多行
    " 选中整个方法
    " 选中方法定义
    nnoremap vsm va{<Esc>v%:action EditorSelectWord<CR>
    " 选中整个方法
    " 选中方法定义
    " 选中方法调用
    nnoremap vsf /\.<CR>Nv/(<CR>%
    " 选中方法调用
    " 选中单词(按驼峰命名规则匹配)
    nnoremap <C-w> <Esc>[w]wv[b
    nnoremap <C-S-w> <Esc>]bv[b
  3. PisecesPeng revised this gist May 19, 2023. 1 changed file with 25 additions and 21 deletions.
    46 changes: 25 additions & 21 deletions .ideavimrc
    Original file line number Diff line number Diff line change
    @@ -40,10 +40,11 @@ let g:highlightedyank_highlight_duration = 1000
    " let g:highlightedyank_highlight_color = "rgba(210,240,244, 155)"
    let g:argtextobj_pairs="[:],(:),<:>"
    " Turn off this plugin when the length of line is longer than g:qs_max_chars.
    let g:qs_max_chars=200
    let g:qs_max_chars=20
    """ Plugin settings -------------------------
    """ Plugin mapping ------------------------
    nmap ss <Plug>(easymotion-s2)
    nmap sl <Plug>(easymotion-sl)
    """ Plugin mapping ------------------------
    """ Action list mapping ------------------------
    " 定位到文件树
    @@ -69,15 +70,17 @@ vmap V <Action>(EditorUnSelectWord)
    " 上/下一个tab
    nmap <Tab> <Action>(NextTab)
    nmap <S-Tab> <Action>(PreviousTab)
    " 开启新一行编辑
    " 开启新一行
    imap <S-CR> <Action>(EditorStartNewLine)
    imap <S-D-CR> <Action>(EditorStartNewLineBefore)
    " 开启新一行编辑
    nmap <S-CR> <Action>(EditorStartNewLine)
    nmap <S-D-CR> <Action>(EditorStartNewLineBefore)
    " 开启新一行
    " 最近编辑
    " nmap <S-D-e> <Action>(RecentLocations)
    nmap <S-D-e> <Action>(RecentLocations)
    " navigate back/forward
    " nmap <S-h> <Action>(Back)
    " nmap <S-l> <Action>(Forward)
    map <D-[> <Action>(Back)
    map <D-]> <Action>(Forward)
    " 多光标选中单词
    nmap <Leader>va <Action>(SelectAllOccurrences)
    vmap <Leader>va <Action>(SelectAllOccurrences)
    @@ -104,7 +107,7 @@ map <Leader>hl <Action>(HighlightUsagesInFile)
    """ Action list mapping ------------------------

    " 重构动作更具确定性
    set idearefactormode=keep
    " set idearefactormode=keep

    " Do incremental searching
    set incsearch
    @@ -153,10 +156,6 @@ nnoremap zl 50zl
    " 按'*'搜索光标选中的内容, 取消高亮`:noh`
    vnoremap * "ry/<C-R>r<CR>

    " 向上/下新增空行
    noremap <S-Enter> O<Esc>
    noremap <CR> o<Esc>

    " 删除不剪切
    nnoremp d "_d
    nnoremap dd "_dd
    @@ -225,6 +224,8 @@ nnoremap ca< "_ca<
    " 快速跳转行首与行尾
    nnoremap <C-l> $
    nnoremap <C-h> ^
    vnoremap <C-l> $
    vnoremap <C-h> ^
    " 快速跳转行首与行尾
    " 移动多行
    noremap <C-j> 5j
    @@ -237,9 +238,9 @@ inoremap <C-h> <Left>
    inoremap <C-j> <Down>
    inoremap <C-k> <Up>
    inoremap <C-l> <Right>
    inoremap <C-b> <Esc>[bi
    inoremap <C-w> <Esc><Right>[wi
    inoremap <C-e> <Esc>ea
    " inoremap <C-b> <Esc>[bi
    " inoremap <C-w> <Esc><Right>[wi
    " inoremap <C-e> <Esc>ea
    " 插入模式移动
    " 插入模式转换普通模式
    inoremap jk <Esc>
    @@ -269,20 +270,23 @@ nnoremap vir ^v$
    nnoremap var ^v$
    " 选中行(不含换行符)
    " 框选指定符号结束的多行
    nnoremap vs( V/(<CR>%
    nnoremap vs{ V/{<CR>%
    nnoremap vs[ V/[<CR>%
    nnoremap vs; V/;<CR>
    nnoremap vs( ^V/(<CR>%
    nnoremap vs{ ^V/{<CR>%
    nnoremap vs[ ^V/[<CR>%
    nnoremap vs) ^V%
    nnoremap vs} ^V%
    nnoremap vs] ^V%
    nnoremap vs; ^V/;<CR>
    " 框选指定符号结束的多行
    " 选中整个方法
    nnoremap vsm va{<Esc>v%:action EditorSelectWord<CR>
    " 选中整个方法
    " 选中单词(按驼峰命名规则匹配)
    nnoremap <C-w> <Esc>[w]wv[b
    nnoremap <C-b> <Esc>]bv[b
    nnoremap <C-S-w> <Esc>]bv[b
    vnoremap <C-w> <Esc>[w]wv[b
    vnoremap <C-b> <Esc>]bv[b
    " 选中单词(按驼峰命名规则匹配)
    vnoremap <C-S-w> <Esc>]bv[b
    " 选中单词(t按驼峰命名规则匹配)
    " 复制 至行尾/行首
    nnoremap <S-y> y$
    nnoremap yH y^
  4. PisecesPeng revised this gist May 13, 2023. 1 changed file with 28 additions and 15 deletions.
    43 changes: 28 additions & 15 deletions .ideavimrc
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ set highlightedyank
    " 代码树
    set NERDTree
    " 搜索时提示高亮
    set quickscope
    " set quickscope
    " 增强段落移动
    set vim-paragraph-motion
    " 普通模式自动切换为英文输入法
    @@ -60,8 +60,6 @@ map <Leader>pi <Action>(ParameterInfo)
    nmap <Leader>ia <Action>(ShowIntentionActions)
    " 跳下/下一个错误
    nmap <leader>ne <action>(GotoNextError)
    " 最近编辑
    nmap <M-S-e> <Action>(RecentLocations)
    " 当前页面方法列表
    nmap <Leader>fs <Action>(FileStructurePopup)
    " 选择模式扩大选择范围
    @@ -71,9 +69,15 @@ vmap V <Action>(EditorUnSelectWord)
    " 上/下一个tab
    nmap <Tab> <Action>(NextTab)
    nmap <S-Tab> <Action>(PreviousTab)
    " 开启新一行编辑
    imap <S-CR> <Action>(EditorStartNewLine)
    imap <S-D-CR> <Action>(EditorStartNewLineBefore)
    " 开启新一行编辑
    " 最近编辑
    " nmap <S-D-e> <Action>(RecentLocations)
    " navigate back/forward
    nmap <S-h> <Action>(Back)
    nmap <S-l> <Action>(Forward)
    " nmap <S-h> <Action>(Back)
    " nmap <S-l> <Action>(Forward)
    " 多光标选中单词
    nmap <Leader>va <Action>(SelectAllOccurrences)
    vmap <Leader>va <Action>(SelectAllOccurrences)
    @@ -221,14 +225,12 @@ nnoremap ca< "_ca<
    " 快速跳转行首与行尾
    nnoremap <C-l> $
    nnoremap <C-h> ^
    vnormap <C-l> $
    vnoremap <C-h> ^
    " 快速跳转行首与行尾
    " 移动多行
    " noremap <C-j> 5j
    " noremap <C-k> 5k
    noremap <C-j> <C-d>
    noremap <C-k> <C-u>
    noremap <C-j> 5j
    noremap <C-k> 5k
    " noremap <C-j> <C-d>
    " noremap <C-k> <C-u>
    " 移动多行
    " 插入模式移动
    inoremap <C-h> <Left>
    @@ -247,9 +249,6 @@ nnoremap sx :split<Return>
    nnoremap sy :vsplit<Return>
    " nnoremap <C-w> <C-w>w
    " 切割窗口
    " 保存行 至末尾
    nnoremap Y y$
    " 保存行 至末尾
    " 保存行(不含换行符)
    nnoremap yir ^v$y
    nnoremap yar ^v$y
    @@ -273,7 +272,7 @@ nnoremap var ^v$
    nnoremap vs( V/(<CR>%
    nnoremap vs{ V/{<CR>%
    nnoremap vs[ V/[<CR>%
    nnoremap vs; V/;<CR>%
    nnoremap vs; V/;<CR>
    " 框选指定符号结束的多行
    " 选中整个方法
    nnoremap vsm va{<Esc>v%:action EditorSelectWord<CR>
    @@ -284,6 +283,20 @@ nnoremap <C-b> <Esc>]bv[b
    vnoremap <C-w> <Esc>[w]wv[b
    vnoremap <C-b> <Esc>]bv[b
    " 选中单词(按驼峰命名规则匹配)
    " 复制 至行尾/行首
    nnoremap <S-y> y$
    nnoremap yH y^
    nnoremap yL y$
    " 复制 至行尾/行首
    " 删除 至行尾/行首
    nnoremap dH d^
    nnoremap dL d$
    nnoremap cH c^
    nnoremap cL c$
    " 删除 至行尾/行首






  5. PisecesPeng revised this gist May 5, 2023. 1 changed file with 18 additions and 24 deletions.
    42 changes: 18 additions & 24 deletions .ideavimrc
    Original file line number Diff line number Diff line change
    @@ -51,7 +51,7 @@ nmap <Leader>\ <Action>(SelectInProjectView)
    " 鼠标悬停
    map <Leader>ed <Action>(ShowErrorDescription)
    " 鼠标右键
    map <Leader>pm <Action>(ShowPopupMenu)
    map <Leader>me <Action>(ShowPopupMenu)
    " 查看文档
    nmap <Leader>jd <Action>(QuickJavaDoc)
    " 查看方法参数
    @@ -69,12 +69,11 @@ vmap v <Action>(EditorSelectWord)
    " 选择模式缩小选择范围
    vmap V <Action>(EditorUnSelectWord)
    " 上/下一个tab
    nmap <A-k> <Action>(NextTab)
    nmap <A-j> <Action>(PreviousTab)
    " navigate back
    nmap <A-h> <Action>(Back)
    " navigate forward
    nmap <A-l> <Action>(Forward)
    nmap <Tab> <Action>(NextTab)
    nmap <S-Tab> <Action>(PreviousTab)
    " navigate back/forward
    nmap <S-h> <Action>(Back)
    nmap <S-l> <Action>(Forward)
    " 多光标选中单词
    nmap <Leader>va <Action>(SelectAllOccurrences)
    vmap <Leader>va <Action>(SelectAllOccurrences)
    @@ -86,8 +85,8 @@ nmap <M-S-g> <Action>(FindPrevious)
    " vmap <Tab> <Action>(EditorIndentSelection)
    " vmap <S-Tab> <Action>(EditorUnindentSelection)
    " 合并行
    nmap <C-j> <Action>(EditorJoinLines)
    " 切换分割窗口的光标
    " nmap <C-j> <Action>(EditorJoinLines)
    " 切换分割窗口
    nmap <C-s> <Action>(NextSplitter)
    vmap <C-s> <Action>(NextSplitter)
    " 行上/下移
    @@ -97,7 +96,7 @@ map <M-S-Down> <Action>(MoveStatementDown)
    nmap <Leader>sw <Action>(SurroundWith)
    vmap <Leader>sw <Action>(SurroundWith)
    " 高亮选中
    map <Leader>hu <Action>(HighlightUsagesInFile)
    map <Leader>hl <Action>(HighlightUsagesInFile)
    """ Action list mapping ------------------------

    " 重构动作更具确定性
    @@ -216,21 +215,21 @@ nnoremap ca{ "_ca{
    nnoremap ca< "_ca<
    " 组合命令删除不剪切
    " 切换tab
    " noremap <A-j> gT
    " noremap <A-k> gt
    " noremap <Tab> gT
    " noremap <S-Tab> gt
    " 切换tab
    " 快速跳转行首与行尾
    nnoremap <C-l> $
    nnoremap <C-h> ^
    vnoremap <C-l> $
    vnormap <C-l> $
    vnoremap <C-h> ^
    " 快速跳转行首与行尾
    " 移动5行
    noremap <C-j> 5j
    noremap <C-k> 5k
    " noremap <C-j> <C-d>
    " noremap <C-k> <C-u>
    " 移动5行
    " 移动多行
    " noremap <C-j> 5j
    " noremap <C-k> 5k
    noremap <C-j> <C-d>
    noremap <C-k> <C-u>
    " 移动多行
    " 插入模式移动
    inoremap <C-h> <Left>
    inoremap <C-j> <Down>
    @@ -285,11 +284,6 @@ nnoremap <C-b> <Esc>]bv[b
    vnoremap <C-w> <Esc>[w]wv[b
    vnoremap <C-b> <Esc>]bv[b
    " 选中单词(按驼峰命名规则匹配)
    " surround-plug使用简化
    " nnoremap siw g@iw"
    " nnoremap si g@i
    " nnoremap sa g@a
    "surround-plug使用简化



  6. PisecesPeng revised this gist Apr 28, 2023. 1 changed file with 44 additions and 21 deletions.
    65 changes: 44 additions & 21 deletions .ideavimrc
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,10 @@

    let mapleader = "\<space>"

    " 防止leader键移动
    nnoremap <space> <nop>
    vnoremap <space> <nop>

    """ Plugins --------------------------------
    " Plugins-marketplace : IdeaVim AceJump IdeaVim-EasyMotion IdeaVim-Quickscope IdeaVimExtension
    " 环绕插入符号
    @@ -18,7 +22,7 @@ set highlightedyank
    " 代码树
    set NERDTree
    " 搜索时提示高亮
    " set quickscope
    set quickscope
    " 增强段落移动
    set vim-paragraph-motion
    " 普通模式自动切换为英文输入法
    @@ -33,7 +37,7 @@ set showmode
    " 高亮时间
    let g:highlightedyank_highlight_duration = 1000
    " 自定义颜色
    " let g:highlightedyank_highlight_color = "rgba(160, 160, 160, 155)"
    " let g:highlightedyank_highlight_color = "rgba(210,240,244, 155)"
    let g:argtextobj_pairs="[:],(:),<:>"
    " Turn off this plugin when the length of line is longer than g:qs_max_chars.
    let g:qs_max_chars=200
    @@ -43,16 +47,19 @@ nmap ss <Plug>(easymotion-s2)
    """ Plugin mapping ------------------------
    """ Action list mapping ------------------------
    " 定位到文件树
    nmap <Leader>sp <Action>(SelectInProjectView)
    nmap <Leader>\ <Action>(SelectInProjectView)
    " 鼠标悬停
    nmap <Leader>\ <Action>(ShowErrorDescription)
    nmap <Leader>jd <Action>(QuickJavaDoc)
    map <Leader>ed <Action>(ShowErrorDescription)
    " 鼠标右键
    nmap <Leader>pm <Action>(ShowPopupMenu)
    vmap <Leader>pm <Action>(ShowPopupMenu)
    map <Leader>pm <Action>(ShowPopupMenu)
    " 查看文档
    nmap <Leader>jd <Action>(QuickJavaDoc)
    " 查看方法参数
    map <Leader>pi <Action>(ParameterInfo)
    " 智能提示
    nmap <Leader>ia <Action>(ShowIntentionActions)
    " 跳下/下一个错误
    nmap <leader>ne <action>(GotoNextError)
    nmap <leader>pe <action>(GotoPreviousError)
    " 最近编辑
    nmap <M-S-e> <Action>(RecentLocations)
    " 当前页面方法列表
    @@ -61,10 +68,9 @@ nmap <Leader>fs <Action>(FileStructurePopup)
    vmap v <Action>(EditorSelectWord)
    " 选择模式缩小选择范围
    vmap V <Action>(EditorUnSelectWord)
    " 上一个tab
    nmap <A-j> <Action>(PreviousTab)
    " 上一个tab
    " 上/下一个tab
    nmap <A-k> <Action>(NextTab)
    nmap <A-j> <Action>(PreviousTab)
    " navigate back
    nmap <A-h> <Action>(Back)
    " navigate forward
    @@ -77,10 +83,10 @@ nmap <C-S-g> <Action>(UnselectPreviousOccurrence)
    nmap <M-g> <Action>(FindNext)
    nmap <M-S-g> <Action>(FindPrevious)
    " 左右缩进
    map <Tab> <Action>(EditorIndentSelection)
    map <S-Tab> <Action>(EditorUnindentSelection)
    " vmap <Tab> <Action>(EditorIndentSelection)
    " vmap <S-Tab> <Action>(EditorUnindentSelection)
    " 合并行
    nmap <S-j> <Action>(EditorJoinLines)
    nmap <C-j> <Action>(EditorJoinLines)
    " 切换分割窗口的光标
    nmap <C-s> <Action>(NextSplitter)
    vmap <C-s> <Action>(NextSplitter)
    @@ -90,6 +96,8 @@ map <M-S-Down> <Action>(MoveStatementDown)
    " 代码生成环绕模版
    nmap <Leader>sw <Action>(SurroundWith)
    vmap <Leader>sw <Action>(SurroundWith)
    " 高亮选中
    map <Leader>hu <Action>(HighlightUsagesInFile)
    """ Action list mapping ------------------------

    " 重构动作更具确定性
    @@ -124,6 +132,11 @@ set cursorline
    set shiftround
    " 自动跟随上行缩进
    set autoindent
    " 简化缩进
    nnoremap > >>
    nnoremap < <<
    vnoremap > >gv
    vnoremap < <gv

    " 突出搜索内容 ':noh'可取消突出
    " set nohlsearch
    @@ -263,15 +276,25 @@ nnoremap vs{ V/{<CR>%
    nnoremap vs[ V/[<CR>%
    nnoremap vs; V/;<CR>%
    " 框选指定符号结束的多行
    " 选中整个方法(power by actionlist:EditorSelectWord)
    nmap vsm va{<Esc>v%v
    " 选中整个方法(power by actionlist:EditorSelectWord)
    " 选中整个方法
    nnoremap vsm va{<Esc>v%:action EditorSelectWord<CR>
    " 选中整个方法
    " 选中单词(按驼峰命名规则匹配)
    nmap <C-w> <Esc>[w]wv[b
    nmap <C-b> <Esc>]bv[b
    vmap <C-w> <Esc>[w]wv[b
    vmap <C-b> <Esc>]bv[b
    nnoremap <C-w> <Esc>[w]wv[b
    nnoremap <C-b> <Esc>]bv[b
    vnoremap <C-w> <Esc>[w]wv[b
    vnoremap <C-b> <Esc>]bv[b
    " 选中单词(按驼峰命名规则匹配)
    " surround-plug使用简化
    " nnoremap siw g@iw"
    " nnoremap si g@i
    " nnoremap sa g@a
    "surround-plug使用简化






    function! Fdemo()
    let code = "demo"
  7. PisecesPeng renamed this gist Apr 28, 2023. 1 changed file with 26 additions and 5 deletions.
    31 changes: 26 additions & 5 deletions .vimrc → .ideavimrc
    Original file line number Diff line number Diff line change
    @@ -30,6 +30,7 @@ set noerrorbells
    set showmode
    """ Plugins --------------------------------
    """ Plugin settings -------------------------
    " 高亮时间
    let g:highlightedyank_highlight_duration = 1000
    " 自定义颜色
    " let g:highlightedyank_highlight_color = "rgba(160, 160, 160, 155)"
    @@ -44,8 +45,14 @@ nmap ss <Plug>(easymotion-s2)
    " 定位到文件树
    nmap <Leader>sp <Action>(SelectInProjectView)
    " 鼠标悬停
    nmap <Leader>ed <Action>(ShowErrorDescription)
    nmap <Leader>\ <Action>(ShowErrorDescription)
    nmap <Leader>jd <Action>(QuickJavaDoc)
    " 鼠标右键
    nmap <Leader>pm <Action>(ShowPopupMenu)
    vmap <Leader>pm <Action>(ShowPopupMenu)
    " 跳下/下一个错误
    nmap <leader>ne <action>(GotoNextError)
    nmap <leader>pe <action>(GotoPreviousError)
    " 最近编辑
    nmap <M-S-e> <Action>(RecentLocations)
    " 当前页面方法列表
    @@ -70,8 +77,8 @@ nmap <C-S-g> <Action>(UnselectPreviousOccurrence)
    nmap <M-g> <Action>(FindNext)
    nmap <M-S-g> <Action>(FindPrevious)
    " 左右缩进
    vmap <Tab> <Action>(EditorIndentSelection)
    vmap <S-Tab> <Action>(EditorUnindentSelection)
    map <Tab> <Action>(EditorIndentSelection)
    map <S-Tab> <Action>(EditorUnindentSelection)
    " 合并行
    nmap <S-j> <Action>(EditorJoinLines)
    " 切换分割窗口的光标
    @@ -80,8 +87,14 @@ vmap <C-s> <Action>(NextSplitter)
    " 行上/下移
    map <M-S-Up> <Action>(MoveStatementUp)
    map <M-S-Down> <Action>(MoveStatementDown)
    " 代码生成环绕模版
    nmap <Leader>sw <Action>(SurroundWith)
    vmap <Leader>sw <Action>(SurroundWith)
    """ Action list mapping ------------------------

    " 重构动作更具确定性
    set idearefactormode=keep

    " Do incremental searching
    set incsearch

    @@ -117,11 +130,18 @@ set autoindent
    " ic 不区分大小写
    " set hls ic

    " 视野移动
    nnoremap zh 50zh
    nnoremap zl 50zl

    " 按'*'搜索光标选中的内容, 取消高亮`:noh`
    vnoremap * "ry/<C-R>r<CR>

    " 向上/下新增空行
    noremap <S-Enter> O<Esc>
    noremap <CR> o<Esc>

    " 删除不剪切
    noremap <C-d> a<Backspace><Esc>
    nnoremp d "_d
    nnoremap dd "_dd
    nnoremap D "_D
    @@ -195,13 +215,14 @@ vnoremap <C-h> ^
    " 移动5行
    noremap <C-j> 5j
    noremap <C-k> 5k
    " noremap <C-j> <C-d>
    " noremap <C-k> <C-u>
    " 移动5行
    " 插入模式移动
    inoremap <C-h> <Left>
    inoremap <C-j> <Down>
    inoremap <C-k> <Up>
    inoremap <C-l> <Right>
    inoremap <C-d> <Backspace>
    inoremap <C-b> <Esc>[bi
    inoremap <C-w> <Esc><Right>[wi
    inoremap <C-e> <Esc>ea
  8. PisecesPeng revised this gist Apr 20, 2023. 1 changed file with 19 additions and 15 deletions.
    34 changes: 19 additions & 15 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -63,19 +63,20 @@ nmap <A-h> <Action>(Back)
    " navigate forward
    nmap <A-l> <Action>(Forward)
    " 多光标选中单词
    nmap <Leader><Leader>a <Action>(SelectAllOccurrences)
    vmap <Leader><Leader>a <Action>(SelectAllOccurrences)
    nmap <Leader>va <Action>(SelectAllOccurrences)
    vmap <Leader>va <Action>(SelectAllOccurrences)
    nmap <C-g> <Action>(SelectNextOccurrence)
    nmap <C-S-g> <Action>(UnselectPreviousOccurrence)
    nmap <M-g> <Action>(FindNext)
    nmap <M-S-g> <Action>(FindPrevious)
    " 选择模式缩小选择范围
    " 左右缩进
    vmap <Tab> <Action>(EditorIndentSelection)
    vmap <S-Tab> <Action>(EditorUnindentSelection)
    " 合并行
    nmap <S-j> <Action>(EditorJoinLines)
    " 切换分割窗口的光标
    nmap <C-s> <Action>(NextSplitter)
    vmap <C-s> <Action>(NextSplitter)
    " 行上/下移
    map <M-S-Up> <Action>(MoveStatementUp)
    map <M-S-Down> <Action>(MoveStatementDown)
    @@ -119,11 +120,6 @@ set autoindent
    " 按'*'搜索光标选中的内容, 取消高亮`:noh`
    vnoremap * "ry/<C-R>r<CR>
    " 针对驼峰命名的移动
    nnoremap <C-w> [w
    nnoremap <C-b> [b
    vnoremap <C-w> [w
    vnoremap <C-b> [b
    " 删除不剪切
    noremap <C-d> a<Backspace><Esc>
    nnoremp d "_d
    @@ -239,12 +235,22 @@ nnoremap yxr ^v$x
    " 选中行(不含换行符)
    nnoremap vir ^v$
    nnoremap var ^v$
    " 多行
    nnoremap s( V/(<CR>%
    nnoremap s{ V/{<CR>%
    nnoremap s[ V/[<CR>%
    nnoremap s; V/;<CR>%
    " 选中行(不含换行符)
    " 框选指定符号结束的多行
    nnoremap vs( V/(<CR>%
    nnoremap vs{ V/{<CR>%
    nnoremap vs[ V/[<CR>%
    nnoremap vs; V/;<CR>%
    " 框选指定符号结束的多行
    " 选中整个方法(power by actionlist:EditorSelectWord)
    nmap vsm va{<Esc>v%v
    " 选中整个方法(power by actionlist:EditorSelectWord)
    " 选中单词(按驼峰命名规则匹配)
    nmap <C-w> <Esc>[w]wv[b
    nmap <C-b> <Esc>]bv[b
    vmap <C-w> <Esc>[w]wv[b
    vmap <C-b> <Esc>]bv[b
    " 选中单词(按驼峰命名规则匹配)

    function! Fdemo()
    let code = "demo"
    @@ -253,8 +259,6 @@ endfunction





    """ IdeaVim development stuff
    " This is actually an undocumented option for internal use.
    " If there is a bug in IdeaVim code and after some command,
  9. PisecesPeng revised this gist Apr 19, 2023. 1 changed file with 3026 additions and 0 deletions.
    3,026 changes: 3,026 additions & 0 deletions actionlist.vimrc
    3,026 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
  10. PisecesPeng revised this gist Apr 19, 2023. No changes.
  11. PisecesPeng created this gist Apr 19, 2023.
    266 changes: 266 additions & 0 deletions .vimrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,266 @@
    "" Source your .vimrc
    "source ~/.vimrc

    let mapleader = "\<space>"

    """ Plugins --------------------------------
    " Plugins-marketplace : IdeaVim AceJump IdeaVim-EasyMotion IdeaVim-Quickscope IdeaVimExtension
    " 环绕插入符号
    set surround
    " 快速跳转
    set easymotion
    " 快速操作参数
    set argtextobj
    " 快速调换位置
    set exchange
    " 复制时高亮
    set highlightedyank
    " 代码树
    set NERDTree
    " 搜索时提示高亮
    " set quickscope
    " 增强段落移动
    set vim-paragraph-motion
    " 普通模式自动切换为英文输入法
    set keep-english-in-normal
    " 取消vim操作声音
    set visualbell
    set noerrorbells
    " 开启模式显示
    set showmode
    """ Plugins --------------------------------
    """ Plugin settings -------------------------
    let g:highlightedyank_highlight_duration = 1000
    " 自定义颜色
    " let g:highlightedyank_highlight_color = "rgba(160, 160, 160, 155)"
    let g:argtextobj_pairs="[:],(:),<:>"
    " Turn off this plugin when the length of line is longer than g:qs_max_chars.
    let g:qs_max_chars=200
    """ Plugin settings -------------------------
    """ Plugin mapping ------------------------
    nmap ss <Plug>(easymotion-s2)
    """ Plugin mapping ------------------------
    """ Action list mapping ------------------------
    " 定位到文件树
    nmap <Leader>sp <Action>(SelectInProjectView)
    " 鼠标悬停
    nmap <Leader>ed <Action>(ShowErrorDescription)
    nmap <Leader>jd <Action>(QuickJavaDoc)
    " 最近编辑
    nmap <M-S-e> <Action>(RecentLocations)
    " 当前页面方法列表
    nmap <Leader>fs <Action>(FileStructurePopup)
    " 选择模式扩大选择范围
    vmap v <Action>(EditorSelectWord)
    " 选择模式缩小选择范围
    vmap V <Action>(EditorUnSelectWord)
    " 上一个tab
    nmap <A-j> <Action>(PreviousTab)
    " 上一个tab
    nmap <A-k> <Action>(NextTab)
    " navigate back
    nmap <A-h> <Action>(Back)
    " navigate forward
    nmap <A-l> <Action>(Forward)
    " 多光标选中单词
    nmap <Leader><Leader>a <Action>(SelectAllOccurrences)
    vmap <Leader><Leader>a <Action>(SelectAllOccurrences)
    nmap <C-g> <Action>(SelectNextOccurrence)
    nmap <C-S-g> <Action>(UnselectPreviousOccurrence)
    nmap <M-g> <Action>(FindNext)
    nmap <M-S-g> <Action>(FindPrevious)
    " 选择模式缩小选择范围
    vmap <Tab> <Action>(EditorIndentSelection)
    vmap <S-Tab> <Action>(EditorUnindentSelection)
    " 合并行
    nmap <S-j> <Action>(EditorJoinLines)
    " 切换分割窗口的光标
    nmap <C-s> <Action>(NextSplitter)
    " 行上/下移
    map <M-S-Up> <Action>(MoveStatementUp)
    map <M-S-Down> <Action>(MoveStatementDown)
    """ Action list mapping ------------------------

    " Do incremental searching
    set incsearch

    " Find more examples here: https://jb.gg/share-ideavimrc
    set ideajoin
    set clipboard+=ideaput

    " 不区分大小写
    set ignorecase smartcase

    " 显示匹配括号
    set showmatch

    " 设置行号样式
    set number relativenumber

    " 将系统剪贴板与vim剪贴板合并
    set clipboard=unnamed

    " 屏幕追随光标移动的距离
    set scrolloff=8

    " 突出显示行
    set cursorline

    " 使用'<'&'>'进行缩进
    set shiftround
    " 自动跟随上行缩进
    set autoindent

    " 突出搜索内容 ':noh'可取消突出
    " set nohlsearch
    " ic 不区分大小写
    " set hls ic

    " 按'*'搜索光标选中的内容, 取消高亮`:noh`
    vnoremap * "ry/<C-R>r<CR>
    " 针对驼峰命名的移动
    nnoremap <C-w> [w
    nnoremap <C-b> [b
    vnoremap <C-w> [w
    vnoremap <C-b> [b
    " 删除不剪切
    noremap <C-d> a<Backspace><Esc>
    nnoremp d "_d
    nnoremap dd "_dd
    nnoremap D "_D
    " nnoremap <leader>d ""d
    " nnoremap <leader>dd ""dd
    " nnoremap <leader>D ""D
    nnoremap c "_c
    nnoremap cc "_cc
    nnoremap C "_C
    " nnoremap <leader>c ""c
    " nnoremap <leader>cc ""cc
    " nnoremap <leader>C ""C
    vnoremap d "_d
    vnoremap dd "_dd
    vnoremap D "_D
    " vnoremap <leader>d ""d
    " vnoremap <leader>dd ""dd
    " vnoremap <leader>D ""D
    vnoremap c "_c
    vnoremap cc "_cc
    vnoremap C "_C
    " vnoremap <leader>c ""c
    " vnoremap <leader>cc ""cc
    " vnoremap <leader>C ""C
    vnoremap p "_dp
    vnoremap P "_dP
    " 删除不剪切
    " 组合命令删除不剪切
    nnoremap diw "_diw
    nnoremap di" "_di"
    nnoremap di' "_di'
    nnoremap di( "_di(
    nnoremap di[ "_di[
    nnoremap di{ "_di{
    nnoremap di< "_di<
    nnoremap daw "_daw
    nnoremap da" "_da"
    nnoremap da' "_da'
    nnoremap da( "_da(
    nnoremap da[ "_da[
    nnoremap da{ "_da{
    nnoremap da< "_da<
    nnoremap ciw "_ciw
    nnoremap ci" "_ci"
    nnoremap ci' "_ci'
    nnoremap ci( "_ci(
    nnoremap ci[ "_ci[
    nnoremap ci{ "_ci{
    nnoremap ci< "_ci<
    nnoremap caw "_caw
    nnoremap ca" "_ca"
    nnoremap ca' "_ca'
    nnoremap ca( "_ca(
    nnoremap ca[ "_ca[
    nnoremap ca{ "_ca{
    nnoremap ca< "_ca<
    " 组合命令删除不剪切
    " 切换tab
    " noremap <A-j> gT
    " noremap <A-k> gt
    " 切换tab
    " 快速跳转行首与行尾
    nnoremap <C-l> $
    nnoremap <C-h> ^
    vnoremap <C-l> $
    vnoremap <C-h> ^
    " 快速跳转行首与行尾
    " 移动5行
    noremap <C-j> 5j
    noremap <C-k> 5k
    " 移动5行
    " 插入模式移动
    inoremap <C-h> <Left>
    inoremap <C-j> <Down>
    inoremap <C-k> <Up>
    inoremap <C-l> <Right>
    inoremap <C-d> <Backspace>
    inoremap <C-b> <Esc>[bi
    inoremap <C-w> <Esc><Right>[wi
    inoremap <C-e> <Esc>ea
    " 插入模式移动
    " 插入模式转换普通模式
    inoremap jk <Esc>
    " 插入模式转换普通模式
    " 切割窗口
    nnoremap sx :split<Return>
    nnoremap sy :vsplit<Return>
    " nnoremap <C-w> <C-w>w
    " 切割窗口
    " 保存行 至末尾
    nnoremap Y y$
    " 保存行 至末尾
    " 保存行(不含换行符)
    nnoremap yir ^v$y
    nnoremap yar ^v$y
    " 保存行(不含换行符)
    " 删除行(不含换行符)
    nnoremap dir ^v$"_d
    nnoremap dar ^v$"_d
    " 删除行(不含换行符)
    " 删除行(不含换行符)
    nnoremap cir ^v"_C
    nnoremap car ^v"_C
    " 删除行(不含换行符)
    " 删除&复制行(不含换行符)
    nnoremap yxr ^v$x
    " 删除&复制行(不含换行符)
    " 选中行(不含换行符)
    nnoremap vir ^v$
    nnoremap var ^v$
    " 多行
    nnoremap s( V/(<CR>%
    nnoremap s{ V/{<CR>%
    nnoremap s[ V/[<CR>%
    nnoremap s; V/;<CR>%
    " 选中行(不含换行符)

    function! Fdemo()
    let code = "demo"
    return code
    endfunction





    """ IdeaVim development stuff
    " This is actually an undocumented option for internal use.
    " If there is a bug in IdeaVim code and after some command,
    " IdeaVim calculates that the caret should be located at 1000000 offset in a short file,
    " we have a protection that would put the caret just at the file end.
    " This way the actual error is hidden from the user. With this option enabled,
    " an exception will be thrown and IJ will show a notification that something is wrong.
    " Since I use IdeaVim for myself, I'd like to see such notifications and this option is enabled for me.
    set ideastrictmode