Re: Extending 'VIP' editor

2022-01-22 Thread Alexander Burger
Thanks Erik! Works perfectly! :) "^B" conflicts with the default prefix key in tmux, but of course it is trivial to choose another key to go backwards. ☺/ A!ex On Sat, Jan 22, 2022 at 01:12:37PM -0600, Erik Gustafson wrote: > Hi all, > > Here's a modified 'insMode' that provides basic

Re: Extending 'VIP' editor

2022-01-22 Thread Erik Gustafson
Hi all, Here's a modified 'insMode' that provides basic "structural editing" features: https://gist.github.com/erdg/0e7d97cc66b205ffd5eadc9b637ed4a9 - balanced insert/delete of (super-)parens - automatic code indentation - line editing shortcuts from within insert mode The line editing

Re: Extending 'VIP' editor

2021-12-13 Thread Alexander Burger
Hi Erik, thats really cool! Thanks a lot for sharing! ☺/ A!ex On Sun, Dec 12, 2021 at 09:34:24PM -0600, Erik Gustafson wrote: > Hi list, > > The rabbit hole went pretty deep. Here's my current viprc: > > https://gist.github.com/erdg/ebf4556382bc1bbbaf534c4ebd927322 > > It now contains a

Re: Extending 'VIP' editor

2021-12-12 Thread Erik Gustafson
Hi list, The rabbit hole went pretty deep. Here's my current viprc: https://gist.github.com/erdg/ebf4556382bc1bbbaf534c4ebd927322 It now contains a substantial "command language" for lisp code based on the keys '(', ')', '@' and '#'. There's also a bunch of utility functions that make writing

Re: Extending 'VIP' editor

2021-11-05 Thread Erik Gustafson
Hi beneroth, > sounds to me a lot like ParEdit mode in emacs (it automatically creates > closing parens and gives fast ways to indent/nest or un-nest S-expr's). > I will check out your extensions and consider switching once again. Please do! Might be a tough sell to the emacs crowd, but it beats

Re: Extending 'VIP' editor

2021-11-05 Thread Erik Gustafson
Hi Alex, > I cannot dig into the whole code, but let me point to one minor error: Namespaces strike again! Thanks, I'll fix it. > I think this is difficult. [...] Eh, not worth it then. I guess the solution to my example is the '#@' command, i.e. create a command that undoes whatever, if

Re: Extending 'VIP' editor

2021-11-05 Thread andreas
On 05.11.21 08:41, Alexander Burger wrote: >> to undo that action I need to press 'u' twice. >> Ideally 'u' would undo everything that happened in the command's prg body. > I think this is difficult. I know about this issue, e.g. when 'pipeN' is used > (I > use F4 a lot, e.g. when formatting

Re: Extending 'VIP' editor

2021-11-05 Thread andreas
Wow! Great extensions Erik, especially > [@@] - indent expr / paragraph sounds to me a lot like ParEdit mode in emacs (it automatically creates closing parens and gives fast ways to indent/nest or un-nest S-expr's). I will check out your extensions and consider switching once again. Thx, -

Re: Extending 'VIP' editor

2021-11-05 Thread Alexander Burger
Hi Erik, > After a week of exclusively using vip for editing picolisp, here's what > I've got: > > https://gist.github.com/erdg/ebf4556382bc1bbbaf534c4ebd927322 Wow, that is really a lot! Very nice to see that Vip is alive :) I cannot dig into the whole code, but let me point to one minor

Re: Extending 'VIP' editor

2021-11-04 Thread Erik Gustafson
Hi all, After a week of exclusively using vip for editing picolisp, here's what I've got: https://gist.github.com/erdg/ebf4556382bc1bbbaf534c4ebd927322 Most interesting are the "code formatting" commands ('@' prefix). Using vip made me realize how much I leaned on vim's "blinking parens" when

Re: Extending 'VIP' editor

2021-10-27 Thread Erik Gustafson
Hi Alex, > More general are 'cutX', 'cutN' and 'paste'. They are the main internal > editing > workhorses, based on 'change'. 'change' takes care of everything, like > maintaning undo/redo stacks, markup and rerfeshing the display. > Yep, this is it. 'paste' does what I need. "simulate ..." was

Re: Extending 'VIP' editor

2021-10-27 Thread Alexander Burger
Hi Erik, > What is the best way to programmatically add characters to the current line? > The function 'insChar' can replace the character under the cursor, but I'd 'insChar' only replaces a single char (or the same char "count" times). More general are 'cutX', 'cutN' and 'paste'. They are the

Re: Extending 'VIP' editor

2021-10-27 Thread Erik Gustafson
Hi Alex, What is the best way to programmatically add characters to the current line? The function 'insChar' can replace the character under the cursor, but I'd like to simulate pressing 'i' to enter insert mode, typing e.g. "#{", pressing esc, etc, from code in 'viprc'. Thanks, Erik On Mon,

Re: Extending 'VIP' editor

2021-10-25 Thread Erik Gustafson
Hi Alex, The file must be loaded in 'vip' namespace to have the right context: > >(symbols '(vip pico) > (load "~/.pil/viprc") ) > symbols - one of my blindspots! Thank you

Re: Extending 'VIP' editor

2021-10-25 Thread Alexander Burger
Hi Erik, > What is the best way to reload 'viprc' while vip is running? > > With a simple > > (load "~/.pil/viprc") > > the changes do not take effect. The file must be loaded in 'vip' namespace to have the right context: (symbols '(vip pico) (load "~/.pil/viprc") ) ☺/ A!ex --

Re: Extending 'VIP' editor

2021-10-25 Thread Erik Gustafson
Hi Alex, What is the best way to reload 'viprc' while vip is running? With a simple (load "~/.pil/viprc") the changes do not take effect. Instead, I've been reloading '@lib/vip.l' (which then loads 'viprc'). This works, but it seems there is a weird bug... any time the ':e' command is

Re: Extending 'VIP' editor

2021-10-25 Thread Alexander Burger
Hi Erik, > Now, no lisp editor is complete without an implementation of "Rainbow > Parens": > > https://gist.github.com/erdg/9b9499dc53e8dbbf1ef0a7a574318d02 > > They change color every time the screen is redrawn. It caught me by > surprise, I > don't think I've ever laughed so hard while

Re: Extending 'VIP' editor

2021-10-25 Thread Erik Gustafson
Hi Alex, > Great! I released it :) > Thanks! Now, no lisp editor is complete without an implementation of "Rainbow Parens": https://gist.github.com/erdg/9b9499dc53e8dbbf1ef0a7a574318d02 They change color every time the screen is redrawn. It caught me by surprise, I don't think I've ever

Re: Extending 'VIP' editor

2021-10-25 Thread Alexander Burger
Hi Erik, > This is great, much cleaner. I've moved my key maps to 'viprc' now and > updated > the 'vi' function: >... > Simple and effective, works perfectly! Great! I released it :) ☺/ A!ex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: Extending 'VIP' editor

2021-10-24 Thread Erik Gustafson
Hi Alex, >(de *KeyMap > > ("^u" ...) # half page up > > ... > >(de *KeyMap-g > > ... > >(de *KeyMap-q > > ... > > which are then 'assoc'ed in the proper places in the main loop. > > AND: These places should always be at the *beginning* of the 'case' > statements. > In this way,

Re: Extending 'VIP' editor

2021-10-24 Thread Alexander Burger
On Sun, Oct 24, 2021 at 05:19:40PM +0200, Alexander Burger wrote: >(de *KeyMap > ("^u" ...) # half page up > ... >(de *KeyMap-g > ... >(de *KeyMap-q > ... > which are then 'assoc'ed in the proper places in the main loop. AND: These places should always be at the *beginning* of

Re: Extending 'VIP' editor

2021-10-24 Thread Alexander Burger
Hi Erik, > I've got a handful that I've just inserted into the main loop, but > that seems less than ideal. Right. > It would become a lot of copying and pasting to try > to keep my tweaks in sync with VIP as you continue to develop it. > > Would it be possible to have a slot in the loop for

Re: Extending 'VIP' editor

2021-10-24 Thread Erik Gustafson
Hi Alex, Currently there are only *F7 through *F12 reserved. For example, my actual > ~/.pil/viprc is this: > [ ... ] Thanks for sharing, I'm going to use some of those :) > We could add more hooks perhaps. But I'm not sure if this is really > helpful. > What about adding new 'normal

Re: Extending 'VIP' editor

2021-10-24 Thread Alexander Burger
Hi Erik, > I was hacking 'VIP' a bit today, and thought I'd share the results. Good idea! :) > A new color scheme: > https://gist.github.com/erdg/8d5ad1649975153c963ba7b0a1210fe5 > > And a few normal mode commands for manipulating code comments: >

Extending 'VIP' editor

2021-10-23 Thread Erik Gustafson
Hi Alex, list, I was hacking 'VIP' a bit today, and thought I'd share the results. A new color scheme: https://gist.github.com/erdg/8d5ad1649975153c963ba7b0a1210fe5 And a few normal mode commands for manipulating code comments: https://gist.github.com/erdg/24e53ad4fcc71d08c88a432c2bcc6544

Re: Vip Editor

2017-01-04 Thread Alexander Burger
Hi David, > > (For some reasons, the default "libncurses.so" is NOT a shared object > > library > > which can be called from C programs, but a text file with some kind of > > pointer > > or link in it) > ... > Wow...it's situations like this that make me feel I'll never understand C. > Why use an

Re: Vip Editor

2017-01-04 Thread David Bloom
Hi Alex and thanks for the speedy reply. > > Yes, this is the common problem. I tried to explain it in the article, > perhaps > it got a bit too short: > > Oops, I was trying to avoid the common problem. Not your directions so much as my misunderstanding of C perhaps, see below. Following your

Re: Vip Editor

2017-01-04 Thread Robert W. Brown
I've had the same experience on a 64-bit Linux Mint installation. Bob On Tue, Jan 3, 2017 at 10:05 PM, David Bloom wrote: > Thank you Alex for another exciting utility as well as more example code > to learn from. I'm having some difficulty installing vip and I hope >

Re: Vip Editor

2017-01-03 Thread Alexander Burger
Hi David, > Thank you Alex for another exciting utility as well as more example code to > learn from. I'm having some difficulty installing vip and I hope someone > can help me out. Using a 64-bit Netrunner (based off of Manjaro based off > Arch) install, a fresh 16-12 picolisp installation,

Re: Vip Editor

2017-01-03 Thread David Bloom
Thank you Alex for another exciting utility as well as more example code to learn from. I'm having some difficulty installing vip and I hope someone can help me out. Using a 64-bit Netrunner (based off of Manjaro based off Arch) install, a fresh 16-12 picolisp installation, and ncurses installed

Re: Vip Editor

2017-01-02 Thread Bruno Franco
Downloaded and Installed! Thanks Alex! On Mon, Jan 2, 2017 at 2:29 AM, Alexander Burger wrote: > Hi all, > > here is an article about Vip, the Vi-Style Editor in PicoLisp: > >http://picolisp.com/wiki/?vip > > It consists of only 990 lines of code. > > Not that the

Vip Editor

2017-01-01 Thread Alexander Burger
Hi all, here is an article about Vip, the Vi-Style Editor in PicoLisp: http://picolisp.com/wiki/?vip It consists of only 990 lines of code. Not that the world needs yet another editor! But it may serve as a useful collection of PicoLisp coding examples :) - Alex -- UNSUBSCRIBE: