Ajay Jain wrote:
> Hi, 
> 
> When I write a C code, I would like to wrap up after say 80 columns. Can
> I do this in Vim? If yes, how? What are the related and useful commands
> to wrap around while coding?

Make sure 't' is in formatoptions to wrap code and not just comments:

:set fo+=t

and set textwidth to 80

:set tw=80

are the main two.

:help 'fo'
:help fo-table
:help 'tw'

You'll probably also want auto-indenting of some kind turned on.

:filetype indent on

may well suit you. If not, just

:set autoindent

:help :filetype-indent-on
:help 'ai'

The gq command is helpful for rewrapping stuff that's already written. I
tend to use linewise visual mode (shift-V) to highlight lines and then
type gq.

:help gq
:help v_q

Others may have more tips. There are so many...

Ben.




--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to