Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to absolute numbering #18

Closed
saltydressage opened this issue Sep 14, 2012 · 9 comments
Closed

Default to absolute numbering #18

saltydressage opened this issue Sep 14, 2012 · 9 comments

Comments

@saltydressage
Copy link

I'd like it to default to absolute rather than relative. Any way to do this?

@myusuf3
Copy link
Owner

myusuf3 commented Sep 14, 2012

@jeffes what do you mean to default to absolute? its supposed to switch for you when you change between insert and normal mode.

@saltydressage
Copy link
Author

When I open a file, I want it to be in absolute mode 'first' (ie: by default). I don't want to have to toggle to absolute. I use absolute all the time everywhere other than when I specifically need relative numbering, which I then hit F2 to toggle to, then toggle back.

ie. I want to be in absolute all of the time, period. Other than when I specifically toggle to relative, then I want it in relative all the time until I toggle back.

@fisadev
Copy link

fisadev commented Sep 14, 2012

Same here. Most of the time I want to see the real (absolute) line number, not the relative one. I only want to see the relative from time to time, when deleting many lines or something like that.

@myusuf3
Copy link
Owner

myusuf3 commented Sep 17, 2012

That is the purpose of the plugin. It will always keep you in those modes when you are switching between insert and normal modes.

That being said you can always toggle whenever you need to but when you switch again it will go back to what line numbering should be for that state. If you simple just want a ToggleCommand just add this your .vimrc

" use Ctrl+L to toggle the line number counting method
    function! g:ToggleNuMode()
            if(&rnu == 1)
                set nu
        else
            set rnu
        endif
    endfunc
    nnoremap <C-L> :call g:ToggleNuMode()<cr>

Intent of the plugin is to ease code movement in normal mode by providing relative numbers and insert mode to allow ease line identification for use in stack traces and collaboration.

@myusuf3 myusuf3 closed this as completed Sep 17, 2012
@fisadev
Copy link

fisadev commented Sep 17, 2012

The proposed solution doesn't really solve the problem: the toggle works when you call it, but every time you go back to normal mode from other modes the relative numbering is set. This even happens when you enter vim or open a new file.
So, if we want to have absolute numbering most of the time, with this solution we must toggle to absolute every time we go back to normal mode... it isn't a real "toggle", it forgets the user's choice all the time. :/

Sorry, I don't want to annoy you... but being such a useful plugin, it would be great if it played nice with the user preferences :)

@myusuf3
Copy link
Owner

myusuf3 commented Sep 17, 2012

@fisadev your are not an annoyance at all. :) I am just saying that the intent of the plugin is for it to be able to switch it automatically for you so you dont have to do it.

Maybe you are unclear on the intended behaviour. Have you seen the video of me demo'ing it?

http://www.youtube.com/watch?v=qW9sViL9MEQ

@saltydressage
Copy link
Author

I already toggle just fine (with F2). I guess I misread the intent of the plugin and need to make my own then. All I want is a way to easily toggle between absolute and relative, and have it always default to absolute no matter what mode unless I have explicitly toggled it. I don't want it to switch on me depending on the mode.

If it isn't flexible enough to do this then I'll see what I can do about figuring out my own solution.

Cheers

@myusuf3
Copy link
Owner

myusuf3 commented Sep 17, 2012

For the simple functionality you are looking for you can take the little
toggle I wrote for you in the previous comment. It should do what you are
looking for.

Goodluck.

On Mon, Sep 17, 2012 at 2:57 PM, Jeff S notifications@github.com wrote:

I already toggle just fine (with F2). I guess I misread the intent of the
plugin and need to make my own then. All I want is a way to easily toggle
between absolute and relative, and have it always default to absolute no
matter what mode unless I have explicitly toggled it. I don't want it to
switch on me depending on the mode.

If it isn't flexible enough to do this then I'll see what I can do about
figuring out my own solution.

Cheers


Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-8626530.

Mahdi Yusuf

@milushov
Copy link

same shit, guys
I want to same functionality as explained @jeffes, i.e. when i open file first time i want see absolute mode numbering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants