Linux Text Editor

Posted by: tahir

Linux Text Editor - 07/04/2005 13:14

I sometimes have to edit files in Linux and I HATE using vi, is there a non gui, non xwindows editor like Dos edit available for Linux? No special requirements, just something where I don't have to remember to press I for insert or cw for change word...
Posted by: robricc

Re: Linux Text Editor - 07/04/2005 13:23

I use pico mostly. I also can't stand vi. Probably only because I don't use it enough to get used to it.
Posted by: tahir

Re: Linux Text Editor - 07/04/2005 13:39

Thanks very much Rob, like you it's only occasionally that I have to edit a file and to be frank I find vi scary

Looks easier than vi, but the cursor keys seem to delete text if I scroll backwards (like backspace) is that just the way it is?
Posted by: robricc

Re: Linux Text Editor - 07/04/2005 13:48

The back arrow isn't deleting text for me and never has. I am not sure what setting (if any) would cause that. Are you sure text is going away?
Posted by: tahir

Re: Linux Text Editor - 07/04/2005 13:54

I'm having term type problems that are doing weird things to my screen too, I'd better get those figured before I start on pico. Thanks for your help though.
Posted by: drakino

Re: Linux Text Editor - 07/04/2005 19:41

If pico is not on the machine, nano (a clone of pico) or joe might be. Both are easier to use.

However, still try to learn vi to the point of usability, in case none are available.

I remember the following for vi:

Arrow keys navigate
i changes to insert mode to type where the cursor is
Esc backs out of the insert mode
x when not in insert mode deletes the character under the cursor
dd deletes a line
:w writes the file to disk, :q quits, :q! quits without saving
Posted by: wfaulk

Re: Linux Text Editor - 07/04/2005 20:25

Quote:
Arrow keys navigate

Not always. Even when they do, accidentally using them in insert mode can often cause problems.

Better to rely on hjkl: h is left, l is right, k is up, and j is down. This becomes somewhat less obtuse when actually using it.
Posted by: tonyc

Re: Linux Text Editor - 07/04/2005 21:34

Quote:
Not always. Even when they do, accidentally using them in insert mode can often cause problems.

If your arrow keys aren't working in vi, then your terminal settings are borked. Besides, accidentally using hjkl in insert mode can often cause problems, too.
Posted by: wfaulk

Re: Linux Text Editor - 07/04/2005 23:07

Actually, some versions of vi simply don't support the arrows, period. I'll give you that it's been a while since I've seen one, but I learned it the hard way.

Also, adding a few extra characters isn't really as bad as the things that the arrow escape sequences can do.
Posted by: PaulWay

Re: Linux Text Editor - 07/04/2005 23:20

Heh - it took me years of using VIle before I found out that I could use $ to go to the end of the line rather than A<esc>...

I notice no-one has suggested emacs. That's probably because it's even more arcane and brain-draining than vi.

Most people are probably using vim as a replacement for vi now. Vim does all sorts of things, like allowing you to move around while in insert mode and syntax highlighting, that are pretty nifty. If you're not using vim and you've used vi a bit, then this may be a good thing to try.

Otherwise, I just use nedit. Even if I have to use ssh -X.

Have fun,

Paul
Posted by: wfaulk

Re: Linux Text Editor - 08/04/2005 00:00

Emacs: combining all the power of EDLIN with all the ease-of-use of EDLIN.
Posted by: andy

Re: Linux Text Editor - 08/04/2005 07:29

I really like Joe, it has the old Wordstar keybindings (Ctrl-K-B to start a block, Ctrl-K-K to end a block, Ctrk-K-C to copy the block, Ctrl-K-H for help on the other keybindings etc).

I tend to only edit files on Linux once or twice a week, so I need an easy to use editor that doesn't need to have too many bells and whistles. Joe meets my needs in ways vi and emacs can't...

http://sourceforge.net/projects/joe-editor/

There seems to be a total lack of screenshots of Joe on the web, so here are a few to give you a flavour.

Selecting a block:


Running a search and replace:


Showing the help:
Posted by: tahir

Re: Linux Text Editor - 08/04/2005 08:15

Quote:
If your arrow keys aren't working in vi, then your terminal settings are borked.


I like your diagnosis, definitely borked.

Tried AEE, emacs and pico but I'm not getting anywhere really, I need to unbork my tty settings. I access the Linux box from my Win2K PC using a terminal emulation application that's set to use wy60 settings, these work fine in the application but not at the shell prompt. At the shell prompt I've tried:

export TERM=wy60 (and vt100 and ansi) but can't get my arrow keys to work properly.
Posted by: AudunE

Re: Linux Text Editor - 08/04/2005 12:00

Maybe you should try Ed...
Posted by: tahir

Re: Linux Text Editor - 08/04/2005 12:31

ED WILL NOT CORRUPT YOUR PRECIOUS BODILY FLUIDS!!

Well that's allright then
Posted by: bonzi

Re: Linux Text Editor - 08/04/2005 13:36

Do you know whether the application uses (n)curses library or something of its own? Also, curses package has two terminal capability databases: termcap (older) and terminfo (newer). Perhaps something is wrong with that part of setup.

Another thing: IIRC, the default codes wyse60 arrow keys generate are very badly chosen: down-arrow sends linefeed, left-arrow backspace etc. When I was working with physical wy60 terminals I was always remapping them to some ESC sequences (but then I had to tweek all terminal capability descriptions)

I would suggest that you first swithc your terminal emulator to something else (e.g. vt100, if you don't need function keys), and set TERM env variable accordingly. Then, using octal dump (od) command verify that arrow keys produce ANSI escape sequences (or whatever is expected of the terminal emulated by your amulator). Finally, use infocmp to verify that terminal capability database contains correct definitions.

Or, if you want to avoid learning much more about Unix 'TUI' handling than you ever wanted to know, switch to something with WS-like navigation, as suggested (but there things also can go wrong, from similar reasons: editor has to know how to repaint the screen etc).
Posted by: tahir

Re: Linux Text Editor - 08/04/2005 13:47

Thanks for that Bonzi

I think I'll wait till somebody in support's free to sort it out for me. Call me stupid but Dos 5.0 was my favourite OS.
Posted by: bonzi

Re: Linux Text Editor - 08/04/2005 13:51

Quote:
I think I'll wait till somebody in support's free to sort it out for me.

Reasonable decision. This is a particular piece of Unix arcana (going slowly away, with proliferation of single-user workstations and/or X-terminals) best left to those unfortunate enough to have had to learn it already...
Posted by: tahir

Re: Linux Text Editor - 08/04/2005 14:48

Glad you resisted the temptation to call me stupid