forked from amix/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyvimrc
More file actions
31 lines (24 loc) · 747 Bytes
/
myvimrc
File metadata and controls
31 lines (24 loc) · 747 Bytes
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
"自动补全括号
inoremap ' ''<ESC>i
inoremap " ""<ESC>i
inoremap ( ()<ESC>i
inoremap [ []<ESC>i
inoremap { {<CR>}<ESC>O
"展示数字
set nu
"设置跳出自动补全的括号
func SkipPair()
if getline('.')[col('.') - 1] == '>' || getline('.')[col('.') - 1] == ')' || getline('.')[col('.') - 1] == ']' || getline('.')[col('.') - 1] == '"' || getline('.')[col('.') - 1] == "'" || getline('.')[col('.') - 1] == '}'
return "\<ESC>la"
else
return "\t"
endif
endfunc
" 将tab键绑定为跳出括号
inoremap <TAB> <c-r>=SkipPair()<CR>
"一键执行python
map <F5> :w<cr>:!python %<cr>
"一键执行js
map <F6> :w<cr>:!node %<cr>
"快捷打开vimrc文件
nmap <silent> <leader>ev :e $MYVIMRC<CR>