💾 Archived View for tilde.pink › ~icedtea › vis.gmi captured on 2024-08-18 at 18:31:10. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

Vis editor tutorial

Those notes are meant for those who already know vi/vim.

What's vis

Vis is a modal editor inspired by both vi(m) and sam. Basically it's vi with ex

replaced by sam regexes.

Project Github page

Project SourceHut page

Objective of this article

Vis doesn't have a proper tutorial, to learn it you have to read its help and

manpage. There is a video demonstration on ascii I find it quite inconvienant,

I prefer to learn by pratice.

It is recommanded to download this gmi file, so you can open it in vis.

Basic sam regexes

So that, you don't mess the rest of the file select with visual mode examples.

Substitution

To do a subsitution type :x/patern_to_replace/ c/replacement/<Enter>

Try it out by replacing thee by the in the following text :

thee best time to see thee flowers is in thee spring.

Now let's decompose what we just did :

Those two commands are independant try to do this :

As you might have noticed, when executing the x command you switched to visual

mode.

So there is a third way to substitute text :

Append/Insert text

add the missing letters in the next line (example : x/ext/ i/t/)

this text, is missin a few letter

Warning : if you want to do the same with vi command you have to first press

<Escape> to get back to insert mode, you'll have a cursor placed at the beginning

of every selection.

Deletion

The d command is used for deleting selection.

Delete every comma in the following line:

This, text, as, a, lot, of, commas.