[英]Unable to figure out some vimrc settings
I came across the following lines in a vimrc file and can't figure out what they're supposed to do or how they're supposed to work. 我在vimrc文件中遇到了以下几行,无法弄清楚它们应该做什么或它们应该如何工作。 Am thrown off by the use of the $ sign. 因使用$符号而被抛弃。 Does it have any special meaning or is it used in a regular manner like any other character? 它是否有任何特殊含义,或者像其他角色一样以常规方式使用?
" Parenthesis/bracket expanding
vnoremap $1 <esc>`>a)<esc>`<i(<esc>
vnoremap $2 <esc>`>a]<esc>`<i[<esc>
vnoremap $3 <esc>`>a}<esc>`<i{<esc>
vnoremap $$ <esc>`>a"<esc>`<i"<esc>
vnoremap $q <esc>`>a'<esc>`<i'<esc>
vnoremap $e <esc>`>a"<esc>`<i"<esc>
" Map auto complete of (, ", ', [
inoremap $1 ()<esc>i
inoremap $2 []<esc>i
inoremap $3 {}<esc>i
inoremap $4 {<esc>o}<esc>O
inoremap $q ''<esc>i
inoremap $e ""<esc>i
inoremap $t <><esc>i
If anyone's interested. 如果有人有兴趣。 This is the link to the vimrc 这是vimrc的链接
Looking at just two of these. 只看其中两个。
The first is a visual-mode mapping : 第一个是可视模式映射 :
" Parenthesis/bracket expanding
vnoremap $1 <esc>`>a)<esc>`<i(<esc>
This wraps the selection in ()
when you type $ 1 . 当您键入$ 1时,这会将选项包装在()
。 First it jumps to the end of the selection ( '>
) and a
ppend sa )
before jumping to the beginning of the selection ( '<
) and i
nsert ing a (
. 首先,它(跳到选择结束'>
和) a
PPEND SA )
跳跃到选择(开始前'<
)和i
nsert荷兰国际集团一个(
。
This is an insert-mode mapping : 这是一个插入模式映射 :
" Map auto complete of (, ", ', [
inoremap $1 ()<esc>i
This inserts ()
when you type $ 1 and leaves the cursor in between the two parentheses. 当您键入$ 1并将光标留在两个括号之间时插入()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.