Monday, November 10, 2014

Re: Changing line numbers from normal to relative

On Sunday, November 9, 2014 11:53:38 AM UTC-6, Eric Christopherson wrote:
>
> Great idea! But I find it only works in the terminal when I call the map
> <C-@> (even though my terminal treats C-Space as C-@).
>
> If I use <C-Space> as the map name, when I try the <C-Space> combination
> in one of those modes, I just get a bell. I tried running Vim with
> -V20vim.out to log what's going on, and it didn't show that CycleLNum()
> was ever called.

Weird. What does Vim see in insert mode when you do <C-V><C-Space>? It works fine for me in gvim in Windows, and it was a free key...that's the only reason I chose it. Use what works, I guess. :-)

>
> Two other minor quibbles here:
> - it doesn't reset the old numbering style after a motion or visual
> operation has been done.

Yes, this mapping was intended to cycle through on a more permanent basis for my use. You could store the original line numbering in a variable and restore it in a second mapping if you like. Or restore it in a CursorHold/CursorMoved autocmd.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: