 <p>Well you could use python itself to reverse the line through the filter command. Say the text you had written was: </p> <pre><code>Python </code></pre> <p>You could reverse it by issuing.</p> <pre><code>:1 ! python -c "print raw_input()[::-1]" </code></pre> <p>And your text will be replaced to become:</p> <pre><code>nohtyP </code></pre> <p>The "1" in the command tells vi to send line 1 to the python statement which we are executing: "print raw_input()[::-1]". So if you wanted some other line reversed, you would send that line number as argument. The python statement then reverses the line of input. </p>