Skip to content

Commit d30b94e

Browse files
josephschmittopencode
andcommitted
Reverse recency sort order - most recent URLs first
Most recent URLs now appear at the top of the list for quickest selection, regardless of fzf layout (default or --reverse). 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <[email protected]>
1 parent b7776b0 commit d30b94e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fzf-url.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ if [[ "$sort_by" == "alphabetical" ]]; then
5757
# Original behavior: sort alphabetically and remove duplicates
5858
items=$(echo "$all_urls" | cut -d: -f2- | sort -u | nl -w3 -s ' ')
5959
else
60-
# Default recency behavior: preserve scrollback order, remove duplicates keeping first occurrence
60+
# Default recency behavior: most recent URLs first, remove duplicates keeping first occurrence
6161
items=$(echo "$all_urls" | awk -F: '
6262
{
6363
url = substr($0, index($0, ":") + 1)
6464
if (!seen[url]) {
6565
seen[url] = 1
6666
print $1 ":" url
6767
}
68-
}' | sort -n | cut -d: -f2- | nl -w3 -s ' ')
68+
}' | sort -nr | cut -d: -f2- | nl -w3 -s ' ')
6969
fi
7070
[ -z "$items" ] && tmux display 'tmux-fzf-url: no URLs found' && exit
7171

0 commit comments

Comments
 (0)