Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

add connect-repl #34

Closed
wants to merge 1 commit into from
Closed

Conversation

listentolist
Copy link
Contributor

No description provided.

@alexherbo2
Copy link
Collaborator

How connect.kak can leverage the use of a REPL?

@listentolist
Copy link
Contributor Author

When working on a script that uses connect.kak it is useful to be able to test parts of it by sending it to a connected REPL. It would be just convenient if I can simply use the repl-send-text command for that. Furthermore when having a connected terminal one can edit a long command in a scratch buffer and send it to the terminal.

@alexherbo2
Copy link
Collaborator

But when you use the REPL, you use the connect.kak’s features?

@listentolist
Copy link
Contributor Author

Yes. For example when writing a plugin that uses connect.kak commands I can run connect-repl bash in Kakoune and interactively test parts of it by sending a selection to the connected REPL.

@alexherbo2
Copy link
Collaborator

I hesitate to merge it. We have the > (connect-terminal) and $ (connect-shell) commands. I would like to unify the implementations and make a connected terminal or program a REPL at any time.

@alexherbo2
Copy link
Collaborator

@listentolist Can you test the latest commit 5ad59e5 and implementation?

@listentolist
Copy link
Contributor Author

Thank you! connect repl-new works as expected.

@alexherbo2
Copy link
Collaborator

Very happy with that.

We can now use the explicit:

connect tmux-terminal-horizontal

and all other flavors.

@useredsa
Copy link
Contributor

useredsa commented Nov 1, 2020

Yes. For example when writing a plugin that uses connect.kak commands I can run connect-repl bash in Kakoune and interactively test parts of it by sending a selection to the connected REPL.

I was also using it a lot. As a repl for bash scripts for example. :fifo is just great. Also as a connected repl for compilation: $(:get %opt{makecmd}) `:it`

@alexherbo2
Copy link
Collaborator

alexherbo2 commented Nov 23, 2020

I’ve added the @ (think kitty’s REPL) command, alongside the + popup command.

Example – Open a connected Janet REPL:

@ janet

Example – Open files with fzf in a popup window:

+ :fzf

@useredsa
Copy link
Contributor

I’ve added the @ (think kitty’s REPL) command, alongside the + popup command.

Example – Open a connected Janet REPL:

@ janet

Example – Open files with fzf in a popup window:

+ :fzf

Default popup handling is very nice. I had this in my kakrc:

    define-command fzf-files -override -params .. -file-completion -docstring 'Open files with fzf' %{
        terminal-set global kitty kitty-terminal-tab kitty-focus
        > :fzf-files %arg{@}
        terminal-set global x11 x11-terminal x11-focus
    }
    define-command fzf-buffers -override -params ..1 -buffer-completion -docstring 'Open buffers with fzf' %{
        terminal-set global kitty kitty-terminal-tab kitty-focus
        > :fzf-buffers %arg{@}
        terminal-set global x11 x11-terminal x11-focus
    }

Connected repls are also useful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants