Results 1 to 8 of 8
hi,,i am new on linux programming..i want to know how can i compile a c program on vim editor?which commands should i use? thanks for reading.....
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-14-2005 #1
- Join Date
- Sep 2005
hi,,i am new on linux programming..i want to know how can i compile a c program on vim editor?which commands should i use?
thanks for reading..
- 10-14-2005 #2
- Join Date
- Apr 2005
- Buenos Aires, Argentina
compile a program on vim? vim is an editor.. it has nothing to do with compiling!serzsite.com.ar
"All the drugs in this world won\'t save you from yourself"
- 10-14-2005 #3
Well, it can be done by executing shell commands, but this is not what I recommend.
Write your program in vi, then type, in command mode, ":wq" and enter. This will save your file and exit you from vi.
Now, back on the commandline, enter:
gcc -Wall -o foo foo.c
If you get an error about "gcc: command not found", you need to install gcc. The path for this is distro-dependent.
- 10-14-2005 #4
- 10-14-2005 #5Originally Posted by Cabhan
- 10-15-2005 #6
I'd recommend doing it outside vim, in the shell proper, as opposed to the within-vim option indicated by dylunio.
Ah, I see how that's ambiguous. I apologize.
And actually, now looking at it, I see that it may not be such a bad solution at all. *shrugs* I guess I just prefer to operate outside vim for running my apps.
So yeah, you can either exit to the shell proper or use dylunio's within-vim option. Bother are viable.
- 10-15-2005 #7
I know what you mean. I thought you meant not to use the shell.
But I have a similar qualm with the Emacs shell. I really don't use it much for compiling because of its rudimentary functionality ( although in Emacs' defense, the documentation doesn't claim the shell to be otherwise! ) such as lack of tab-completion.
- 10-16-2005 #8
- Join Date
- Jul 2004
Well, Vim has a nice, little feature called 'quickfix' that enables you to invoke make utility from within and provides a nice navigation over spotted errors. Type ":help quickfix" in Vim to learn more. Regards..."I don't know what I'm running from
And I don't know where I'm running to
There's something deep and strange inside of me I see"