-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ideavimrc
81 lines (78 loc) · 2.84 KB
/
.ideavimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Plug 'tpope/vim-surround'
Plug 'preservim/nerdtree'
Plug 'vim-exchange'
Plug 'vim-scripts/argtextobj.vim'
let mapleader=","
set easymotion
set hlsearch " 检索时高亮显示匹配项
set incsearch " 边输入边搜索
set ignorecase
set smartcase
set nu " 显示行号
set rnu " 显示行号
set nocp " 不兼容vi
set hidden " 允许不保存切换buffer
set splitright " 新分割窗口在右边
set splitbelow " 新分割窗口在下边
set autoread " 文件在Vim之外修改过,自动重新读入
set scrolljump=1 " 当光标离开屏幕滑动行数
set scrolloff=2 " 保持在光标上下最少行数
map f <Plug>(easymotion-bd-f)
inoremap jj <esc>
nnoremap <silent> \1 :b 1<CR>
nnoremap <silent> \2 :b 2<CR>
nnoremap <silent> \3 :b 3<CR>
nnoremap <silent> \4 :b 4<CR>
nnoremap <silent> \5 :b 5<CR>
nnoremap <silent> \6 :b 6<CR>
nnoremap <silent> \7 :b 7<CR>
nnoremap <silent> \8 :b 8<CR>
nnoremap <silent> \9 :b 9<CR>
nnoremap <silent> <leader>1 :b 1<CR>
nnoremap <silent> <leader>2 :b 2<CR>
nnoremap <silent> <leader>3 :b 3<CR>
nnoremap <silent> <leader>4 :b 4<CR>
nnoremap <silent> <leader>5 :b 5<CR>
nnoremap <silent> <leader>6 :b 6<CR>
nnoremap <silent> <leader>7 :b 7<CR>
nnoremap <silent> <leader>8 :b 8<CR>
nnoremap <silent> <leader>9 :b 9<CR>
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
cnoremap <C-a> <Home>
cnoremap <C-e> <End>
cnoremap <C-p> <Up>
cnoremap <C-n> <Down>
xnoremap * :<C-u>call <SID>VSetSearch()<CR>/<C-R>=@/<CR><CR>
xnoremap # :<C-u>call <SID>VSetSearch()<CR>?<C-R>=@/<CR><CR>
function! s:VSetSearch()
let temp = @s
norm! gv"sy
let @/ = '\V' . substitute(escape(@s, '/\'), '\n', '\\n', 'g')
let @s = temp
endfunction
nnoremap sg :action SplitVertically<CR>
nnoremap sv :action SplitHorizontally<CR>
nnoremap <Leader>q :action CloseContent<CR>
nnoremap <Leader>qa :action CloseAllEditors<CR>
nnoremap <Leader>qq :action CloseAllEditorsButActive<CR>
nnoremap <Leader>n :action NextWindow<CR>
nnoremap <Leader>t :action ActivateTerminalToolWindow<CR>
nnoremap <leader>u :action FindUsages<CR>
nnoremap <leader>s :action GotoRelated<CR>
nnoremap <leader>h :action CallHierarchy<CR>
nnoremap <leader>b :action ShowNavBar<CR>
nnoremap <leader>ff :NERDTreeFind<CR>
nnoremap <leader>ft :NERDTreeToggle<CR>
nnoremap <c-s> :action FileStructurePopup<CR>
nnoremap gc :action GotoClass<CR>
nnoremap gi :action GotoImplementation<CR>
nnoremap gd :action GotToDeclaration<CR>
nnoremap gp :action GotToSuperMethod<CR>
nnoremap gt :action GotoTest<CR>
nnoremap gb :action Back<CR>
nnoremap gf :action Forward<CR>
nnoremap gh :action VcsShowNextChangeMarker<CR>
nnoremap hg :action VcsShowPrevChangeMarker<CR>