From 11c434c50c0db95702391123005e9d44d0faad65 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 17 Nov 2024 17:36:29 +0100 Subject: [PATCH] use eza --- .../fish/functions/__fish_list_current_token.fish | 13 +++++-------- Makefile | 2 ++ meta.sh | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.config/fish/functions/__fish_list_current_token.fish b/.config/fish/functions/__fish_list_current_token.fish index 33659a9..13727a7 100644 --- a/.config/fish/functions/__fish_list_current_token.fish +++ b/.config/fish/functions/__fish_list_current_token.fish @@ -3,19 +3,16 @@ function __fish_list_current_token -d "List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory" set -l val (commandline -t | string replace -r '^~' "$HOME") - printf "\n" + set -l cmd if test -d $val - eza --icons=auto $val + set cmd eza --icons $val else set -l dir (dirname -- $val) if test $dir != . -a -d $dir - eza --icons=auto $dir + set cmd eza --icons $dir else - eza --icons=auto + set cmd eza --icons end end - - string repeat -N \n --count=(math (count (fish_prompt)) - 1) - - commandline -f repaint + __fish_echo $cmd end diff --git a/Makefile b/Makefile index c7468ab..6cd4628 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,8 @@ sync-dotconfig: @$(WGET) $(REPO_SRC)/.config/fish/config.fish -O $(HOME)/.config/fish/config.fish + @$(WGET) $(REPO_SRC)/.config/fish/functions/__fish_list_current_token.fish -O $(HOME)/.config/fish/functions/__fish_list_current_token.fish + @$(WGET) $(REPO_SRC)/.config/fish/functions/fish_prompt.fish -O $(HOME)/.config/fish/functions/fish_prompt.fish @$(WGET) $(REPO_SRC)/.config/fish/functions/catall.fish -O $(HOME)/.config/fish/functions/catall.fish @$(WGET) $(REPO_SRC)/.config/fish/functions/latex-color.fish -O $(HOME)/.config/fish/functions/latex-color.fish diff --git a/meta.sh b/meta.sh index 23fd3d7..e687eb1 100644 --- a/meta.sh +++ b/meta.sh @@ -84,8 +84,8 @@ function main { # Add aliases wget -q "${repo}"/.config/fish/conf.d/alias.fish -O "$HOME"/.config/fish/conf.d/alias.fish # Add functions - functions=("catall" "latex-color" "makeaway" "ssh-export" "ssh-import" "ugc" - "update-theme") + functions=("__fish_list_current_token" "catall" "latex-color" "makeaway" + "ssh-export" "ssh-import" "ugc" "update-theme") for function in "${functions[@]}" do wget -q "${repo}"/.config/fish/functions/"${function}".fish -O "$HOME"/.config/fish/functions/"${function}".fish