LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Text editor in RH9 shell? (https://www.linuxquestions.org/questions/linux-newbie-8/text-editor-in-rh9-shell-154171/)

deWin 03-06-2004 08:43 AM

Text editor in RH9 shell?
 
Hello,

Very simple question. What is the text editor when I'm in shell on RH9. I want to edit a .cfg file but don't want to go into GUI for just that.

Thanks for any answers.

deWin.

lugoteehalt 03-06-2004 09:05 AM

Errr..don't know what editor is installed by default. Perhaps try doing:
apropos editor
or simmilar?
vi or vim or emacs or pico or ed:D

matador 03-06-2004 11:17 AM

I prefer pico. It's included in the pine package. You can find can it via urpmi or rpmfind.

deWin 03-06-2004 11:52 AM

woah! lol english please guys. I mean like in dos you can use the command "edit blah.txt" to edit it and save it. I'll try some of the above but too many choices i guess.

deWin 03-06-2004 12:02 PM

ok i got the vim, opened the file and edited it. Now how do i save that file. i did vim myfile.txt and it opened up the file allowing me to edit. I hit CTRL+Z it stops, I hit CTRL+S it freezes.

Mega Man X 03-06-2004 12:08 PM

Vim is complicated. But it's geeks favorite editor. Here are some commands:

vim <what you want to edit>

ESC: wq

That is for (w)rite and (q)uit. Press in that order, "ESC", then ":" then "wq", then enter. If you feel that you messed up, press:

ESC: q!

That is to quit without saving changes. I will find to you a vim command list. Be right back ;)

Mega Man X 03-06-2004 12:10 PM

Here:

http://www.fprintf.net/vimCheatSheet.html

If you think it stinks, you might consider using another editor. At least at the beginning. I warn you though, once you get the hang of vim, you will be freaking addicted to it and you won't ever be able to use anything else :p. lol

deWin 03-06-2004 04:16 PM

oh no it's absolutely fine. Thanks for the command, of course without knowing command no one can do anything and I thought it'd be like CTRL+S :) It works like a charm and I like the editor, plus that commands list will come in handy. I just hoped i could get the same list by vim --help command.

Mega Man X 03-06-2004 05:06 PM

Cool! My pleasure ;).

You could also try "man vim" at the terminal. It will bring a lot of stuff about vim usage with details. But I really like that table the best ;)

Cheers!

deWin 03-06-2004 05:49 PM

ESC wq for some reason just beeps, no error and it doesn't save. Any ideas? The file is not readonly.

Mega Man X 03-06-2004 05:56 PM

It should be ESC: wq

don't forget the ":" ;)

deWin 03-06-2004 06:15 PM

i thought it was a sequence of keys, so is it the key ESCAPE, shift+; letter w and q and then enter, correct?

Mega Man X 03-06-2004 06:38 PM

exactly, press then in a sequence, first Escape, then : then w, then q, then enter. You not really have to press Escape, only when you are at "Insert mode". The ":" brings you to command line, where you can type stuff to pass to the editor. But get used to always press escape to make sure you are not using any mode. For you to see the power of vim, here are some more examples that I use often:

ESC: set tabstop=4

That will make all "Tab" presses with a space equivalent of 4 spaces. Great for programming

ESC: syntax on

That will make the text highlight, for most of programming and tag languages around ;)

ESC: set vb

That will stop those annoying beeps :). See? Isn't it great? And there's much, much more. Everyday I find a new thing for vim :D

mikshaw 03-06-2004 08:49 PM

Quote:

Originally posted by lugoteehalt
Errr..don't know what editor is installed by default. Perhaps try doing:
apropos editor

cool...apropos is a new one to me. Thanks for the tip.

vimtutor was a handy primer for me.

deWin 03-06-2004 10:25 PM

Works nicely now. It's for sure a powerful tool so i'll be spending some time on it and if I get stuck, I know where to go.

I want to ask another question but I'm not gonna start a new thread. I have a set of files, huge files around 1.2GB for a set of files. I know there is something called linking the files or something where you can have duplicate copies of those files but they won't take up physical space since they are actually just link to the original file.

Now this is a folder e.g. called folder1 and I want to create a folder2 and link files and subfolders from folder1 to folder2. How would I do that. Yup! I've got a small HD so it'd be nice if I could do that.

Also how many links can I create with one set of files?

mikshaw 03-07-2004 12:30 AM

ln -s path/to/file path/to/link
For example, I'm in my home directory (/home/mik) and I want to make a link in /home/mik/links to /etc/fstab:

ln -s /etc/fstab links/fstab

The same can be done with directories


All times are GMT -5. The time now is 04:16 AM.