top | item 39498281

ViHN: Vim for Hacker News

124 points| qsantos | 2 years ago |qsantos.fr

57 comments

order
[+] surprisetalk|2 years ago|reply
Y'all may be interested in my HNTV script:

  curl -s 'https://news.ycombinator.com/from?site=youtube.com' \
  | egrep -o 'https?://www.youtube.com[^"]+' \
  | mpv --playlist=- \
    --speed=1.5 \
    --ytdl-format='bestvideo[height<=?720]+bestaudio/best'
[1] https://taylor.town/hntv
[+] yaj54|2 years ago|reply
Nice. Reminds me of a project I built a long time ago: https://yahnd.com/theater/?t=week. Makes me want to update it to have all the urls on the listing page so I can use your player technique on it. Or throw em in a yt playlist.
[+] tra3|2 years ago|reply
Is there a YouTube API tool? Would love to create a YouTube playlist so that I can watch this on the TV.
[+] HL33tibCe7|2 years ago|reply
I just use vimium, basically never have to use my mouse when browsing HN
[+] geniium|2 years ago|reply
And Vimium C
[+] SilasX|2 years ago|reply
The only problem I have is when I use the search (which, I know, is not HN itself but a separate service), it won't pick up the dropdown options as clickable.
[+] qsantos|2 years ago|reply
I use Vimium as well! It's very frustrating when I need to reach for the mouse to navigate a website.
[+] yungtriggz|2 years ago|reply
I love the 'vim for this' trend. does vimium just take care of that for everything?
[+] imwally|2 years ago|reply
There’s Vimari for the dozens of us that use Safari.
[+] moelf|2 years ago|reply
when I hit `F` the url density is too high that it's difficult to tell which is which, how do you navigate differently?
[+] gloosx|2 years ago|reply
But... You can use $> lynx -vikeys from a terminal emulator inside the vim itself! That way you dont even have to invent anything or leave vim! (posted from vim btw)
[+] k3vinw|2 years ago|reply
Interesting. Are you running lynx inside a vim terminal buffer?
[+] every|2 years ago|reply
Interestingly enough, I'm reading this and posting in lynx. I have both vikeys and numbered links set...
[+] ykonstant|2 years ago|reply
w3m which I am using also seems able to browse HN; however, usually people want seamless navigation between HN and various links, so a graphical browser is a must. Qutebrowser is a good choice for those who enjoy keyboard navigation.
[+] whackx|2 years ago|reply
Why not using keyboard controls for web pages in general? I tried multiple solutions for browsing the web and using vim binding to do so over the years. Some of them for extended periods of time, including Tridactyl, Vimium and others. My favorite by far is Qutebrowser because of its default commands and integration of them, for example moving between tabs, editing or copying URLs or configuration is pretty easy.
[+] qsantos|2 years ago|reply
I do! I use Vimium C for general browsing. But, considering the time I spend on Hacker News, I needed something to optimize my procrastination even further!
[+] throwaway_08932|2 years ago|reply
> When GNOME Shell happened, I was forced to go looking for a new window manager. I ended up installing Ratpoison.

Wow, I used Ratpoison around 20 years ago. SunOS labs in school used some window manager I couldn't stand (don't remember which) and I saw a classmate with basically no window chrome on their display, and was intrigued.

They helped me compile it (no small feat given our resource constraints) and off I went, until my hand started to cramp a year later from hitting ctrl-t so much. I switched to ion for awhile, and then ended up scavenging a linux box to do assignments from home.

I'm happy to see some folks still holding firm on the "no-pointer" front.

[+] k3vinw|2 years ago|reply
As a fan of vi/vim keyboard navigation everywhere, I’m always intrigued to see how other people solve this. But if you’re looking for a more generalized approach, I can recommend a mix of vimium and w3m with vim key bindings.
[+] doix|2 years ago|reply
Is it really vim if you don't have modes and can't combine operations ;p. Everything is pretty much single keystrokes that don't combine in any meaningful way. The only "vim" thing about it is h/j/k/l. Thing like collapsing don't use vim keys z(a|o|c), going to different places doesn't use g<thing>.

There's some weird scroll into view code as well, holding j to just scroll down buffers up a bunch of scrolls and then scrolls all at once. I'm guessing it's a side effect of smooth scrolling or something.

To avoid being a typical grumpy HN commentator, nice work :).

[+] qsantos|2 years ago|reply
Thanks!

And I agreed that this is not “pure” Vim.

But I did need to find a compromise. There is little point in having an “insert” mode, like Vimium does, since I am targeting a very specific website and not overriding any existing shortcut (AFAICT). If you think it's important to you, I might consider implementing custom key bindings so that you can use with “pure” Vim shortcuts!

Regarding the scrolling, it could be two things:

1. I do not update the address bar on every key press, to avoid some kind of rate limitation I encountered when I did so initially. Instead, there is a very short delay so before it happens. But the viewport should still scroll immediately. 2. If it's smooth scrolling, there is actually a toggle you can change in the extension settings. If you still have the behavior without smooth scrolling, I would be curious to know more, to see if I can make the experience more pleasant.

[+] komali2|2 years ago|reply
Simple man: I see a screen with a window manager with gaps, I scream.

We're paying thousands of dollars for machines with high resolution displays, why don't people use the whole display???

[+] karolist|2 years ago|reply
I like my windows (contexts really) to have more visual separation so all my Amethyst windows have 5px margins.
[+] amelius|2 years ago|reply
Because we want to enjoy our wallpapers too.
[+] arnorhs|2 years ago|reply
Re >I never quite liked the idea of trying to remember what comments the user might have seen.

One way to do this by simply storing the latest comment's timestamp, and then you know that all the comments with a greater timestamp are newer

[+] anthk|2 years ago|reply

     lynx -vikeys gopher://hngopher.com
[+] igorguerrero|2 years ago|reply
Switched to this immediately, great HN tv too hah
[+] fp64|2 years ago|reply
There should be a couple command line tools to read HN, this way you can even stay in the terminal and don't need to switch to the browser

Switching to my browser, navigating to HN, and checking the first page (and going back if nothing interests me) already does not require me to touch my mouse and can be done with very few keystrokes. Typically, I visit HN when I'm waiting for something to complete or similar, though, in which case I anyways happily move my hand to the mouse, as I'll be _browsing_ for a bit