l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2001 Dec 30 17:07

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] Vim tip-o-rama
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] Vim tip-o-rama

Cut lines that match a regular expression

	If you've never done batch editing using ex commands, I hope this will
	convince you to try: the ':global' command runs any command on each line
	in your file (or range if you give it a range) that matches a regular
	expression. Example: ':global/foo/delete' will delete all lines that
	contain the letters 'foo'. Instead of 'delete' you can have any ex command
	you like, or any normal mode (keystroke) command, e.g, 'global/foo/normal
	dd'. If you enter insert mode you need to add the escape tp end your
	command by finishing with '<ctrl-v><esc>' (type the keys names, not the
	literal text).

Brace matching on steroids
	The % command to jump between matching brackets works great for Perl and
	C, but shell scripts and some other langages have block-like constructs
	that are demited by words like if...elsif...fi instead of brackets.
	Matchit.vim provides macros that extend % to find matching keywords. Get
	it from <http://sites.netscape.net/BBenjiF/vim/beta/matchit.vim> and use
	it by adding 'source matchit.vim' to your .vimrc.

Reclaim your Control-S and Control-Q (really an xterm / console tip)

	By default, control s and q start and stop flow control -- a relic of
	the days of 300 baud serial terminals that makes little sense in your
	xterm. Also, if you hit control-s accidentally, your terminal freezes,
	which may be quite disorienting. To turn control s and q back into
	ordinary keystrokes, add 'stty -ixon' to you .bashrc.

Henry House
OpenPGP key available from http://romana.hajhouse.org/hajhouse.asc

Attachment: pgp00011.pgp
Description: PGP signature

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.