You know I love the Vi – improved. And I wish I know this tip a long time ago.

Basically Vim allows you to write freely and then wrap your text to a fixed number of characters. You can use the :set tw=80 to force your text never to exceed 80 characters. And if you already have a non wrapped text, you can easily select (using visual mode) the text you like to wrap and hit gq on your keyboard, and Vim will haply apply your settings to the region.

For LaTeX and emails, this is awesome…

About

photo of Ruben Fonseca

My name is Ruben Fonseca. I'm a Computer Science and Systems Engineer from Portugal that loves FLOSS.

I'm currently an Open Source Consultant at Lisbon, Portugal. This blog is about my daily geek life.

You can contact me anytime at or via LinkedIn:

View Ruben Fonseca's profile on LinkedIn

Feeds

Related Posts

You may be interested in these posts too:

2 Comments | rss | atom | xml | json

  1. avatar pedro mg

    ... yes, tw phisically wraps the text. I have a :set wrap! on my .vimrc but for blogging purpose, i’l try out textwidth for a while to see how posts come out.

    Nice tip ;)

  2. avatar VuDu

    Well, couldn’t find that very useful to me, but since I didn’t read the documentation yet I wasn’t very hopeful either. Though, krani1 almost threatened me to leave a comment, so here it is. :P

new comment New Comment