diff --git a/.ideavimrc b/.ideavimrc index 3af6363..f524e8c 100644 --- a/.ideavimrc +++ b/.ideavimrc @@ -6,50 +6,205 @@ " text scroll if you mouse-click near the start or end of the window. set scrolloff=5 +" enable plugin 开启插件 +set hlsearch " highlight searches +set incsearch " do incremental searching, search as you type +set ignorecase " ignore case when searching +set smartcase " no ignorecase if Uppercase char present +set nu relativenumber +set which-key +set clipboard+=unnamedplus + +" 设置显示模式 +set showomode +set showcmd " 状态栏展示命令前缀 +set de=on " 开启错误提示 + + " Do incremental searching. set incsearch set easymotion -let mapleader="\" -" Don't use Ex mode, use Q for formatting. -map Q gq + +" 设置leader +" 设置leader为空格 +nnoremap +let mapleader = " " +" let mapleader="\" -map l (easymotion-lineforward) -map j (easymotion-j) -map k (easymotion-k) -map h (easymotion-linebackward) -map w (easymotion-w) -map b (easymotion-b) -nmap s (easymotion-s2) -nmap t (easymotion-t2) +imap jj +nnoremap +map i{ea} +"在某个函数名上执行快捷复制某个函数 +nnoremap c V$%y -let g:EasyMotion_smartcase = 1 - -" ==== 系统剪切板复制粘贴 ==== -" v 模式下复制内容到系统剪切板 -vmap c "+yy -" n 模式下复制一行到系统剪切板 -nmap c "+yy -" n 模式下粘贴系统剪切板的内容 -nmap v "+p +"设置acejump 快捷键为f +map f (AceAction)% +"翻页设置 +nnoremap d +nnoremap u +" 清理高亮 sc :nohlsearch +nnoremap sl :close -"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t -"" Map \r to the Reformat Code action -"map \r (ReformatCode) +" 窗口操作 window operation +noremap wv v +nnoremap ws s +nnoremap w- s +nnoremap w\| v -"" Map d to start debug -"map d (Debug) +nnoremap ww w +nnoremap wd c +nnoremap wj j +nnremap wk k +nnoremap wh h +nnoremap wl l -"" Map \b to toggle the breakpoint on the current line -"map \b (ToggleLineBreakpoint) +"开启插件 +set ideajoin +set NERDTree +set surround +"参数选择插件 使用 v i/a + w/s/p 或者[{(<‘"t ,这里的t表示html或者xml的选择 +"这里i/a 的区别是i 是inside,a是souard +set argtextobj +"行高亮插件 +set vim-highlightedyank + +"粘贴和复制 +nnoremap y "*y +" 将剪贴板内容粘贴 +nnoremap p "*p +nnoremap P "*0p +vnoremap Y "+y + +"tab operation tab操作 +nnoremap tn gt +nnoremap tp gT -" Find more examples here: https://jb.gg/share-ideavimrc +"函数折叠 +"zc 关闭当前打开的折叠 +"zo 打开当前的折叠 +"zm 关闭所有折叠 +"zM 关闭所有折叠及其嵌套的折叠 +"zr 打开所有折叠 +"zR 打开所有折叠及其嵌套的折叠 +"zd 删除当前折叠 +"zE 删除所有折叠 +"zj 移动至下一个折叠 +"zk 移动至上一个折叠 +"zn 禁用折叠 +"zN 启用折叠 -map("i", "", "b") -map("i", "", "l") -map("i", "", "j") -map("i", "", "k") +" 退出模式 +nnoremap q :q +nnoremap Q :qa! + +"编辑vimrc +nnoremap ve :e ~/.config/ideavim/.ideavimrc +nnoremap vw :w! +nnoremap vs :source ~/.config/ideavim/.ideavimrc + + +" https://github.com/JetBrains/ideavim/wiki/NERDTree-support +" NERDTreeFocus 将窗口的光标移动tree 里面 +" o 打开文件,文件夹但是丢失focus +" go 打开文件但是不丢失focus +" i 使用分离的window open file +" gi 打开分离的window,但是不丢失光标: +" s ,gs 和上面是相同的原理 +" x 关闭当前节点的parent +" p 跳转到当前节点的root节点,P 跳转到项目的root节点 +" m 展示菜单: +" A 全局或者缩小窗口 +nnoremap ntf :NERDTreeFocus +nnoremap :NERDTreeToggle +nnoremap :NERDTree +nnoremap :NERDTreeFind + +" intellij built in key map +nnoremap a :action GotoAction +nnoremap b :action Bookmarks +"nnoremap c :action GotoClass +nnoremap e :action SearchEverywhere +"nnoremap f :action FindInPath +nnoremap gc :action Git.CompareWithBranch +nnoremap ga :action Annotate +nnoremap gh :action Vcs.ShowTabbedFileHistory +nnoremap nj :action NewClass +nnoremap nt :action Kotlin.NewFile +nnoremap rf :action RecentFiles +nnoremap rl :action RecentLocations + +"toggle something +"toggle track vim action Id +nnoremap ta :action VimFindActionIdAction + +" run and debug +nnoremap ,d :action Debug +nnoremap ,r :action Run +nnoremap ,c :action CompileDirty +nnoremap ,b :action ToggleLineBreakpoint +nnoremap ,v :action ViewBreakpoints +nnoremap ,s :action Stop +" navigation +nnoremap gs :action GotoSuperMethod +nnoremap gb :action JumpToLastChange +nnoremap gi :action GotoImplementation +nnoremap gd :action GotoDeclaration +nnoremap gf :action FileStructurePopup + +" code actions +nnoremap U :action FindUsages +nnoremap R :action RenameElement +nnoremap == :action ReformatCode +vnoremap = :action ReformatCode +nnoremap -- :action OptimizeImports +"nnoremap cc :action CommentByLineComment +"vnoremap cc :action CommentByLineComment + +" " Don't use Ex mode, use Q for formatting. +" map Q gq +" +" +" map l (easymotion-lineforward) +" map j (easymotion-j) +" map k (easymotion-k) +" map h (easymotion-linebackward) +" map w (easymotion-w) +" map b (easymotion-b) +" nmap s (easymotion-s2) +" nmap t (easymotion-t2) +" +" let g:EasyMotion_smartcase = 1 +" +" " ==== 系统剪切板复制粘贴 ==== +" " v 模式下复制内容到系统剪切板 +" vmap c "+yy +" " n 模式下复制一行到系统剪切板 +" nmap c "+yy +" " n 模式下粘贴系统剪切板的内容 +" nmap v "+p +" +" +" +" "" -- 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) +" +" +" " Find more examples here: https://jb.gg/share-ideavimrc +" +" map("i", "", "b") +" map("i", "", "l") +" map("i", "", "j") +" map("i", "", "k")