irc-core icon indicating copy to clipboard operation
irc-core copied to clipboard

Add keybindings inspired from weechat

Open Ekleog opened this issue 5 years ago • 2 comments

Hello,

I'm currently using weechat, but have been told that glirc might be a nice replacement. Having skimmed the wiki, here are the things that are blocking me from trying it, hoping you would find them useful too:

  • [ ] The go.py plugin for weechat, plugged on Alt-G (or whatever), that starts fuzzy-matching the buffer list looking for a buffer to jump into
  • [ ] Alt-U, that jumps to the last message not yet seen (marked by a bar in weechat, can't see it in the screenshot but I guess there's one in glirc too)
  • [ ] Alt-N and Alt-P, which jump to next/previous highlight in the current buffer

In addition, something that would be nice to have (but which weechat doesn't have) and that I can't find in the docs either is a way to reset the “last read message” bar to some other position, if one wants to mark a message as unread to come back to it later.

What do you think about these? :)

Ekleog avatar Oct 11 '18 10:10 Ekleog

I think the easiest way to tackle fuzzy jumping would be to start with a short command like /j that had dynamic updating like /url does so you could see the match incrementally. This would basically be like a version of /c for changing between channels that simply didn't use an exact match.

For jumping to the unread bar and highlighted messages you can use the importance metadata stored on lines and the marker metadata stored on windows. The hardest part would just be figuring out how many lines of actual scrollback are needed to bring the logical lines to the top.

https://github.com/glguy/irc-core/blob/823aeae6d36c6223039cae202c629862110dcbf4/src/Client/State/Window.hs#L66-L73

https://github.com/glguy/irc-core/blob/823aeae6d36c6223039cae202c629862110dcbf4/src/Client/State/Window.hs#L83-L90

For manually setting the unread message marker the only tricky part is picking a UI for specifying the right message. Actually moving the bar is just a matter of setting this Int:

https://github.com/glguy/irc-core/blob/823aeae6d36c6223039cae202c629862110dcbf4/src/Client/State/Window.hs#L85

I'd be happy to work with you on making any of these changes. I'm probably not going to implement features to get someone try using glirc for the first time, but these certainly sound interesting!

glguy avatar Oct 11 '18 15:10 glguy

Thank you for the pointers! Unfortunately I've got a whole lot of projects of my own, and weechat works well enough for my use case… well, I guess maybe I'll come back here in a few years when other projects will be complete and try to implement it?

Leaving this open for the ideas if someone else feels like implementing it, feel free to close :)

Ekleog avatar Oct 11 '18 17:10 Ekleog