Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full path output and clipboard #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

coresh
Copy link

@coresh coresh commented Nov 20, 2024

No description provided.

Copy link
Owner

@QtRoS QtRoS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coresh thank your for your PR 🙏
Left 2 comments, it would be awesome if you address them!

@@ -46,14 +46,14 @@ qsb() {
file="$(
FZF_DEFAULT_COMMAND="$RG_PREFIX '$1'" \
fzf \
--preview="if [[ -n {} ]]; then if [[ -n {q} ]]; then ~/bin/bat-extras/src/batgrep.sh --color=always --terminal-width=105 --context=3 {q} {}; else bat --color=always {}; fi; fi" \
--preview="if [[ -n {} ]]; then if [[ -n {q} ]]; then /usr/bin/batgrep --color=always --terminal-width=105 --context=3 {q} {}; else bat --color=always {}; fi; fi" \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add an example how to install batgrep so you can call it like this, /usr/bin/batgrep? I suppose it's simply symlink, but I think it will still be useful and more user friendly since all other tools in this function have installation instructions.

--disabled --query "$1" \
--bind "change:reload:sleep 0.1; $RG_PREFIX {q}" \
--bind "f3:execute(bat --paging=always --pager=\"less -j4 -R -F +/{q}\" --color=always {} < /dev/tty > /dev/tty)" \
--bind "f4:execute(code {})" \
--preview-window="70%:wrap"
)" &&
echo "$file"
RESULT="$(pwd)/${file}" && echo "${RESULT}" | xclip -selection clipboard && echo "${RESULT}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, xclip is not available in MacOS out of the box, so I would either add installation instruction or handle this case so it doesn't cause 'command not found error'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants