Skip to content

Commit

Permalink
zshrc: Move uopen to skel/.zshrc
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Terbeck <ft@bewatermyfriend.org>
  • Loading branch information
ft authored and mika committed Dec 6, 2011
1 parent ce4346f commit 73a6cb7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
4 changes: 0 additions & 4 deletions doc/grmlzshrc.t2t
Expand Up @@ -791,10 +791,6 @@ Makes a unified diff of the command line arguments trying hard to find a
smaller set of changes. Descends recursively into subdirectories. Ignores
hows some information about current status.

: **uopen()**
Downloads and displays a file using a suitable program for its
Content-Type.

: **uprint()**
Works around the "print -l ${(u)foo}"-limitation on zsh older than 4.2.

Expand Down
17 changes: 17 additions & 0 deletions etc/skel/.zshrc
Expand Up @@ -228,6 +228,23 @@ fi
# fi
#}

## Download a file and display it locally
#uopen() {
# emulate -L zsh
# if ! [[ -n "$1" ]] ; then
# print "Usage: uopen \$URL/\$file">&2
# return 1
# else
# FILE=$1
# MIME=$(curl --head $FILE | \
# grep Content-Type | \
# cut -d ' ' -f 2 | \
# cut -d\; -f 1)
# MIME=${MIME%$'\r'}
# curl $FILE | see ${MIME}:-
# fi
#}

## log out? set timeout in seconds...
## ...and do not log out in some specific terminals:
#if [[ "${TERM}" == ([Exa]term*|rxvt|dtterm|screen*) ]] ; then
Expand Down
15 changes: 0 additions & 15 deletions etc/zsh/zshrc
Expand Up @@ -2790,21 +2790,6 @@ viless() {
vim --cmd 'let no_plugin_maps = 1' -c "so \$VIMRUNTIME/macros/less.vim" "${@:--}"
}

# Function Usage: uopen $URL/$file
#f5# Download a file and display it locally
uopen() {
emulate -L zsh
if ! [[ -n "$1" ]] ; then
print "Usage: uopen \$URL/\$file">&2
return 1
else
FILE=$1
MIME=$(curl --head $FILE | grep Content-Type | cut -d ' ' -f 2 | cut -d\; -f 1)
MIME=${MIME%$'\r'}
curl $FILE | see ${MIME}:-
fi
}

# Function Usage: doc packagename
#f5# \kbd{cd} to /usr/share/doc/\textit{package}
doc() {
Expand Down

0 comments on commit 73a6cb7

Please sign in to comment.