Amiga.org

Amiga computer related discussion => General chat about Amiga topics => Topic started by: WarPiper on August 27, 2003, 02:58:38 AM

Title: linex text editor?
Post by: WarPiper on August 27, 2003, 02:58:38 AM
does anyone here know of a text editor that I can use in the shell?  I can not boot to x and would like to edit a file.  of if at worst, a step by step way of recompiling the kernal?
Title: Re: linex text editor?
Post by: Merc on August 27, 2003, 03:02:11 AM
vi!  :-D Takes some getting used to though, emacs might be easier if you don't know vi that well...
Title: Re: linex text editor?
Post by: WarPiper on August 27, 2003, 03:05:46 AM
what does vii do? doe it recompile the kernal or is it a text editor? soor, I am a linux moron stil in training.
Title: Re: linex text editor?
Post by: Ilwrath on August 27, 2003, 03:16:43 AM
yep... vi and emacs are your text editors....

personally, I prefer vi.  They're both awkward until you get used to them, though.

You'll probably want to go over a quick reference, like this one (http://chris.tobkin.com/~tobkin/vi/quick_reference.html) though...  

The main thing to remember is that vi uses 2 modes... insert and command.  To go to insert (able to type things) hit 'i', to get out, and back to command, hit 'ESC' or 'CTRL ['.

Good luck, and may the force be with you.
Title: Re: linex text editor?
Post by: ronybeck on August 27, 2003, 03:42:58 AM
Vi can be a little bit of a challange to any one who is new to linux.  You could also try pico.  It is much more intuitive and acts more like notepad type apps.  It is not as powerful as vi or emacs but the average joe won't need the extra functions that vi and emacs provide any how.
Title: Re: linex text editor?
Post by: Rigger on August 27, 2003, 03:58:57 AM
Pico get my vote.
Title: Re: linex text editor?
Post by: Siggy on August 27, 2003, 07:50:42 AM
If you want something rather easy to use, try joe.

Siggy
Title: Re: linex text editor?
Post by: BouncingAyatollah on August 27, 2003, 08:41:52 AM
vi is an old style text editor so when you run it, it is in "command mode", i.e. any keys you hit will do something! Good thing is, if you just need to use it infrequently, all you need to know is:

i        insert text and ESC to end insert
x      delete character
:wq write file and quit
:q     quit

u      undo! :)

As said, it is worth learning at least the minimal because no matter what state your system gets into, you know vi will be there!
Title: Re: linex text editor?
Post by: Jope on August 27, 2003, 08:44:11 AM
Quote

ronybeck wrote:
Vi can be a little bit of a challange to any one who is new to linux.  You could also try pico.  It is much more intuitive and acts more like notepad type apps.  It is not as powerful as vi or emacs but the average joe won't need the extra functions that vi and emacs provide any how.

Ok, if the original asker decides that he doesn't want to do himself a favour and learn vi, then at least use

pico -w

Very important. Braindead pico has word wrap enabled by default and -w turns it off. Too many config files have been ruined, and strands of hair have been pulled out by beginners using pico, and not noticing that some lines got wrapped while they edited them.

BTW, learning vi is not a religion thing for me - it's just plain common sense. Vi is available about 99,99% of the time. Especially if you use a commercial unix, that's usually the only visual editor you get out of the box. You need to install your favourite editor on each machine if you don't want to learn vi.
Title: Re: linex text editor?
Post by: Targhan on August 27, 2003, 08:47:42 AM

pico -w

It rules.  However, there are basically two Unix editor camps.  Emacs, and then, there is everyone else. :-P

I belong to the "everyone else" grouping.  Although, a simple printed "cheat sheet" is about the most helpful thing in the world for either VI or EMACS.
Title: Re: linex text editor?
Post by: Floid on August 27, 2003, 10:38:10 AM
Quote

Targhan wrote:

pico -w

It rules.  However, there are basically two Unix editor camps.  Emacs, and then, there is everyone else. :-P

I belong to the "everyone else" grouping.  Although, a simple printed "cheat sheet" is about the most helpful thing in the world for either VI or EMACS.


'vi' seems to be the 'everything else.'  Which is annoying if you're an ex-MS-DOS moron, and expect everything to be at least as straightforward as VDE was. ;)

If you want to use 'pico,' you may as well use 'nano.'  Systems intended to support people who like 'pico' may have one or the other installed.  (So remember both names.)

http://www.nano-editor.org/ (http://www.nano-editor.org/)

A working knowledge of 'vi' - and 'ed,' its precursor - will probably save your posterior at least once, since nearly every *NIX maintains at least the latter in /sbin or some other place you'll have access to when you're stuck in single-user mode with none of your other partitions mountable.

When it comes to everyday use, I'd say there are four camps - those in the ever-ongoing vi vs. emacs "war" (both fit different niches); those getting by with nano, pico, or other 'niche' console-based editors that fit different people's opinions of 'usability'; and those who prefer to work from the GUI, and use editors that can only be used from within X (of which there are quite a few, many of which seem decent enough, especially in comparison to the mess that is console-land).

