On Tue, 18 May 2010, Jeremiah Martell wrote:

> I cant figure out how to search for "newline followed by non-newline" using 
> vim.
> 
> So if I have a file like this:
> 
> a b c
> d e f
> g
> 
> h i j
> k l
> 
> m n o
> p q
> 
> I want to find the newlines after c, f, j, and o, but not after g or l.
> 
> What's the regular expression look like for this?

\n...@!

That's:
\n       newline
  \...@!  not-followed-by newline

See :help \...@!

Depending on what you're using the pattern for, you might also get away 
with using just:
\n\n

E.g., to join lines that aren't followed by a blank line:

:v/\n\n/normal J

-- 
Best,
Ben

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to