You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a new option for `@fzf-url-sort-by`, defaulting to `alphabetical` as before, and adding `recency` to sort urls by recency in the scrollback history.
Most of the time when I use this plugin, I want to open the url that just got printed (usually a github PR). Sorting be recency makes it so 9/10 times, I invoke the plugin and hit enter to oepn it right away.
You can control how URLs are sorted by setting `@fzf-url-sort-by`:
60
+
61
+
```tmux
62
+
# Sort URLs alphabetically (default)
63
+
set -g @fzf-url-sort-by 'alphabetical'
64
+
65
+
# Sort URLs by recency - most recent URLs closest to search bar
66
+
set -g @fzf-url-sort-by 'recency'
67
+
```
68
+
69
+
**Smart Layout Detection**: When using recency sorting, the plugin automatically detects your fzf layout and adjusts the sort order to keep the most recent URLs closest to the search bar:
70
+
71
+
-**Default layout** (search at bottom): Recent URLs appear first (top of list)
72
+
-**Reverse layout** (with `--reverse` option): Recent URLs appear last (bottom of list)
73
+
74
+
This ensures optimal accessibility regardless of your preferred fzf layout.
75
+
59
76
By default, `tmux-fzf-url` will use `xdg-open`, `open`, or the `BROWSER`
60
77
environment variable to open the url, respectively. If you want to use a
61
78
different command, you can set `@fzf-url-open` to the command you want to use.
wwws=$(echo "$content"| grep -noE '(http?s://)?www\.[a-zA-Z](-?[a-zA-Z0-9])+\.[a-zA-Z]{2,}(/\S+)*'| grep -vE ':[0-9]*:https?://'| sed 's/^\([0-9]*\):\(.*\)$/\1:http:\/\/\2/')
44
+
ips=$(echo "$content"| grep -noE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}(:[0-9]{1,5})?(/\S+)*'| sed 's/^\([0-9]*\):\(.*\)$/\1:http:\/\/\2/')
45
+
gits=$(echo "$content"| grep -noE '(ssh://)?git@\S*'| sed 's/:/\//g'| sed 's/^\([0-9]*\)\/\/\(ssh\/\/\/\)\{0,1\}git@\(.*\)$/\1:https:\/\/\3/')
46
+
gh=$(echo "$content"| grep -noE "['\"]([_A-Za-z0-9-]*/[_.A-Za-z0-9-]*)['\"]"| sed "s/['\"]//g"| sed 's/^\([0-9]*\):\(.*\)$/\1:https:\/\/github.com\/\2/')
45
47
46
48
if [[ $#-ge 1 &&"$1"!='' ]];then
47
-
extras=$(echo "$content"|eval "$1")
49
+
extras=$(echo "$content"| nl -nln |eval"$1"| sed 's/^\([0-9]*\)\t\(.*\)$/\1:\2/')
0 commit comments