cofi / evil-leader

<leader> key for evil
GNU General Public License v3.0
315 stars 22 forks source link

Also support <LocalLeader> #5

Closed seschwar closed 11 years ago

seschwar commented 11 years ago

Vim actually provides two leader keys: <Leader> and <LocalLeader> which can be set via mapleader and maplocalleader respectively. And as the Vim documentation says:

<LocalLeader> is just like <Leader>, except that it uses "maplocalleader" instead of "mapleader". <LocalLeader> is to be used for mappings which are local to a buffer.

For example in Vim I have bound <Leader>w to C-w in order to avoid the control key. This is a command which affect the whole Vim "frame"/tab. I have also bound <LocalLeader>s to :sort<CR> in visual mode which only affects a single buffer. While in this case I could bind both with the same leader key it is nice to have different leader keys for different scopes. It would it make possible to have bindings like <Leader>q for ZZ and <LocalLeader>q for :write|bdelete<CR> for example.

cofi commented 11 years ago

I've pondered about this a while, but I won't put anymore significant work into evil-leader, so no.

The plan for the long term is to port vim-like keybindings (i.e. non-prefixfree and with timeouts) for evil. In addition to that moving into evil is planned - but by a another mechanism - so could come along as well.