Skip to content
Snippets Groups Projects
Commit df3c88e6 authored by Jens Nolte's avatar Jens Nolte
Browse files

Add pastebin function to zsh config

parent 5c225946
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,7 @@ fi
# "The time the shell waits, in hundredths of seconds, for another key to be pressed when reading bound multi-character sequences."
# This is for vim-style multi-letter commands (<f><d> is mapped to <Esc>)
KEYTIMEOUT=10
KEYTIMEOUT=20
HISTSIZE=100000
SAVEHIST=100000
......@@ -213,5 +213,25 @@ man() {
LESS_TERMCAP_us=$'\e[01;32m' \
command man "$@"
}
# submit file/stdin to pastebin, optionally signing it
pastebin () {
local -r pastebin='https://0x0.st'
if [ "$1" = '--sign' ]; then
local -r filter='gpg --clearsign --output -'
shift
else
local -r filter='cat'
fi
if [ -n "$1" ]; then
local -r file="$1"
else
local -r file='-'
fi
$filter "$file" | curl -F'file=@-' "$pastebin"
}
'';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment