top | item 26550490

Vim-gh-line: Vim plugin to open the current line on GitHub

83 points| polm23 | 5 years ago |github.com

37 comments

order
[+] cormacrelf|5 years ago|reply
If you mostly use GitHub and use tpope/vim-fugitive, you can already do this with https://github.com/tpope/vim-rhubarb, visual select, :GBrowse.
[+] boring_twenties|5 years ago|reply
Fugitive supports basically every git web frontend including GitLab, SourceHut, and a bunch of others (via plugins).
[+] jdonaldson|5 years ago|reply
Yeah, I'm sure that other plugin is great and all, but once Tim Pope puts his name on something, it becomes an instant default for me.
[+] riffraff|5 years ago|reply
if, like me, you've thought "wait, but :GBrowse only opens the file", the trick is to _select_ a line first, i.e.

> :{range}GBrowse [args]

[+] pacomerh|5 years ago|reply
Yup this is what I use too. :10,15.Gbrowse will open the current file selected from line 10 to 15
[+] codecurve|5 years ago|reply
As I discovered yesterday, :Gbrowse also works for other contexts such as jumping directly to the GitHub page for a specific commit after opening one via :Git log or :Git blame.
[+] mssundaram|5 years ago|reply
What is the use case for this, I wonder? I am not being snide, genuinely not sure what I'd do with it, which is ok, however I am curious.
[+] grossvogel|5 years ago|reply
I send links to specific lines or chunks of code pretty much every day (using a similar VS Code plugin), usually to show an example of a pattern or show where / how a particular piece of logic is implemented. Or sometimes to give an idea of a possible home for a new piece of logic
[+] mtm7|5 years ago|reply
I use a similar extension for VS Code. My use case is to share certain lines of code with coworkers. I didn't realize it would be so helpful, but I probably use it at least 3 times every day.
[+] grliga|5 years ago|reply
Maybe when you find a line you want to discuss/share with other people online?
[+] jweir|5 years ago|reply
I use it all the time, the Fugitive version, to share or point a block of code with my tram.

I will select a block, :Gbrowse, then copy and paste the url to my collaborators.

Basically a round about way of linking to lines a file.

[+] lbj|5 years ago|reply
Are there still a lot of people using Vim?
[+] TheFullstackGuy|5 years ago|reply
I started out my coding career using sublime, moved to atom relatively quickly, experimented with jetbrains products but didn’t like it, and moved to VSCode soon after it was released and have been using it since.

There were a few people at work who had been on the same path as me before and were trying to turn me to the “dark side”, and I eventually gave in and told myself I would give it a try for two weeks and see how I liked it.

Up until a few months ago I would have thought vim would never replace vscode for me, but here I am typing this message having been using vim as my only editor/ide for the last two and a half months.

I use neovim nightly with the builtin lsp and treesitter support and I don’t think I’ll ever go back. It’s not only faster itself, but I am more efficient using it.

[+] messo|5 years ago|reply
It would be interesting to see some numbers on this, but I have the impression that (neo)vim users are growing in numbers. I'm just a HTML+CSS guy building small websites, and learning vim has been huge boost not only to my speed/efficiency, but to the amount of fun I'm having! I ditched VScode aprox 4 months ago an basically live in the terminal now with tmux, nvim and fzf. It's such a powerfull combination!
[+] maddyboo|5 years ago|reply
Not only are a lot of people using it, the number of active users and plugin creators seems to be growing. It’s a wonderful time to be a vim user.
[+] mssundaram|5 years ago|reply
I'm curious about your intent with this question. Do you sincerely wonder? Are you trying to make a joke?
[+] artificialLimbs|5 years ago|reply
I can crush my previous programming speed by orders of magnitude (~90wpm typist for years) with Vim extensions added onto whatever IDE, and prefer to just program in Vim as is anyway, being moderately new to programming.
[+] b0afc375b5|5 years ago|reply
If you mean as an IDE then yes, but most likely declining.

If you mean as a text editor, absolutely and most definitely yes.