logoalt Hacker News

VimGraph

141 pointsby gdelfino01yesterday at 1:40 PM26 commentsview on HN

Comments

nomilkyesterday at 5:43 PM

This would be a bit easier to understand had the example used text that was unrelated to vim itself.

(seems to occur quite often with tutorials/documentation where the author has the topic they're showcasing top of mind, and naturally, but unnecessarily, uses the topic itself in examples, making it confusing for new readers to distinguish concept from arbitrary example)

For anyone wondering what's going on, "How do I\nexit vim?" is completely arbitrary text. This VimGraph function accepts this (or any other) text as an input, and shows the keys you could press to get from one place in the text to another using vim. The example limits the keys to just three (k, l, and w) presumably to not let things get too cluttered. (there's a curious 'crown' shaped key, which I suspect is a rendering bug where a 'w' and 'l' have been placed on top of one another).

show 1 reply
samlinnferyesterday at 2:56 PM

Having the t/T/f/T movements available would be too easy it seems.

A shout out to quick-scope (https://github.com/unblevable/quick-scope) possibly the best named vim plugin.

thorntonyesterday at 1:53 PM

This is one of those times when I want someone to explain the value to me. Like is this to help coding agents be more efficient?

Forgive my ignorance!

show 3 replies
mastermedoyesterday at 4:22 PM

Interesting. Thanks for sharing.

I'm curious about something a bit different. Given a vim buffer, and picking two caret locations in it, I'd like a tool that shows only the paths to getting there with my current Vim setup (including all the plugins).

After 10 years of using vim, I rarely use L and H. For horizontal moving it's almost always F or S (vim-sneak).

show 1 reply
ctenbyesterday at 7:59 PM

This post has many upvotes, but all the comments ask questions about the usefulness of this, without any justifying response so far. I have the same question, and I wonder what's going on with this post?

jiehongyesterday at 3:06 PM

At first, I thought it was to produce graphs by _encoding the positions of nodes_ as _vim movements_.

uticusyesterday at 4:00 PM

Most of the comments here ask "what's the point?"

I'd like to submit this has no practicality from a Vim tutorial perspective. However, from the perspective of anyone wanting to learn about graph theory and who understands the concepts of typing efficiency incorporated in Vim key movements, this could be very interesting.

Kind of like many other things using Wolfram - a personal notebook that someone found interesting or useful, take it or leave it.

show 1 reply
NoSaltyesterday at 3:56 PM

So ... what, exactly, is this useful for? I mean, it graphs the keys you use in Vim in command mode, is that it?

uticusyesterday at 5:07 PM

> Illustrates the relationship between the maximum keystroke distance required to navigate between two letters in a text and the number of randomly inserted newlines:

I'd love to see a comparison between Vim and Kakoune or Helix.

Jenkyesterday at 3:29 PM

I can see value in this. I use which-key already and could see a graph, al be it a differently arranged graph, being a useful visual aid. Perhaps a static (printed?) Cheat-sheet or even a dynamically generated visual - though not sure how effective it would be in a TUI :)

sheerunyesterday at 7:08 PM

I guess it's a proof that you can describe rare vim movements as a graph

stogotyesterday at 11:21 PM

More documentation here woold be nice but the example “how do I exit vim” is ;;chefs kiss;;

foofoo12yesterday at 2:58 PM

I like Vim and I like graphs. But WTF?

jgoode19yesterday at 4:35 PM

[flagged]