summaryrefslogtreecommitdiff
path: root/rc
diff options
context:
space:
mode:
authorAlex Leferry 2 <alexherbo2@gmail.com>2020-08-13 18:21:25 +0200
committerAlex Leferry 2 <alexherbo2@gmail.com>2020-08-13 21:33:41 +0200
commit7fe2efc9bed557373e9c9cfe860d8e684dfd56bc (patch)
tree90e2a1c628b6ccc05c04415011255200c312f746 /rc
parentdefb50fc0ace0195d12e804993b1b74343024ada (diff)
Overhaul
Diffstat (limited to 'rc')
-rw-r--r--rc/connect.kak131
-rw-r--r--rc/env/git.env2
-rw-r--r--rc/env/kakoune.env4
-rw-r--r--rc/env/overrides.env9
-rw-r--r--rc/modules/broot.kak3
-rw-r--r--rc/modules/dmenu.kak15
-rw-r--r--rc/modules/dolphin.kak5
-rw-r--r--rc/modules/fzf.kak15
-rw-r--r--rc/modules/lf.kak3
-rw-r--r--rc/modules/nnn.kak3
-rw-r--r--rc/modules/rofi.kak15
-rw-r--r--rc/modules/wofi.kak15
l---------rc/paths/aliases/:a1
l---------rc/paths/aliases/:b1
l---------rc/paths/aliases/:e1
l---------rc/paths/aliases/a2
l---------rc/paths/aliases/b2
l---------rc/paths/aliases/e2
-rwxr-xr-xrc/paths/commands/:attach4
-rwxr-xr-xrc/paths/commands/:buffer7
-rwxr-xr-xrc/paths/commands/:cd4
-rwxr-xr-xrc/paths/commands/:edit35
-rwxr-xr-xrc/paths/commands/:get7
-rwxr-xr-xrc/paths/commands/:it3
-rwxr-xr-xrc/paths/commands/:ls6
-rwxr-xr-xrc/paths/commands/:send6
-rwxr-xr-xrc/paths/commands/attach16
-rwxr-xr-xrc/paths/commands/buffer38
-rwxr-xr-xrc/paths/commands/cd!4
-rwxr-xr-xrc/paths/commands/edit75
-rwxr-xr-xrc/paths/commands/get10
-rwxr-xr-xrc/paths/commands/it5
-rwxr-xr-xrc/paths/commands/send11
33 files changed, 188 insertions, 272 deletions
diff --git a/rc/connect.kak b/rc/connect.kak
index fa25239..2c7207b 100644
--- a/rc/connect.kak
+++ b/rc/connect.kak
@@ -1,91 +1,98 @@
+# Save the connect path
declare-option -hidden str connect_path %sh(dirname "$kak_source")
-declare-option str connect_environment
-
-hook global ModuleLoaded connect %{
- hook global ModuleLoaded terminal-mode %{
- require-module connect-terminal-mode
- }
- hook global KakBegin .* %{
- require-module connect-terminal-mode
- }
-}
provide-module connect %{
+ # Modules
require-module prelude
- declare-option -docstring 'Attach to terminal' bool connect_attach no
- declare-option -docstring 'Path to connect data' str connect_data_path %sh{
- # Environment variables
- XDG_DATA_HOME=${XDG_DATA_HOME:-~/.local/share}
- DATA=$XDG_DATA_HOME/kak/connect
- printf '%s' "$DATA"
- }
- define-command connect-terminal -params .. -shell-completion -docstring 'Connect a terminal' %{
+
+ # Options
+ declare-option str connect_environment
+
+ # Commands
+ define-command connect-terminal -params .. -shell-completion -docstring 'Open a new terminal' %{
terminal sh -c %{
- kak_opt_prelude=$1 kak_opt_connect_path=$2 kak_opt_connect_data_path=$3 kak_opt_connect_attach=$4 kak_opt_connect_environment=$5 kak_session=$6 kak_client=$7 kak_client_env_SHELL=$8 kak_sh_pwd=$9
+ kak_opt_prelude=$1
+ kak_opt_connect_path=$2
+ kak_opt_connect_environment=$3
+ kak_session=$4
+ kak_client=$5
+
. "$kak_opt_connect_path/env/default.env"
. "$kak_opt_connect_path/env/overrides.env"
. "$kak_opt_connect_path/env/kakoune.env"
. "$kak_opt_connect_path/env/git.env"
+
eval "$kak_opt_connect_environment"
- shift 9
- # Start the shell in the current working directory.
- cd "$kak_sh_pwd"
- "${@:-$SHELL}"
- } -- %opt{prelude} %opt{connect_path} %opt{connect_data_path} %opt{connect_attach} %opt{connect_environment} %val{session} %val{client} %val{client_env_SHELL} %sh{pwd} %arg{@}
+
+ shift 5
+
+ [ "$1" ] && "$@" || "$SHELL"
+ } -- \
+ %opt{prelude} \
+ %opt{connect_path} \
+ %opt{connect_environment} \
+ %val{session} \
+ %val{client} \
+ %arg{@}
}
- define-command connect-shell -params 1.. -shell-completion -docstring 'Connect a shell' %{
+
+ define-command connect-shell -params 1.. -shell-completion -docstring 'Execute commands in a shell' %{
nop %sh{
- # kak_opt_prelude kak_opt_connect_path kak_opt_connect_data_path kak_opt_connect_attach kak_opt_connect_environment kak_session kak_client kak_client_env_SHELL
+ # kak_opt_prelude
+ # kak_opt_connect_path
+ # kak_opt_connect_environment
+ # kak_session
+ # kak_client
+
. "$kak_opt_connect_path/env/default.env"
. "$kak_opt_connect_path/env/overrides.env"
. "$kak_opt_connect_path/env/kakoune.env"
. "$kak_opt_connect_path/env/git.env"
+
eval "$kak_opt_connect_environment"
+
setsid sh -c "$@" < /dev/null > /dev/null 2>&1 &
}
}
- define-command connect-detach -params .. -shell-completion -docstring 'Write the given shell command to your connect data path and detach the client' %{
- evaluate-commands %sh{
- mkdir -p "$kak_opt_connect_data_path"
- }
- echo -to-file "%opt{connect_data_path}/script.sh" -quoting shell %arg{@}
- # Delete the script
- hook -once global ClientCreate %val{client} %{
- nop %sh{
- rm -f "$kak_opt_connect_data_path/script.sh~"
- }
- }
- quit!
- }
- alias global t connect-terminal
- alias global $ connect-shell
- alias global d connect-detach
-}
-provide-module connect-terminal-mode %{
- require-module connect
- require-module terminal-mode
+ define-command connect-detach -params .. -shell-completion -docstring 'Write an attachable program to connect.sh and detach the client' %{
+ echo -to-file "%val{client_env_PWD}/connect.sh" -quoting shell sh -c %{
+ rm connect.sh
- declare-user-mode connect
+ kak_opt_prelude=$1
+ kak_opt_connect_path=$2
+ kak_opt_connect_environment=$3
+ kak_session=$4
+ kak_server_working_directory=$5
- # Set the terminal to :connect-detach.
- # connect-set-detach <scope>
- define-command -hidden connect-set-detach -params 1 %{
- set-option %arg{1} connect_attach yes
- alias %arg{1} terminal connect-detach
- }
+ . "$kak_opt_connect_path/env/default.env"
+ . "$kak_opt_connect_path/env/overrides.env"
+ . "$kak_opt_connect_path/env/kakoune.env"
+ . "$kak_opt_connect_path/env/git.env"
+
+ eval "$kak_opt_connect_environment"
+
+ shift 5
- # Reset terminal settings.
- # connect-set-terminal <scope>
- define-command -hidden connect-set-terminal -params 1 %{
- set-option %arg{1} connect_attach no
- enter-user-mode terminal
+ cd "$kak_server_working_directory"
+
+ [ "$1" ] && "$@" || "$SHELL"
+ } -- \
+ %opt{prelude} \
+ %opt{connect_path} \
+ %opt{connect_environment} \
+ %val{session} \
+ %sh{pwd} \
+ %arg{@}
+
+ # Detach the client
+ quit!
}
- # Mappings
- map global terminal c ': enter-user-mode connect<ret>' -docstring 'connect'
- map global connect d ': connect-set-detach global<ret>' -docstring 'Detach'
- map global connect r ': connect-set-terminal global<ret>' -docstring 'Reset'
+ # Aliases
+ alias global > connect-terminal
+ alias global $ connect-shell
+ alias global & connect-detach
}
require-module connect
diff --git a/rc/env/git.env b/rc/env/git.env
index 83ff9c0..d90e610 100644
--- a/rc/env/git.env
+++ b/rc/env/git.env
@@ -1 +1 @@
-export GIT_EDITOR='edit -wait'
+export GIT_EDITOR=kak
diff --git a/rc/env/kakoune.env b/rc/env/kakoune.env
index 23b915a..832a02d 100644
--- a/rc/env/kakoune.env
+++ b/rc/env/kakoune.env
@@ -2,7 +2,3 @@ export IN_KAKOUNE_CONNECT=1
export KAKOUNE_SESSION=$kak_session
export KAKOUNE_CLIENT=$kak_client
export KAKOUNE_PRELUDE=$kak_opt_prelude
-export KAKOUNE_CONNECT=$kak_opt_connect_path
-export KAKOUNE_CONNECT_DATA=$kak_opt_connect_data_path
-export KAKOUNE_CONNECT_SCRIPT=$kak_opt_connect_data_path/script.sh
-export KAKOUNE_CONNECT_ATTACH=$kak_opt_connect_attach
diff --git a/rc/env/overrides.env b/rc/env/overrides.env
index d16cf9d..1e756e0 100644
--- a/rc/env/overrides.env
+++ b/rc/env/overrides.env
@@ -1,5 +1,4 @@
-# aliases, commands, paths, tools
-PATH=$kak_opt_connect_path/paths/aliases:$kak_opt_connect_path/paths/commands:$PATH:$kak_opt_connect_path/paths/tools
-SHELL=$kak_client_env_SHELL
-VISUAL=edit
-EDITOR=edit
+paths=$kak_opt_connect_path/paths
+PATH=$paths/aliases:$paths/commands:$PATH:$paths/tools
+VISUAL=:edit
+EDITOR=:edit
diff --git a/rc/modules/broot.kak b/rc/modules/broot.kak
index a9a47e6..76f00b4 100644
--- a/rc/modules/broot.kak
+++ b/rc/modules/broot.kak
@@ -3,7 +3,8 @@
provide-module connect-broot %{
require-module connect
+
define-command broot -params .. -file-completion -docstring 'Open files with Broot' %{
- connect-terminal broot %arg{@}
+ > broot %arg{@}
}
}
diff --git a/rc/modules/dmenu.kak b/rc/modules/dmenu.kak
index c34c270..6be98bb 100644
--- a/rc/modules/dmenu.kak
+++ b/rc/modules/dmenu.kak
@@ -6,15 +6,14 @@
provide-module connect-dmenu %{
require-module connect
- define-command dmenu-files -params .. -file-completion -docstring 'Open selected files with Rofi' %{
- connect-shell %{
- edit $(fd --type file . "$@" | dmenu -l 20 -i -p 'Open selected files')
- } -- %arg{@}
+
+ define-command dmenu-files -params .. -file-completion -docstring 'Open files with dmenu' %{
+ $ %(:edit $(fd --type file . "$@" | dmenu -l 20 -i -p 'Open files')) -- %arg{@}
}
- define-command dmenu-buffers -params ..1 -buffer-completion -docstring 'Open selected buffers with Rofi' %{
- connect-shell %{
- buffer $(buffer | grep -F "$1" | dmenu -l 20 -i -p 'Open selected buffers')
- } -- %arg{@}
+
+ define-command dmenu-buffers -params ..1 -buffer-completion -docstring 'Open buffers with dmenu' %{
+ $ %(:buffer $(:ls | grep -F "$1" | dmenu -l 20 -i -p 'Open buffers')) -- %arg{@}
}
+
alias global dmenu dmenu-files
}
diff --git a/rc/modules/dolphin.kak b/rc/modules/dolphin.kak
index d68e934..6917bc1 100644
--- a/rc/modules/dolphin.kak
+++ b/rc/modules/dolphin.kak
@@ -3,9 +3,8 @@
provide-module connect-dolphin %{
require-module connect
+
define-command dolphin -params .. -file-completion -docstring 'Open files with Dolphin' %{
- connect-shell %{
- dolphin "${@:-.}"
- } -- %arg{@}
+ $ %(dolphin "${@:-.}") -- %arg{@}
}
}
diff --git a/rc/modules/fzf.kak b/rc/modules/fzf.kak
index f03fa6f..e6e120d 100644
--- a/rc/modules/fzf.kak
+++ b/rc/modules/fzf.kak
@@ -6,15 +6,14 @@
provide-module connect-fzf %{
require-module connect
- define-command fzf-files -params .. -file-completion -docstring 'Open selected files with fzf' %{
- connect-terminal sh -c %{
- edit $(fd --type file . "$@" | fzf)
- } -- %arg{@}
+
+ define-command fzf-files -params .. -file-completion -docstring 'Open files with fzf' %{
+ > sh -c %(:edit $(fd --type file . "$@" | fzf --prompt='(f)>')) -- %arg{@}
}
- define-command fzf-buffers -params ..1 -buffer-completion -docstring 'Open selected buffers with fzf' %{
- connect-terminal sh -c %{
- buffer $(buffer | grep -F "$1" | fzf)
- } -- %arg{@}
+
+ define-command fzf-buffers -params ..1 -buffer-completion -docstring 'Open buffers with fzf' %{
+ > sh -c %(:buffer $(:ls | grep -F "$1" | fzf --prompt='(b)>')) -- %arg{@}
}
+
alias global fzf fzf-files
}
diff --git a/rc/modules/lf.kak b/rc/modules/lf.kak
index 9fc500f..7a8c319 100644
--- a/rc/modules/lf.kak
+++ b/rc/modules/lf.kak
@@ -3,7 +3,8 @@
provide-module connect-lf %{
require-module connect
+
define-command lf -params .. -file-completion -docstring 'Open files with lf' %{
- connect-terminal lf %arg{@}
+ > lf %arg{@}
}
}
diff --git a/rc/modules/nnn.kak b/rc/modules/nnn.kak
index 8305949..e78b6e9 100644
--- a/rc/modules/nnn.kak
+++ b/rc/modules/nnn.kak
@@ -3,7 +3,8 @@
provide-module connect-nnn %{
require-module connect
+
define-command nnn -params .. -file-completion -docstring 'Open files with nnn' %{
- connect-terminal nnn %arg{@}
+ > nnn %arg{@}
}
}
diff --git a/rc/modules/rofi.kak b/rc/modules/rofi.kak
index f6befbd..6359f75 100644
--- a/rc/modules/rofi.kak
+++ b/rc/modules/rofi.kak
@@ -6,15 +6,14 @@
provide-module connect-rofi %{
require-module connect
- define-command rofi-files -params .. -file-completion -docstring 'Open selected files with Rofi' %{
- connect-shell %{
- edit $(fd --type file . "$@" | rofi -dmenu -i -p 'Open selected files')
- } -- %arg{@}
+
+ define-command rofi-files -params .. -file-completion -docstring 'Open files with Rofi' %{
+ $ %(:edit $(fd --type file . "$@" | rofi -dmenu -i -p 'Open files')) -- %arg{@}
}
- define-command rofi-buffers -params ..1 -buffer-completion -docstring 'Open selected buffers with Rofi' %{
- connect-shell %{
- buffer $(buffer | grep -F "$1" | rofi -dmenu -i -p 'Open selected buffers')
- } -- %arg{@}
+
+ define-command rofi-buffers -params ..1 -buffer-completion -docstring 'Open buffers with Rofi' %{
+ $ %(:buffer $(:ls | grep -F "$1" | rofi -dmenu -i -p 'Open buffers')) -- %arg{@}
}
+
alias global rofi rofi-files
}
diff --git a/rc/modules/wofi.kak b/rc/modules/wofi.kak
index 527306f..f567adc 100644
--- a/rc/modules/wofi.kak
+++ b/rc/modules/wofi.kak
@@ -6,15 +6,14 @@
provide-module connect-wofi %{
require-module connect
- define-command wofi-files -params .. -file-completion -docstring 'Open selected files with Wofi' %{
- connect-shell %{
- edit $(fd --type file . "$@" | wofi --show dmenu --prompt 'Open selected files')
- } -- %arg{@}
+
+ define-command wofi-files -params .. -file-completion -docstring 'Open files with Wofi' %{
+ $ %(:edit $(fd --type file . "$@" | wofi --dmenu --prompt 'Open files')) -- %arg{@}
}
- define-command wofi-buffers -params ..1 -buffer-completion -docstring 'Open selected buffers with Wofi' %{
- connect-shell %{
- buffer $(buffer | grep -F "$1" | wofi --show dmenu --prompt 'Open selected buffers')
- } -- %arg{@}
+
+ define-command wofi-buffers -params ..1 -buffer-completion -docstring 'Open buffers with Wofi' %{
+ $ %(:buffer $(:ls | grep -F "$1" | wofi --dmenu --prompt 'Open buffers')) -- %arg{@}
}
+
alias global wofi wofi-files
}
diff --git a/rc/paths/aliases/:a b/rc/paths/aliases/:a
new file mode 120000
index 0000000..aa48667
--- /dev/null
+++ b/rc/paths/aliases/:a
@@ -0,0 +1 @@
+../commands/:attach \ No newline at end of file
diff --git a/rc/paths/aliases/:b b/rc/paths/aliases/:b
new file mode 120000
index 0000000..85d8725
--- /dev/null
+++ b/rc/paths/aliases/:b
@@ -0,0 +1 @@
+../commands/:buffer \ No newline at end of file
diff --git a/rc/paths/aliases/:e b/rc/paths/aliases/:e
new file mode 120000
index 0000000..75c9534
--- /dev/null
+++ b/rc/paths/aliases/:e
@@ -0,0 +1 @@
+../commands/:edit \ No newline at end of file
diff --git a/rc/paths/aliases/a b/rc/paths/aliases/a
index ad2cb98..aa48667 120000
--- a/rc/paths/aliases/a
+++ b/rc/paths/aliases/a
@@ -1 +1 @@
-../commands/attach \ No newline at end of file
+../commands/:attach \ No newline at end of file
diff --git a/rc/paths/aliases/b b/rc/paths/aliases/b
index daf79f2..85d8725 120000
--- a/rc/paths/aliases/b
+++ b/rc/paths/aliases/b
@@ -1 +1 @@
-../commands/buffer \ No newline at end of file
+../commands/:buffer \ No newline at end of file
diff --git a/rc/paths/aliases/e b/rc/paths/aliases/e
index 1cb50b6..75c9534 120000
--- a/rc/paths/aliases/e
+++ b/rc/paths/aliases/e
@@ -1 +1 @@
-../commands/edit \ No newline at end of file
+../commands/:edit \ No newline at end of file
diff --git a/rc/paths/commands/:attach b/rc/paths/commands/:attach
new file mode 100755
index 0000000..2894021
--- /dev/null
+++ b/rc/paths/commands/:attach
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Reattach to the session.
+kak -c "$KAKOUNE_SESSION" "$@"
diff --git a/rc/paths/commands/:buffer b/rc/paths/commands/:buffer
new file mode 100755
index 0000000..0d63f2a
--- /dev/null
+++ b/rc/paths/commands/:buffer
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Open buffer
+:send buffer "$@"
+
+# Focus back the client
+:send focus
diff --git a/rc/paths/commands/:cd b/rc/paths/commands/:cd
new file mode 100755
index 0000000..a936e3c
--- /dev/null
+++ b/rc/paths/commands/:cd
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Sync to your current working directory
+:send cd "$PWD"
diff --git a/rc/paths/commands/:edit b/rc/paths/commands/:edit
new file mode 100755
index 0000000..65c26d9
--- /dev/null
+++ b/rc/paths/commands/:edit
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+. "$KAKOUNE_PRELUDE"
+
+# Skip options
+[ "$1" = '--' ] && shift
+
+# Open files
+commands=$(
+ while [ "$1" ]; do
+ file=$(realpath "$1")
+ case "$2" in
+ '+'*':'*)
+ line=${2#+}; line=${line%:*}
+ column=${2#*:}
+ shift 2
+ kak_escape edit "$file" "$line" "$column"
+ ;;
+ '+'*)
+ line=${2#+}
+ shift 2
+ kak_escape edit "$file" "$line"
+ ;;
+ *)
+ shift 1
+ kak_escape edit "$file"
+ ;;
+ esac
+ done
+)
+
+:send "$commands"
+
+# Focus back the client
+:send focus
diff --git a/rc/paths/commands/:get b/rc/paths/commands/:get
new file mode 100755
index 0000000..13bf2fc
--- /dev/null
+++ b/rc/paths/commands/:get
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# Get a value from a client
+mkfifo connect.fifo
+trap 'rm connect.fifo' EXIT
+:send echo -to-file "$PWD/connect.fifo" "$@"
+cat connect.fifo
diff --git a/rc/paths/commands/:it b/rc/paths/commands/:it
new file mode 100755
index 0000000..17cc516
--- /dev/null
+++ b/rc/paths/commands/:it
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+:get %val{buffile}
diff --git a/rc/paths/commands/:ls b/rc/paths/commands/:ls
new file mode 100755
index 0000000..e41719d
--- /dev/null
+++ b/rc/paths/commands/:ls
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# List buffers
+kak_quoted_buflist=$(:get %val{buflist})
+eval "set -- $kak_quoted_buflist"
+printf '%s\n' "$@"
diff --git a/rc/paths/commands/:send b/rc/paths/commands/:send
new file mode 100755
index 0000000..86f90a6
--- /dev/null
+++ b/rc/paths/commands/:send
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. "$KAKOUNE_PRELUDE"
+
+# Send commands to the client
+kak_escape evaluate-commands -try-client "$KAKOUNE_CLIENT" "$@" | kak -p "$KAKOUNE_SESSION"
diff --git a/rc/paths/commands/attach b/rc/paths/commands/attach
deleted file mode 100755
index b7f1471..0000000
--- a/rc/paths/commands/attach
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-
-# Attach a command ran from Kakoune with :connect-detach.
-
-if test -e "$KAKOUNE_CONNECT_SCRIPT"; then
- mv "$KAKOUNE_CONNECT_SCRIPT" "$KAKOUNE_CONNECT_SCRIPT~"
- sh "$KAKOUNE_CONNECT_SCRIPT~"
- # Note:
- # This script is deleted by :connect-detach when reattaching to the session.
- # If the script still exists, sh <connect-script> did not reattach.
- # Mitigate the need to manually reattach.
- if test -e "$KAKOUNE_CONNECT_SCRIPT~"; then
- rm -f "$KAKOUNE_CONNECT_SCRIPT~"
- edit
- fi
-fi
diff --git a/rc/paths/commands/buffer b/rc/paths/commands/buffer
deleted file mode 100755
index 46b594e..0000000
--- a/rc/paths/commands/buffer
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-# Open buffers. With no argument, list buffers instead.
-
-. "$KAKOUNE_PRELUDE"
-
-main() {
- if test $# -eq 0; then
- list
- else
- edit "$@"
- # Try to attach a connect terminal command
- attach
- fi
-}
-
-list() {
- kak_quoted_buflist=$(get '%val{buflist}')
- eval "set -- $kak_quoted_buflist"
- printf '%s\n' "$@"
-}
-
-edit() {
- commands=''
- for buffer do
- kak_quoted_buffer=$(kak_escape "$buffer")
- commands="buffer $kak_quoted_buffer; $commands"
- done
- # Attach to terminal.
- # Ensure there is a terminal.
- if test -t 1 -a "$KAKOUNE_CONNECT_ATTACH" = true; then
- kak -c "$KAKOUNE_SESSION" -e "$commands"
- else
- send "$commands"
- fi
-}
-
-main "$@"
diff --git a/rc/paths/commands/cd! b/rc/paths/commands/cd!
deleted file mode 100755
index f2e6304..0000000
--- a/rc/paths/commands/cd!
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-# Sync the Kakoune working directory to your current working directory.
-send cd "$PWD"
diff --git a/rc/paths/commands/edit b/rc/paths/commands/edit
deleted file mode 100755
index f34d228..0000000
--- a/rc/paths/commands/edit
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-
-# Open files.
-
-. "$KAKOUNE_PRELUDE"
-
-# Option parser
-# For the simplicity of parsing, we only parse the first argument.
-wait=false
-case "$1" in
- -wait) wait=true; shift ;;
- --) shift; break ;;
-esac
-
-commands=''
-regex=''
-while test $# -gt 0; do
- file=$(realpath "$1")
- kak_quoted_file=$(kak_escape "$file")
- # Optional coordinates
- case "$2" in
- +*:*)
- line=${2#+}; line=${line%:*}
- column=${2#*:}
- shift 2
- commands="edit $kak_quoted_file $line $column; $commands"
- ;;
- +*)
- line=${2#+}
- shift 2
- commands="edit $kak_quoted_file $line; $commands"
- ;;
- *)
- shift
- commands="edit $kak_quoted_file; $commands"
- ;;
- esac
- regex="${regex}|\\Q${file}\\E"
-done
-# Focus back the client on open.
-commands="$commands; focus"
-regex=${regex#|}
-kak_quoted_regex=$(kak_escape "$regex")
-
-# Attach to terminal.
-# Note: Ensure there is a terminal.
-# Motivation: GUI apps can connect to the client.
-# Example: :connect-shell dolphin
-if test -t 1 -a "$KAKOUNE_CONNECT_ATTACH" = true; then
- kak -c "$KAKOUNE_SESSION" -e "$commands"
-else
- send "$commands"
-fi
-
-if test "$wait" = true; then
- state=$(mktemp -d)
- trap 'rm -Rf "$state"' EXIT
- mkfifo "$state/status"
- send "
- hook -group connect-detach global BufWritePost $kak_quoted_regex %{
- remove-hooks global connect-detach
- delete-buffer %val{hook_param}
- echo -to-file $state/status 0
- }
- hook -group connect-detach global BufClose $kak_quoted_regex %{
- remove-hooks global connect-detach
- echo -to-file $state/status 1
- }
- "
- read status < "$state/status"
- exit "$status"
-fi
-
-# Try to attach a connect terminal command
-attach
diff --git a/rc/paths/commands/get b/rc/paths/commands/get
deleted file mode 100755
index f9ef02d..0000000
--- a/rc/paths/commands/get
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-# Get a property.
-
-state=$(mktemp -d)
-trap 'rm -Rf "$state"' EXIT
-mkfifo "$state/fifo"
-
-send echo -to-file "$state/fifo" "$@"
-cat "$state/fifo"
diff --git a/rc/paths/commands/it b/rc/paths/commands/it
deleted file mode 100755
index 92c5869..0000000
--- a/rc/paths/commands/it
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-
-# Get the current buffer.
-
-get %val{buffile}
diff --git a/rc/paths/commands/send b/rc/paths/commands/send
deleted file mode 100755
index f107e71..0000000
--- a/rc/paths/commands/send
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-# Send a command.
-
-. "$KAKOUNE_PRELUDE"
-
-if test -n "$KAKOUNE_SESSION" -a -n "$KAKOUNE_CLIENT"; then
- kak_escape evaluate-commands -try-client "$KAKOUNE_CLIENT" "$@" | kak -p "$KAKOUNE_SESSION"
-elif test -n "$KAKOUNE_SESSION"; then
- kak -c "$KAKOUNE_SESSION" -e "$@"
-fi