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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ qse() {
--bind "f4:execute(code {})" \
--preview-window="70%:wrap"
)" &&
echo "$file"
RESULT="$(pwd)/${file}" && echo "${RESULT}" | xclip -selection clipboard && echo "${RESULT}"
}
```

Expand All @@ -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'

}
```

Expand Down