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
I created a fork where I added a preview window. Below I'll explain how it works. If you are interested, I can make a pull request such that it can be added to this repo. I tried to make it so that it is backwards compatible with the default configurations + it is turned off by default. In order to create the preview window (efficiently) I needed to extract the line numbers of the matches, using grep -n. This explains the changes that were made in the regexes. I created a separate script called preview.sh that handles the preview window.
Below you'll find a piece of documentation that I added to the README of my fork:
This is a fork of wfxr/tmux-fzf-url with
a set of features added to it as is explained below. The goal is to keep this
repo up-to-date with the original one, and extend it with new features were
possible.
The following features have been added to this fork:
preview window: a preview window can be enabled that shows the content of
the tmux buffer. The selected fzf line will be highlighted in the preview
window. The preview window is disabled by default, and can be enabled by
setting:
set -g @fzf-url-fzf-preview true
Note that it may be desirable to set a custom sort command, as is explained
below.
sort command: after searching the tmux buffer, the results are presented
in the following format: line_number:match. Here line_number is the line
number in the tmux buffer, and match is the match. Before passing them to
fzf, any duplicates are removed by using the sort -u command. Next, they are
fed to a command that can be specified by the user. By default, the command is
set -g @fzf-url-sort-cmd "sort -u -t: -k2"
which means that only the match part is used for sorting this time, instead
of the entire line. It will remove any duplicates, even if the line_number
part is different. This will limit the number of lines that are shown in the
fzf window, and will make it easier to find the desired line. However, when
using the preview window, it may be desirable to display all the lines, such
that you can scroll through them. In this case, the following may be more
suitable:
set -g @fzf-url-sort-cmd "sort -n"
This will only sort the line_number part, and will not remove any
duplicates.
The text was updated successfully, but these errors were encountered:
By the way, as the newest (most relevant) links in a terminal would be at the bottom, passing an extra sorting option -r to reverse results works nicely.
Thanks! Good to hear it is useful for you. I added some more changes to my fork and eventually moved it to a new repo called tmux-fzf-open, since it started to deviate too much from the original project. Maybe it will be of interest for you as wel.
Hey @wfxr,
Thanks for this repo. I use it everyday.
I created a fork where I added a preview window. Below I'll explain how it works. If you are interested, I can make a pull request such that it can be added to this repo. I tried to make it so that it is backwards compatible with the default configurations + it is turned off by default. In order to create the preview window (efficiently) I needed to extract the line numbers of the matches, using
grep -n
. This explains the changes that were made in the regexes. I created a separate script calledpreview.sh
that handles the preview window.Below you'll find a piece of documentation that I added to the README of my fork:
This is a fork of wfxr/tmux-fzf-url with
a set of features added to it as is explained below. The goal is to keep this
repo up-to-date with the original one, and extend it with new features were
possible.
The following features have been added to this fork:
preview window: a preview window can be enabled that shows the content of
the tmux buffer. The selected fzf line will be highlighted in the preview
window. The preview window is disabled by default, and can be enabled by
setting:
Note that it may be desirable to set a custom sort command, as is explained
below.
sort command: after searching the tmux buffer, the results are presented
in the following format:
line_number:match
. Hereline_number
is the linenumber in the tmux buffer, and
match
is the match. Before passing them tofzf, any duplicates are removed by using the
sort -u
command. Next, they arefed to a command that can be specified by the user. By default, the command is
which means that only the
match
part is used for sorting this time, insteadof the entire line. It will remove any duplicates, even if the
line_number
part is different. This will limit the number of lines that are shown in the
fzf window, and will make it easier to find the desired line. However, when
using the preview window, it may be desirable to display all the lines, such
that you can scroll through them. In this case, the following may be more
suitable:
This will only sort the
line_number
part, and will not remove anyduplicates.
The text was updated successfully, but these errors were encountered: