PDA

View Full Version : vi alternative



briantan
30th July 2008, 04:29 PM
I imagine many noobs are having problem with vi.

Any recommendation on alternate "terminal" text editor?

ivancat
30th July 2008, 04:39 PM
if you need a simple text editor consider using nano


nano

another variant is ed

ed

briantan
30th July 2008, 04:40 PM
Wonder where "ee" lives now. (Wordstar-like editor)

http://www.ucl.ac.uk/is/unix/ee.htm

oneofmany
30th July 2008, 04:41 PM
gedit and emacs too, though personally i prefer vi :)

briantan
30th July 2008, 04:43 PM
gedit is gui based. Edit: as is emacs.

ditto vi my favourites.

briantan
30th July 2008, 04:47 PM
I stand corrected. emacs start different interface (terminal or X11 client) depending on whether X is available.

wraithe
30th July 2008, 04:49 PM
I am old school and love vi, nearly lost it when someone told me that vim was going to be completely different, glad its the saem too...
vi is easy once you learn it...
nano i have not used but others tell me its simple, give it a try...
There are quite a few, both terminal and gui based, but forget gui based, too fiddly...

stefan1975
30th July 2008, 05:02 PM
gvim for those wanting X in their vi.
vi in any form is of course the best there is.....

stefan

briantan
30th July 2008, 05:26 PM
how do you install gvim ?

stefan1975
30th July 2008, 05:34 PM
how do you install gvim ?



$ sudo yum install gvim

pete_1967
30th July 2008, 05:41 PM
$ sudo yum install gvim


Not a Fedora way.



su
yum install gvim

briantan
30th July 2008, 05:41 PM
Thanks. Didn't know that gvim is actually vim-X11.

briantan
30th July 2008, 05:45 PM
Not a Fedora way.



su
yum install gvim


how is that sudo yum is not a Fedora way?

stefan1975
30th July 2008, 05:45 PM
Not a Fedora way.



su
yum install gvim


wel then it would probably be something more like this I suppose



$ su -c "yum install gvim"


stefan

stefan1975
30th July 2008, 05:48 PM
how is that sudo yum is not a Fedora way?

because fedora by default uses the "root" account and not a regular user that is granted administrative privileges.

This is more secure in the opinion of many, since the root password should be a tough to hack password and often regular user passwords are used more often and easier to remember and thus hack and this way more easily gain root access through a normal user account.

Ubuntu uses the sudo way and does not have "root" enabled at all, the password is not set and all administration is done through sudo by the default user account.

I use the root account and prefer the fedora way but still have "sudo" enabled for my personal user, albeit password protected.

stefan

briantan
30th July 2008, 05:53 PM
Thanks. Anyway, I always use "su -" to get the root home environment set up.

sidebrnz
30th July 2008, 09:51 PM
Many old-time Unix users swear by vi and think it's the greatest thing since punched cards. Others, who haven't learned it, swear at it. The important thing is to find at least one editor that doesn't need a gui that you can learn and use easily, then stick with it.

Personally, I suggest that posters not "push" vi on new users who have never encountered it before for emergency edits. Either you have to give a long, drawn-out keystroke by keystroke cheat-sheet for that one edit, or the new user gets lost and fscks everything up; possibly both, if things go wrong. Nano, ed, joe and so on may all have their problems, but they're fairly "new-user friendly" and are adequate for such minor tasks as changing the name of your video driver so that you can get X started. If you love vi, you can always suggest that the person you're helping take the time to learn it LATER, but remember that learning vi isn't as important at this point as getting the system up and running again. Keep the instructions simple, and there's less chance that something will go wrong.

Sorry to lecture like this, but so many vi users are One True Way fanatics, and that isn't (or shouldn't be) the Linux way of doing things.

RupertPupkin
30th July 2008, 09:55 PM
Wonder where "ee" lives now. (Wordstar-like editor)
Try joe: yum install joe
It's a Wordstar-like editor (nonGUI), and if you run it as 'jstar' then it has a much stricter compatibility with Wordstar.
Other good console-style editors are jed and moe. You can install jed using yum, but you'll have to compile moe from source: http://www.gnu.org/software/moe/

stefan1975
30th July 2008, 10:07 PM
Sorry to lecture like this, but so many vi users are One True Way fanatics, and that isn't (or shouldn't be) the Linux way of doing things.

oh no and here I thought 'vi' was the best thing since sliced bread. ;-)

I always catch myself trying to use vi shortcuts in OOo, notepad++ or even M$ office. I even use vim for windows whenever I need to run *cough*vista*cough*

perhaps xemacs might be good for some, it even has some games integrated, well at least the Tru64 version had tetris enabled.

stefan

wraithe
31st July 2008, 03:17 AM
Many old-time Unix users swear by vi and think it's the greatest thing since punched cards.


Umm are you calling me old... :D
I'll have you know that just because I drove a fairly new 65' model when i got my drivers license, doesnt make me old.... :cool:

Love your start to the post...
Just had to say that, but yes your lecture did make a very valid point, linux does not have restrictions to what you must use, there are always alternatives and ones you will get fluent with...
vi I use because thats what i am used to, and it wasnt the only thing around, its just what i used...
But then I also like the idea of no terminal work in setting up linux, but alas I whinge when I cant do that fixing a windows box...
Damm, I must be getting old, now wheres my walking stick so i can go make a cup of Tea...
:D :D :D :D

juanfgs
31st July 2008, 03:44 AM
I stand corrected. emacs start different interface (terminal or X11 client) depending on whether X is available.

Or you can pass the -nw parameter to run it from console(and -q makes it ignore your .emacs in case you are loading heavy plugins). You can always use alias to make it more comfortable:


alias emacs="emacs -nw -q"

marko
31st July 2008, 04:09 AM
nano has one feature I really like. If you put a bunch of text in the editor and put the cursor in a paragraph and press Ctrl+J , nano will format and justify the paragraph so that the words as kept whole and so that each line ends just before the right edge. It doesn't matter how long that line you copy and pasted into nano is, it justifies it.

It's really nice for editing email or text files.