nomilk a day ago

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).

  • fragmede 21 hours ago

    But if they didn't, then how would we know if Stephen Wolfram is too clever by one half?

pona-a 2 hours ago

Someone needs to make a program that captures/replays your vim movements and another one that uses this to find the shortest path within every chunk.

thornton a day ago

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!

  • qsort a day ago

    I believe that's mostly for fun. Coding agents wouldn't need to interact via the same interfaces humans use, they'd be given a tool to read and write files and they'd be fine with that.

    • zero_bias 12 hours ago

      Unfortunately, this characterizes the entire project: "cool" examples with no practical utility. Meanwhile, the language itself is incredibly strange (functions via patterns are an example of strange language choice), extremely slow, and very unstable.

      In short, it's developing in the wrong direction.

      I switched from Mathematica to Matlab in my work; it was the best investment of time in the entire project

      • lieuwex 12 hours ago

        This function is user contributed. It's not official.

    • fnfs2000 a day ago

      They're literally using diff/patch under the covers, at least the setup i'm currently using.

      • andai a day ago

        Did you get them working with diff syntax? I couldn't figure it out, so I just tried a bunch of agentic programs, found a few that actually worked, and it turned out they all use search/replace strings. There's probably other ways to do it but it seems basically everyone settled on that.

        I've been trying that with smaller models and had to make some adjustments (e.g. they all really wanted to include the filename twice). So I just make a small tweak and bam suddenly I can edit code with small fast cheap models.

  • tantalor a day ago

    The thought of forcing the AI to use vim gave me a nice chuckle. Thank you sir.

    • d-lisp a day ago

      I found chatGPT to be bad at VimGolfing.

      ``` Here is a 35 keystrokes solution that beat your 36 keystrokes solution ! <89 keystrokes> ```

      And then it keeps looping in the same way if you ask it about the seahorse emoji (or sometimes just lie about the keystrokes number).

      In fact that's not surprising, what is rather surprising is that some of the solutions actually work (>= 100 keystrokes)

      • bee_rider a day ago

        They should probably train LLMs to be bad at vim golf. The whole point of vim’s funky language is that human keypresses are very valuable and should not be wasted. Saving keystrokes for an LLM is a non-goal at best.

  • utopiah a day ago

    I guess it's to win at Vim Golf, i.e. how does one get more efficient.

mastermedo a day ago

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).

  • busfahrer a day ago

    More often than L and H, I use { and }, which jumps across paragraphs (i.e. blocks of lines separated by blank lines).

    I've found that most of my code consists of 3-5 line blocks, and { and } feel like a nice medium-range navigation tool, because oftentimes CTRL+D jumps too far.

    The downside is that both of these jumps go into the jump table, so they will clutter your CTRL+O history a bit.

    But I think I'm weird in this regard.

    • wonger_ a day ago

      I rebound ctrl+j/k to scroll about a third or fourth of the screen (~20 lines?) as an alternative to ctrl+d.

      I've been using { and } more as well. Mostly to navigate paragraphs of prose, but sometimes for code too.

      • mastermedo a day ago

        Yeah, I did the same for shift+j.

        When I experimented with scrolling, I found it hard not to lose understanding where I just scrolled from. What helped immensely was defining a top and bottom margin and using vim-smoothie.

ctenb a day ago

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?

jiehong a day ago

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

uticus a day ago

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.

  • isaacremuant a day ago

    Analyzing the typing experience in vim by looking at pure keystrokes would be a mistake if you don't understand the tradeoffs and benefits of having a modal system and operating the editor without leaving the home row or needing a mouse.

    Good remappings/config would also significantly alter your experience.

    In the example, why would you even move with single chars and not words or to the end of line? I think it's definitely a poor example because the point of the diagram/investigation is not clearly described.

    • Jtsummers a day ago

      > In the example, why would you even move with single chars and not words or to the end of line?

      If you expand the "Scope" section you'll see more examples. The reason the initial example is restricted is probably because of how noisy those other graphs are when all (or more) movement commands are available. They make poor initial examples.

      • isaacremuant 19 hours ago

        Noted. Probably the best thing would be simplified color coding in separate graphs showing 3 types of movements from worse to more efficient. And a good statement around what's the point.

        Conveying information through images is all about making something understood, not about graph completeness.

NoSalt a day ago

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

Jenk a day ago

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 :)

uticus a day ago

> 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.

sheerun a day ago

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

foofoo12 a day ago

I like Vim and I like graphs. But WTF?

stogot a day ago

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