Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a command to make Vim type from right to left? If not us any one aware of this plugin?

share|improve this question
5  
Are you talking about in the context of a right-to-left language such as Arabic of Farsi, or do you just want to advance the cursor to the left when inputting normal western alphabet characters? Please edit your question to be more specific. –  Caleb Aug 25 '11 at 6:24
add comment

1 Answer

up vote 12 down vote accepted

Sure!

:set rightleft

Or, just rl. However, this will save the file with the characters in the order you typed them in. If you want to have it save it reversed, type :%!rev before saving.

Edit:

If you use the revins or ri option, the inserting is done backwards. You could probably map this to a key combination, but that's up to you.

Here is the appropriate section of vim help:

o  Typing backwards                 *ins-reverse*
----------------
In lieu of using full-fledged the 'rightleft' option, one can opt for
reverse insertion.  When the 'revins' (reverse insert) option is set,
inserting happens backwards.  This can be used to type right-to-left
text.  When inserting characters the cursor is not moved and the text
moves rightwards.  A <BS> deletes the character under the cursor.
CTRL-W and CTRL-U also work in the opposite direction.  <BS>, CTRL-W
and CTRL-U do not stop at the start of insert or end of line, no matter
how the 'backspace' option is set.

There is no reverse replace mode (yet).

If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown
in the status line when reverse Insert mode is active.
share|improve this answer
    
Was not the effect I was looking for but definitely the right answer to the question I asked. I am actually working in a left to right file. Sometimes I like to define my statements backwards is there a way to just type a few characters right to left with out changing the flow of the document? –  James Andino Sep 3 '11 at 18:25
    
Ty for the update to that I had missed it. I appreciate it. –  James Andino Oct 4 '11 at 14:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.