Reader small image

You're reading from  Mastering Vim

Product typeBook
Published inNov 2018
PublisherPackt
ISBN-139781789341096
Edition1st Edition
Tools
Right arrow
Author (1)
Ruslan Osipov
Ruslan Osipov
author image
Ruslan Osipov

Ruslan Osipov is a software engineer at Google, an avid traveler, and a part-time blogger. He is a self-taught engineer. He started publishing personal Vim notes in 2012, and became increasingly interested in the intricacies of the editor and its applications in optimizing development workflows.
Read more about Ruslan Osipov

Right arrow

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.

When you rebind a key, it's default functionality is overwritten. For example, comma , this is used to replay the...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Vim
Published in: Nov 2018Publisher: PacktISBN-13: 9781789341096

Author (1)

author image
Ruslan Osipov

Ruslan Osipov is a software engineer at Google, an avid traveler, and a part-time blogger. He is a self-taught engineer. He started publishing personal Vim notes in 2012, and became increasingly interested in the intricacies of the editor and its applications in optimizing development workflows.
Read more about Ruslan Osipov