RetroBSD

2.11BSD operating system for microcontrollers
It is currently Sun Jun 17, 2018 11:33 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: re editor
PostPosted: Fri Dec 21, 2012 9:56 am 
Committer
User avatar

Joined: Wed Oct 10, 2012 11:01 pm
Posts: 1079
Location: Sunnyvale, CA
I'm mostly finished with /bin/re editor. It's quite stable, and all available features work as expected. Need to write some kind of a tutorial. There is a built-in help screen: use F3 or ^N to switch. Exit with saving is ^X ^C (like Emacs).

Function keys:
F1 - enter a so called Cmd mode, a prompt at lower line of screen, used to select a region of text for copy-paste or delete. Also allows to run external filters, like sort or sed.
F2 - save file. Recommended to press periodically to avoid data loss in case of crash.
F3 - switch to alternative file. You can edit two files and switch between them using this key (or ^N).
F4 - run external filter. The sequence is, for example: F1 sort F3. This will run sort over a single paragraph of text (up to empty line).
F5 - copy the current line, or a selected block, to paste buffer.
F6 - insert a block from paste buffer.
F7 - search for a string. For example: F1 abcd F7.
F8 - goto a line by number. For example: F1 123 F8.

Some commands are entered vua control-chars:
^Y - delete line or selected block. This block is put to a so called delete buffer, and can be pasted back using F1-F6 sequence.
^D - delete symbol, same as Delete key.
^F - search forward, same as F7.
^B - search backward.
^N - next or new file, same as F3. To open a file, use F1 filename F3.
^A - Cmd prompt, same as F1.
^C - copy line/block, same as F5.
^V - paste line/block, same as F6.
^P - quote next non-printable symbol.
^X i - toggle insert/overwrite mode.
^L - refresh screen, current line centered.
^X f, ^X b - shift a view right or left. Too long lines are not wrapped as in VI, but clipped. To view or edit them, use these commands, or End key.

To exit without saving, use: F1 qa <Enter>.

For search and replace, use external filters, for example:
Code:
F1 9999sed s/foo/bar/ F4

Here 9999 is a counter of paragraphs, i.e. to end of file.

--Serge


Top
 Profile  
 
 Post subject: Re: re editor
PostPosted: Fri Dec 21, 2012 1:02 pm 
Committer
User avatar

Joined: Thu Oct 11, 2012 8:45 am
Posts: 1801
Location: Room 217, Floor 8, Arm 8, Wheel S7, Mars Base Alpha 3
vak wrote:
I'm mostly finished with /bin/re editor. It's quite stable, and all available features work as expected. Need to write some kind of a tutorial. There is a built-in help screen: use F3 or ^N to switch. Exit with saving is ^X ^C (like Emacs).

Nice one. A couple of gripes tho:

Quote:
F1 - enter a so called Cmd mode, a prompt at lower line of screen, used to select a region of text for copy-paste or delete. Also allows to run external filters, like sort or sed.
^A - Cmd prompt, same as F1.


Can't use F1 in Gnome Terminal - it brings up the Gnome Terminal help window (a right royal pain that is if you ask me), and ^A is used as the command key for Minicom. So, for me to access the command mode of re, I'd have to do ^A^A.

(edit: I have found how to disable F1-help in Gnome terminal - it's buried at the end of a big list of key bindings - not good for a new user though)

_________________
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".


Top
 Profile  
 
 Post subject: Re: re editor
PostPosted: Thu Jan 03, 2013 3:51 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi All,

Just downloaded and compiled latest current.

Uploaded re to my working retro system.

It works. Still figuring it out, but seems to work well even without 'correct' version of kernel.

Wiz


Top
 Profile  
 
 Post subject: Re: re editor
PostPosted: Thu Jan 03, 2013 4:09 pm 
Contributor

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
So I create a test file 4 lines.

I am not sure how to create a block?

If I delete a line it seems to be gone? I thought it might be in a buffer?

If I copy a line, I can paste it.

If I copy one line followed by another, I paste only the last one back in.

How do I use block feature? Is there an extended use manual I missed?

So far no unexpected crashes, etc. here :).

Wiz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:




Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission