-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Question: Get the selected line **number**? #1034
Comments
Have you looked at #1014? |
Thanks a lot @junegunn that looks perfect! |
|
@ElectricRCAircraftGuy I'm not sure what comment are you replying to, since no one mentioned using |
@infokiller , oh, sorry, I'm just documenting a generic answer to the title of the question: "Get the selected line number?", which I am demonstrating how to do when passing regular text files to Anyway, what I've got above does just that for anyone else who is looking for it. |
@ElectricRCAircraftGuy It looks like you can alter the the answer infokiller linked to to get what you want: nl -ba file.txt | fzf | awk '{ print $1 }' This will add line numbers to the contents of Personally, I think this looks cleaner than the |
Hey, is there an option in fzf for outputting the line number that I'm missing?
If not, what's the best way to get the selected line number, as opposed to the actual line content?
Right now I have a script which does this in an hacky way by grepping for the selected line, but this won't always work (for example, if there are duplicate lines in the stream).
Thanks!
The text was updated successfully, but these errors were encountered: