Jump to content
IGNORED

vi99


TheBF

Recommended Posts

It's my understanding, VI was a modal editor in order to make it easier to port to multiple terminals, and to make it responsive on slow terminal connection (?).

 

Would it be possible to re-factor the code and create an abstraction layer, so i/o could be done either via a keyboard/vdp or a terminal?

 

Also, per your question what would be nice to have, I didn't see search and replace mentioned in the docs. I know things like regex is hard, but maybe a simple /string/replacement string/ ?

Link to comment
Share on other sites

15 hours ago, dhe said:

It's my understanding, VI was a modal editor in order to make it easier to port to multiple terminals, and to make it responsive on slow terminal connection (?).

 

Would it be possible to re-factor the code and create an abstraction layer, so i/o could be done either via a keyboard/vdp or a terminal?

 

Also, per your question what would be nice to have, I didn't see search and replace mentioned in the docs. I know things like regex is hard, but maybe a simple /string/replacement string/ ?

I believe you are correct about the modal "model" :) 

There is also some history written about it being built on top of some kind of IBM line editor that was not very nice and VI was designed to make the line editing look more WYSIWYG.

 

You are reading my mind about how to do the port from the RS232 to F18.  In fact Forth programs are just one abstraction layer upon abstraction layer.

You can overwrite any function with a new one of the same name. The language is a chameleon.

 

For example in the regular Camel99 Forth kernel the ISO Forth screen I/O words call a bunch of VDP assembler code.

In the RS232 version of Camel99 Forth the screen control words emit VT100 escape strings. But they both can compile standard ISO programs.

 

In theory... (he said nervously)  I should be able to recompile the RS232 version on the VDP kernel and most things will just work. 

hahahhahaha :)

 

I know that I made use of some VT100 features in the RS232 version for scrolling part of the screen that I might need to translate to VDP so there will be that extra work.

Just starting to feel human again today so I might start getting some files organized.

 

 

  • Like 2
  • Thanks 1
  • Haha 1
Link to comment
Share on other sites

On 11/27/2023 at 5:37 PM, dhe said:

image.png.0cfefe270abaa683c5c3a1dd9d99f221.png

 

Any chance these could be mapped to the arrow keys via Classic99?

Even on PC's running Linux, I never use those...

Oh man. I thought you were an Orthodox user. :) 

 

I will put this on the list. 

I might need to make a keymap file that can be loaded on boot up to address all the user requests out there. :) 

 

  • Like 1
  • Haha 2
Link to comment
Share on other sites

Update on VI99 II for F18 80 columns.

I have compiled the code for the RS232 version using function names from the VT100 library that run VDP code.

It starts and much of it is working now. My emulation of the VT100 scrollup and scrolldown  need a lot of work 

and a few other bugs but I think the potential for this version is to be much better than the previous

version for F18.

 

On the mend but still lacking full energy. :) 

 

 

  • Like 4
Link to comment
Share on other sites

  • 2 weeks later...
On 11/27/2023 at 9:54 AM, TheBF said:

I believe you are correct about the modal "model" :) 

There is also some history written about it being built on top of some kind of IBM line editor that was not very nice and VI was designed to make the line editing look more WYSIWYG.

I was taught to  use vi on DEC Ultrix in the 80s. It was indeed a thin layer atop the "ex" single line editor. The : key opened the ex prompt. Which had always been a :.


 

ex was similar to ed, edlin,  the old mailbox programs and even DOS offered  some variant. It surely goes way back. I learned ed on KIS, a 1975 OS for PDP-11/05. 

 


My brother used PTERM and dialup from the 99/4A.  PTERM had only CR/LF and FF control codes. But vi/ex accommodated that by starting over on a new line.    Fast-Term on 99/4A  had the same limitation, not quite adm3A.  (FF and VT goofy.)  Telco supported vi just fine with VT100. I recall FastTerm Geneve worked perfectly. 
 

h    cursor left:  backspace (better be non-erasing backspace)
j    down one line. backspace to cursor
k    up one line.  when no upline supported, would print the whole previous line on a new line. Fun!
l    cursor right: echo the character under cursor

 

 

Especially at 300 baud, you learned to used counts.  15x to delete 15 chars, 10k to go up ten lines.

 

 

