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: >