-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
104 lines (88 loc) · 2.28 KB
/
.vimrc
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
" set leader key
nnoremap <SPACE> <Nop>
let mapleader = " "
" 联想插件 tabnine
" set relativenumber
" search
set hlsearch
set incsearch
set clipboard=unnamed
" plugins
set easymotion
set surround
" basic key mapping
nnoremap L $
nnoremap H ^
vnoremap L $
vnoremap H ^
nnoremap <leader>] <C-]>
nnoremap <leader>. <C-i>
nnoremap <leader>, <C-o>
nnoremap <CR> o<Esc>
nnoremap <S-Enter> i<CR><Esc>k$
nnoremap dH d^
nnoremap <leader>sc :nohlsearch<CR>
nnoremap <LEADER>d <C-d>
nnoremap <leader>u <C-u>
" Window operation
nnoremap <leader>ww <C-W>w
" lq
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
" 纵向创建窗口
noremap <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
noremap <leader>y "*y
noremap <leader>Y "*ygvd
noremap <leader>p "*p
noremap <leader>P "0p
vnoremap Y "+y
" Tab operation
nnoremap tn gt
nnoremap tp gT
" Insert mode shortcut
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
inoremap <C-a> <Home>
inoremap <C-e> <End>
inoremap <C-d> <Delete>
" Quit normal mode
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>
" 可定制 :actionlist
" intellij built in key map
nnoremap <leader>a :action GotoAction<CR>
nnoremap <leader>b :action Bookmarks<CR>
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>
nnoremap <leader>or :action FileMenu<CR>
nnoremap <leader>r :action RecentFiles<CR>
nnoremap <leader>s :action FileStructurePopup<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 cc :action CommentByLineComment<CR>
vnoremap cc :action CommentByLineComment<CR>