本文介绍了什么是<leader>在 .vimrc 文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在许多 .vimrc
文件中看到 ,我想知道它是什么意思?
它有什么用?
对目的和用法做一个总体概述就好了.
解决方案
键默认映射到 .所以如果你有
t
的map,你可以默认用+来执行.有关更多详细信息或使用 mapleader
变量重新分配它,请参阅
:帮助领导
要定义使用mapleader"变量的映射,特殊字符串"可以使用.它被替换为mapleader"的字符串值.如果mapleader"未设置或为空,则使用反斜杠代替.例子::map <Leader>A oanother line <Esc>像这样工作::map A oanother line 但是之后::let mapleader = ","它的工作原理如下::map ,A oanother line <Esc>请注意,在映射时使用mapleader"的值定义.之后更改mapleader"对已定义的无效映射.I see <leader>
in many .vimrc
files, and I am wondering what does it mean?
What is it used for?
Just a general overview of the purpose and usage would be great.
解决方案
The <Leader>
key is mapped to by default. So if you have a map of <Leader>t
, you can execute it by default with +. For more detail or re-assigning it using the mapleader
variable, see
:help leader
To define a mapping which uses the "mapleader" variable, the special string "<Leader>" can be used. It is replaced with the string value of "mapleader". If "mapleader" is not set or empty, a backslash is used instead. Example: :map <Leader>A oanother line <Esc> Works like: :map A oanother line <Esc> But after: :let mapleader = "," It works like: :map ,A oanother line <Esc> Note that the value of "mapleader" is used at the moment the mapping is defined. Changing "mapleader" after that has no effect for already defined mappings.
这篇关于什么是<leader>在 .vimrc 文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!