Sounds ridiculous, but bear with me here.
You made the decision that incorporating a multiplexer into kakoune is beyond the scope of this project. This is a decision I agree with, but it comes with a significant downside - you leave all the comforts of kakoune the moment you switch to a different pane/window.
Consider the scenario of opening a terminal buffer in Vim/Emacs. If you want to kill/yank some text, you have all your editing cozies with you, instead of resorting to the limited editing and selection capabilities of your multiplexer or terminal emulator.
Is there a way around this limitation, perhaps through a read-only mode of kakoune that the community has thought up that I'm missing? If not, is there a way to create one without causing endless feature creep?
Now that #3394 is fixed, if you know the name of the Kakoune session you're using, you can pipe things to a new kak client of that session, so that the copy/paste register will be shared. For example, if you start a Kakoune session named "foo":
kak -s foo
...you can pipe data into a fresh scratch buffer in the same session:
echo whatever | kak -c foo
For something a bit more polished, a plugin like kakoune-connect sets things up so when you spawn a new terminal from inside Kakoune, any editing you do from inside that terminal will automatically connect back to the Kakoune session that spawned it.
@jjzmajic I've had a few solutions to this. At first, with tmux, I made C-a [ open the tmux buffer's contents with Kakoune. With kak-ansi installed, it even has the correct colors. See here for discussion on this approach. This worked quite well except for a small delay when entering the scrollback mode.
After that, I decided to try and create a native Kakoune copy mode for tmux - to elminate the delay. I didn't get very far, and I ditched tmux before it was complete. But what I did get, I made into a tmux plugin.
Now I'm using kitty as a terminal emulator, and I'm back to the original approach. It needs a little polish but it works. https://github.com/eraserhd/dotfiles/blob/develop/kitty/default.nix#L216. (The polish it needs is that kitty doesn't set up the environment variables correctly in order for that to share my Kakoune session, and I want Esc to exit scrollback mode, some indication that the terminal is in scrollback mode, and position the cursor and viewport in the correct places. None of this is hard to work out, but I haven't done it yet.)
I forgot to mention that zsh should be able to map a mode to emulate Kakoune, and that various shells have a binding to edit the command line in $EDITOR.
In fish, I can press ALTe to edit command line in $EDITOR. It's lifesaver sometimes
Thanks everyone! kakoune-connect seems to be closes to what I'm trying to achieve, but looking at its documentation (and the other suggestions here) I can't quite see how I could achieve the following:
I'm probably being a bit slow, but if anyone could point me in the right direction I would really appreciate it
Ok, well, it seems this isn't kakoune's job. Switched from tmux to dvtm. Its build in copy mode does exactly what I need and actually has sane window management. Adding kakoune support for it would be really nice. I guess I can hack something together and upstream it
@jjzmajic You might be interested in [3mux].
@lenormf THANK YOU!
Most helpful comment
@jjzmajic https://github.com/lenormf/kakoune-extra/blob/master/dvtm.kak