How to exit vi?
Ok, I've been using linux on console only PC for a couple days now and one big thing is really bothering me...
How do I exit vi/emacs/joe?! also, how do I save + open files? I know how to stop the process (ctrl + Z) but I doubt thats the best way to exit :-) This is really bugging me b/c its sooo simple and I've been trying key combos for hours, but I've finally decided to just put my pride aside and ask. So please, anyone, how do I exit? |
vi - press escape to get into command mode if you re not already in command mode (if you are, it s OK to press it anyway). :q to quit :w to save, :wq to do both.
emacs - ^X^S to save, ^X^C to quit |
also, adding an exclamation mark at the end of the command means "do it!" - as in
:q! (yes, I know I made changes, but quit anyway, and don't bother me about it...) :) |
Thank You!
Btw, this kind of super-newbie information should maybe be put in man pages? maybe a section of the man dedicated to newbs? Just so that people might have some idea where to start... this also applies to exiting man pages I figured out too... :-) |
For more information on the subject of vi, you might want to review the following thread, where I asked information regarding vi
http://www.linuxquestions.org/questi...threadid=19701 That might give you more information. :jawa: |
There is a really good vi command reference at: http://mmdc.net/h/vi.html
For Joe, ^kz will stop the job, not a good thing. Use ^kx to save the file and ^c to cancel the file or any changes. At any time in joe, use ^kh and you'll get a split screen with the commands in the top half. ^[. takes you to the next help page if needed. Use ^kh again to get rid of it. It is very fast. Emacs is not a good one to start with. I'd get vi or joe down well first. BTW, to get out of man pages, hit q |
Jed or even better, XJed is a V good editor IMHO.
Comes with syntax highlighting, can be set up to emulate a number of other editors, the default being emacs so its an easy transition. Doesnt have the HUGE overhead of LISP and all the emacs baggage but does have its own S Lang thingy should the need arise to go beyond the norm. small, lean and mean XJed forevaaa Martin |
I use a small simple editor joe. Bit like wordstar remember that.
rpm for it on Redhat distro and probably many more. Sorry I hate vi! |
I use joe, too. It's not simple, quite many options... I can remember all commands I need, and there is good help.
|
I use vi cause every *N*X has it. The BSD versions are tricky sometimes.
Linux i or insert to insert text ii ir insert insert to replace (overwrite) arrow keys to navigate esc :q! to exit with out changes esc :wq to save and exit my fave esc shift^ZZ to save and exit. *BSD same as above but no arrow keys and sometimes no insert i(only) esc takes you to command mode and you can navigate .with keys x =delete h,j,k,l = arrows etc... just the very basics:) Almost forgot that *BSD has an editor ee I like alot when you're done editing esc and you get a little menu |
vi in ssh
Help please.
I'm connected to debian through SSH and have vi running with resolv.conf open and close to mashing it up which I don't want to do. Esc :q isn't working. How can I exit without saving mistakes? |
Quote:
If you use the Esc key, that brings up the cmd line beginning with ':' If you HAVEN'T made any changes :q will quit+no save :q! will quit+no save if you HAVE made changes :x will exit+save changes |
Quote:
|
in Vi I press ESC key but I don't get the : prompt....in fact theres no way I can get any text to appear, or close Vi.
using Arch Linux and Openbox |
When you will press escape the insert mode will be disabled, then you need to type : After that you can provide q! the hit enter.
|
All times are GMT -5. The time now is 06:23 PM. |