Loading ...
Sorry, an error occurred while loading the content.

Re: Destructive left shift of a block of text

Expand Messages
  • cga2000
    Thus spake Gerald Lai on Mon, May 01, 2006 at 04:43:55PM -0700 or thereabouts: [2006-05-01 20:16]: [...] ... I like this too..
    Message 1 of 5 , May 1, 2006
    • 0 Attachment
      Thus spake Gerald Lai on Mon, May 01, 2006 at 04:43:55PM -0700 or thereabouts: <laige@...> [2006-05-01 20:16]:

      [...]

      > >
      > >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 like this too.. funny I did not figure it out myself :-/

      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]
      >
      > Yes, that's a good idea:
      >
      > :%s/^> //

      I was having trouble with this.. thought that I had to escape the '^'
      meta character for some reason.. and I got caught in a nasty tangle of
      /'s and \'s..

      >
      > HTH :)

      Thanks much.. It's a bit embarrassing to come up with all these silly
      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.

      cga
    Your message has been successfully submitted and would be delivered to recipients shortly.