How to save my code?
Hello and Good Evening to everyone!
Situation: I've written the following code in Vim (trying to write in C) PHP Code:
I don't know how to save my file (example: hello.c) (that's a classic example as you know :P) I just don't get it.. Any help? Thank you in advance :) P.S: Here is a screen shot of my situation.. Sreen shot |
Vim is crazy. Once you get there, type ESC : wq and then press return
the ':' puts it in command mode |
Heh ... welcome to LQ!
You need to find a vi tutorial or cheat sheet ;} Code:
<ESC>:wq Cheers, Tink |
Thanks!
Thank you both of you!
I finally got it :P @Tinkster Do you have any link to get a -really good- vim tutorial? edit: I type the following command in terminal: Code:
bobnos@ubuntu:~$ gcc hello.c -o hello.out Code:
hello.c:1:17: error: missing terminating > character Thnx |
For your include directive, you need #include <stdio.h>. The ">" at the end is missing. Really, though, the error message should have been sufficient - it even tells you the line number where the problem is!
|
Hi,
Welcome to LQ! Learning vi - "cheat sheet" technique is a good tutorial that will show you how to use vi, a powerful visual editor. :hattip: The above link and others can be found at 'Slackware-Links'. More than just SlackwareŽ links! |
You will soon learn that vim also has a heap a ways of doing things, but I just thought I would add that the following are equivalent:
Code:
<ESC>:wq |
In addition to everything that has been said,
you might wanna try using an easier tool, such as Geany. |
Thank you for your answers.
But I've still have a problem :p I add > as someone told me before. Then I wrote this code: PHP Code:
When I open it, nothing happen. Does anyone know why? :S |
Quote:
You should be executing hello.out: Code:
./hello.out |
Quote:
|
Most systems will probably be using ELF as the executable format. a.out may not work on his system.
|
As for vi, typing
Code:
ZZ |
For a good vi tutorial read A byte of Vim
|
Quote:
http://www.linuxquestions.org/linux/...grams_on_Linux |
All times are GMT -5. The time now is 01:47 PM. |