mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
Merge 43dfb0c0fc into 91926dc80a
This commit is contained in:
commit
5cbfc42f12
3 changed files with 80 additions and 11 deletions
|
|
@ -31,17 +31,6 @@ zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm
|
||||||
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
|
||||||
cdpath=(.)
|
cdpath=(.)
|
||||||
|
|
||||||
# use /etc/hosts and known_hosts for hostname completion
|
|
||||||
[ -r ~/.ssh/known_hosts ] && _ssh_hosts=(${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[\|]*}%%\ *}%%,*}) || _ssh_hosts=()
|
|
||||||
[ -r /etc/hosts ] && : ${(A)_etc_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}} || _etc_hosts=()
|
|
||||||
hosts=(
|
|
||||||
"$_ssh_hosts[@]"
|
|
||||||
"$_etc_hosts[@]"
|
|
||||||
`hostname`
|
|
||||||
localhost
|
|
||||||
)
|
|
||||||
zstyle ':completion:*:hosts' hosts $hosts
|
|
||||||
|
|
||||||
# Use caching so that commands like apt and dpkg complete are useable
|
# Use caching so that commands like apt and dpkg complete are useable
|
||||||
zstyle ':completion::complete:*' use-cache 1
|
zstyle ':completion::complete:*' use-cache 1
|
||||||
zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/
|
zstyle ':completion::complete:*' cache-path ~/.oh-my-zsh/cache/
|
||||||
|
|
|
||||||
64
plugins/sprunge/sprunge.plugin.zsh
Normal file
64
plugins/sprunge/sprunge.plugin.zsh
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
# Contributed and SLIGHTLY modded by Matt Parnell/ilikenwf <parwok -at- gmail>
|
||||||
|
# Created by the blogger at the URL below...I don't know where to find his/her name
|
||||||
|
# Original found at http://www.shellperson.net/sprunge-pastebin-script/
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
description | fmt -s >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
description() {
|
||||||
|
cat << HERE
|
||||||
|
|
||||||
|
DESCRIPTION
|
||||||
|
Upload data and fetch URL from the pastebin http://sprunge.us
|
||||||
|
|
||||||
|
USAGE
|
||||||
|
$0 filename.txt
|
||||||
|
$0 text string
|
||||||
|
$0 < filename.txt
|
||||||
|
piped_data | $0
|
||||||
|
|
||||||
|
NOTES
|
||||||
|
--------------------------------------------------------------------------
|
||||||
|
* INPUT METHODS *
|
||||||
|
$0 can accept piped data, STDIN redirection [<filename.txt], text strings following the command as arguments, or filenames as arguments. Only one of these methods can be used at a time, so please see the note on precedence. Also, note that using a pipe or STDIN redirection will treat tabs as spaces, or disregard them entirely (if they appear at the beginning of a line). So I suggest using a filename as an argument if tabs are important either to the function or readability of the code.
|
||||||
|
|
||||||
|
* PRECEDENCE *
|
||||||
|
STDIN redirection has precedence, then piped input, then a filename as an argument, and finally text strings as an arguments.
|
||||||
|
|
||||||
|
EXAMPLE:
|
||||||
|
echo piped | "$0" arguments.txt < stdin_redirection.txt
|
||||||
|
|
||||||
|
In this example, the contents of file_as_stdin_redirection.txt would be uploaded. Both the piped_text and the file_as_argument.txt are ignored. If there is piped input and arguments, the arguments will be ignored, and the piped input uploaded.
|
||||||
|
|
||||||
|
* FILENAMES *
|
||||||
|
If a filename is misspelled or doesn't have the necessary path description, it will NOT generate an error, but will instead treat it as a text string and upload it.
|
||||||
|
--------------------------------------------------------------------------
|
||||||
|
|
||||||
|
HERE
|
||||||
|
exit
|
||||||
|
}
|
||||||
|
|
||||||
|
sprunge() {
|
||||||
|
if [ -t 0 ]; then
|
||||||
|
echo Running interactively, checking for arguments... >&2
|
||||||
|
if [ "$*" ]; then
|
||||||
|
echo Arguments present... >&2
|
||||||
|
if [ -f "$*" ]; then
|
||||||
|
echo Uploading the contents of "$*"... >&2
|
||||||
|
cat "$*"
|
||||||
|
else
|
||||||
|
echo Uploading the text: \""$*"\"... >&2
|
||||||
|
echo "$*"
|
||||||
|
fi | curl -F 'sprunge=<-' http://sprunge.us
|
||||||
|
else
|
||||||
|
echo No arguments found, printing USAGE and exiting. >&2
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo Using input from a pipe or STDIN redirection... >&2
|
||||||
|
while read -r line ; do
|
||||||
|
echo $line
|
||||||
|
done | curl -F 'sprunge=<-' http://sprunge.us
|
||||||
|
fi
|
||||||
|
}
|
||||||
16
themes/mattparnell.zsh-theme
Normal file
16
themes/mattparnell.zsh-theme
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
# based on clean.zsh-theme with some prompt tweaks
|
||||||
|
|
||||||
|
if [ $UID -eq 0 ]; then NCOLOR="red"; else NCOLOR="white"; fi
|
||||||
|
|
||||||
|
PROMPT='%F{8}%n@%m%F{blue}%40<...< %~ %<<%F{white}%(!.#.%F{blue}$%F{8}) $(git_prompt_info)'
|
||||||
|
RPROMPT="[%D{%m/%d %I:%M %p}]"
|
||||||
|
|
||||||
|
# git theming
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}(%{$fg_no_bold[yellow]%}%B"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%b%{$fg_bold[blue]%})%{$reset_color%} "
|
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg_bold[red]%}✗"
|
||||||
|
|
||||||
|
# LS colors, made with http://geoff.greer.fm/lscolors/
|
||||||
|
export LSCOLORS="Gxfxcxdxbxegedabagacad"
|
||||||
|
export LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tbz=00;31:*.tgz=00;31:*.rpm=00;31:*.deb=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.lzma=00;31:*.zip=00;31:*.zoo=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.tb2=00;31:*.tz2=00;31:*.tbz2=00;31:*.avi=01;35:*.bmp=01;35:*.fli=01;35:*.gif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mng=01;35:*.mov=01;35:*.mpg=01;35:*.pcx=01;35:*.pbm=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.tga=01;35:*.tif=01;35:*.xbm=01;35:*.xpm=01;35:*.dl=01;35:*.gl=01;35:*.wmv=01;35:*.aiff=00;32:*.au=00;32:*.mid=00;32:*.mp3=00;32:*.ogg=00;32:*.voc=00;32:*.wav=00;32:'
|
||||||
Loading…
Add table
Add a link
Reference in a new issue