The leader key
You’ve probably already encountered a key referred to as the leader key. The leader key is essentially a namespace for user- or plugin-defined shortcuts. Within a second of pressing the leader key, any key that’s pressed will be in from that namespace.
The default leader key is a backslash, \, but it’s not the most comfortable binding. There are a few alternative keys that are popular in the community, with the comma (,) being the most popular. To rebind the leader key, set the following in your .
vimrc
file:
" Map the leader key to a comma. let mapleader = ','
You’ll want to define your leader key closer to the top of .vimrc
as the newly defined leader key will only apply to mappings defined after its definition.
Important note
When you rebind a key, its default functionality is overwritten. For example, comma (,) is used to replay the last t, f, T, or F movement commands, in the opposite direction.
My personal...