ideavimrc中 " 后面的是注释
nnoremap <SPACE> <Nop>
let mapleader = " "
set hlsearch
set incsearch
set smartcase
set ignorecase
set easymotion
set surround
set argtextobj
set keep-english-in-normal-and-restore-in-insert
set scrolloff=4
" basic key mapping
" nnoremap L $
" nnoremap H ^
" noremap L $
" nvnoremap H ^
" nnoremap ; :
" clear the highlighted search result
nnoremap <Leader>sc :nohlsearch<CR>
" Move half page faster
" 向下半屏幕
nnoremap <LEADER>d <C-d>
" 向上半屏幕
nnoremap <leader>u <C-u>
" Window operation
" 光标在多个分屏移动
nnoremap <leader>ww <C-W>w
" 关闭分屏
nnoremap <leader>wd <C-W>c
" 光标左右上下移动
nnoremap <leader>wj <C-W>j
nnoremap <leader>wk <C-W>k
nnoremap <leader>wh <C-W>h
nnoremap <leader>wl <C-W>l
" 新建纵向窗口
nnoremap <leader>ws <C-W>s
nnoremap <leader>w- <C-W>s
" 新建横向窗口
noremap <leader>wv <C-W>v
nnoremap <leader>w\| <C-W>v
" copy and paste
nnoremap <Leader>y "y
nnoremap <Leader>p "p
nnoremap <Leader>P "+p
nnoremap Y "+y
" Tab operation
" 打个下一个打开的文件tab
nnoremap tn gt
" 打个上一个打开的文件tab
nnoremap tp gT
" Insert mode shortcut
nnoremap <C-h> <Left>
nnoremap <C-j> <Down>
nnoremap <C-k> <Up>
nnoremap <C-l> <Right>
nnoremap <C-a> <Home>
nnoremap <C-e> <End>
nnoremap <C-d> <Delete>
" Quit normal mode
" 关闭当前文件tab窗
nnoremap <Space>q :q<CR>
" 关闭所有文件窗口
nnoremap <Space>Q :qa!<CR>
" edit vimrc
nnoremap <leader>ve :e ~/.ideavimrc<CR>
nnoremap <leader>vw :w!<CR>
nnoremap <leader>vs :source ~/.ideavimrc<CR>
" intellij built in key map
" 搜索idea配置项
nnoremap <leader>a :action GotoAction<CR>
nnoremap <leader>b :action Bookmarks<CR>
" 项目中搜索类 java后缀文件
nnoremap <leader>c :action GotoClass<CR>
" 项目中搜索所有后缀 文件
nnoremap <leader>e :action SearchEverywhere<CR>
" 关键字搜索项目所有文件中的内容
nnoremap <leader>f :action FindInPath<CR>
" 与分支比较
nnoremap <leader>gc :action Git.CompareWithBranch<CR>
"
nnoremap <leader>gr :action Git.ResolveConflicts<CR>
nnoremap <leader>ga :action Annotate<CR>
" 打开idea的文件窗
nnoremap <leader>or :action FileMenu<CR>
" 查近打开过的文件
nnoremap <leader>r :action RecentFiles<CR>
nnoremap <leader>s :action FileStructurePopup<CR>
nnoremap <leader>h :action Back<CR>
nnoremap <leader>l :action Forward<CR>
" navigation
" 打开父类
nnoremap gs :action GotoSuperMethod<CR>
" 光标回到上次编辑的地方
nnoremap gb :action JumpToLastChange<CR>
" 查找引用
nnoremap gi :action GotoImplementation<CR>
" 查找定义
nnoremap gd :action GotoDeclaration<CR>
" 重命名
nnoremap gr :action RenameElement<CR>
" code actions
nnoremap U :action FindUsages<CR>
" 重命名
nnoremap R :action RenameElement<CR>
" 格式化代码
nnoremap == :action ReformatCode<CR>
" nnoremap = :action ReformatCode<CR>
" 注释当前行
nnoremap cc :action CommentByLineComment<CR>
" 打断点
nnoremap <Leader>sb :action ToggleLineBreakpoint<CR>
nnoremap <Leader>zb :action ViewBreakpoints<CR>
" 跳转到下一个错误
nnoremap <Leader>nn :action GotoNextError<CR>
nnoremap <Leader>nb :action GotoPreviousError<CR>
" 实现方法
nnoremap zi :action ImplementMethods<CR>
" 重写方法"
nnoremap zo :action OverrideMethods<CR>
" 行尾加;并换行
nnoremap ;<Cr> <Esc>A;<Cr>
" 行尾加;不换行
nnoremap ;; <Esc>A;