This commit is contained in:
Mylloon 2024-11-17 17:36:29 +01:00
parent 8b661cc11e
commit 11c434c50c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 9 additions and 10 deletions

View file

@ -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

View file

@ -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

View file

@ -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