Add kak-connect to connect external programs as file browsers#4968
Add kak-connect to connect external programs as file browsers#4968stacyharper wants to merge 2 commits into
Conversation
fd445a0 to
9eb04a5
Compare
|
I've been using https://github.com/kkga/kks for a while and it works great. kak -e "kks-connect terminal nnn -e"If you are looking to build this functionality into Edit: While playing more with map global user e ':tmux-repl-vertical "echo eval -client %val{client} \""edit $(nnn -o -p -)\"" | kak -p %val{session}"<ret>' -docstring 'NNN' |
|
I've just tested kks, and it is of interset. The scripts cover a broader set of feature. Both relate in their minimal use -case, which is helping the user to connect another environment with the EDITOR. What I'm trying to upstream still fit better imo, and because is POSIX compatible, should work immediately with extra dependency. |
|
As @alexherbo2 did a lot of stuffs around connect back in the day, maybe he's interested by reviewing this PR. |
9eb04a5 to
2884c4f
Compare
Kakoune doesn't embark a file browser. It has been designed as client-server, and this make it easy to connect to external programs. The problem is that there is no easy way to do so out of the box. The users are expected to glue this themselves. This try to help users to connect external softwares to Kakoune. :connect is a new command to be used with :terminal or :run to start a new connected terminal, or graphical application. Those connected software have the corresponding KAKOUNE_SESSION and KAKOUNE_CLIENT environment variables. It also set kak-connect as EDITOR. kak-connect is a simple POSIX shell script that send commands to the connected Kakoune session, to open the files. The basic usage of all could be: :connect terminal nnn :connect terminal ranger Which open nnn or ranger in another terminal (external, or in a tmux pane), and to open the files in the Kakoune client. We can itterate over this: - Add hooks to open a file browser when the user open a directory, or no file with :edit. - Make nnn, or other programs detected and configured by default, as we do in windowing terminals. And wrap it with a :file-browser command.
This is a follow-up of :connect. We automatically determinate the best appropriate command to use as file explorer. We hooks this on :edit errors to open the explorer when used with directory, or no files at all.
Kakoune doesn't embark a file browser. It has been designed as client-server, and this make it easy to connect to external programs.
The problem is that there is no easy way to do so out of the box. The users are expected to glue this themselves.
This try to help users to connect external softwares to Kakoune.
:connect is a new command to be used with :terminal or :run to start a new connected terminal, or graphical application.
Those connected software have the corresponding KAKOUNE_SESSION and KAKOUNE_CLIENT environment variables. It also set kak-connect as EDITOR.
kak-connect is a simple POSIX shell script that send commands to the connected Kakoune session, to open the files.
The basic usage of all could be:
:connect terminal nnn
:connect terminal ranger
Which open nnn or ranger in another terminal (external, or in a tmux pane), and to open the files in the Kakoune client.
We can itterate over this: