What is the in a .vimrc file?

后端 未结 5 959
情深已故
情深已故 2020-11-28 17:04

I see in many .vimrc files, and I am wondering what does it mean?

What is it used for?

Just a general overview of

5条回答
  •  粉色の甜心
    2020-11-28 17:48

    Vim's key is a way of creating a namespace for commands you want to define. Vim already maps most keys and combinations of Ctrl + (some key), so (some key) is where you (or plugins) can add custom behavior.

    For example, if you find yourself frequently deleting exactly 3 words and 7 characters, you might find it convenient to map a command via nmap d 3dw7x so that pressing the leader key followed by d will delete 3 words and 7 characters. Because it uses the leader key as a prefix, you can be (relatively) assured that you're not stomping on any pre-existing behavior.

    The default key for is \, but you can use the command :let mapleader = "," to remap it to another key (, in this case).

    Usevim's page on the leader key has more information.

提交回复
热议问题