Wednesday, September 8, 2010

Re: shifting paragraphs by one space

* sandeep kapse <sandeep.kapse85@gmail.com> [2010-09-08 15:39]:
> Following is my problem statement.
>
> I have to shift the following text to
> left or right with just one place (space):
>
> logData = TM_STM()
> logData += AGENT
> logData += self.function.__doc__
> logData += "Starting "
> logData += str(self.function.__name__)
>
> Which keystroke should I use to shift the give text
> to the right place (or left) by one place (space)?

when the cursor is on the paragraph then use commands
">ip" or "<ip" to shift it right/left, respectively.

> Consider I have selected the text with visual or visual block mode.
> ( > keystroke shift text by 4 places )

yes, in visual mode simply type '<' or '>'
for shifting left or right accordingly.

a shift is done according to the current
value of the option "shiftwidth" ("sw").

so for a shift by only *one* spaces
requires the value to be set to '1':

:set sw=1

easy. :)

Sven

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

Post a Comment