Re: Destructive left shift of a block of text
- Thus spake Gerald Lai on Mon, May 01, 2006 at 04:43:55PM -0700 or thereabouts: <laige@...> [2006-05-01 20:16]:
> >I like this too.. funny I did not figure it out myself :-/
> >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".
The nice thing about it being that you don't have to think - means less
overhead on my personal cpu.. Also you can use it just as easily to get
rid of some trailing character(s) in col. 72 or whatever - such as a
column of !'s or |'s.. if the original text was for some reason inside
an 'ascii box' or such like..
> [snip]I was having trouble with this.. thought that I had to escape the '^'
> Yes, that's a good idea:
> :%s/^> //
meta character for some reason.. and I got caught in a nasty tangle of
/'s and \'s..
>Thanks much.. It's a bit embarrassing to come up with all these silly
> HTH :)
questions but sometimes you're just stuck and wish someone with
experience could give you a hint.. so all the help I've been getting
for free here lately is much appreciated.