On 01/21/12 11:01, sc wrote:
On Sat, Jan 21, 2012 at 07:54:12AM -0900, Tim Johnson wrote:
I'm using MacVim 7.3 on OSX 10.7 (Lion)
As well as (g)vim 7.~ on ubuntu.

I would like to be able to move a column right by an arbitrary
numbers of spaces, regardless of the value of `shiftwidth'.

Is that possible?

many ways -- probably the simplest:

     - position the cursor at the left/top of the column you want
       to move
     - press ctrl-v to enter visual mode
     - cursor down with the relevant motion command however long
       your column is

     - press I
     - enter as many spaces as you want

Or, enter a count for the number of spaces, press "I", insert one space and hit <ESC>.

     - press ESC and the rest of the lines will get their spaces


If the column is delimited rather than at a particular character offset, you can use (assuming a "," as the delimiter here)

  :%s/^\%([^,]*,\)\{5}\zs/\=repeat(' ', 10)

where "5" is the number of columns to precede the insertion, and "10" is the number of spaces to insert. Similarly, one could use \%20c or \%20v as the search target for inserting N spaces.

As SC said, lots of options :)

-tim



--
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