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
|
fi
|
||||||
|
|
||||||
if [[ "$TERM" == "xterm-kitty" ]]; then
|
if [[ "$TERM" == "xterm-kitty" ]]; then
|
||||||
alias ff="fzf --preview '
|
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'"
|
||||||
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
|
else
|
||||||
alias ff="fzf --preview 'bat --style=numbers --color=always {}'"
|
alias ff="fzf --preview 'bat --style=numbers --color=always {}'"
|
||||||
fi
|
fi
|
||||||
alias eff='$EDITOR "$(ff)"'
|
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
|
if command -v zoxide &> /dev/null; then
|
||||||
alias cd="zd"
|
alias cd="zd"
|
||||||
|
|||||||
Reference in New Issue
Block a user