[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: vim tip-o-rama



on Sun, May 06, 2001 at 11:03:15PM -0400, MaD dUCK (madduck@madduck.net) wrote:
> also sprach mdevin (on Wed, 02 May 2001 03:12:19PM +1000):
> > Can you explain further how that works to someone who barely know
> > that i puts vim in insert mode and esc takes it out?  I had a look
> > at the manpage and vimtutor and I can't see how gqip works - but it
> > did work and it is cool!
> 
> i haven't heard of gqip before this, the official way of doing the
> same is gq}. at least i've been with vim pretty much since it started
> and that's how it's been...

The difference is that 'gq}' will align from current line to end of
paragraph.  'gqip' will align the entire paragraph, from anywhere within
it.  'ip' is one of the motions defined in 'Text object motions' within
vim help.  It's pretty sweet.

> gq is a composite command which replaces the former G, which is now
> used differently.
> the formal definition of the command is something like
> 
> gq<movement>
> 
> which is typical vi(m): you specify a command, and then you move over
> the text to which you want the command applied. since } steps to the
> end of the paragraph, the entire paragraph will be gq'd. for this to
> work, you need to be at the beginning of the paragraph, something gqip
> doesn't require (yes, i want an analysis of the ip movement too).
> nevertheless, you can't do this with gqip:
> 
> 1GgqG
> 
> which reformats the entire document.
> 
> > Also can you give me a tip on how to make mutt with vim wrap the
> > lines at 72 chars or does everyone just press enter when the text is
> > near the side of the page?  Because I didn't on these last 3 lines
> > to see how it would look when I posted it.  Sorry if that upsets
> > people.  I normally use netscape mail but am beginning to use mutt
> > (with vim).
> 
> my relevant settings:
> 
> set nowrap
> set nolinebreak
> set textwidth=0
> set wrapmargin=10
> set wrapscan

set textwidth=72

-- 
Karsten M. Self <kmself@ix.netcom.com>    http://kmself.home.netcom.com/
 What part of "Gestalt" don't you understand?       There is no K5 cabal
  http://gestalt-system.sourceforge.net/         http://www.kuro5hin.org

Attachment: pgpgGGXtg6myE.pgp
Description: PGP signature


Reply to: