Everything2
Near Matches
Ignore Exact
Full Text
Everything2

vi macro

created by jt

(thing) by jt (1.5 y) (print)   ?   (I like it!) 1 C! Sun Oct 22 2000 at 8:09:38

A macro written for the Unix text editor vi. The editor is so powerful that any general computing task can be performed (albeit slowly) by one of its macros; in fact, someone has coded a Turing machine as a vi macro, and I have written a macro which plays Conway's game of life. Slowly.

Those Everythingians who use vi for their writeups might find this macro useful for adding hardlinks:

:map v i[<control-v><escape>Ea]<control-v><escape><enter>
After typing the above from command mode (or doing something equivalent in your .exrc), hit v at the beginning of any word you want to hard-link to painlessly insert square brackets around it.

(thing) by tres equis (2.2 y) (print)   ?   (I like it!) Fri Nov 17 2000 at 12:09:33

If you're new to vi or, more specifically, to vim and you're trying to learn how to create macros, it can be very frustrating trying to find a reference to macro programming in the documentation. Logically you might expect the command :help macros to work but in fact :help source is the key to it all.

This took me ages to find so I hope it helps somebody.


printable version
chaos

Turing Machine Game of Life vi Linux For Monkeys
snog E2-related browser tips .exrc VIM
E2 Visual Basic hardlinking utility nvi fmt Macro Photography Workshop
Emacs Strong AI vs Weak AI Glut TeX
RC text editor Stop button panic insert mode
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
Just another sprinkling of indeterminacy
Katie, formerly known as Wolf
Working for a Car Dealership compromises my soul every day
Pyrrhonism
Sex for Dummies
Marcel Proust
Out here on the perimeter, there are no stars
Vegemite
quine
Van Morrison
Internet piracy and the working writer
Tortoise
Clipboard
Pompey
New Writeups
Tildeee
IANAL(idea)
antigravpussy
One fly amongst many(person)
sam512
Moon Base Shackleton, 1978(fiction)
Pavlovna
toy boy(person)
XWiz
tear jerker(review)
Heitah
Anarchy is Order(idea)
jessicaj
July 26, 2008(dream)
Berek
ABBA(person)
devolution
k-hole(place)
Nadine_2
The Sound Of Madness(review)
SwimmingMonkey
Conversations with Fo Fo, the Loneliest dog in Purgatory(fiction)
locke baron
lynx(thing)
Simulacron3
Reality, Dimensions and the Natural Ontology(essay)
SubSane
Making Love to a 9-Foot Woman(person)
Ouzo
Thoughts(idea)
E2 is a by-product of the existence of The Everything Development Company