18 releases (4 breaking)

0.5.1 Oct 24, 2023
0.5.0 Oct 24, 2023
0.4.4 Oct 19, 2023
0.4.1 Jul 15, 2023
0.1.0 Jun 4, 2023

#1511 in Command line utilities

Download history 1/week @ 2024-02-15 6/week @ 2024-02-22 3/week @ 2024-02-29 3/week @ 2024-03-07 2/week @ 2024-03-14 44/week @ 2024-03-28 11/week @ 2024-04-04

55 downloads per month

CC0 license

40KB
1.5K SLoC

popup.kak

Kakoune popups for running ephemeral commands.

Demo

asciicast

Installation

Prerequisites

tmux must be installed. It is not required that kakoune runs under tmux, just that it's installed.

  1. Install the binary with cargo install kak-popup.
  2. Add evaluate-commands %sh{kak-popup init} to your kakrc.

Manual

  1. Install the plugin using nix or manually place rc/popup.kak into your autoload directory.
  2. Install kak-popup with cargo or nix.

Usage

Within kakoune

popup [<switches>] <shell-command> <shell-arg1>...: create a modal running
<shell-command> in a terminal. Switches are prefixed with --. The command
and arguments can be passed as a single string or as a series of arguments,
for example, the following two invocations are equivalent:

  popup --title open %{fish -c "some fish command"}

  popup --title open -- fish -c "some fish command"

Popups can be exited using <c-space>.

Switches:
  --kak-script <commands> kakoune script to execute after the shell-command
                          exits, providing any standard output through
                          %opt{popup_output}
  --title <title>         the title of the modal
  --input <input>         input passed as the stdin of <shell-command>
  --on-err <on-err>       what to do on non-zero exit status
            warn          show a modal with stderr
            dismiss       dismiss modal without running KAK_SCRIPT
            ignore        ignore status and always run KAK_SCRIPT

Examples

These are some possible ways to use popup.kak:

# open a shell
popup fish

# a file picker
popup --title open --kak-script %{edit %opt{popup_output}} -- fzf

Dependencies

~8–20MB
~281K SLoC