If you do decide to pick between emacs (a 20-40MB text-editing operating system) and vi (available in many flavors, most extremely-to-relatively light in comparison), keep in mind that both the 'real' GNU emacs and 'vim,' the most popular vi variant, can work in both X and console modes.  This doesn't mean either are point-and-click simple within X, of course, just that they have their own window-dressings available.

If you come across something called 'Xemacs,' that's a project that forked from the original GNU emacs years ago, and doesn't have much to do with X11 support anymore.  (In other words, the original 'GNU' flavor has long since caught up in that regard.)  Emacs fans swear by either, in practical terms there isn't much difference, but I have it on authority of one XEmacs fan that you're best off sticking with the straight GNU flavor until you develop any reasons to hate it.
Title: Re: linex text editor?
Post by: alx on August 27, 2003, 10:57:56 AM
Emacs always seemed to be a bit better for me than vi - type in "info emacs" at the command line for a hypertext manual with a tutorial.

Although I haven't used any text-based editors for a while, and I've heard that joe is meant to have a less steep learning curve.
Title: Re: linex text editor?
Post by: bhoggett on August 27, 2003, 11:26:23 AM
vi (or vim - vi improved) and emacs are the two "standard" editors you will find on almost any Linux and Unix system.

Since you're running Mandrake 9.1, you may want to try joe or nano.
Title: Re: linex text editor?
Post by: minator on August 27, 2003, 12:11:14 PM
I think it is no coincidence that vi are the middle two letters in "evil" :-D

As user friendlyness goes, it isn't.

It's there simply becasue it has been around a long time and lots of people know it.  If you get into trouble on an old system it'll be there to save you ass.  It's everywhere, type vim in a shell in BeOS and it'll appear...

Anyone who actually likes it, quite frankly needs their head examined.

And no I don't like emacs either, I prefer something from this century.
Title: Re: linex text editor?
Post by: Jope on August 27, 2003, 12:49:53 PM
Quote
Anyone who actually likes [vi], quite frankly needs their head examined.


Now now, don't be starting an editor war!

Vi does everything I need from a text editor.. (and I feel rather sane)
Title: Re: linex text editor?
Post by: asian1 on August 27, 2003, 01:15:19 PM
Try JSTAR, some sort of WordStar / Turbo pascal
compatible editor. Another editor:
SED (Stream editor).
Try "man sed"
Title: Re: linex text editor?
Post by: FluffyMcDeath on August 27, 2003, 08:57:11 PM
Forget vi .
You want Vim!!!

That's Vi IMproved.

It's hugely capable. Yes, it takes a bit of getting used to, but so does everything.

It started life on the Amiga back in 1988. Bram Moolenar got an Amiga 2000, but wasn't a big fan of Ed, wanted something more like vi on UNIX. He found a proggie that was a bit like vi, but wasn't happy with it. The source was available so he started hacking away. Many moons later and with much input from users and other developers it is a very powerful editor, and is available on a large number of platforms (including UNIX, often being used instead of vi!!).

It's charity ware, but fully working. Try it.
Actually, you may already have it. I think vim in in several standard distros now.
Title: Re: linex text editor?
Post by: Floid on August 27, 2003, 10:28:56 PM
Quote

FluffyMcDeath wrote:
Forget vi .
You want Vim!!!

That's Vi IMproved.

It's hugely capable. Yes, it takes a bit of getting used to, but so does everything.

It started life on the Amiga back in 1988.
Props there - I forgot all about the heritage.  'Vim' is indeed the best 'vi' for serious work.  Do forgive us BSD fans for snickering at distros that use it by default, though -

-rwxr-xr-x  1 root  wheel  1301332 Jul  8 03:08 vim
-r-xr-xr-x  6 root  wheel  311156 Jun  5 00:24 nvi

...I think they're compensating for something. ;)  (Seriously for those trying to learn from this, it's a degree-of-complexity 'debate.'  Vim is cool, but the question is how far you trust it to work and not have possibly relied on an unnecessary dependency when your system's just blown apart.  The answer, of course, is that you can trust it quite far, because any kinks have long-since been ironed out, but shipping something 'simple' by default lets you worry about other things, like why you had to be in single-user with partitions unmountable.  The 5.x-branch of FreeBSD is in the process of trashing some of its recovery niceties in tradeoff for some new features, anyway... and if you run out of a single / partition with no separate /usr, you'll never get in a situation to notice the differences anyway; either your system will be hosed or it won't. ;-))

Asian1 said,
Quote
Another editor:  SED (Stream editor).
Try "man sed"
Man, sometimes I can't tell if you're kidding. ;-)  sed is a great tool - and part of the 'grep, awk, sed' trinity of 'things with silly names that hold UNIX together,' but it'd take a brave, slightly insane man to use it for daily editing.  It's quite handy for things like find/replace on a file ('stream') from the command line, once you've learned all about regular expressions...