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

Relative line number #15436

Open
quantum-booty opened this issue Jun 15, 2020 · 13 comments
Open

Relative line number #15436

quantum-booty opened this issue Jun 15, 2020 · 13 comments
Labels
enhancement help wanted tag:Extension Idea Ideas for interesting extensions that live outside of JupyterLab core.

Comments

@quantum-booty
Copy link

Is it possible to add relative line numbers in Jupyter lab? I use the vim plugin and navigating would be a lot easier if I could see the relative line numbers.

@fcollonval
Copy link
Member

Could you please add a screenshot and specify in which context you would like the one numbers to appear?

@quantum-booty
Copy link
Author

Relative line numbers are probabily most useful in the text editor, but it would be nice to see it within the notebook cells as well.
image
image

@ianhi
Copy link
Contributor

ianhi commented Jul 13, 2020

I think this ought to be transferred to the jupyterlab issue list - (@fcollonval the triage rights changed so now they only work on the jupyterlab repo - meaning I cannot actually do that)

@wanghankun you may also want to ask this on one of the jupyterlab_vim repos. Unfortunately I don't think there is any ready to go codemirror setting for this. Someone will need to make an extension that does this or add this to the jupyterlab_vim extension. A technique for getting relative line numbers can be found here codemirror/codemirror5#4116

@holdmygithub
Copy link

Is there relative line numbering in jupyter notebook (like that in vim)?
It is pretty convenient to use vim emulator in jupyter

@fcollonval
Copy link
Member

I'm closing this one as it is not related to this repository (i.e. the git extension).

XRef jupyterlab core related issue: #6718

@ianhi
Copy link
Contributor

ianhi commented Oct 11, 2020

This has also come up in vim support for the notebook. See discussion #9068 (comment) essentially the answer is that at the moment this will either require a separate extension or be perhaps be incorporated in https://github.com/ianhi/jupyterlab-vimrc

@telamonian
Copy link
Member

Uhhh, I'm confused. "Show Line Numbers" has been an option that you can toggle on/off in Jupyterlab's "View" menu at least since the release of Jlab 1.0:

image

Or was the OP asking for something more complicated than the existing per-cell line numbering?

@quantum-booty
Copy link
Author

Uhhh, I'm confused. "Show Line Numbers" has been an option that you can toggle on/off in Jupyterlab's "View" menu at least since the release of Jlab 1.0:

image

Or was the OP asking for something more complicated than the existing per-cell line numbering?

I meant vim-like relative numbers. Like this:
image

@ianhi
Copy link
Contributor

ianhi commented Oct 12, 2020

(edit: wow posted at nearly same time - didn't mean to double up)
@telamonian they are asking after this behavior in vim:
image

@telamonian
Copy link
Member

telamonian commented Oct 12, 2020

Wow, I've been using vim for more than a decade now and I've never seen that. So many weird corners to that ancient tool...

@quantum-booty Anyway, this feature has nothing to do with jupyterlab-git in the slightest. If you really want it, you should open an issue on the main jupyterlab repo

@holdmygithub
Copy link

Yes! we need that in jupyter. Relative numbering is very convenient to use in Vim mode!

@xaviernogueira
Copy link

Any updates here?

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Nov 22, 2023
@krassowski krassowski transferred this issue from jupyterlab/jupyterlab-git Nov 22, 2023
@krassowski
Copy link
Member

Re-opening after transferring to the right repository because I do not think that #6718 captures it.

One can create a JupyterLab extension adding a CM6 extension like https://github.com/jsjoeio/codemirror-line-numbers-relative to achieve this effect.

@krassowski krassowski reopened this Nov 22, 2023
@fcollonval fcollonval added help wanted and removed status:Needs Triage Applied to new issues that need triage labels Nov 24, 2023
@krassowski krassowski added the tag:Extension Idea Ideas for interesting extensions that live outside of JupyterLab core. label Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted tag:Extension Idea Ideas for interesting extensions that live outside of JupyterLab core.
Projects
None yet
Development

No branches or pull requests

7 participants