From 9134410521c0782eb607a4116225c8b779802973 Mon Sep 17 00:00:00 2001 From: Wu Zhenyu Date: Sat, 13 Jan 2024 01:35:10 +0800 Subject: [PATCH] :bug: Don't define less() when less exists --- functions/main.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/functions/main.zsh b/functions/main.zsh index f2d0bcb..ff7fad1 100644 --- a/functions/main.zsh +++ b/functions/main.zsh @@ -6,9 +6,11 @@ (($+commands[pygmentize])) || pygmentize() {bat $@} (($+commands[mdcat])) || mdcat() {bat -lmarkdown} # https://github.com/Freed-Wu/fzf-tab-source/issues/6 -(($+commands[less])) && [ -x ~/.lessfilter ] && - less() {~/.lessfilter $@ || command less $@} || (($+commands[less])) || - less() {command ls -l $@} +if (($+commands[less])) && [ -x ~/.lessfilter ]; then + less() {~/.lessfilter $@ || command less $@} +else + (($+commands[less])) || less() {command ls -l $@} +fi if ((! $+commands[finger])); then (($+commands[pinky])) && finger() {command pinky $@} || finger() {command whoami} fi