Question: copy the full path to the buffer
Hello, thanks for the application!
I want to copy the full path to the directory or file where my cursor is located to the buffer.
:print_path outputs the full path, as I need it, but will exit the broot application.
{
invocation: yank_full_path
shortcut: yp
execution: ":print_path"
leave_broot: false
}
Is there a solution to this?
I have such an alias in the shell, and I would like something similar for the broot:
yp='pwd | pbcopy'
#question #mac
You may use the :copy_path internal.
(broot must be compiled with the "clipboard" feature)
Wow, thx!
(broot must be compiled with the "clipboard" feature)
Yeah, at the moment I get the error "Clipboard feature not enabled at compilation"; I installed it through Homebrew and trying to figure out how to enable this feature.
Unfortunately I can't provide precompiled binaries for Mac.
If you want to compile broot yourself you need to
- install the rust environnement (using https://rustup.rs/)
- fetch the repository
- compile with
cargo install --features clipboard --locked --path .
Gotcha, thx.
Maybe someone has another solution that will use the standard pbcopy?
execution: "$(echo {file} | pbcopy) ; br"
from_shell: true
At the moment I have something like this, and it drops the cursor position, I know it's silly ^_^
here is my solution for linux, without specifically compilling the package:
{
invocation: "path_copy"
execution: "echo -n {file} | xclip -selection clipboard;"
from_shell: true
#leave_broot: false
}
it rely on xclip .
it won't work without from_shell: true,
It's a shame because from_shell: true it NOT compatible with leave_broot: false (therefore I commented it out).
I wish I could find an xlip based solution that would NOT quit broot.
You can't simultaneously have leave_broot=false and from_shell=true