Skip to content

Follow rustlings watch with editor by opening source files in the same order #281

Closed
@agentofuser

Description

@agentofuser

First of all, thank you so much for rustlings, this is an amazing project! A well thought-out practice test suite is worth a thousand tutorials.

I got lazy from having to close nvim and open it on the next file to keep up with rustlings watch, so I came up with a little kludge:

cd rustlings # local rustlings repo
rg '^path = "' info.toml | rg '"(.*)"' --only-matching --replace='$1' --null | xargs -J {} nvim '{}'

This is the same as typing:

nvim file1 file2 file3 ...

When you do this, nvim opens one file at a time, and you can navigate between them with :previous and :next.

So after passing the tests for one exercise, I delete the // I AM NOT DONE line, then type :wn on nvim, which saves the file (w is for "write") and opens the next one (n).

That's enough keystroke savings for me, but if this sounds like an interesting idea, maybe it could be turned into a rustlings watch editor command that calls $EDITOR in succession with the file that's currently failing rustlings watch, so both can be kept running side by side in sync.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions