danchoi / vmail

a vim interface for gmail
http://danielchoi.com/software/vmail.html
MIT License
786 stars 59 forks source link

Customize comma leader? #185

Open justmytwospence opened 10 years ago

justmytwospence commented 10 years ago

Is there any way to use another key instead of , as the Vmail leader key? Something like the spacebar would be much more comfortable for me personally.

notalex commented 10 years ago

Vmail maps the leader key to ,. So you can simply remap the leader key to something else. See :h leader.

justmytwospence commented 10 years ago

I already have let mapleader="\<Space>" in my vimrc, but it is overridden by vmail. I can't seem to set it manually either. Does it need to go in an ftplugin file perhaps?

notalex commented 10 years ago

Yes. ftplugin should take precedence over vmail mappings. Also you would need to check for a global variable g:loaded_vim. This will help you avoid overwriting the leader key for non vmail windows. If you need help with the exact script, let me know.

notalex commented 10 years ago

Sorry, you actually do not need that global variable. The mapping should be set in a ftplugin for vmailMessageList. This is the first buffer that is loaded.

justmytwospence commented 10 years ago

Still no luck. This is the contents of my vmailMessageList.vim:

call clearmatches()
let mapleader="\<Space>"

Pressing space still toggles "fullscreen". Is there something else that needs to be unmapped from the spacebar?

notalex commented 10 years ago

Seems like I failed to understand mapleader correctly. As per :help mapleader,

Note that the value of "mapleader" is used at the moment the mapping is defined. Changing "mapleader" after that has no effect for already defined mappings.

So my proposed solution would not work. I will look for other alternatives.

justmytwospence commented 10 years ago

Perhaps <LocalLeader>? I'm looking into it as well.

WuTheFWasThat commented 7 years ago

ever find a solution to this? it seems weird to me that vmail sets leader at all