General discussion


Vi for programmers, part 2

By RexWorld ·
article root

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

Saving your current settings

by RexWorld In reply to Vi for programmers, part ...

If you're the lazy type and don't feel like typing all these options into a ViM configuration file, use the ":mkvimrc" command to automatically write your current settings to a file.

Collapse -

The :g command

by jobollin In reply to Saving your current setti ...

You have discussed some of the very useful pattern matching features built into ViM, but you overlooked one of my favorites: the :g command. This is used to perform a ViM command on every line that matches a specified pattern. For instance, suppose I have an address list of the form:

last1,first1 street_address1 city1 country1
last2,first2 street_address2 city2 country2

and in a fit of pique I decide to remove all references to any of my [hypothetical] ex-inlaws, the Foos. With ViM it's easy: :g/^Foo/d

Collapse -

Nice tip

by RexWorld In reply to The :g command

Thanks for sharing that tip. Just be careful--there really are people with the last name of "Foo". One of the engineers I used to work with on, for example.

Related Discussions

Related Forums