from small one page howto to huge articles all in one place

search text in:

Other sites:

Last additions:
How to make X listen on port 6000

How to make X listen on port 6000






average rating: 1.5 (4 votes) (1=very good 6=terrible)

May, 25th 2007:
April, 26th 2007:
Apr, 10th. 2007:
Druckversion . pdf icon
You are here: Tutorials per portage category->app-editors->VI

8. Macros

Buffers can also act as macros if they contain valid vi or ex commands.
To execute such a macro, type:

@a - where "a" is the name of the buffer

Example: From a file containing definitions of complex macros, yank
one paragraph (say, 20 lines) to a named buffer "a". Then
return to a file you were originally editing and type @a.
The commands contained in the buffer will be executed on the file
being edited.

It is possible to make files act as vi macros by using command:

:so filename

The most powerful macros, however, are created using programs combined
into shell scripts (or DOS batch files), and acting as filters on the text
sent to them from within vi. Such shell scripts or programs must take standard
input and send results to standard output (which most UNIX tools do).

Even though seemingly strange at first, with a little practice using
vi becomes second nature.

/* The article above and any accompanying files are freely
* distributable, but please leave this notice and the text intact.
* Home for this document:
* Copyright (C) 1994, 1999 Tony Thomas
* Contact author through email:
* Last revision Feb 23, 1999
* UNIX is a trademark of X/Open

rate this article:
current rating: no votes yet
Your rating:
Very good (1) Good (2) ok (3) average (4) bad (5) terrible (6)


Support us on Content Nation

New Packages

- as rdf newsfeed
- as rss newsfeed
- as Atom newsfeed
rdf newsfeed | rss newsfeed | Atom newsfeed
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 143.6 ms