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
| "" Source your .vimrc
source ~/.vimrc
"" -- Suggested options --
" Show a few lines of context around the cursor. Note that this makes the
" text scroll if you mouse-click near the start or end of the window.
set scrolloff=5
" Do incremental searching.
set incsearch
" Don't use Ex mode, use Q for formatting.
map Q gq
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
"" Map \r to the Reformat Code action
"map \r <Action>(ReformatCode)
"" Map <leader>d to start debug
"map <leader>d <Action>(Debug)
"" Map \b to toggle the breakpoint on the current line
"map \b <Action>(ToggleLineBreakpoint)
let mapleader=','
" Find more examples here: https://jb.gg/share-ideavimrc
""" Plugins --------------------------------
" ys, cs, ds, S
set surround
" gcc, gc + motion, v_gc
set commentary
" argument text objects: aa, ia
set argtextobj
" cx{motion} to select, again to exchange
set exchange
" entire buffer text object: ae
set textobj-entire
" easymotion <Leader> s / f
set easymotion
" 寄存器替换
set ReplaceWithRegister
" 文件树展示
set NERDTree
" 复制时高亮内容
set highlightedyank
" 空格行也能够跳转
set vim-paragraph-motion
""" Common settings -------------------------
" 显示当前mode
set showmode
" 光标移动时保留5行
set so=5
" 实时查找
set incsearch
" 显示行号
set nu
" 忽略大小写
set ignorecase
" 允许光标到行末
set virtualedit=onemore
" 搜索内容高亮显示
set hlsearch
""" Idea specific settings ------------------
" 多行合并 J
set ideajoin
" icon展示
set ideastatusicon=gray
" 在normal mode默认eng
set keep-english-in-normal-and-restore-in-insert
""" Plugin settings -------------------------
let g:argtextobj_pairs="[:],(:),<:>"
let g:highlightedyank_highlight_duration = "1000"
""" My Mappings -----------------------------
map <leader>f <Plug>(easymotion-s)
map <leader>e <Plug>(easymotion-f)
map <leader>d <Action>(Debug)
map <leader>r <Action>(RenameElement)
map <leader>c <Action>(Stop)
map <leader>z <Action>(ToggleDistractionFreeMode)
map <leader>s <Action>(SelectInProjectView)
map <leader>a <Action>(Annotate)
map <leader>h <Action>(Vcs.ShowTabbedFileHistory)
map <S-Space> <Action>(GotoNextError)
map <leader>= <Action>(ReformatCode)
nnoremap <Tab> >>_
nnoremap <S-Tab> <<_
inoremap <S-Tab> <C-D>
vnoremap <Tab> >gv
vnoremap <S-Tab> <gv
set ideastrictmode
|