From a9966aac3ab9ac75f3dfb6f081d6e8a64898fe7e Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Fri, 23 Jul 2021 15:31:57 -0500 Subject: [PATCH] open windows in popups instead of splits --- pkgs/kak-open/rc/kak-open.kak | 4 ++-- pkgs/kak-tree-grepper/rc/kak-tree-grepper.kak | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/kak-open/rc/kak-open.kak b/pkgs/kak-open/rc/kak-open.kak index e9d9c44..e3d7541 100644 --- a/pkgs/kak-open/rc/kak-open.kak +++ b/pkgs/kak-open/rc/kak-open.kak @@ -1,7 +1,7 @@ declare-option str similar_sort_path "similar-sort" define-command -docstring 'open files named similarly to the current buffer' open-similar %{ - tmux-terminal-horizontal sh -c %{ + tmux-terminal-impl 'display-popup -E' sh -c %{ set -euo pipefail FILE="$(git ls-files --others --cached --exclude-standard | $1 $2 | grep -Ev "^$2\$" | fzf --tiebreak index)" printf "evaluate-commands -client %s edit %s\n" "$3" "$FILE" | indiekak -p $4 @@ -9,7 +9,7 @@ define-command -docstring 'open files named similarly to the current buffer' ope } define-command -docstring 'open buffers named similarly to the current buffer' open-similar-buffer %{ - tmux-terminal-horizontal sh -c %{ + tmux-terminal-impl 'display-popup -E' sh -c %{ set -euo pipefail OPTIONS="" for OPTION in "${@:5}"; do diff --git a/pkgs/kak-tree-grepper/rc/kak-tree-grepper.kak b/pkgs/kak-tree-grepper/rc/kak-tree-grepper.kak index ebc9043..42e0312 100644 --- a/pkgs/kak-tree-grepper/rc/kak-tree-grepper.kak +++ b/pkgs/kak-tree-grepper/rc/kak-tree-grepper.kak @@ -2,7 +2,7 @@ declare-option str tree_grepper_path "tree-grepper" declare-option str tree_grepper_fzf_path "fzf" define-command -override -docstring "jump somewhere in an Elm file's definition outline" -params 0..1 outline-jump-elm %{ - tmux-terminal-horizontal sh -c %{ + tmux-terminal-impl 'display-popup -E' sh -c %{ set -euo pipefail # what tools do we have available? @@ -20,13 +20,13 @@ define-command -override -docstring "jump somewhere in an Elm file's definition # do the magic! QUERY="(function_declaration_left (lower_case_identifier)@function) (type_declaration (type) (upper_case_identifier)@type) (type_alias_declaration (type) (alias) (upper_case_identifier)@alias) (union_variant (upper_case_identifier)@constructor) (field_type (lower_case_identifier)@field) (lower_pattern)@pattern (exposed_type)@exposed_type (exposed_value)@exposed_value (as_clause (as) (upper_case_identifier)@module_alias) (port_annotation (port) (lower_case_identifier)@port)" - EDIT_LOCATION="$("$TREE_GREPPER" --language elm "$QUERY" "$FILE" | fzf --with-nth 4,5 --nth 2,1 --delimiter=: --query "$FZF_QUERY" --select-1 --preview 'bat --color=always -pp --highlight-line {2} --line-range "$(echo "x = $(echo {2}) - 7; if (x < 0) { 0 } else { x }" | bc):$(($(echo {2}) + 7))" {1}' --preview-window=down | cut -d : -f 1-3 | tr : ' ')" + EDIT_LOCATION="$("$TREE_GREPPER" --language elm "$QUERY" "$FILE" | fzf --with-nth 4,5 --nth 2,1 --delimiter=: --query "$FZF_QUERY" --select-1 --preview 'bat --color=always -pp --highlight-line {2} --line-range "$(echo "x = $(echo {2}) - 7; if (x < 0) { 0 } else { x }" | bc):$(($(echo {2}) + 7))" {1}' | cut -d : -f 1-3 | tr : ' ')" printf "evaluate-commands -client %s edit %s\n" "$CLIENT" "$EDIT_LOCATION" | indiekak -p "$SESSION" } -- %opt{tree_grepper_path} %opt{tree_grepper_fzf_path} %val{bufname} %arg{1} %val{client} %val{session} } define-command -override -docstring "jump somewhere in a Ruby file's definition outline" -params 0..1 outline-jump-ruby %{ - tmux-terminal-horizontal sh -c %{ + tmux-terminal-impl 'display-popup -E' sh -c %{ set -euo pipefail # what tools do we have available? @@ -44,13 +44,13 @@ define-command -override -docstring "jump somewhere in a Ruby file's definition # do the magic! QUERY="(module name: (_) @module) (class name: (_) @class) (method name: (_) @method) (singleton_method name: (_) @method) (assignment left: (_) @assignment) (operator_assignment left: (_) @assignment)" - EDIT_LOCATION="$("$TREE_GREPPER" --language ruby "$QUERY" "$FILE" | fzf --with-nth 4,5 --nth 2,1 --delimiter=: --query "$FZF_QUERY" --select-1 --preview 'bat --color=always -pp --highlight-line {2} --line-range "$(echo "x = $(echo {2}) - 7; if (x < 0) { 0 } else { x }" | bc):$(($(echo {2}) + 7))" {1}' --preview-window=down | cut -d : -f 1-3 | tr : ' ')" + EDIT_LOCATION="$("$TREE_GREPPER" --language ruby "$QUERY" "$FILE" | fzf --with-nth 4,5 --nth 2,1 --delimiter=: --query "$FZF_QUERY" --select-1 --preview 'bat --color=always -pp --highlight-line {2} --line-range "$(echo "x = $(echo {2}) - 7; if (x < 0) { 0 } else { x }" | bc):$(($(echo {2}) + 7))" {1}' | cut -d : -f 1-3 | tr : ' ')" printf "evaluate-commands -client %s edit %s\n" "$CLIENT" "$EDIT_LOCATION" | indiekak -p "$SESSION" } -- %opt{tree_grepper_path} %opt{tree_grepper_fzf_path} %val{bufname} %arg{1} %val{client} %val{session} } define-command -override -docstring "jump somewhere in an Haskell file's definition outline" -params 0..1 outline-jump-haskell %{ - tmux-terminal-horizontal sh -c %{ + tmux-terminal-impl 'display-popup -E' sh -c %{ set -euo pipefail # what tools do we have available? @@ -70,13 +70,13 @@ define-command -override -docstring "jump somewhere in an Haskell file's definit # import-hidings, so we just show the entire import statements. QUERY="(import)@import (signature)@signature (function name: (_)@function) (pat_name (_)@name) (adt (type)@data) (data_constructor)@constructor (newtype (type)@newtype) (newtype_constructor)@constructor (instance_head)@instance" - EDIT_LOCATION="$("$TREE_GREPPER" --language haskell "$QUERY" "$FILE" | fzf --with-nth 4.. --nth 2,1 --delimiter=: --query "$FZF_QUERY" --select-1 --preview 'bat --color=always -pp --highlight-line {2} --line-range "$(echo "x = $(echo {2}) - 7; if (x < 0) { 0 } else { x }" | bc):$(($(echo {2}) + 7))" {1}' --preview-window=down | cut -d : -f 1-3 | tr : ' ')" + EDIT_LOCATION="$("$TREE_GREPPER" --language haskell "$QUERY" "$FILE" | fzf --with-nth 4.. --nth 2,1 --delimiter=: --query "$FZF_QUERY" --select-1 --preview 'bat --color=always -pp --highlight-line {2} --line-range "$(echo "x = $(echo {2}) - 7; if (x < 0) { 0 } else { x }" | bc):$(($(echo {2}) + 7))" {1}' | cut -d : -f 1-3 | tr : ' ')" printf "evaluate-commands -client %s edit %s\n" "$CLIENT" "$EDIT_LOCATION" | indiekak -p "$SESSION" } -- %opt{tree_grepper_path} %opt{tree_grepper_fzf_path} %val{bufname} %arg{1} %val{client} %val{session} } define-command -override -docstring "jump somewhere in an Rust file's definition outline" -params 0..1 outline-jump-rust %{ - tmux-terminal-horizontal sh -c %{ + tmux-terminal-impl 'display-popup -E' sh -c %{ set -euo pipefail # what tools do we have available? @@ -94,7 +94,7 @@ define-command -override -docstring "jump somewhere in an Rust file's definition # do the magic! QUERY="(use_declaration)@use (function_item _ (_) @function) (struct_item (type_identifier) @struct) (field_declaration)@field (parameter) (let_declaration)@let (enum_item (type_identifier)@enum) (enum_variant)" - EDIT_LOCATION="$("$TREE_GREPPER" --language rust "$QUERY" "$FILE" | fzf --with-nth 4,5 --nth 2,1 --delimiter=: --query "$FZF_QUERY" --select-1 --preview 'bat --color=always -pp --highlight-line {2} --line-range "$(echo "x = $(echo {2}) - 7; if (x < 0) { 0 } else { x }" | bc):$(($(echo {2}) + 7))" {1}' --preview-window=down | cut -d : -f 1-3 | tr : ' ')" + EDIT_LOCATION="$("$TREE_GREPPER" --language rust "$QUERY" "$FILE" | fzf --with-nth 4,5 --nth 2,1 --delimiter=: --query "$FZF_QUERY" --select-1 --preview 'bat --color=always -pp --highlight-line {2} --line-range "$(echo "x = $(echo {2}) - 7; if (x < 0) { 0 } else { x }" | bc):$(($(echo {2}) + 7))" {1}' | cut -d : -f 1-3 | tr : ' ')" printf "evaluate-commands -client %s edit %s\n" "$CLIENT" "$EDIT_LOCATION" | indiekak -p "$SESSION" } -- %opt{tree_grepper_path} %opt{tree_grepper_fzf_path} %val{bufname} %arg{1} %val{client} %val{session} }