[英]Unable to understand a line in .vimrc
I do not understand what the following line does in .vimrc我不明白以下行在 .vimrc 中的作用
nmap <silent> <leader>v :EditConfig<cr>
It seems that看起来
What does the line mean in .vimrc?该行在 .vimrc 中是什么意思?
nmap
means "map a key sequence when in normal mode" (see vim's docs ). nmap
意思是“在正常模式下映射一个键序列”(参见 vim 的文档)。<silent>
tells vim to show no message when this key sequence is used. <silent>
告诉 vim 在使用这个键序列时不显示任何消息。<leader>
means the key sequence starts with the character assigned to variable mapleader
-- a backslash, if no let mapleader =
statement has executed yet at the point nmap
executes. <leader>
表示键序列以分配给变量mapleader
的字符开始——反斜杠,如果在nmap
执行点还没有执行let mapleader =
语句。 And the v
is the rest of the key sequence.而
v
是键序列的其余部分。
So overall this is mapping, in normal mode, a backslash-v key sequence to show no message and execute :EditConfig
which is likely a function defined previously in the vimrc to edit configuration files (see for example this vimrc, search in browser for editconfig).所以总的来说这是映射,在正常模式下,反斜杠-v 键序列不显示任何消息并执行
:EditConfig
这可能是之前在 vimrc 中定义的用于编辑配置文件的函数(参见例如这个vimrc,在浏览器中搜索 editconfig )。 :call EditConfig()
at the end (as the vimrc file I gave the URL to uses) would be better, I believe. :call EditConfig()
最后(作为我给使用的 URL 的 vimrc 文件)会更好,我相信。
It would appear that you are missing a function...看起来你缺少一个功能......
Try,尝试,
function! EditConfig()
for config in ['$MYGVIMRC', '$MYVIMRC']
if exists(config)
execute 'edit '.config
endif
endfor
endfunction
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.