mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Add sff for using ff together with scp for easily sending files to remote servers
This commit is contained in:
@@ -7,16 +7,12 @@ if command -v eza &> /dev/null; then
|
||||
fi
|
||||
|
||||
if [[ "$TERM" == "xterm-kitty" ]]; then
|
||||
alias ff="fzf --preview '
|
||||
case \$(file --mime-type -b {}) in
|
||||
image/*) kitty icat --clear --transfer-mode=memory --stdin=no --place=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES}@0x0 {} ;;
|
||||
*) bat --style=numbers --color=always {} ;;
|
||||
esac
|
||||
'"
|
||||
alias ff="fzf --preview 'case \$(file --mime-type -b {}) in image/*) kitty icat --clear --transfer-mode=memory --stdin=no --place=\${FZF_PREVIEW_COLUMNS}x\${FZF_PREVIEW_LINES}@0x0 {} ;; *) bat --style=numbers --color=always {} ;; esac'"
|
||||
else
|
||||
alias ff="fzf --preview 'bat --style=numbers --color=always {}'"
|
||||
fi
|
||||
alias eff='$EDITOR "$(ff)"'
|
||||
sff() { if [ $# -eq 0 ]; then echo "Usage: sff <destination> (e.g. sff host:/tmp/)"; return 1; fi; local file; file=$(find . -type f -printf '%T@\t%p\n' | sort -rn | cut -f2- | ff) && [ -n "$file" ] && scp "$file" "$1"; }
|
||||
|
||||
if command -v zoxide &> /dev/null; then
|
||||
alias cd="zd"
|
||||
|
||||
Reference in New Issue
Block a user