LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   vim c-formating unformated text (https://www.linuxquestions.org/questions/programming-9/vim-c-formating-unformated-text-472399/)

websinger 08-09-2006 03:32 PM

vim c-formating unformated text
 
Is there a vim editor command that whould take
highlighted (but unformatted ) c code and
format it, inserting indents and line feeds
the documentation I looked at seems to be able to
set it up to do that on input but how about existing
text.

Tinkster 08-10-2006 01:57 AM

5 seconds on google ...

http://www.vim.org/htmldoc/indent.html
http://www.vim.org/tips/tip.php?tip_id=83


Cheers,
Tink

websinger 08-10-2006 08:35 AM

re vim indent
 
No, I saw those before I posted, they just didn't do what I was asking. This is what I am wondering about

1. hilighted existing unformated text
a. no line feeds
b. no indentation ( tabs or spaces )
c. block of text hilighted in visual mode

2. an editor directive ':somthing' that will
reformat the highlighted block of text c indentqation style.

somthing like-
Code:

#include <stdio.h> #include <stdlib.h> int main(){ printf(" %s \n","hello World"); return 0; }


All times are GMT -5. The time now is 02:09 AM.