Friday, February 4, 2011

Re: Trying to write a command that begins with “%”.

On 4/02/11 8:26 PM, tirengarfio wrote:
> Hi,
>
> i have found somewhere that this below should remove the first column
> of a document.
>
> %s/^[^\t]*\zs\t[^\t]*\ze//g
>
> But when i just try to write "%" it doesn't show anything in the
> command line.
>
> Any idea?

You need to start by typing : to get onto the commandline. So it will
actually look like

:%s/^[^\t]*\zs\t[^\t]*\ze//g

It seems to me that pattern will delete the second column, though.

The % just means 'whole file'. You're using the :substitute command (abbreviated
to :s) on the whole document (:help :range).

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

No comments: