Skip to content

Instantly share code, notes, and snippets.

@erdg
erdg / vip-lispMode.l
Last active January 22, 2022 18:36
Basic structural editing for VIP editor
# lispMode - a modified 'insMode'
#
# - balanced parens
# - line editing shortcuts (ctrl prefix with motion)
# e.g. "^B" to move word backward, "^X" to delete char under cursor
# - indents code as you go
# installation
#
# - add this code to '~/.pil/viprc'
@erdg
erdg / viprc-docs
Last active December 30, 2021 02:56
Cheatsheet for viprc
# ^ or ## - search word under cursor backwards ('#' is masked)
#
# F - move to first non-space char of next line
# H - go to first non-space char, then (press again) jump indentation level up/left
# L - go to end of lisp line, then (press again) end of line
# T - move to next opening paren
# U - undo lisp cut (append current line to end of previous line)
# V - lisp cut (move rest of line to new line below)
# [ - like '{', but goes to first char of paragraph
# ] - like '}', but goes to first char of paragraph
@erdg
erdg / viprc
Last active January 22, 2022 17:58
My current config for the VIP editor
(de *F8
(evCmd (size (s-expr))) )
# utils
(local) (posChar? prevChar nextChar posLine prevLine nextLine beforeCursor
afterCursor move1 moveSearchForward moveSearchBackward moveIn moveOut
moveDownExpr moveUpExpr moveFirstExpr moveLastExpr moveEndLisp endLisp?
insert-i insert-a insert-I insert-A insertLisp-i insertLisp-a insertLisp-I
insertLisp-A lispmode insLispMode jumpPar diffPars ind@nt indentationLevel
removeEndPars closeEndPars closeParsUp dangleEndPars deleteText lispCut lispJoin
@erdg
erdg / vip-rainbow.l
Last active November 28, 2021 20:38
Rainbow Parens for 'VIP' editor
# Possibly the most concise implementation ever!
#
# Parens change color everytime the screen is redrawn,
# which happens on almost every key stroke! Totally not
# distracting!
#
# INSTALL - add to '~/.pil/viprc'
(de RAINBOW . (31 32 33 34 35 36 91 92 93 94 95 96))
@erdg
erdg / vip-colors.l
Last active December 12, 2021 20:38
Custom colorschemes for the 'VIP' editor
# VIP colors
#
# INSTALL - add to '~/.pil/viprc'
#
# Creating a new colorscheme for 'VIP' is easy as 1, 2, 3!!
# 1) pick colors!
# https://stackoverflow.com/questions/4842424/list-of-ansi-color-escape-sequences
@erdg
erdg / vip-extensions.l
Last active October 24, 2021 01:57
Code comment extension for 'VIP' editor
# Easy code comments for 'VIP' editor
#
# In normal mode...
#
# gca - (go comment after)
# starts a comment two spaces past the current end of line.
#
# gcd - (go comment delete)
# deletes comment on line matching ' # ...' format.
#