Hi all,

After a week of exclusively using vip for editing picolisp, here's what
I've got:

https://gist.github.com/erdg/ebf4556382bc1bbbaf534c4ebd927322

Most interesting are the "code formatting" commands ('@' prefix). Using vip
made
me realize how much I leaned on vim's "blinking parens" when writing code.
These
commands allow me to quickly express intention without having to count my
way
out of a deeply nested mess. They're respectful of comments, too.

[@!] - remove trailing parens on current line
[@$] - (re)close parens on current line
N[@~] - (re)close all but N parens on current line
N[@`] - (re)close parens on line and N levels up
N[@,] - (re)close parens on line to top of expr, minus 1 level
[@?] - close parens on line to search backwards
[@@] - indent expr / paragraph, also set mark "@"
[@# / @.] - indent and (re)close ending parens of expr / paragraph

There's also commands for working with comments ('#' prefix). Most useful
are:

[#$] - (re)write end of line comment
[#%] - comment wrap to matching paren
[#'] - wrap word, element or transient symbol
[#}] - wrap paragraph
[#@] - remove surrounding comment wrap

(Normal "backward search word under cursor" is '##', but it's trivial to
change
the prefix if that's bothersome)

Towards the end of the file I went overkill with colorschemes, implementing
everything easy and creating a few more example themes.

Vi personalized indeed!

Now some questions... some of these commands add and remove a lot of
characters,
is there a way to "batch" the edits to the file? For example, pressing '#}'
wraps a paragraph in a multi-line comment, but to undo that action I need to
press 'u' twice. Ideally 'u' would undo everything that happened in the
command's prg body. Can 'evRpt' be used for this? I haven't figured that
one out
yet.

Regards,
Erik

Reply via email to