On Mon, 1 May 2006, cga2000 wrote:

I have saved the following in a file:


I can't give you any Mac-specific advice, since I don't use them, but
I can give you a general run-down.

1. You need to have the right locale settings.  Your locale should be
set to something similar to this:

  $ locale
  LANG=en_US.UTF-8

[...]

The above was posted on the mutt mailing list and has '> ' in col. 1-2
and I would have liked to get rid of these two characters.

What would be the best approach to have vim do this for me?

One way is to use the Visual Block. To invoke it, type Ctrl-v or Ctrl-q
in Normal mode, when your cursor is on the first ">". Then move the
cursor down to highlight what I call a "visual strip". You can also type
"G" to highlight a visual strip till the end line of the file.

Then move the cursor to the right by one character. This will highlight
a box of "> "'s. Hit "x" to delete that block.

You can also use visual strips for ex commands like ":y" and ":d", and for
normal commands like "I", "A" or "c".

I tried setting shiftwidth=2 followed by as visual select of the entire
buffer + '<' or '<<' but vim does not do anything. I suspect he is just
being nice and refusing to shift the selected block to the left because
columns 1-2 contain stuff that is not white space and therefore might be
important.. :-)

You're right. You can only left-shift whitespaces.

So, is there any command that tells vim to shift left no matter what..

No such command. You could create a mapping/function that would do it
though. You could try:

  nnoremap <C-S-BS> v0"_x

or should I use some regexp-driven substitute command to replace all
greater-than characters followed by a space in column one by // (void)?
[snip]

Yes, that's a good idea:

  :%s/^> //

HTH :)
--
Gerald

Reply via email to