💾 Archived View for tilde.pink › ~icedtea › vis.gmi captured on 2023-04-26 at 13:51:11. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-01-29)
-=-=-=-=-=-=-
Those notes are meant for those who already know vi/vim.
Vis is a modal editor inspired by both vi(m) and sam. Basically it's vi with ex
replaced by sam regexes.
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.
So that, you don't mess the rest of the file select with visual mode examples.
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 :
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.
The d command is used for deleting selection.
Delete every comma in the following line:
This, text, as, a, lot, of, commas.