ideaVim 设置

1、  打开如图所示的文件夹:C:\Users\你的用户名\

2、创建_ideavimrc 文件

3、文件内添加以下代码:

let mapSpace=' ' 
set hlsearch 
set incsearch 
set ignorecase 
set smartcase 
set showmode
set number
set relativenumber 
set scrolloff=3 
set history=100000 
set clipboard=unnamed 

" clear the highlighted search result 
nnoremap sc :nohlsearch 
nnoremap fs :w 
nnoremap ? :action GotoAction 
nnoremap gd :action GotoDeclaration 
nnoremap gi :action GotoImplementation 

" project search 
nnoremap ps :action SearchEverywhere 
nnoremap pf :action GotoFile 
nnoremap fu :action FindUsages 

" Quit normal mode 
nnoremap q  :q 
nnoremap Q  :qa! 

" Move half page faster 
nnoremap d   
nnoremap u   

" Insert mode shortcut 
inoremap   
inoremap   
inoremap   
inoremap   
inoremap   
inoremap   
inoremap   

" Quit insert mode 
inoremap jj  
inoremap jk  
inoremap kk  

" Quit visual mode 
vnoremap v  

" Move to the start of line 
nnoremap H ^ 

" Move to the end of line 
nnoremap L $ " Redo 
nnoremap U  

" Yank to the end of line 
nnoremap Y y$ 

" quit ==> close current window 
nnoremap q w 

" Window operation 
nnoremap ww w 
nnoremap wd c 
nnoremap wj j 
nnoremap wk k 
nnoremap wh h 
nnoremap wl l 
nnoremap ws s 
nnoremap w- s 
nnoremap wv v 
nnoremap w\| v 

" Tab operation nnoremap tn gt nnoremap tp gT 
" ================================================== 
" Show all the provided actions via `:actionlist` 
" ================================================== 
" built in search looks better 
nnoremap / :action Find 

" but preserve ideavim search 
nnoremap / / 
nnoremap ;; :action CommentByLineComment 
nnoremap bb :action ToggleLineBreakpoint 
nnoremap br :action ViewBreakpoints 
nnoremap cv :action ChangeView 
nnoremap cd :action ChooseDebugConfiguration 
nnoremap ga :action GotoAction 
nnoremap gc :action GotoClass 
nnoremap gd :action GotoDeclaration 
nnoremap gf :action GotoFile 
nnoremap gi :action GotoImplementation 
nnoremap gs :action GotoSymbol 
nnoremap gt :action GotoTest 
nnoremap fp :action ShowFilePath 
nnoremap ic :action InspectCode 
nnoremap mv :action ActivateMavenProjectsToolWindow 
nnoremap oi :action OptimizeImports 
nnoremap pm :action ShowPopupMenu 
nnoremap rc :action ChooseRunConfiguration 
nnoremap re :action RenameElement 
nnoremap rf :action RenameFile 
nnoremap se :action SearchEverywhere 
nnoremap su :action ShowUsages 
nnoremap tc :action CloseActiveTab 
nnoremap tl Vy:action ActivateTerminalToolWindow 
vnoremap tl y:action ActivateTerminalToolWindow

 

你可能感兴趣的:(ideaVim 设置)