Try entering :ex in your favorite vi. To go back , you type vi.

 

Some ex commands you already know are :w and :1,99d 

Edited by FarmerPotato
Rewote keys section
  • Like 3
Link to comment
Share on other sites

So I finally got my head together to port the TTY version backwards onto the F18 80 column functionality.

 

I found and fixed a bug that was in the TTY version where the editor cursor  lost sync with the screen position. 

 

Changes:

  1.  arrow keys and pageup/pagedown keys added to the valid key strokes for the 21st century VI users. :)
  2. When you enter editing mode the cursor changes from and underline to tall block
  3. I think this was missing in 1.43 of the f18 version.  dw ( delete word/words) 
  4. Next word (w) and previous word (b) commands

 

Future:

Now that this seems pretty stable, I have a search utility in development. It's pretty close. So that will add the / command.

Replace might be a stretch but I will give it a try.

 

The zip file just has the 3 binary program files  (VI99II) and the manpage. 

 

Let me know what I broke. :)  I have not spent enough time testing everything myself. 

 

 

image.png.5603f18a550d5c0fc03805e728103945.png

 

 

Edited by TheBF
Removed the buggy version or program
  • Like 4
  • Thanks 1
Link to comment
Share on other sites

11 minutes ago, chris36 said:

Still use vi in the form of vim as my goto text editor in Linux.

I would not have believed that 30 years ago, but this is also true for me. I usually say that before your fancy editor's splash screen has finished loading, I'm already done editing with vi.

  • Like 2
Link to comment
Share on other sites

Oops!  I found an error in my LIST code.

It fails to display line 24 when the screen refreshes completely when loading a new file or page-up/page-down.

(I think it worked on Terra Term OK, but I will have to test that as well)

 

Very sorry.  Here is a corrected version (0.93)

 

I really suck at quality control without a boss. :dunce: 

 

PS. Send in your bugs and I will do my best to clean them up.

 

Standby.. fixed another thing.

 

  • Like 1
Link to comment
Share on other sites

So once I tried to use V .92 it was pretty sad. 

 

This version is much better.

  1. line 24 reports file/editor information more consistently
  2. r command (read file) works for insert a file into a file at the cursor. 
  3. dd dw yy report a text message more like vim. 
  4. Overall seems more stable. 
  5. Found a stack error in my putch code that I compensated for in the wrong place. Fixed. 

Let me know.

 

I think I can see my way clear now to using this code base with VT100 codes by consolidating the VDP code into a file like the VT100 screen control.

 

 

Known bug:  When I try pasting a large file into the editor it hangs after a few lines. Don't have a reason for that yet. 

 

VI99II.93.zip

  • Like 4
Link to comment
Share on other sites

8 hours ago, Vorticon said:

Getting there :) What is the default baud rate? Can one pick the baud rate at program initiation or set a permanent default? 

This version is only for VDP/F18.  I am tight on space as it is currently built so I don't think I can fit RS232 and VDP in the same program without blowing it out into SAMS.

I want a solid editor before I go to SAMS.

 

The latest version for RS232 is autobaud.  It sets BPS after your first enter key is pressed. 

 

Link to comment
Share on other sites

Today's Bug Report:

 

vi to file gives error:
image.png.fe26a5277cb678de573e4251d7bfacb3.png

 

DB OR db - returns error honk.

 

4j - goes down 4 lines, but only after you press a key, the cursor should move immediately.

 

d$ - crashes system.

 

write 3 lines.
 dw on word of middle line.
you can no longer go down to last line with arrow keys.

dd doesn't respect end of file.
 

image.png.48d65fe75faad2c5b9f6c7d76610dd8a.png

 

yy p combo.
usually you can p as many times as you please. This version, you can only p once.

 

  • Thanks 1
Link to comment
Share on other sites

My mistake. I was adding commands faster than I realized.

 

I have corrected d$ and will get to the paste function so it behaves as expected. 

I have created so many functions that I don't always remember how to use them correctly. :(

 

 

 

Link to comment
Share on other sites

4 hours ago, dhe said:

I printed the manpage you create for the release.

 

I use it as a guide to what is fair game! 😃

Thank you for keeping me on track. 

I have been away from the code for a while and since I am not a real VI user, that is the only document that contains what I tried to get working. :)

 

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...