Unverified Commit 0232ac4b authored by Marc Cornellà's avatar Marc Cornellà Committed by GitHub
Browse files

Merge branch 'master' into master

parents afb02876 ebc700be
# 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
```
...@@ -19,6 +19,7 @@ plugins=(... extract) ...@@ -19,6 +19,7 @@ plugins=(... extract)
| `7z` | 7zip file | | `7z` | 7zip file |
| `Z` | Z archive (LZW) | | `Z` | Z archive (LZW) |
| `apk` | Android app file | | `apk` | Android app file |
| `aar` | Android library file |
| `bz2` | Bzip2 file | | `bz2` | Bzip2 file |
| `deb` | Debian package | | `deb` | Debian package |
| `gz` | Gzip file | | `gz` | Gzip file |
......
...@@ -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|aar|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
...@@ -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|*.aar|*.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.
# Use Ctrl-Z to switch back to Vim # Use Ctrl-Z to switch back to Vim
I frequently need to execute random command in my shell. To achieve it I pause I frequently need to execute random commands in my shell. To achieve it I pause
Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim. Vim by pressing Ctrl-z, type command and press fg<Enter> to switch back to Vim.
The fg part really hurt sme. I just wanted to hit Ctrl-z once again to get back The fg part really hurts me. I just wanted to hit Ctrl-z once again to get back
to Vim. I could not find a solution, so I developed one on my own that to Vim. I could not find a solution, so I developed one on my own that
works wonderfully with ZSH works wonderfully with ZSH.
Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/ Source: http://sheerun.net/2014/03/21/how-to-boost-your-vim-productivity/
......
...@@ -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
# fd
This plugin adds completion for the file search tool [`fd`](https://github.com/sharkdp/fd), also known as `fd-find`.
To use it, add `fd` to the plugins array in your zshrc file:
```zsh
plugins=(... fd)
```
Completion is taken from the fd release [`7.3.0`](https://github.com/sharkdp/fd/releases/tag/v7.3.0).
Updated on Febrary 13th, 2019.
#compdef fd fdfind
autoload -U is-at-least
_fd() {
typeset -A opt_args
typeset -a _arguments_options
local ret=1
if is-at-least 5.2; then
_arguments_options=(-s -S -C)
else
_arguments_options=(-s -C)
fi
local context curcontext="$curcontext" state line
_arguments "${_arguments_options[@]}" \
'-d+[Set maximum search depth (default: none)]' \
'--max-depth=[Set maximum search depth (default: none)]' \
'--maxdepth=[See --max-depth]' \
'*-t+[Filter by type: file (f), directory (d), symlink (l),
executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \
'*--type=[Filter by type: file (f), directory (d), symlink (l),
executable (x), empty (e)]: :(f file d directory l symlink x executable e empty)' \
'*-e+[Filter by file extension]' \
'*--extension=[Filter by file extension]' \
'-x+[Execute a command for each search result]' \
'--exec=[Execute a command for each search result]' \
'(-x --exec)-X+[Execute a command with all search results at once]' \
'(-x --exec)--exec-batch=[Execute a command with all search results at once]' \
'*-E+[Exclude entries that match the given glob pattern]' \
'*--exclude=[Exclude entries that match the given glob pattern]' \
'*--ignore-file=[Add a custom ignore-file in .gitignore format]' \
'-c+[When to use colors: never, *auto*, always]: :(never auto always)' \
'--color=[When to use colors: never, *auto*, always]: :(never auto always)' \
'-j+[Set number of threads to use for searching & executing]' \
'--threads=[Set number of threads to use for searching & executing]' \
'*-S+[Limit results based on the size of files.]' \
'*--size=[Limit results based on the size of files.]' \
'--max-buffer-time=[the time (in ms) to buffer, before streaming to the console]' \
'--changed-within=[Filter by file modification time (newer than)]' \
'--changed-before=[Filter by file modification time (older than)]' \
'*--search-path=[(hidden)]' \
'-H[Search hidden files and directories]' \
'--hidden[Search hidden files and directories]' \
'-I[Do not respect .(git|fd)ignore files]' \
'--no-ignore[Do not respect .(git|fd)ignore files]' \
'--no-ignore-vcs[Do not respect .gitignore files]' \
'*-u[Alias for no-ignore and/or hidden]' \
'-s[Case-sensitive search (default: smart case)]' \
'--case-sensitive[Case-sensitive search (default: smart case)]' \
'-i[Case-insensitive search (default: smart case)]' \
'--ignore-case[Case-insensitive search (default: smart case)]' \
'-F[Treat the pattern as a literal string]' \
'--fixed-strings[Treat the pattern as a literal string]' \
'-a[Show absolute instead of relative paths]' \
'--absolute-path[Show absolute instead of relative paths]' \
'-L[Follow symbolic links]' \
'--follow[Follow symbolic links]' \
'-p[Search full path (default: file-/dirname only)]' \
'--full-path[Search full path (default: file-/dirname only)]' \
'-0[Separate results by the null character]' \
'--print0[Separate results by the null character]' \
'--show-errors[Enable display of filesystem errors]' \
'-h[Prints help information]' \
'--help[Prints help information]' \
'-V[Prints version information]' \
'--version[Prints version information]' \
'::pattern -- the search pattern, a regular expression (optional):_files' \
'::path -- the root directory for the filesystem search (optional):_files' \
&& ret=0
}
(( $+functions[_fd_commands] )) ||
_fd_commands() {
local commands; commands=(
)
_describe -t commands 'fd commands' commands "$@"
}
_fd "$@"
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).
## Aliases
alias dnfs="dnf search" # search package
alias dnfp="dnf info" # show package info
alias dnfl="dnf list" # list packages
alias dnfgl="dnf grouplist" # list package groups
alias dnfli="dnf list installed" # print all installed packages
alias dnfmc="dnf makecache" # rebuilds the dnf package list
alias dnfu="sudo dnf upgrade" # upgrade packages
alias dnfi="sudo dnf install" # install package
alias dnfgi="sudo dnf groupinstall" # install package group
alias dnfr="sudo dnf remove" # remove package
alias dnfgr="sudo dnf groupremove" # remove pagage group
alias dnfrl="sudo dnf remove --remove-leaves" # remove package and leaves
alias dnfc="sudo dnf clean all" # clean cache
../dnf/dnf.plugin.zsh
\ No newline at end of file
...@@ -6,7 +6,7 @@ alias fwrp="sudo firewall-cmd --runtime-to-permanent" ...@@ -6,7 +6,7 @@ alias fwrp="sudo firewall-cmd --runtime-to-permanent"
function fwl () { function fwl () {
# converts output to zsh array () # converts output to zsh array ()
# @f flag split on new line # @f flag split on new line
zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v interfaces)}") zones=("${(@f)$(sudo firewall-cmd --get-active-zones | grep -v 'interfaces\|sources')}")
for i in $zones; do for i in $zones; do
sudo firewall-cmd --zone $i --list-all sudo firewall-cmd --zone $i --list-all
......
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