Skip to content
Kakoune extension to connect a program to the current client
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
rc Fix indentation of break May 2, 2019
CONTRIBUTING Fix typo Apr 21, 2019
README.md README: Add example for Rofi Apr 26, 2019
UNLICENSE Initial commit Nov 12, 2017

README.md

Connect

IRC

Usage | Documentation | Contributing

Kakoune extension to connect a program to the current client.

asciicast

Installation

Pathogen

pathogen-infect /home/user/repositories/github.com/alexherbo2/connect.kak

Optional – To install globally:

ln -s $PWD/rc/commands/edit ~/.local/bin/kak-connect

Usage

You can use :connect to create a new terminal with [e]dit, [b]uffer and VISUAL, EDITOR connected to the client.

If you open a file using the shell command edit or an application using the default editor, the file will be opened in the client from where :connect was executed.

You can also open a buffer by using the buffer command (or its alias b). With no argument, buffer will list the available buffers.

If in your workflow you use one session for all projects, it can be useful to have Connect installed globally.

Example – Shell configuration to default in Othala session:

KAKOUNE_SESSION=othala
alias kak=kak-connect

Examples

:connect # Spawn a terminal

From that terminal:

$ edit example.txt

You can also run the shell commands from Kakoune.

For example, ranger and fzfᶠᵈ integration can be:

define-command ranger -params .. -file-completion %(connect ranger %arg(@))
define-command fzf-files -params .. -file-completion %(connect edit $(fd --type file . %arg(@) | fzf))
alias global fzf fzf-files
define-command fzf-buffers %(connect buffer $(buffer | fzf))

To use with Rofiᶠᵈ:

define-command rofi-files -params .. -file-completion %(connect-shell edit $(fd --type file . %arg(@) | rofi -dmenu -p "'Select files'"))
alias global rofi rofi-files

Commands

  • connect-shell [program] [arguments]: Run a shell with [e]dit, [b]uffer and VISUAL, EDITOR connected to the current client
  • connect-terminal [program] [arguments]: Create a new terminal with [e]dit, [b]uffer and VISUAL, EDITOR connected to the current client

Aliases

  • connectconnect-terminal

Shell environment

  • VISUAL=edit
  • EDITOR=edit
  • [e]dit [files]: Open files in the client from where :connect was executed
  • [b]uffer [buffers]: Get buffer list or open buffers in the client from where :connect was executed
  • get {type} {name}: Get a value in the client from where :connect was executed
  • send {commands}: Send commands in the client from where :connect was executed

Options

  • connect_shell: Shell program to be used as default entry-point (Default: SHELL)

Credits

Thanks to @occivink ❤️ for his work on the :terminal command to abstract the various windowing systems.

You can’t perform that action at this time.