Unverified Commit 8c95c523 authored by Kozlov Alexander's avatar Kozlov Alexander Committed by GitHub
Browse files

Merge branch 'master' into master

parents dd30cf10 3d8f2bda
#!/bin/zsh
source_env() { source_env() {
if [[ -f .env ]]; then if [[ -f .env ]]; then
source .env # test .env syntax
zsh -fn .env || echo 'dotenv: error when sourcing `.env` file' >&2
if [[ -o a ]]; then
source .env
else
set -a
source .env
set +a
fi
fi fi
} }
autoload -U add-zsh-hook autoload -U add-zsh-hook
add-zsh-hook chpwd source_env add-zsh-hook chpwd source_env
source_env
...@@ -16,4 +16,4 @@ Author: [Fabio Fernandes](https://github.com/fabiofl) ...@@ -16,4 +16,4 @@ Author: [Fabio Fernandes](https://github.com/fabiofl)
- Upload a file: `droplr ./path/to/file/` - Upload a file: `droplr ./path/to/file/`
- Shorten a link: `droplr http://example.com` - Shorten a link: `droplr https://example.com`
# ExpressionEngine CMS basic command completion
_eecms_console () {
echo "php $(find . -maxdepth 3 -mindepth 1 -name 'eecms' -type f | head -n 1)"
}
_eecms_get_command_list () {
`_eecms_console` | sed "/Available commands/,/^/d" | sed "s/[[:space:]].*//g"
}
_eecms () {
compadd `_eecms_get_command_list`
}
compdef _eecms '`_eecms_console`'
compdef _eecms 'system/ee/eecms'
compdef _eecms eecms
#Alias
alias eecms='`_eecms_console`'
# Emacs plugin
This plugin utilizes the Emacs daemon capability, allowing the user to quickly open frames, whether they are opened in a terminal via a ssh connection, or X frames opened on the same host. The plugin also provides some aliases for such operations.
- You don't have the cost of starting Emacs all the time anymore
- Opening a file is as fast as Emacs does not have anything else to do.
- You can share opened buffered across opened frames.
- Configuration changes made at runtime are applied to all frames.
**NOTE:** requires Emacs 24 and newer.
To use it, add emacs to the plugins array in your zshrc file:
```zsh
plugins=(... emacs)
```
## Aliases
The plugin uses a custom launcher (which we'll call here `$EMACS_LAUNCHER`) that is just a wrapper around [`emacsclient`](https://www.emacswiki.org/emacs/EmacsClient).
| Alias | Command | Description |
|--------|----------------------------------------------------|----------------------------------------------------------------|
| emacs | `$EMACS_LAUNCHER --no-wait` | Opens a temporary emacsclient frame |
| e | `emacs` | Same as emacs alias |
| te | `$EMACS_LAUNCHER -nw` | Open terminal emacsclient |
| eeval | `$EMACS_LAUNCHER --eval` | Same as `M-x eval` but from outside Emacs |
| eframe | `emacsclient --alternate-editor "" --create-frame` | Create new X frame |
| efile | - | Print the path to the file open in the current buffer |
| ecd | - | Print the directory of the file open in the the current buffer |
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# - Configuration changes made at runtime are applied to all frames. # - Configuration changes made at runtime are applied to all frames.
if "$ZSH/tools/require_tool.sh" emacs 24 2>/dev/null ; then if "$ZSH/tools/require_tool.sh" emacsclient 24 2>/dev/null ; then
export EMACS_PLUGIN_LAUNCHER="$ZSH/plugins/emacs/emacsclient.sh" export EMACS_PLUGIN_LAUNCHER="$ZSH/plugins/emacs/emacsclient.sh"
# set EDITOR if not already defined. # set EDITOR if not already defined.
......
# Ember CLI # Ember CLI
**Maintainers:** [BilalBudhani](http://www.github.com/BilalBudhani), [eubenesa](http://www.github.com/eubenesa) **Maintainers:** [BilalBudhani](https://github.com/BilalBudhani), [eubenesa](https://github.com/eubenesa), [scottkidder](https://github.com/scottkidder]
Ember CLI (http://www.ember-cli.com/) Ember CLI (https://www.ember-cli.com/)
### List of Aliases ### List of Aliases
...@@ -17,5 +17,6 @@ Alias | Ember-CLI command ...@@ -17,5 +17,6 @@ Alias | Ember-CLI command
**ein** | *ember init* **ein** | *ember init*
**ei** | *ember install* **ei** | *ember install*
**et** | *ember test* **et** | *ember test*
**ets** | *ember test --serve*
**eu** | *ember update* **eu** | *ember update*
**ev** | *ember version* **ev** | *ember version*
# Ember CLI # Ember CLI
# Visit http://www.ember-cli.com/ to view user guide # Visit https://www.ember-cli.com/ to view user guide
alias es='ember serve' alias es='ember serve'
alias ea='ember addon' alias ea='ember addon'
...@@ -10,6 +10,7 @@ alias eh='ember help' ...@@ -10,6 +10,7 @@ alias eh='ember help'
alias ein='ember init' alias ein='ember init'
alias ei='ember install' alias ei='ember install'
alias et='ember test' alias et='ember test'
alias ets='ember test --serve'
alias eu='ember update' alias eu='ember update'
# version # version
......
# emoji-clock
The plugin displays current time as an emoji symbol with half hour accuracy.
To use it, add `emoji-clock` to the plugins array of your zshrc file:
```
plugins=(... emoji-clock)
```
## Features
| Function | Description |
|-------------------|----------------------------------------------------------------------|
| `emoji-clock` | Displays current time in clock emoji symbol with half hour accuracy |
...@@ -71,7 +71,7 @@ PROMPT="$surfer > " ...@@ -71,7 +71,7 @@ PROMPT="$surfer > "
## Technical Details ## Technical Details
The emoji names and codes are sourced from Unicode Technical Report \#51, which provides information on emoji support in Unicode. It can be found at http://www.unicode.org/reports/tr51/index.html. The emoji names and codes are sourced from Unicode Technical Report \#51, which provides information on emoji support in Unicode. It can be found at https://www.unicode.org/reports/tr51/index.html.
The group definitions are added by this OMZ plugin. They are not based on external definitions. (As far as I can tell. -apjanke) The group definitions are added by this OMZ plugin. They are not based on external definitions. (As far as I can tell. -apjanke)
...@@ -108,7 +108,7 @@ The `$emoji_skintone` associative array maps skin tone IDs to the variation sele ...@@ -108,7 +108,7 @@ The `$emoji_skintone` associative array maps skin tone IDs to the variation sele
echo "$emoji[smiling_face_with_open_mouth]$emoji_skintone[4]" echo "$emoji[smiling_face_with_open_mouth]$emoji_skintone[4]"
``` ```
Note that `$emoji_skintone` is an associative array, and its keys are the *names* of "Fitzpatrick Skin Type" groups, not linear indexes into a normal array. The names are `1_2`, `3`, `4`, `5`, and `6`. (Types 1 and 2 are combined into a single color.) See the [Diversity section in Unicode TR 51](http://www.unicode.org/reports/tr51/index.html#Diversity) for details. Note that `$emoji_skintone` is an associative array, and its keys are the *names* of "Fitzpatrick Skin Type" groups, not linear indexes into a normal array. The names are `1_2`, `3`, `4`, `5`, and `6`. (Types 1 and 2 are combined into a single color.) See the [Diversity section in Unicode TR 51](https://www.unicode.org/reports/tr51/index.html#Diversity) for details.
## TODO ## TODO
...@@ -130,6 +130,6 @@ This does *not* mean that it should use Gemoji at run time. None of the `zsh` pl ...@@ -130,6 +130,6 @@ This does *not* mean that it should use Gemoji at run time. None of the `zsh` pl
#### ZWJ combining function #### ZWJ combining function
One of the newer features of Unicode emoji is the ability to use the "Zero-Width Joiner" character to compose multiple emoji characters in to a single "emoji ligature" glyph. For example, this is [how Apple supports "family" emoji with various genders and skin tones](http://www.unicode.org/reports/tr51/index.html#ZWJ_Sequences). One of the newer features of Unicode emoji is the ability to use the "Zero-Width Joiner" character to compose multiple emoji characters in to a single "emoji ligature" glyph. For example, this is [how Apple supports "family" emoji with various genders and skin tones](https://www.unicode.org/reports/tr51/index.html#ZWJ_Sequences).
These are a pain to write out (and probably worse to read), and it might be convenient to have a couple functions for concisely composing them, if wider support for them appears. These are a pain to write out (and probably worse to read), and it might be convenient to have a couple functions for concisely composing them, if wider support for them appears.
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# none: not applicable # none: not applicable
# Field 4 — Emoji_Sources: # Field 4 — Emoji_Sources:
# one or more values from {z, a, j, w, x} # one or more values from {z, a, j, w, x}
# see the key in http://www.unicode.org/draft/reports/tr51/tr51.html#Major_Sources # see the key in https://www.unicode.org/draft/reports/tr51/tr51.html#Major_Sources
# NA: not applicable # NA: not applicable
# Comment — currently contains the version where the character was first encoded, # Comment — currently contains the version where the character was first encoded,
# followed by: # followed by:
...@@ -1200,7 +1200,7 @@ ...@@ -1200,7 +1200,7 @@
1F1F2 1F1ED ; emoji ; L2 ; none ; x # V6.0 (🇲🇭) flag for Marshall Islands 1F1F2 1F1ED ; emoji ; L2 ; none ; x # V6.0 (🇲🇭) flag for Marshall Islands
1F1F2 1F1F0 ; emoji ; L2 ; none ; x # V6.0 (🇲🇰) flag for Macedonia 1F1F2 1F1F0 ; emoji ; L2 ; none ; x # V6.0 (🇲🇰) flag for Macedonia
1F1F2 1F1F1 ; emoji ; L2 ; none ; x # V6.0 (🇲🇱) flag for Mali 1F1F2 1F1F1 ; emoji ; L2 ; none ; x # V6.0 (🇲🇱) flag for Mali
1F1F2 1F1F2 ; emoji ; L2 ; none ; x # V6.0 (🇲🇲) flag for Myanmar 1F1F2 1F1F2 ; emoji ; L2 ; none ; x # V6.0 (🇲🇲) flag for Myanmar
1F1F2 1F1F3 ; emoji ; L2 ; none ; x # V6.0 (🇲🇳) flag for Mongolia 1F1F2 1F1F3 ; emoji ; L2 ; none ; x # V6.0 (🇲🇳) flag for Mongolia
1F1F2 1F1F4 ; emoji ; L2 ; none ; x # V6.0 (🇲🇴) flag for Macau 1F1F2 1F1F4 ; emoji ; L2 ; none ; x # V6.0 (🇲🇴) flag for Macau
1F1F2 1F1F5 ; emoji ; L2 ; none ; x # V6.0 (🇲🇵) flag for Northern Mariana Islands 1F1F2 1F1F5 ; emoji ; L2 ; none ; x # V6.0 (🇲🇵) flag for Northern Mariana Islands
......
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
# This script generates the emoji.plugin.zsh emoji definitions from the Unicode # This script generates the emoji.plugin.zsh emoji definitions from the Unicode
# character data for the emoji characters. # character data for the emoji characters.
# #
# The data file can be found at http://unicode.org/Public/emoji/latest/emoji-data.txt # The data file can be found at https://unicode.org/Public/emoji/latest/emoji-data.txt
# as referenced in Unicode TR51 (http://www.unicode.org/reports/tr51/index.html). # as referenced in Unicode TR51 (https://www.unicode.org/reports/tr51/index.html).
# #
# This is known to work with the data file from version 1.0. It may not work with later # This is known to work with the data file from version 1.0. It may not work with later
# versions if the format changes. In particular, this reads line comments to get the # versions if the format changes. In particular, this reads line comments to get the
# emoji character name and unicode version. # emoji character name and unicode version.
# #
# Country names have punctuation and other non-letter characters removed from their name, # Country names have punctuation and other non-letter characters removed from their name,
# to avoid possible complications with having to escape the strings when using them as # to avoid possible complications with having to escape the strings when using them as
# array subscripts. The definition file seems to use some combining characters like accents # array subscripts. The definition file seems to use some combining characters like accents
# that get stripped during this process. # that get stripped during this process.
...@@ -41,7 +41,7 @@ sub process_emoji_data_file { ...@@ -41,7 +41,7 @@ sub process_emoji_data_file {
# #
# This contains the definition for: # This contains the definition for:
# \$emoji - which maps character names to Unicode characters # \$emoji - which maps character names to Unicode characters
# \$emoji_flags - maps country names to Unicode flag characters using region indicators # \$emoji_flags - maps country names to Unicode flag characters using region indicators
# Main emoji # Main emoji
typeset -gAH emoji typeset -gAH emoji
...@@ -63,7 +63,7 @@ typeset -gAH emoji_mod ...@@ -63,7 +63,7 @@ typeset -gAH emoji_mod
next if /^\s*#/ or /^\s*$/; next if /^\s*#/ or /^\s*$/;
if (/^(\S.*?\S)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w.*?)\s*#\s*V(\S+)\s\(.*?\)\s*(\w.*\S)\s*$/) { if (/^(\S.*?\S)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w+)\s*;\s*(\w.*?)\s*#\s*V(\S+)\s\(.*?\)\s*(\w.*\S)\s*$/) {
my ($code, $style, $level, $modifier_status, $sources, $version, $keycap_name) my ($code, $style, $level, $modifier_status, $sources, $version, $keycap_name)
= ($1, $2, $3, $4, $5, $6, $7); = ($1, $2, $3, $4, $5, $6, $7);
#print "code=$code style=$style level=$level modifier_status=$modifier_status sources=$sources version=$version name=$keycap_name\n"; #print "code=$code style=$style level=$level modifier_status=$modifier_status sources=$sources version=$version name=$keycap_name\n";
my @code_points = split /\s+/, $code; my @code_points = split /\s+/, $code;
...@@ -84,7 +84,7 @@ typeset -gAH emoji_mod ...@@ -84,7 +84,7 @@ typeset -gAH emoji_mod
if ($flag_country) { if ($flag_country) {
$outfh->print("emoji_flags[$zsh_flag_country]=\$'$zsh_code'\n"); $outfh->print("emoji_flags[$zsh_flag_country]=\$'$zsh_code'\n");
} else { } else {
$outfh->print("emoji[$omz_name]=\$'$zsh_code'\n"); $outfh->print("emoji[$omz_name]=\$'$zsh_code'\n");
} }
# Modifiers are included in both the main set and their separate map, # Modifiers are included in both the main set and their separate map,
# because they have a standalone representation as a color swatch. # because they have a standalone representation as a color swatch.
......
...@@ -26,13 +26,14 @@ function emotty() { ...@@ -26,13 +26,14 @@ function emotty() {
# Use emotty set defined by user, fallback to default # Use emotty set defined by user, fallback to default
local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]} local emotty=${_emotty_sets[${emotty_set:-$emotty_default_set}]}
# Parse $TTY number, normalizing it to an emotty set index # Parse $TTY number, normalizing it to an emotty set index
(( tty = (${TTY##/dev/ttys} % ${#${=emotty}}) + 1 )) (( tty = (${TTY##/dev/tty} % ${#${=emotty}}) + 1 ))
local character_name=${${=emotty}[tty]} local character_name=${${=emotty}[tty]}
echo "${emoji[${character_name}]}${emoji2[emoji_style]}" echo "${emoji[${character_name}]}${emoji2[emoji_style]}"
} }
function display_emotty() { function display_emotty() {
local name=$1 local name=${1:-$emotty_set}
echo $name
for i in ${=_emotty_sets[$name]}; do for i in ${=_emotty_sets[$name]}; do
printf "${emoji[$i]}${emoji2[emoji_style]} " printf "${emoji[$i]}${emoji2[emoji_style]} "
done done
......
# encode64
Alias plugin for encoding or decoding using `base64` command
## Functions and Aliases
| Function | Alias | Description |
| ---------- | ----- | ------------------------------ |
| `encode64` | `e64` | Encodes given data to base64 |
| `decode64` | `d64` | Decodes given data from base64 |
## Enabling plugin
1. Edit your `.zshrc` file and add `encode64` to the list of plugins:
```sh
plugins=(
# ...other enabled plugins
encode64
)
```
2. Restart your terminal session or reload configuration by running:
```sh
source ~/.zshrc
```
## Usage and examples
### Encoding
- From parameter
```console
$ encode64 "oh-my-zsh"
b2gtbXktenNo
$ e64 "oh-my-zsh"
b2gtbXktenNo
```
- From piping
```console
$ echo "oh-my-zsh" | encode64
b2gtbXktenNo==
$ echo "oh-my-zsh" | e64
b2gtbXktenNo==
```
### Decoding
- From parameter
```console
$ decode64 b2gtbXktenNo
oh-my-zsh%
$ d64 b2gtbXktenNo
oh-my-zsh%
```
- From piping
```console
$ echo "b2gtbXktenNoCg==" | decode64
oh-my-zsh
$ echo "b2gtbXktenNoCg==" | decode64
oh-my-zsh
```
...@@ -3,5 +3,5 @@ ...@@ -3,5 +3,5 @@
_arguments \ _arguments \
'(-r --remove)'{-r,--remove}'[Remove archive.]' \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \
"*::archive file:_files -g '(#i)*.(7z|Z|apk|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|xpi|xz|zip)(-.)'" \ "*::archive file:_files -g '(#i)*.(7z|Z|apk|bz2|deb|gz|ipsw|jar|lzma|rar|sublime-package|tar|tar.bz2|tar.gz|tar.xz|tar.zma|tbz|tbz2|tgz|tlz|txz|war|whl|xpi|xz|zip)(-.)'" \
&& return 0 && return 0
...@@ -10,7 +10,7 @@ extract() { ...@@ -10,7 +10,7 @@ extract() {
Usage: extract [-option] [file ...] Usage: extract [-option] [file ...]
Options: Options:
-r, --remove Remove archive. -r, --remove Remove archive after unpacking.
EOF EOF
fi fi
...@@ -29,7 +29,7 @@ extract() { ...@@ -29,7 +29,7 @@ extract() {
success=0 success=0
extract_dir="${1:t:r}" extract_dir="${1:t:r}"
case "$1" in case "${1:l}" in
(*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;; (*.tar.gz|*.tgz) (( $+commands[pigz] )) && { pigz -dc "$1" | tar xv } || tar zxvf "$1" ;;
(*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;; (*.tar.bz2|*.tbz|*.tbz2) tar xvjf "$1" ;;
(*.tar.xz|*.txz) (*.tar.xz|*.txz)
...@@ -45,8 +45,8 @@ extract() { ...@@ -45,8 +45,8 @@ extract() {
(*.bz2) bunzip2 "$1" ;; (*.bz2) bunzip2 "$1" ;;
(*.xz) unxz "$1" ;; (*.xz) unxz "$1" ;;
(*.lzma) unlzma "$1" ;; (*.lzma) unlzma "$1" ;;
(*.Z) uncompress "$1" ;; (*.z) uncompress "$1" ;;
(*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk) unzip "$1" -d $extract_dir ;; (*.zip|*.war|*.jar|*.sublime-package|*.ipsw|*.xpi|*.apk|*.whl) unzip "$1" -d $extract_dir ;;
(*.rar) unrar x -ad "$1" ;; (*.rar) unrar x -ad "$1" ;;
(*.7z) 7za x "$1" ;; (*.7z) 7za x "$1" ;;
(*.deb) (*.deb)
......
# Fabric
This plugin provides completion for [Fabric](https://www.fabfile.org/).
To use it add fabric to the plugins array in your zshrc file.
```bash
plugins=(... fabric)
```
# DECLARION: This plugin was created by vhbit. What I did is just making a portal from https://github.com/vhbit/fabric-zsh-autocomplete.
...@@ -6,6 +6,7 @@ if [ $commands[fasd] ]; then # check if fasd is installed ...@@ -6,6 +6,7 @@ if [ $commands[fasd] ]; then # check if fasd is installed
source "$fasd_cache" source "$fasd_cache"
unset fasd_cache unset fasd_cache
alias v="f -e $EDITOR" alias v="f -e \"$EDITOR\""
alias o='a -e open_command' alias o='a -e xdg-open'
alias j='zz'
fi fi
This is a plugin based on yum plugin, but using dnf as main frontend The fedora plugin is deprecated. Use the [dnf plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/dnf) instead.
(from Fedora 22 onwards, yum is deprecated in favor of dnf).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment