update zsh
This commit is contained in:
parent
7b9b0e4510
commit
958d14152d
@ -1,4 +1,4 @@
|
||||
SERVICES=("syncthing@vincent" "named" "mariadb" "nginx" "php-fpm" "gitea" "tt-rss" "named" "gunicorn-chainetv.socket" "gunicorn-supysonic" "rsyncd.service" "fail2ban")
|
||||
SERVICES=("syncthing@vincent" "named" "mariadb" "nginx" "php-fpm" "gitea" "tt-rss" "named" "gunicorn-chainetv.socket" "gunicorn-supysonic" "rsyncd.service" "fail2ban" "supysonic-daemon" "home-assistant" "radicale")
|
||||
HOST=$(hostname)
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
|
@ -44,4 +44,10 @@
|
||||
# VisualHostKey no
|
||||
# ProxyCommand ssh -q -W %h:%p gateway.example.com
|
||||
# RekeyLimit 1G 1h
|
||||
|
||||
Host git.ducamps.win
|
||||
HostName git.ducamps.win
|
||||
User gitea
|
||||
IdentityFile ~/.ssh/id_gitea
|
||||
Host oscar
|
||||
HostName oscar
|
||||
User vincent
|
||||
|
1
zsh/.oh-my-zsh/.gitignore
vendored
1
zsh/.oh-my-zsh/.gitignore
vendored
@ -5,3 +5,4 @@ custom/
|
||||
cache/
|
||||
log/
|
||||
*.swp
|
||||
.DS_Store
|
||||
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2009-2019 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/contributors)
|
||||
Copyright (c) 2009-2020 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/contributors)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
@ -2,9 +2,6 @@
|
||||
<img src="https://s3.amazonaws.com/ohmyzsh/oh-my-zsh-logo.png" alt="Oh My Zsh">
|
||||
</p>
|
||||
|
||||
[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
|
||||
[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
|
||||
|
||||
Oh My Zsh is an open source, community-driven framework for managing your [zsh](https://www.zsh.org/) configuration.
|
||||
|
||||
Sounds boring. Let's try again.
|
||||
@ -15,7 +12,11 @@ Once installed, your terminal shell will become the talk of the town _or your mo
|
||||
|
||||
Finally, you'll begin to get the sort of attention that you have always felt you deserved. ...or maybe you'll use the time that you're saving to start flossing more often. 😬
|
||||
|
||||
To learn more, visit [ohmyz.sh](https://ohmyz.sh) and follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter.
|
||||
To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twitter.com/ohmyzsh) on Twitter, and/or join us on Discord.
|
||||
|
||||
![Check Suite](https://github.com/ohmyzsh/ohmyzsh/workflows/Check%20Suite/badge.svg)
|
||||
[![Follow @ohmyzsh](https://img.shields.io/twitter/follow/ohmyzsh?label=Follow+@ohmyzsh&style=flat)](https://twitter.com/intent/follow?screen_name=ohmyzsh)
|
||||
[![Discord server](https://img.shields.io/discord/642496866407284746)](https://discord.gg/bpXWhnN)
|
||||
|
||||
## Getting Started
|
||||
|
||||
|
@ -24,7 +24,7 @@ function clipcopy() {
|
||||
else
|
||||
cat $file | pbcopy
|
||||
fi
|
||||
elif [[ $OSTYPE == cygwin* ]]; then
|
||||
elif [[ $OSTYPE == (cygwin|msys)* ]]; then
|
||||
if [[ -z $file ]]; then
|
||||
cat > /dev/clipboard
|
||||
else
|
||||
@ -71,7 +71,7 @@ function clippaste() {
|
||||
emulate -L zsh
|
||||
if [[ $OSTYPE == darwin* ]]; then
|
||||
pbpaste
|
||||
elif [[ $OSTYPE == cygwin* ]]; then
|
||||
elif [[ $OSTYPE == (cygwin|msys)* ]]; then
|
||||
cat /dev/clipboard
|
||||
else
|
||||
if (( $+commands[xclip] )); then
|
||||
|
@ -32,8 +32,8 @@ fi
|
||||
is_plugin() {
|
||||
local base_dir=$1
|
||||
local name=$2
|
||||
test -f $base_dir/plugins/$name/$name.plugin.zsh \
|
||||
|| test -f $base_dir/plugins/$name/_$name
|
||||
builtin test -f $base_dir/plugins/$name/$name.plugin.zsh \
|
||||
|| builtin test -f $base_dir/plugins/$name/_$name
|
||||
}
|
||||
|
||||
# Add all defined plugins to fpath. This must be done
|
||||
|
@ -10,7 +10,8 @@ function asp() {
|
||||
return
|
||||
fi
|
||||
|
||||
local available_profiles=($(aws_profiles))
|
||||
local -a available_profiles
|
||||
available_profiles=($(aws_profiles))
|
||||
if [[ -z "${available_profiles[(r)$1]}" ]]; then
|
||||
echo "${fg[red]}Profile '$1' not found in '${AWS_CONFIG_FILE:-$HOME/.aws/config}'" >&2
|
||||
echo "Available profiles: ${(j:, :)available_profiles:-no profiles found}${reset_color}" >&2
|
||||
|
@ -17,7 +17,7 @@ EOF
|
||||
fi
|
||||
|
||||
function colored() {
|
||||
env \
|
||||
command env \
|
||||
LESS_TERMCAP_mb=$(printf "\e[1;31m") \
|
||||
LESS_TERMCAP_md=$(printf "\e[1;31m") \
|
||||
LESS_TERMCAP_me=$(printf "\e[0m") \
|
||||
|
@ -17,10 +17,10 @@ plugins=(... colorize)
|
||||
|
||||
### Requirements
|
||||
|
||||
This plugin requires that either of the following tools be installed:
|
||||
This plugin requires that at least one of the following tools is installed:
|
||||
|
||||
* Chroma: [https://github.com/alecthomas/chroma](https://github.com/alecthomas/chroma)
|
||||
* Pygments be installed: [pygments.org](https://pygments.org/)
|
||||
* [Chroma](https://github.com/alecthomas/chroma)
|
||||
* [Pygments](https://pygments.org/download/)
|
||||
|
||||
### Colorize tool
|
||||
|
||||
@ -41,12 +41,8 @@ ZSH_COLORIZE_STYLE="colorful"
|
||||
## Usage
|
||||
|
||||
* `ccat <file> [files]`: colorize the contents of the file (or files, if more than one are provided).
|
||||
If no arguments are passed it will colorize the standard input or stdin.
|
||||
If no files are passed it will colorize the standard input.
|
||||
|
||||
* `cless <file> [files]`: colorize the contents of the file (or files, if more than one are provided) and
|
||||
open less. If no arguments are passed it will colorize the standard input or stdin.
|
||||
|
||||
Note that `cless` will behave as less when provided more than one file: you have to navigate files with
|
||||
the commands `:n` for next and `:p` for previous. The downside is that less options are not supported.
|
||||
But you can circumvent this by either using the LESS environment variable, or by running `ccat file1 file2|less --opts`.
|
||||
In the latter form, the file contents will be concatenated and presented by less as a single file.
|
||||
* `cless [less-options] <file> [files]`: colorize the contents of the file (or files, if more than one are provided) and open less.
|
||||
If no files are passed it will colorize the standard input.
|
||||
The LESSOPEN and LESSCLOSE will be overwritten for this to work, but only in a local scope.
|
||||
|
@ -1,8 +1,11 @@
|
||||
# easier alias to use the plugin
|
||||
alias ccat='colorize_via_pygmentize'
|
||||
alias cless='colorize_via_pygmentize_less'
|
||||
# Easier alias to use the plugin
|
||||
alias ccat="colorize_cat"
|
||||
alias cless="colorize_less"
|
||||
|
||||
colorize_via_pygmentize() {
|
||||
# '$0:A' gets the absolute path of this file
|
||||
ZSH_COLORIZE_PLUGIN_PATH=$0:A
|
||||
|
||||
colorize_check_requirements() {
|
||||
local available_tools=("chroma" "pygmentize")
|
||||
|
||||
if [ -z "$ZSH_COLORIZE_TOOL" ]; then
|
||||
@ -23,6 +26,12 @@ colorize_via_pygmentize() {
|
||||
echo "Package '$ZSH_COLORIZE_TOOL' is not installed!" >&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
colorize_cat() {
|
||||
if ! colorize_check_requirements; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
# If the environment variable ZSH_COLORIZE_STYLE
|
||||
# is set, use that theme instead. Otherwise,
|
||||
@ -32,7 +41,7 @@ colorize_via_pygmentize() {
|
||||
ZSH_COLORIZE_STYLE="emacs"
|
||||
fi
|
||||
|
||||
# pygmentize stdin if no arguments passed
|
||||
# Use stdin if no arguments have been passed.
|
||||
if [ $# -eq 0 ]; then
|
||||
if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
|
||||
pygmentize -O style="$ZSH_COLORIZE_STYLE" -g
|
||||
@ -42,12 +51,9 @@ colorize_via_pygmentize() {
|
||||
return $?
|
||||
fi
|
||||
|
||||
# guess lexer from file extension, or
|
||||
# guess it from file contents if unsuccessful
|
||||
|
||||
# Guess lexer from file extension, or guess it from file contents if unsuccessful.
|
||||
local FNAME lexer
|
||||
for FNAME in "$@"
|
||||
do
|
||||
for FNAME in "$@"; do
|
||||
if [[ "$ZSH_COLORIZE_TOOL" == "pygmentize" ]]; then
|
||||
lexer=$(pygmentize -N "$FNAME")
|
||||
if [[ $lexer != text ]]; then
|
||||
@ -61,22 +67,47 @@ colorize_via_pygmentize() {
|
||||
done
|
||||
}
|
||||
|
||||
colorize_via_pygmentize_less() (
|
||||
# this function is a subshell so tmp_files can be shared to cleanup function
|
||||
declare -a tmp_files
|
||||
# The less option 'F - Forward forever; like "tail -f".' will not work in this implementation
|
||||
# caused by the lack of the ability to follow the file within pygmentize.
|
||||
colorize_less() {
|
||||
if ! colorize_check_requirements; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
cleanup () {
|
||||
[[ ${#tmp_files} -gt 0 ]] && rm -f "${tmp_files[@]}"
|
||||
exit
|
||||
_cless() {
|
||||
# LESS="-R $LESS" enables raw ANSI colors, while maintain already set options.
|
||||
local LESS="-R $LESS"
|
||||
|
||||
# This variable tells less to pipe every file through the specified command
|
||||
# (see the man page of less INPUT PREPROCESSOR).
|
||||
# 'zsh -ic "colorize_cat %s 2> /dev/null"' would not work for huge files like
|
||||
# the ~/.zsh_history. For such files the tty of the preprocessor will be supended.
|
||||
# Therefore we must source this file to make colorize_cat available in the
|
||||
# preprocessor without the interactive mode.
|
||||
# `2>/dev/null` will suppress the error for large files 'broken pipe' of the python
|
||||
# script pygmentize, which will show up if less has not fully "loaded the file"
|
||||
# (e.g. when not scrolled to the bottom) while already the next file will be displayed.
|
||||
local LESSOPEN="| zsh -c 'source \"$ZSH_COLORIZE_PLUGIN_PATH\"; \
|
||||
ZSH_COLORIZE_TOOL=$ZSH_COLORIZE_TOOL ZSH_COLORIZE_STYLE=$ZSH_COLORIZE_STYLE \
|
||||
colorize_cat %s 2> /dev/null'"
|
||||
|
||||
# LESSCLOSE will be set to prevent any errors by executing a user script
|
||||
# which assumes that his LESSOPEN has been executed.
|
||||
local LESSCLOSE=""
|
||||
|
||||
LESS="$LESS" LESSOPEN="$LESSOPEN" LESSCLOSE="$LESSCLOSE" less "$@"
|
||||
}
|
||||
trap 'cleanup' EXIT HUP TERM INT
|
||||
|
||||
while (( $# != 0 )); do #TODO: filter out less opts
|
||||
tmp_file="$(mktemp -t "tmp.colorize.XXXX.$(sed 's/\//./g' <<< "$1")")"
|
||||
tmp_files+=("$tmp_file")
|
||||
colorize_via_pygmentize "$1" > "$tmp_file"
|
||||
shift 1
|
||||
done
|
||||
|
||||
less -f "${tmp_files[@]}"
|
||||
)
|
||||
if [ -t 0 ]; then
|
||||
_cless "$@"
|
||||
else
|
||||
# The input is not associated with a terminal, therefore colorize_cat will
|
||||
# colorize this input and pass it to less.
|
||||
# Less has now to decide what to use. If any files have been provided, less
|
||||
# will ignore the input by default, otherwise the colorized input will be used.
|
||||
# If files have been supplied and the input has been redirected, this will
|
||||
# lead to unnecessary overhead, but retains the ability to use the less options
|
||||
# without checking for them inside this script.
|
||||
colorize_cat | _cless "$@"
|
||||
fi
|
||||
}
|
||||
|
@ -25,6 +25,8 @@ plugins=(... extract)
|
||||
| `gz` | Gzip file |
|
||||
| `ipsw` | iOS firmware file |
|
||||
| `jar` | Java Archive |
|
||||
| `lrz` | LRZ archive |
|
||||
| `lz4` | LZ4 archive |
|
||||
| `lzma` | LZMA archive |
|
||||
| `rar` | WinRAR archive |
|
||||
| `rpm` | RPM package |
|
||||
@ -32,7 +34,9 @@ plugins=(... extract)
|
||||
| `tar` | Tarball |
|
||||
| `tar.bz2` | Tarball with bzip2 compression |
|
||||
| `tar.gz` | Tarball with gzip compression |
|
||||
| `tar.lrz` | Tarball with lrzip compression |
|
||||
| `tar.lz` | Tarball with lzip compression |
|
||||
| `tar.lz4` | Tarball with lz4 compression |
|
||||
| `tar.xz` | Tarball with lzma2 compression |
|
||||
| `tar.zma` | Tarball with lzma compression |
|
||||
| `tar.zst` | Tarball with zstd compression |
|
||||
|
@ -3,5 +3,5 @@
|
||||
|
||||
_arguments \
|
||||
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
|
||||
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lz|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
|
||||
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|deb|gz|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst)(-.)'" \
|
||||
&& return 0
|
||||
|
@ -46,9 +46,13 @@ extract() {
|
||||
|| zstdcat "$1" | tar xvf - ;;
|
||||
(*.tar) tar xvf "$1" ;;
|
||||
(*.tar.lz) (( $+commands[lzip] )) && tar xvf "$1" ;;
|
||||
(*.tar.lz4) lz4 -c -d "$1" | tar xvf - ;;
|
||||
(*.tar.lrz) (( $+commands[lrzuntar] )) && lrzuntar "$1" ;;
|
||||
(*.gz) (( $+commands[pigz] )) && pigz -dk "$1" || gunzip -k "$1" ;;
|
||||
(*.bz2) bunzip2 "$1" ;;
|
||||
(*.xz) unxz "$1" ;;
|
||||
(*.lrz) (( $+commands[lrunzip] )) && lrunzip "$1" ;;
|
||||
(*.lz4) lz4 -d "$1" ;;
|
||||
(*.lzma) unlzma "$1" ;;
|
||||
(*.z) uncompress "$1" ;;
|
||||
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.aar|*.whl) unzip "$1" -d $extract_dir ;;
|
||||
|
@ -1,13 +1,3 @@
|
||||
################################################################################
|
||||
# FILE: fastfile.plugin.zsh
|
||||
# DESCRIPTION: oh-my-zsh plugin file.
|
||||
# AUTHOR: Michael Varner (musikmichael@web.de)
|
||||
# VERSION: 1.0.0
|
||||
#
|
||||
# This plugin adds the ability to on the fly generate and access file shortcuts.
|
||||
#
|
||||
################################################################################
|
||||
|
||||
###########################
|
||||
# Settings
|
||||
|
||||
@ -51,7 +41,7 @@ function fastfile() {
|
||||
# Arguments:
|
||||
# 1. name - The name of the shortcut
|
||||
# STDOUT:
|
||||
# The path
|
||||
# The path to the shortcut file
|
||||
#
|
||||
function fastfile_resolv() {
|
||||
echo "${fastfile_dir}${1}"
|
||||
@ -102,7 +92,6 @@ function fastfile_ls() {
|
||||
#
|
||||
# Arguments:
|
||||
# 1. name - The name of the shortcut (default: name of the file)
|
||||
# 2. file - The file or directory to make the shortcut for
|
||||
# STDOUT:
|
||||
# => fastfle_print
|
||||
#
|
||||
|
@ -1,22 +0,0 @@
|
||||
# FirewallD Plugin
|
||||
|
||||
This plugin adds some aliases and functions for FirewallD using the `firewalld-cmd` command. To use it, add firewalld to your plugins array.
|
||||
|
||||
```zsh
|
||||
plugins=(... firewalld)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| :---- | :----------------------------------------- | :--------------------------- |
|
||||
| fw | `sudo firewall-cmd` | Shorthand |
|
||||
| fwr | `sudo firewall-cmd --reload` | Reload current configuration |
|
||||
| fwp | `sudo firewall-cmd --permanent` | Create permanent rule |
|
||||
| fwrp | `sudo firewall-cmd --runtime-to-permanent` | Save current configuration |
|
||||
|
||||
## Functions
|
||||
|
||||
| Function | Description |
|
||||
| :------- | :--------------------------------------------------------- |
|
||||
| fwl | Lists configuration from all active zones and direct rules |
|
@ -1,3 +0,0 @@
|
||||
# if there is a user named 'glassfish' on the system, we'll assume
|
||||
# that is the user asadmin should be run as
|
||||
# grep -e '^glassfish' /etc/passwd > /dev/null && alias asadmin='sudo -u glassfish asadmin'
|
@ -5,9 +5,12 @@
|
||||
# VERSION: 1.0.0
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Detect if GNU coreutils are installed by looking for gwhoami
|
||||
if [[ ! -x "${commands[gwhoami]}" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ -x "${commands[gwhoami]}" ]]; then
|
||||
__gnu_utils() {
|
||||
__gnu_utils() {
|
||||
emulate -L zsh
|
||||
local gcmds
|
||||
local gcmd
|
||||
@ -36,48 +39,45 @@ if [[ -x "${commands[gwhoami]}" ]]; then
|
||||
gcmds+=('gsed' 'gtar' 'gtime')
|
||||
|
||||
for gcmd in "${gcmds[@]}"; do
|
||||
#
|
||||
# Do nothing if the command isn't found
|
||||
(( ${+commands[$gcmd]} )) || continue
|
||||
|
||||
# This method allows for builtin commands to be primary but it's
|
||||
# lost if hash -r or rehash -f is executed. Thus, those two
|
||||
# functions have to be wrapped.
|
||||
#
|
||||
(( ${+commands[$gcmd]} )) && hash ${gcmd[2,-1]}=${commands[$gcmd]}
|
||||
hash ${gcmd[2,-1]}=${commands[$gcmd]}
|
||||
|
||||
#
|
||||
# This method generates wrapper functions.
|
||||
# It will override shell builtins.
|
||||
#
|
||||
# (( ${+commands[$gcmd]} )) && \
|
||||
# eval "function $gcmd[2,-1]() { \"${prefix}/${gcmd//"["/"\\["}\" \"\$@\"; }"
|
||||
|
||||
#
|
||||
# This method is inflexible since the aliases are at risk of being
|
||||
# overridden resulting in the BSD coreutils being called.
|
||||
#
|
||||
# (( ${+commands[$gcmd]} )) && \
|
||||
# alias "$gcmd[2,-1]"="${prefix}/${gcmd//"["/"\\["}"
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
__gnu_utils;
|
||||
}
|
||||
__gnu_utils
|
||||
|
||||
function hash() {
|
||||
function hash() {
|
||||
if [[ "$*" =~ "-(r|f)" ]]; then
|
||||
builtin hash "$@"
|
||||
__gnu_utils
|
||||
else
|
||||
builtin hash "$@"
|
||||
fi
|
||||
}
|
||||
}
|
||||
|
||||
function rehash() {
|
||||
function rehash() {
|
||||
if [[ "$*" =~ "-f" ]]; then
|
||||
builtin rehash "$@"
|
||||
__gnu_utils
|
||||
else
|
||||
builtin rehash "$@"
|
||||
fi
|
||||
}
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
# Read around where these are used for more detail.
|
||||
|
||||
# These flags should be available everywhere according to man knife
|
||||
knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes )
|
||||
knife_general_flags=(--help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes)
|
||||
|
||||
# knife has a very special syntax, some example calls are:
|
||||
# knife status
|
||||
@ -25,8 +25,8 @@ _knife() {
|
||||
typeset -A opt_args
|
||||
cloudproviders=(bluebox ec2 rackspace slicehost terremark)
|
||||
_arguments \
|
||||
'1: :->knifecmd'\
|
||||
'2: :->knifesubcmd'\
|
||||
'1: :->knifecmd' \
|
||||
'2: :->knifesubcmd' \
|
||||
'3: :->knifesubcmd2' \
|
||||
'4: :->knifesubcmd3' \
|
||||
'5: :->knifesubcmd4' \
|
||||
@ -38,7 +38,7 @@ _knife() {
|
||||
;;
|
||||
knifesubcmd)
|
||||
case $words[2] in
|
||||
(bluebox|ec2|rackspace|slicehost|terremark)
|
||||
bluebox|ec2|rackspace|slicehost|terremark)
|
||||
compadd "$@" server images
|
||||
;;
|
||||
client)
|
||||
@ -76,6 +76,7 @@ _knife() {
|
||||
;;
|
||||
*)
|
||||
_arguments '2:Subsubcommands:($(_knife_options1))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
knifesubcmd2)
|
||||
@ -89,10 +90,10 @@ _knife() {
|
||||
site)
|
||||
compadd "$@" vendor show share search download list unshare
|
||||
;;
|
||||
(show|delete|edit)
|
||||
show|delete|edit)
|
||||
_arguments '3:Subsubcommands:($(_chef_$words[2]s_remote))'
|
||||
;;
|
||||
(upload|test)
|
||||
upload|test)
|
||||
_arguments '3:Subsubcommands:($(_chef_$words[2]s_local) --all)'
|
||||
;;
|
||||
list)
|
||||
@ -103,6 +104,7 @@ _knife() {
|
||||
;;
|
||||
*)
|
||||
_arguments '3:Subsubcommands:($(_knife_options2))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
knifesubcmd3)
|
||||
@ -113,12 +115,14 @@ _knife() {
|
||||
versioncomp=1
|
||||
_arguments '4:Cookbookversions:($(_cookbook_versions) latest)'
|
||||
;;
|
||||
(node|client|role)
|
||||
node|client|role)
|
||||
compadd "$@" --attribute
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
case $words[4] in
|
||||
(show|edit)
|
||||
show|edit)
|
||||
_arguments '4:Subsubsubcommands:($(_chef_$words[2]_$words[3]s_remote))'
|
||||
;;
|
||||
file)
|
||||
@ -134,6 +138,7 @@ _knife() {
|
||||
;;
|
||||
*)
|
||||
_arguments '*:Subsubcommands:($(_knife_options3))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
list)
|
||||
@ -141,17 +146,18 @@ _knife() {
|
||||
;;
|
||||
*)
|
||||
_arguments '*:Subsubcommands:($(_knife_options3))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
knifesubcmd4)
|
||||
if (( versioncomp > 0 )); then
|
||||
if ((versioncomp > 0)); then
|
||||
compadd "$@" attributes definitions files libraries providers recipes resources templates
|
||||
else
|
||||
case $words[5] in
|
||||
file)
|
||||
_arguments '*:directory:_path_files -/ -W "$(_chef_root)/data_bags" -qS \ '
|
||||
;;
|
||||
*) _arguments '*:Subsubcommands:($(_knife_options2))'
|
||||
*) _arguments '*:Subsubcommands:($(_knife_options2))' ;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
@ -162,21 +168,23 @@ _knife() {
|
||||
;;
|
||||
*)
|
||||
_arguments '*:Subsubcommands:($(_knife_options3))'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Helper functions to provide the argument completion for several depths of commands
|
||||
_knife_options1() {
|
||||
( for line in $( knife $words[2] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
|
||||
(for line in $(knife $words[2] --help | grep -v "^knife"); do echo $line | grep "\-\-"; done)
|
||||
}
|
||||
|
||||
_knife_options2() {
|
||||
( for line in $( knife $words[2] $words[3] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
|
||||
(for line in $(knife $words[2] $words[3] --help | grep -v "^knife"); do echo $line | grep "\-\-"; done)
|
||||
}
|
||||
|
||||
_knife_options3() {
|
||||
( for line in $( knife $words[2] $words[3] $words[4] --help | grep -v "^knife" ); do echo $line | grep "\-\-"; done )
|
||||
(for line in $(knife $words[2] $words[3] $words[4] --help | grep -v "^knife"); do echo $line | grep "\-\-"; done)
|
||||
}
|
||||
|
||||
# The chef_x_remote functions use knife to get a list of objects of type x on the server
|
||||
@ -217,7 +225,7 @@ _chef_cookbooks_local() {
|
||||
if [ -f ./.chef/knife.rb ]; then
|
||||
knife_rb="./.chef/knife.rb"
|
||||
fi
|
||||
local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/' )}
|
||||
local cookbook_path=${KNIFE_COOKBOOK_PATH:-$(grep cookbook_path $knife_rb | awk 'BEGIN {FS = "[" }; {print $2}' | sed 's/\,//g' | sed "s/'//g" | sed 's/\(.*\)]/\1/')}
|
||||
fi
|
||||
(for i in $cookbook_path; do ls $i; done)
|
||||
}
|
||||
@ -229,10 +237,9 @@ _cookbook_versions() {
|
||||
|
||||
# Searches up from current directory to find the closest folder that has a .chef folder
|
||||
# Useful for the knife upload/from file commands
|
||||
_chef_root () {
|
||||
_chef_root() {
|
||||
directory="$PWD"
|
||||
while [ $directory != '/' ]
|
||||
do
|
||||
while [ $directory != '/' ]; do
|
||||
test -e "$directory/.chef" && echo "$directory" && return
|
||||
directory="${directory:h}"
|
||||
done
|
||||
|
@ -1,17 +1,17 @@
|
||||
function knife_ssh() {
|
||||
grep -q $1 ~/.knife_comp~ 2> /dev/null || rm -f ~/.knife_comp~;
|
||||
grep -q $1 ~/.knife_comp~ 2> /dev/null || rm -f ~/.knife_comp~
|
||||
ssh $(knife node show $1 | awk '/IP:/{print $2}')
|
||||
}
|
||||
|
||||
_knife_ssh() {
|
||||
if hash knife 2>/dev/null; then
|
||||
if [[ ! -f ~/.knife_comp~ ]]; then
|
||||
echo "\nGenerating ~/.knife_comp~..." >/dev/stderr
|
||||
echo "\nGenerating ~/.knife_comp~..." >&2
|
||||
knife node list > ~/.knife_comp~
|
||||
fi
|
||||
compadd $(<~/.knife_comp~)
|
||||
compadd $(< ~/.knife_comp~)
|
||||
else
|
||||
echo "Could not find knife" > /dev/stderr;
|
||||
echo "Could not find knife" >&2
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,7 @@ alias kdelf='kubectl delete -f'
|
||||
|
||||
# Pod management.
|
||||
alias kgp='kubectl get pods'
|
||||
alias kgpa='kubectl get pods --all-namespaces'
|
||||
alias kgpw='kgp --watch'
|
||||
alias kgpwide='kgp -o wide'
|
||||
alias kep='kubectl edit pods'
|
||||
@ -48,6 +49,7 @@ alias kgpl='kgp -l'
|
||||
|
||||
# Service management.
|
||||
alias kgs='kubectl get svc'
|
||||
alias kgsa='kubectl get svc --all-namespaces'
|
||||
alias kgsw='kgs --watch'
|
||||
alias kgswide='kgs -o wide'
|
||||
alias kes='kubectl edit svc'
|
||||
@ -56,6 +58,7 @@ alias kdels='kubectl delete svc'
|
||||
|
||||
# Ingress management
|
||||
alias kgi='kubectl get ingress'
|
||||
alias kgia='kubectl get ingress --all-namespaces'
|
||||
alias kei='kubectl edit ingress'
|
||||
alias kdi='kubectl describe ingress'
|
||||
alias kdeli='kubectl delete ingress'
|
||||
@ -69,17 +72,20 @@ alias kcn='kubectl config set-context $(kubectl config current-context) --namesp
|
||||
|
||||
# ConfigMap management
|
||||
alias kgcm='kubectl get configmaps'
|
||||
alias kgcma='kubectl get configmaps --all-namespaces'
|
||||
alias kecm='kubectl edit configmap'
|
||||
alias kdcm='kubectl describe configmap'
|
||||
alias kdelcm='kubectl delete configmap'
|
||||
|
||||
# Secret management
|
||||
alias kgsec='kubectl get secret'
|
||||
alias kgseca='kubectl get secret --all-namespaces'
|
||||
alias kdsec='kubectl describe secret'
|
||||
alias kdelsec='kubectl delete secret'
|
||||
|
||||
# Deployment management.
|
||||
alias kgd='kubectl get deployment'
|
||||
alias kgda='kubectl get deployment --all-namespaces'
|
||||
alias kgdw='kgd --watch'
|
||||
alias kgdwide='kgd -o wide'
|
||||
alias ked='kubectl edit deployment'
|
||||
@ -98,6 +104,7 @@ alias kru='kubectl rollout undo'
|
||||
|
||||
# Statefulset management.
|
||||
alias kgss='kubectl get statefulset'
|
||||
alias kgssa='kubectl get statefulset --all-namespaces'
|
||||
alias kgssw='kgss --watch'
|
||||
alias kgsswide='kgss -o wide'
|
||||
alias kess='kubectl edit statefulset'
|
||||
@ -115,7 +122,13 @@ alias kgaa='kubectl get all --all-namespaces'
|
||||
|
||||
# Logs
|
||||
alias kl='kubectl logs'
|
||||
alias kl1h='kubectl logs --since 1h'
|
||||
alias kl1m='kubectl logs --since 1m'
|
||||
alias kl1s='kubectl logs --since 1s'
|
||||
alias klf='kubectl logs -f'
|
||||
alias klf1h='kubectl logs --since 1h -f'
|
||||
alias klf1m='kubectl logs --since 1m -f'
|
||||
alias klf1s='kubectl logs --since 1s -f'
|
||||
|
||||
# File copy
|
||||
alias kcp='kubectl cp'
|
||||
@ -128,6 +141,7 @@ alias kdelno='kubectl delete node'
|
||||
|
||||
# PVC management.
|
||||
alias kgpvc='kubectl get pvc'
|
||||
alias kgpvca='kubectl get pvc --all-namespaces'
|
||||
alias kgpvcw='kgpvc --watch'
|
||||
alias kepvc='kubectl edit pvc'
|
||||
alias kdpvc='kubectl describe pvc'
|
||||
|
@ -29,6 +29,12 @@ plugins=(... laravel)
|
||||
| `pamc` | `php artisan make:controller` |
|
||||
| `pams` | `php artisan make:seeder` |
|
||||
| `pamt` | `php artisan make:test` |
|
||||
| `pamfa` | `php artisan make:factory` |
|
||||
| `pamp` | `php artisan make:policy` |
|
||||
| `pame` | `php artisan make:event` |
|
||||
| `pamj` | `php artisan make:job` |
|
||||
| `paml` | `php artisan make:listener` |
|
||||
| `pamn` | `php artisan make:notification` |
|
||||
|
||||
## Clears
|
||||
|
||||
@ -38,3 +44,14 @@ plugins=(... laravel)
|
||||
| `pacoc` | `php artisan config:clear` |
|
||||
| `pavic` | `php artisan view:clear` |
|
||||
| `paroc` | `php artisan route:clear` |
|
||||
|
||||
## Queues
|
||||
|
||||
| Alias | Description |
|
||||
|:-:|:-:|
|
||||
| `paqf` | `php artisan queue:failed` |
|
||||
| `paqft` | `php artisan queue:failed-table` |
|
||||
| `paql` | `php artisan queue:listen` |
|
||||
| `paqr` | `php artisan queue:retry` |
|
||||
| `paqt` | `php artisan queue:table` |
|
||||
| `paqw` | `php artisan queue:work` |
|
||||
|
@ -17,6 +17,13 @@ alias pamm='php artisan make:model'
|
||||
alias pamc='php artisan make:controller'
|
||||
alias pams='php artisan make:seeder'
|
||||
alias pamt='php artisan make:test'
|
||||
alias pamfa='php artisan make:factory'
|
||||
alias pamp='php artisan make:policy'
|
||||
alias pame='php artisan make:event'
|
||||
alias pamj='php artisan make:job'
|
||||
alias paml='php artisan make:listener'
|
||||
alias pamn='php artisan make:notification'
|
||||
alias pampp='php artisan make:provider'
|
||||
|
||||
|
||||
# Clears
|
||||
@ -24,3 +31,11 @@ alias pacac='php artisan cache:clear'
|
||||
alias pacoc='php artisan config:clear'
|
||||
alias pavic='php artisan view:clear'
|
||||
alias paroc='php artisan route:clear'
|
||||
|
||||
# queues
|
||||
alias paqf='php artisan queue:failed'
|
||||
alias paqft='php artisan queue:failed-table'
|
||||
alias paql='php artisan queue:listen'
|
||||
alias paqr='php artisan queue:retry'
|
||||
alias paqt='php artisan queue:table'
|
||||
alias paqw='php artisan queue:work'
|
||||
|
@ -61,7 +61,7 @@ Plugin for adding catspeak aliases, because why not
|
||||
| `violenz` | `git rebase` |
|
||||
| `visible` | `echo` |
|
||||
| `wtf` | `dmesg` |
|
||||
| `yolo` | `git commit -m "$(curl -s https://whatthecommit.com/index.txt)"` |
|
||||
| `yolo` | `git commit -m "$(curl -s http://whatthecommit.com/index.txt)"` |
|
||||
|
||||
## Usage Examples
|
||||
|
||||
@ -78,6 +78,6 @@ nowai u=r,go= some.file
|
||||
# ssh root@catserver.org
|
||||
pwned root@catserver.org
|
||||
|
||||
# git commit -m "$(curl -s https://whatthecommit.com/index.txt)"
|
||||
# git commit -m "$(curl -s http://whatthecommit.com/index.txt)"
|
||||
yolo
|
||||
```
|
||||
|
@ -1,17 +0,0 @@
|
||||
## Magic Enter plugin
|
||||
|
||||
This plugin makes your enter key magical, by binding commonly used commands to it.
|
||||
|
||||
To use it, add `magic-enter` to the plugins array in your zshrc file. You can set the
|
||||
commands to be run in your .zshrc, before the line containing plugins. If no command
|
||||
is specified in a git directory, `git status` is executed; in other directories, `ls`.
|
||||
|
||||
```zsh
|
||||
# defaults
|
||||
MAGIC_ENTER_GIT_COMMAND='git status -u .'
|
||||
MAGIC_ENTER_OTHER_COMMAND='ls -lh .'
|
||||
|
||||
plugins=(... magic-enter)
|
||||
```
|
||||
|
||||
**Maintainer:** [@dufferzafar](https://github.com/dufferzafar)
|
@ -148,11 +148,11 @@ if [ $# = 0 ]; then
|
||||
else
|
||||
if [ ! -d /Applications/Spotify.app ] && [ ! -d $HOME/Applications/Spotify.app ]; then
|
||||
echo "The Spotify application must be installed."
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ $(osascript -e 'application "Spotify" is running') = "false" ]; then
|
||||
osascript -e 'tell application "Spotify" to activate' || exit 1
|
||||
osascript -e 'tell application "Spotify" to activate' || return 1
|
||||
sleep 2
|
||||
fi
|
||||
fi
|
||||
@ -170,12 +170,12 @@ while [ $# -gt 0 ]; do
|
||||
if [ -z "${CLIENT_ID}" ]; then
|
||||
cecho "Invalid Client ID, please update ${USER_CONFIG_FILE}";
|
||||
showAPIHelp;
|
||||
exit 1;
|
||||
return 1
|
||||
fi
|
||||
if [ -z "${CLIENT_SECRET}" ]; then
|
||||
cecho "Invalid Client Secret, please update ${USER_CONFIG_FILE}";
|
||||
showAPIHelp;
|
||||
exit 1;
|
||||
return 1
|
||||
fi
|
||||
SHPOTIFY_CREDENTIALS=$(printf "${CLIENT_ID}:${CLIENT_SECRET}" | base64 | tr -d "\n"|tr -d '\r');
|
||||
SPOTIFY_PLAY_URI="";
|
||||
@ -194,7 +194,7 @@ while [ $# -gt 0 ]; do
|
||||
cecho "Autorization failed, please check ${USER_CONFG_FILE}"
|
||||
cecho "${SPOTIFY_TOKEN_RESPONSE_DATA}"
|
||||
showAPIHelp
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
SPOTIFY_ACCESS_TOKEN=$( \
|
||||
printf "${SPOTIFY_TOKEN_RESPONSE_DATA}" \
|
||||
@ -307,7 +307,7 @@ while [ $# -gt 0 ]; do
|
||||
|
||||
"quit" ) cecho "Quitting Spotify.";
|
||||
osascript -e 'tell application "Spotify" to quit';
|
||||
exit 0 ;;
|
||||
break ;;
|
||||
|
||||
"next" ) cecho "Going to next track." ;
|
||||
osascript -e 'tell application "Spotify" to next track';
|
||||
@ -358,7 +358,7 @@ while [ $# -gt 0 ]; do
|
||||
echo " vol down # Decreases the volume by 10%.";
|
||||
echo " vol [amount] # Sets the volume to an amount between 0 and 100.";
|
||||
echo " vol # Shows the current Spotify volume.";
|
||||
exit 1;
|
||||
return 1
|
||||
fi
|
||||
|
||||
osascript -e "tell application \"Spotify\" to set sound volume to $newvol";
|
||||
@ -468,9 +468,10 @@ while [ $# -gt 0 ]; do
|
||||
"help" )
|
||||
showHelp;
|
||||
break ;;
|
||||
|
||||
* )
|
||||
showHelp;
|
||||
break;
|
||||
return 1 ;;
|
||||
|
||||
esac
|
||||
done
|
||||
|
@ -12,32 +12,23 @@ function ot () {
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ `uname` == 'Darwin' ]] then # MacOS X
|
||||
export COPY_CMD='pbcopy'
|
||||
elif command -v xsel > /dev/null 2>&1; then # Any Unix with xsel installed
|
||||
export COPY_CMD='xsel --clipboard --input'
|
||||
else
|
||||
COPY_CMD='true'
|
||||
fi
|
||||
|
||||
if [[ "x$1" == "x" ]]; then
|
||||
echo "usage: otpw <profile.name>"
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "usage: $0 <profile.name>"
|
||||
return 1
|
||||
elif [ ! -f $OTP_HOME/$1.otp.asc ]; then
|
||||
echo "missing profile $1, you might need to create it first using otp_add_device"
|
||||
return 1
|
||||
else
|
||||
totpkey=$(gpg --decrypt $OTP_HOME/$1.otp.asc)
|
||||
oathtool --totp --b $totpkey | tee /dev/stderr | `echo $COPY_CMD`
|
||||
if [[ $COPY_CMD == 'true' ]] then
|
||||
echo "Note: you might consider installing xsel for clipboard integration"
|
||||
fi
|
||||
oathtool --totp --b $totpkey | tee /dev/stderr | clipcopy
|
||||
fi
|
||||
}
|
||||
|
||||
function otp_add_device () {
|
||||
if [[ "x$1" == "x" ]] then
|
||||
echo "usage: otp_add <profile.name>"
|
||||
echo "usage: $0 <profile.name>"
|
||||
return 1
|
||||
else
|
||||
echo "Enter an email address attached to your GPG private key, then paste the secret configuration key followed by ^D"
|
||||
|
@ -1,7 +1,7 @@
|
||||
_paver_does_target_list_need_generating () {
|
||||
[ ! -f .paver_targets ] && return 0;
|
||||
[ pavement.py -nt .paver_targets ] && return 0;
|
||||
return 1;
|
||||
[ ! -f .paver_targets ] && return 0
|
||||
[ pavement.py -nt .paver_targets ] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
_paver () {
|
||||
|
@ -1,7 +1,8 @@
|
||||
# This plugin loads pyenv into the current shell and provides prompt info via
|
||||
# the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available.
|
||||
|
||||
FOUND_PYENV=$+commands[pyenv]
|
||||
# Load pyenv only if command not already available
|
||||
command -v pyenv &> /dev/null && FOUND_PYENV=1 || FOUND_PYENV=0
|
||||
|
||||
if [[ $FOUND_PYENV -ne 1 ]]; then
|
||||
pyenvdirs=("$HOME/.pyenv" "/usr/local/pyenv" "/opt/pyenv" "/usr/local/opt/pyenv")
|
||||
|
@ -16,3 +16,15 @@ compdef _repo ru='repo upload'
|
||||
|
||||
alias rst='repo status'
|
||||
compdef _repo rst='repo status'
|
||||
|
||||
alias rsto='repo status -o'
|
||||
compdef _repo rsto='repo status -o'
|
||||
|
||||
alias rfa='repo forall -c'
|
||||
compdef _repo rfa='repo forall -c'
|
||||
|
||||
alias rfap='repo forall -p -c'
|
||||
compdef _repo rfap='repo forall -p -c'
|
||||
|
||||
alias rinf='repo info'
|
||||
compdef _repo rinf='repo info'
|
||||
|
@ -1,10 +0,0 @@
|
||||
# Roswell Plugin
|
||||
|
||||
This plugin adds completions and aliases for [Roswell](https://github.com/roswell/roswell/).
|
||||
|
||||
To use it, add `ros` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... ros)
|
||||
```
|
||||
|
@ -1,17 +1,6 @@
|
||||
# vim:ft=zsh ts=2 sw=2 sts=2 et
|
||||
#
|
||||
# Faster alternative to the current SVN plugin implementation.
|
||||
#
|
||||
# Works with svn 1.6, 1.7, 1.8.
|
||||
# Use `svn_prompt_info` method to enquire the svn data.
|
||||
# It's faster because his efficient use of svn (single svn call) which saves a lot on a huge codebase
|
||||
# It displays the current status of the local files (added, deleted, modified, replaced, or else...)
|
||||
#
|
||||
# Use as a drop-in replacement of the svn plugin not as complementary plugin
|
||||
|
||||
function svn_prompt_info() {
|
||||
local info
|
||||
info=$(svn info 2>&1) || return 1; # capture stdout and stderr
|
||||
info=$(svn info 2>&1) || return 1 # capture stdout and stderr
|
||||
local repo_need_upgrade=$(svn_repo_need_upgrade $info)
|
||||
|
||||
if [[ -n $repo_need_upgrade ]]; then
|
||||
@ -27,7 +16,6 @@ function svn_prompt_info() {
|
||||
printf '%s%s%s%s %s%s%s:%s%s%s%s' \
|
||||
"$ZSH_PROMPT_BASE_COLOR" \
|
||||
"$ZSH_THEME_SVN_PROMPT_PREFIX" \
|
||||
\
|
||||
"$(svn_status_info $info)" \
|
||||
"$ZSH_PROMPT_BASE_COLOR" \
|
||||
\
|
||||
@ -37,14 +25,13 @@ function svn_prompt_info() {
|
||||
\
|
||||
"$(svn_current_revision $info)" \
|
||||
"$ZSH_PROMPT_BASE_COLOR" \
|
||||
\
|
||||
"$ZSH_THEME_SVN_PROMPT_SUFFIX" \
|
||||
"$ZSH_PROMPT_BASE_COLOR"
|
||||
fi
|
||||
}
|
||||
|
||||
function svn_repo_need_upgrade() {
|
||||
grep -q "E155036" <<< ${1:-$(svn info 2> /dev/null)} && \
|
||||
grep -q "E155036" <<< "${1:-$(svn info 2> /dev/null)}" && \
|
||||
echo "E155036: upgrade repo with svn upgrade"
|
||||
}
|
||||
|
||||
@ -63,12 +50,23 @@ function svn_current_revision() {
|
||||
function svn_status_info() {
|
||||
local svn_status_string="$ZSH_THEME_SVN_PROMPT_CLEAN"
|
||||
local svn_status="$(svn status 2> /dev/null)";
|
||||
if command grep -E '^\s*A' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_ADDITIONS:-+}"; fi
|
||||
if command grep -E '^\s*D' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_DELETIONS:-✖}"; fi
|
||||
if command grep -E '^\s*M' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_MODIFICATIONS:-✎}"; fi
|
||||
if command grep -E '^\s*[R~]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_REPLACEMENTS:-∿}"; fi
|
||||
if command grep -E '^\s*\?' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_UNTRACKED:-?}"; fi
|
||||
if command grep -E '^\s*[CI!L]' &> /dev/null <<< $svn_status; then svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_DIRTY:-!}"; fi
|
||||
if command grep -E '^\s*A' &> /dev/null <<< $svn_status; then
|
||||
svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_ADDITIONS:-+}"
|
||||
fi
|
||||
if command grep -E '^\s*D' &> /dev/null <<< $svn_status; then
|
||||
svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_DELETIONS:-✖}"
|
||||
fi
|
||||
if command grep -E '^\s*M' &> /dev/null <<< $svn_status; then
|
||||
svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_MODIFICATIONS:-✎}"
|
||||
fi
|
||||
if command grep -E '^\s*[R~]' &> /dev/null <<< $svn_status; then
|
||||
svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_REPLACEMENTS:-∿}"
|
||||
fi
|
||||
if command grep -E '^\s*\?' &> /dev/null <<< $svn_status; then
|
||||
svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_UNTRACKED:-?}"
|
||||
fi
|
||||
if command grep -E '^\s*[CI!L]' &> /dev/null <<< $svn_status; then
|
||||
svn_status_string="$svn_status_string${ZSH_THEME_SVN_PROMPT_DIRTY:-!}"
|
||||
fi
|
||||
echo $svn_status_string
|
||||
}
|
||||
|
||||
|
@ -5,16 +5,16 @@
|
||||
# Author: Manfred Touron (@moul)
|
||||
|
||||
_arguments \
|
||||
'(-h --help)'{-h,--help}'[This help.]' \
|
||||
'(-u --user)'{-u,--user}'[User to use.]' \
|
||||
'(-c --certificate)'{-c,--certificate}'[Path to ssh-certificate to use.]' \
|
||||
'(-sc --ssh)'{-sc,--ssh}'[SSH-connection-string, multiple.]' \
|
||||
'(-sa --ssh)'{-sa,--ssh}'[SSH connection arguments, used on every session.]' \
|
||||
'(-ts --tmux)'{-ts,--tmux}'[Alternative tmux-session-name, default: tmux-cssh]' \
|
||||
'(-ns --new)'{-ns,--new}'[Initializes a new session, like -ts \[name\].]' \
|
||||
'(-q --quiet)'{-q,--quiet}'[Quiet-mode.]' \
|
||||
'(-f --filename)'{-f,--filename}'[Filename of textfile to get -sc connection-strings from, line separated.]' \
|
||||
'(-cs --config)'{-cs,--config}'[Name of config-settings which should be get from config-file "$HOME/.tmux-cssh". Which can be a grep-regular expression to find the name(s).]' \
|
||||
'(-h --help)'{-h,--help}'[This help.]' \
|
||||
'(-u --user)'{-u,--user}'[User to use.]' \
|
||||
'(-c --certificate)'{-c,--certificate}'[Path to ssh-certificate to use.]' \
|
||||
'(-sc --ssh)'{-sc,--ssh}'[SSH-connection-string, multiple.]' \
|
||||
'(-sa --ssh)'{-sa,--ssh}'[SSH connection arguments, used on every session.]' \
|
||||
'(-ts --tmux)'{-ts,--tmux}'[Alternative tmux-session-name, default: tmux-cssh]' \
|
||||
'(-ns --new)'{-ns,--new}'[Initializes a new session, like -ts \[name\].]' \
|
||||
'(-q --quiet)'{-q,--quiet}'[Quiet-mode.]' \
|
||||
'(-f --filename)'{-f,--filename}'[Filename of textfile to get -sc connection-strings from, line separated.]' \
|
||||
'(-cs --config)'{-cs,--config}'[Name of config-settings which should be get from config-file "$HOME/.tmux-cssh". Which can be a grep-regular expression to find the name(s).]' \
|
||||
':hosts:_hosts' \
|
||||
'*:: :->subcmds' \
|
||||
&& return 0
|
||||
|
@ -35,7 +35,7 @@ The plugin also supports the following -
|
||||
| `ZSH_TMUX_AUTOQUIT` | Automatically closes terminal once tmux exits (default: `ZSH_TMUX_AUTOSTART`) |
|
||||
| `ZSH_TMUX_FIXTERM` | Sets `$TERM` to 256-color term or not based on current terminal support |
|
||||
| `ZSH_TMUX_ITERM2` | Sets the `-CC` option for iTerm2 tmux integration (default: `false`) |
|
||||
| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `screen`) |
|
||||
| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `screen-256color` |
|
||||
| `ZSH_TMUX_FIXTERM_WITHOUT_256COLOR` | `$TERM` to use for non 256-color terminals (default: `tmux`) |
|
||||
| `ZSH_TMUX_FIXTERM_WITH_256COLOR` | `$TERM` to use for 256-color terminals (default: `tmux-256color` |
|
||||
| `ZSH_TMUX_CONFIG` | Set the configuration path (default: `$HOME/.tmux.conf`) |
|
||||
| `ZSH_TMUX_UNICODE` | Set `tmux -u` option to support unicode |
|
||||
|
@ -22,18 +22,18 @@ alias tkss='tmux kill-session -t'
|
||||
: ${ZSH_TMUX_AUTOCONNECT:=true}
|
||||
# Automatically close the terminal when tmux exits
|
||||
: ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART}
|
||||
# Set term to screen or screen-256color based on current terminal support
|
||||
# Set term to tmux or tmux-256color based on current terminal support
|
||||
: ${ZSH_TMUX_FIXTERM:=true}
|
||||
# Set '-CC' option for iTerm2 tmux integration
|
||||
: ${ZSH_TMUX_ITERM2:=false}
|
||||
# The TERM to use for non-256 color terminals.
|
||||
# Tmux states this should be screen, but you may need to change it on
|
||||
# Tmux states this should be tmux, but you may need to change it on
|
||||
# systems without the proper terminfo
|
||||
: ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=screen}
|
||||
: ${ZSH_TMUX_FIXTERM_WITHOUT_256COLOR:=tmux}
|
||||
# The TERM to use for 256 color terminals.
|
||||
# Tmux states this should be screen-256color, but you may need to change it on
|
||||
# Tmux states this should be tmux-256color, but you may need to change it on
|
||||
# systems without the proper terminfo
|
||||
: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=screen-256color}
|
||||
: ${ZSH_TMUX_FIXTERM_WITH_256COLOR:=tmux-256color}
|
||||
# Set the configuration path
|
||||
: ${ZSH_TMUX_CONFIG:=$HOME/.tmux.conf}
|
||||
# Set -u option to support unicode
|
||||
|
@ -22,6 +22,13 @@ elif [[ -f "/usr/local/bin/virtualenvwrapper.sh" ]]; then
|
||||
virtualenvwrapper="/usr/local/bin/virtualenvwrapper.sh"
|
||||
source "/usr/local/bin/virtualenvwrapper.sh"
|
||||
}
|
||||
elif [[ -f "/usr/share/virtualenvwrapper/virtualenvwrapper.sh" ]]; then
|
||||
function {
|
||||
setopt local_options
|
||||
unsetopt equals
|
||||
virtualenvwrapper="/usr/share/virtualenvwrapper/virtualenvwrapper.sh"
|
||||
source "/usr/share/virtualenvwrapper/virtualenvwrapper.sh"
|
||||
}
|
||||
elif [[ -f "/etc/bash_completion.d/virtualenvwrapper" ]]; then
|
||||
function {
|
||||
setopt local_options
|
||||
|
@ -1,6 +1,6 @@
|
||||
# VS code
|
||||
# VS Code
|
||||
|
||||
This plugin makes interaction between the command line and the code editor easier.
|
||||
This plugin makes interaction between the command line and the VS Code editor easier.
|
||||
|
||||
To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`:
|
||||
|
||||
@ -8,9 +8,11 @@ To start using it, add the `vscode` plugin to your `plugins` array in `~/.zshrc`
|
||||
plugins=(... vscode)
|
||||
```
|
||||
|
||||
If you are using [Visual Studio Code Insiders](https://code.visualstudio.com/insiders/),
|
||||
add the following line in the oh-my-zsh settings section (between the `ZSH_THEME` and
|
||||
the `plugins=()` line). This will make the plugin use the Insiders version instead.
|
||||
## VS Code Insiders
|
||||
|
||||
🍏 **If you are only using [VS Code Insiders](https://code.visualstudio.com/insiders/), the plugin will automatically bind to your Insiders installation.**
|
||||
|
||||
But, if you have both Stable and Insiders versions and want to configure the plugin to just use the Insiders version, add the following line in the oh-my-zsh settings section (between the `ZSH_THEME` and the `plugins=()` line). This will make the plugin use the Insiders version instead.
|
||||
|
||||
```zsh
|
||||
ZSH_THEME=...
|
||||
|
@ -1,9 +1,17 @@
|
||||
# VScode zsh plugin
|
||||
# author: https://github.com/MarsiBarsi
|
||||
# Authors:
|
||||
# https://github.com/MarsiBarsi (original author)
|
||||
# https://github.com/babakks
|
||||
|
||||
# Use main Visual Studio Code version by default
|
||||
: ${VSCODE:=code}
|
||||
# Use the stable VS Code release, unless the Insiders version is the only
|
||||
# available installation
|
||||
if ! which code > /dev/null && which code-insiders > /dev/null; then
|
||||
: ${VSCODE:=code-insiders}
|
||||
else
|
||||
: ${VSCODE:=code}
|
||||
fi
|
||||
|
||||
# Define aliases
|
||||
alias vsc="$VSCODE ."
|
||||
alias vsca="$VSCODE --add"
|
||||
alias vscd="$VSCODE --diff"
|
||||
|
@ -86,9 +86,11 @@ _yarn_scripts() {
|
||||
local i runJSON
|
||||
|
||||
runJSON=$(yarn run --json 2>/dev/null)
|
||||
binaries=($(sed -E '/Commands available/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\n/g' <<< "$runJSON"))
|
||||
scriptNames=($(sed -E '/possibleCommands/!d;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\n/g' <<< "$runJSON"))
|
||||
scriptCommands=("${(@f)$(sed -E '/possibleCommands/!d;s/.*"hints":\{([^}]+)\}.*/\1/;s/"[^"]+"://g;s/:/\\:/g;s/","/\n/g;s/(^"|"$)//g' <<< "$runJSON")}")
|
||||
# Some sed utilities (e.g. Mac OS / BSD) don't interpret `\n` in a replacement
|
||||
# pattern as a newline. See https://superuser.com/q/307165
|
||||
binaries=($(sed -E '/Commands available/!d;s/.*Commands available from binary scripts: ([^"]+)".*/\1/;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\'$'\n/g' <<< "$runJSON"))
|
||||
scriptNames=($(sed -E '/possibleCommands/!d;s/.*"items":\[([^]]+).*/\1/;s/[" ]//g;s/:/\\:/g;s/,/\'$'\n/g' <<< "$runJSON"))
|
||||
scriptCommands=("${(@f)$(sed -E '/possibleCommands/!d;s/.*"hints":\{(.+")\}.*/\1/;s/"[^"]+"://g;s/:/\\:/g;s/","/\'$'\n/g;s/(^"|"$)//g' <<< "$runJSON")}")
|
||||
|
||||
for (( i=1; i <= $#scriptNames; i++ )); do
|
||||
scripts+=("${scriptNames[$i]}:${scriptCommands[$i]}")
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
* `zcu` aliases `zeus cucumber`
|
||||
* `zucumber` aliases `zeus cucumber`
|
||||
* `zwip` aliases `zeus cucumber --profile wip`
|
||||
|
||||
* `zspec` aliases `zeus rspec`
|
||||
|
||||
|
@ -33,6 +33,7 @@ alias zunner='zeus runner'
|
||||
# Cucumber
|
||||
alias zcu='zeus cucumber'
|
||||
alias zucumber='zeus cucumber'
|
||||
alias zwip='zeus cucumber --profile wip'
|
||||
|
||||
# Rspec
|
||||
alias zspec='zeus rspec'
|
||||
|
Loading…
Reference in New Issue
Block a user