Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add leader '[' and ']' customization #10

wants to merge 4 commits into


None yet
6 participants

Using a non-english keymap, the '[' and ']' characters are not so easy to use. This is an attempt to let the user customize theses.

Introducing two global variable :

  • g:unimpaired_leader_prev
  • g:unimpaired_leader_next

vdemeester added some commits Jul 7, 2011

Add leader '[' and ']' customization
Introducing two global variable :
- g:unimpaired_leader_prev
- g:unimpaired_leader_next
Replace fi by endif
Maybe it was too late yesterday when I made my change...

tpope commented Aug 7, 2011

If this is going to be done, it needs to be done right, which means every last mapping. You got 16 out of 38.

To be frank, I'm not sure this is worth it. I mean, the primary point of the plugin is "provide standard, slightly easier maps for common operations," and if you want to change the maps, you're basically left with a whole different plugin.

I'm not sure I've got them all now but I completed the ones I "saw".

I do agree that the primary point of the plugin is to "provide standard, slightly easier maps for common operations". The only gain of being able to change the mapping (by replacing [ and ] with others characters) is for the non-qwerty keyboard user.
For example, on a french azerty keyboard, using [ for shortcuts is a real pain, as you need to use ALT-GR+).


tpope commented Aug 8, 2011

Looks like you got them all.

I'm going to sit on this a bit. While I get your use case, I'm still not sure it justifies complicating the plugin for it. For better or worse, Vim is biased towards US keyboards. I'll give it further consideration before release.

I leave you with this food for thought, which covers not just unimpaired's maps, but Vim's built-in ones, too:

for s:c in map(range(65,90) + range(97,122),'nr2char(v:val)')
  exec 'nmap ('.s:c.' ['.s:c
  exec 'xmap ('.s:c.' ['.s:c
  exec 'nmap )'.s:c.' ]'.s:c
  exec 'xmap )'.s:c.' ]'.s:c

mat813 commented Nov 9, 2011

Hum, well, I have to say that I see the point of having the possibility to use keys other than ] and [, because they're easily accessed on a us keyboard, but on a french keyboard, it's a bit of a pita to access :-)

I understand the bias toward a us keyboard but a way to unbias it a bit would be very nice ;-)

unode commented Apr 29, 2012

I found myself customizing the default bindings too as ]e and a few other variants seem to conflict with python_fn.vim that ships with vim (at least on gentoo setups).

flavius commented Mar 31, 2013

@tpope Germans have the same problem with ] and [. Please provide this feature.

I forked unimpaired to change the bracketmapping to ( and ) instead.
I'll 👍 this

Closing the pull request (after 2 years !) because the solution proposed by @tpope works well, no need for this.

@vdemeester vdemeester closed this Sep 16, 2013

tpope added a commit that referenced this pull request Jun 30, 2017

Route all public maps through wrapper function
I'm finally going to give in and allow for customizing mappings,
including overriding the bracket characters.

References #10
References #62
References #128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment