aboutsummaryrefslogtreecommitdiff
path: root/tmux-tsunami/modules/common/findFile.nix
diff options
context:
space:
mode:
authorCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-05-22 10:23:58 -0500
committerCollin Williams <96917990+bluedragon1221@users.noreply.github.com>2026-05-22 10:24:06 -0500
commit35af4bab99da94845ebd6e9b2efae6a544d39b35 (patch)
tree47c6f76b47f1012932729c9f693316df1512197a /tmux-tsunami/modules/common/findFile.nix
parent2e0c6ccbbc76cc36e92128aea44e4bdd4e5c3d0a (diff)
LOTS OF TEMP STUFF
Diffstat (limited to 'tmux-tsunami/modules/common/findFile.nix')
-rw-r--r--tmux-tsunami/modules/common/findFile.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/tmux-tsunami/modules/common/findFile.nix b/tmux-tsunami/modules/common/findFile.nix
new file mode 100644
index 0000000..3d08603
--- /dev/null
+++ b/tmux-tsunami/modules/common/findFile.nix
@@ -0,0 +1,66 @@
+{
+ pkgs,
+ config,
+ lib,
+ tsunamiLib,
+ std,
+ ...
+}: let
+ inherit (tsunamiLib) scriptPath filePath;
+ cfg = config.tsunami.findFile;
+in {
+ options = {
+ tsunami.findFile = {
+ enable = lib.mkOption {
+ type = lib.types.bool;
+ default = false;
+ };
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ tsunami.keys.leader = [
+ {
+ name = "Find File";
+ key = "C-f";
+ exec = ''run-shell "${scriptPath "minibuffer"} -d '#{?@default-path,#{@default-path},#{pane_current_path}}' '${scriptPath "find-file"}'"'';
+ }
+ ];
+ tsunami.scripts = {
+ "minibuffer" = ''
+ window_height="$(tmux display -p '#{window_height}')"
+ tmux display-popup -EB \
+ -w 100% -h 16 \
+ -x 0 -y "$(($window_height + 1))" \
+ "$@"
+ '';
+
+ "find-file" = ''${pkgs.broot}/bin/broot --conf ${filePath "broot_find_file.toml"}'';
+ };
+
+ tsunami.files."broot_find_file.toml" = std.serde.toTOML {
+ imports = ["~/.config/broot/conf.hjson"];
+ quit_on_last_cancel = true;
+ verbs = [
+ {
+ invocation = "tmux-split";
+ external = ["bash" "-c" ''${scriptPath "split"} -c "#{?@default-path,#{@default-path},#{pane_current_path}}" "$EDITOR '{file}'"''];
+ key = "ctrl-s";
+ apply_to = "file";
+ leave_broot = true;
+ }
+ {
+ invocation = "tmux-window";
+ external = ["tmux" "new-window" "-c" "#{?@default-path,#{@default-path},#{pane_current_path}}" "$EDITOR '{file}'"];
+ key = "ctrl-w";
+ apply_to = "file";
+ leave_broot = true;
+ }
+ {
+ key = "enter";
+ cmd = ":tmux-window";
+ }
+ ];
+ };
+ };
+}