-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathideavimrc
95 lines (77 loc) · 2.15 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
82
83
84
85
86
87
88
89
90
91
92
93
""" Map leader to space ---------------------
let mapleader=" "
""" Plugins --------------------------------
set surround
set multiple-cursors
set easymotion
""" Common settings -------------------------
set ts=4
set expandtab
set autoindent
set noundofile
set rnu
set nu
set mouse=a
set.tabstop = 4
set.softtabstop = 4
set.shiftwidth = 4
set scrolloff=10
set smartindent=true
set incsearch=true
set colorcolumn=120
set list
set listchars=tab:→\ ,nbsp:␣,trail:•,extends:⟩,precedes:⟨
""" IdeaVimExtensions -------------------
" 必须额外安装 IdeaVimExtensions 插件
" 切回普通模式时保持英文输入法
" set keep-english-in-normal
" 切换到插入模式时恢复之前的输入法
set keep-english-in-normal-and-restore-in-insert
""" Mappings --------------------------------
noremap <leader>s :w<CR>
noremap gh 0
noremap gl $
noremap U <C-r>
" buffer
noremap <tab> :bn<cr>
noremap <S-tab> :bp<cr>
noremap <leader><tab> :bdelete<cr>
noremap <leader><S-tab> :bdelete!<cr>
vnoremap <tab> :bn<cr>
vnoremap <S-tab> :bp<cr>
vnoremap <leader><tab> :bdelete<cr>
vnoremap <leader><S-tab> :bdelete!<cr>
vnoremap J :action MoveLineDown<CR>
vnoremap K :action MoveLineUp<CR>
" J 反义词,在当前位置换行
nnoremap K i<CR><Esc>^
" 翻页和搜索时保持光标在屏幕中间
noremap <C-d> <C-d>zz
noremap <C-u> <C-u>zz
noremap n nzzzv
noremap N Nzzzv
" 一些删除操作不会进入buffer
xnoremap <leader>p "_dP
xnoremap <leader>d, "_d
xnoremap x, "_x
xnoremap X, "_X
" 复制进入剪贴板
xnoremap <leader>y "+y
noremap <leader>Y "+Y
" 快速替换当前word的snippet
noremap <leader>c :%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>
" 在普通模式下使用<leader> /? 忽略大小写查找
noremap <leader>/ /\c
noremap <leader>? ?\c
" 跳转到前/后一个变更
map ]c <Action>(VcsShowNextChangeMarker)
map [c <Action>(VcsShowPrevChangeMarker)
" 跳转到前/后一个error
map ]e <Action>(GotoNextError)
map [e <Action>(GotoPreviousError)
" 重命名
map <leader>r <Action>(RenameElement)
" easy motion
map <leader><leader>w <Plug>(easymotion-bd-w)
map <leader><leader>e <Plug>(easymotion-bd-e)
map <leader><leader>/ <Plug>(easymotion-sn)