LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Vim: z as leader (https://www.linuxquestions.org/questions/linux-software-2/vim-z-as-leader-4175468636/)

lucmove 07-05-2013 06:18 PM

Vim: z as leader
 
I've been considering using the 'z' as my leader key, mostly due to its privileged position in the keyboard layout. I know it is already used as some kind of leader (like g, for example) and I inspected all shortcuts assigned to it, and it seems that at least 90% of it has to do with folding, which I never use, so yeah, I definitely want z to be my leader key!

let mapleader="z"

So suppose I want 'zz' to be my 'Undo' shortcut:

nnoremap <Leader>z u

I close and relaunch Vim, to make sure the new binding is enforced.

Well, it doesn't work. Whenever I try it, I get this error:

E490: No fold found

But I just reassigned it!

And ':help z' tells me this:

|zz| zz redraw, cursor line at center of window

I just reassigned it to 'Undo' and its default binding is 'redraw window.' Neither has anything to do with folding. Why is Vim still complaining about folding when I press 'zz'?

:-(

Ygrex 07-09-2013 11:27 PM

Ğmap zz uğ works as undo

lucmove 07-10-2013 01:24 AM

Quote:

Originally Posted by Ygrex (Post 4987451)
Ğmap zz uğ works as undo

Doesn't work for me.


All times are GMT -5. The time now is 01:40 PM.