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
Relative line numbers #423
Comments
This is actually a Vim setting proper: http://jeffkreeftmeijer.com/2013/vims-new-hybrid-line-number-mode/ |
I'm really enjoying VSCodeVim, but I missed this from VIM, so I implemented the gutter image concept @rebornix proposed here: It's available as the 'Relative Line Number' extension in the market place: As mentioned, the images break a few scenarios, like debugging, but at least for my use case they are helpful. It'd be nice if in the future VSCode gave us a way to customize the line number section! |
Wow, that is very, very cool @extr0py! Would you be interested in adding that functionality to VSCodeVim (under a setting flag)? We'd love to have it. If not, do you mind if we just steal it? 😉 |
Thanks! Definitely, makes sense for it to be in VSCodeVim, especially since it is a Vim setting anyway :) I've been enjoying VSCodeVim so would be great to finally contribute something. I'd be happy to add it - I may not get chance to put together a PR until next weekend though. If you want to steal it in the meantime, go for it! |
@extr0py it's insanely amazing and it's almost the same as I thought originally. The biggest number you use is 99 and I think it works on most Monitors (no one wants to show 100+ lines on one page, right?). Since Gutter customization feature request is on track from Code side and seems ppl are not blocked with this feature, I'd like to leave this contribution to you @extr0py :) |
Just send a PR to @extr0py 's relative line number extension bryphe/vscode-relative-line-numbers#3. Previously it was using setInterval and generate too many Since it's redrawing the decorations for the gutter and we don't have any layer concept for gutter, this feature definitely breaks the breakpoint mark on the gutter. So I'd like to keep it a separate |
Close this as we are going to have it in Code. |
Is this in Code already or do we need to use @extr0py's plugin? |
@piggyslasher it's a Code feature http://code.visualstudio.com/updates#_improvements-to-linenumber-and-whitespace-settings you don't need to install any plugin. |
@rebornix Can this be reopened? This does not work like @extr0py 's plugin. It only shows the absolute on the current line, whereas I want to see the absolute on every line, and the relative on every line. Your link is broken, I think you mean this: http://code.visualstudio.com/updates/v1_6#_improvements-to-linenumber-and-whitespace-settings (the v1_6 part). There are only 3 values, on, off, and relative. There is not an option to get the behavior of @extr0py 's plugin |
@Riobe good catch, I found that I can't use feature with latest Insider but while I debug the extension, it works perfectly. |
@Riobe now that this is in vscode it doesn't make sense to reopen this within the vscodevim plugin in my opinion, that would now be an enhancement for the core functionality in vscode |
Agreed. Even in vim - it's either/or. On 10 Nov 2016 12:39 p.m., "Sean Kelly" notifications@github.com wrote:
|
Sorry to bother everyone with this, but you all keep saying that this is in vscode but I just can't find it :/ |
Use the |
@Shahor I think right now with Stable and Insider, you can use the setting @extr0py provides, or run ex command |
Thanks @extr0py @rebornix :) |
This is one of my favorite features of Vim and it took me a bit of searching into these issues to find out that I needed to set |
We could, but it is also a vscode thing and nothing to do with us...(although a lot of us like it) |
Well it's a Vim feature. |
Actually I'd like to set relative line number automatically the same as the vim numbertoggle plugin does(the source):
I think we can't achieve this by changing vscode |
@vincentbel Currently not possible, but wouldn't be that hard to add an option to do so. |
@Chillee where would one need to look to implement this? |
If anyone else is also looking for mode dependent relative line numbers as in vim-numbertoggle as pointed out by @vincentbel, see here for the solution I've come up with. |
@ersel If you wanted to add this to the extension proper, I think a check in modeHandler.ts plus some configuration would make it work. |
|
If I set to relative and do this: |
Solution found at VSCodeVim/Vim#423.
Is it possible to use relative numbers only in |
The above answers do not behave like vim's numbertoggle plugin. The following does: |
This works great! Just one issue, if you disable the vim extension (for various reason) the smartRelativeLine remains always true. Is there a way to change this value in keybindings.json:
|
Any solutions for this issue? |
When we run commands with numeric prefix, we always need to calculate the relative line numbers. In this case, showing relative line numbers beside VS Code line number will be really helpful. But currently VS Code doesn't allow users to customize the line number section.
A dirty workaround is adding images containing Number to the gutter of each line, but it breaks the original gutter view.
The text was updated successfully, but these errors were encountered: