update oh my zsh
This commit is contained in:
parent
2971194e3a
commit
b0fbc7ac35
10
zsh/.oh-my-zsh/.editorconfig
Normal file
10
zsh/.oh-my-zsh/.editorconfig
Normal file
@ -0,0 +1,10 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
|
||||
[*.sh]
|
||||
indent_size = 4
|
||||
indent_style = tab
|
38
zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
38
zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Fill this out before posting. You can delete irrelevant sections, but
|
||||
an issue where no sections have been filled will be deleted without comment.
|
||||
-->
|
||||
|
||||
**Describe the bug**
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
**To Reproduce**
|
||||
<!--
|
||||
Steps to reproduce the behavior:
|
||||
1. Enable plugin '...'
|
||||
2. Run command '...', _or_ try to complete command '...', _etc._
|
||||
3. See error
|
||||
-->
|
||||
|
||||
**Expected behavior**
|
||||
<!-- A clear and concise description of what you expected to happen. -->
|
||||
|
||||
**Screenshots or recordings**
|
||||
<!--
|
||||
If applicable, add screenshots or record an asciinema session (https://asciinema.org/)
|
||||
to help explain your problem.
|
||||
-->
|
||||
|
||||
**System:**
|
||||
- OS: [e.g. macOS]
|
||||
- Zsh version [e.g. 5.6]
|
||||
- Terminal emulator [e.g. iTerm2]
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context about the problem here. -->
|
26
zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
26
zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a feature for Oh My Zsh
|
||||
labels: 'Type: feature'
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
Fill this out before posting. You can delete irrelevant sections, but
|
||||
an issue where no sections have been filled will be deleted without comment.
|
||||
-->
|
||||
|
||||
**Is your feature request related to a particular plugin or theme? If so, specify it.**
|
||||
<!-- The name of the plugin or theme you'd like us to improve. -->
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
|
||||
|
||||
**Describe the solution you'd like**
|
||||
<!-- A clear and concise description of what you want to happen. -->
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
|
||||
|
||||
**Additional context**
|
||||
<!-- Add any other context or screenshots about the feature request here. -->
|
12
zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/support.md
vendored
Normal file
12
zsh/.oh-my-zsh/.github/ISSUE_TEMPLATE/support.md
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
---
|
||||
name: Support
|
||||
about: Request support for any problem you're having with Oh My Zsh
|
||||
labels: 'Type: support'
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
1. Look for similar issues already posted (including closed ones)
|
||||
2. Include as much relevant information as possible
|
||||
3. Try to make sure the issue is due to Oh My Zsh
|
||||
-->
|
76
zsh/.oh-my-zsh/CODE_OF_CONDUCT.md
Normal file
76
zsh/.oh-my-zsh/CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all project spaces, and it also applies when
|
||||
an individual is representing the project or its community in public spaces.
|
||||
Examples of representing a project or community include using an official
|
||||
project e-mail address, posting via an official social media account, or acting
|
||||
as an appointed representative at an online or offline event. Representation of
|
||||
a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at ohmyzsh@planetargon.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
46
zsh/.oh-my-zsh/plugins/alias-finder/README.md
Normal file
46
zsh/.oh-my-zsh/plugins/alias-finder/README.md
Normal file
@ -0,0 +1,46 @@
|
||||
# alias-finder plugin
|
||||
|
||||
This plugin searches the defined aliases and outputs any that match the command inputted. This makes learning new aliases easier.
|
||||
|
||||
To use it, add `alias-finder` to the `plugins` array of your zshrc file:
|
||||
```
|
||||
plugins=(... alias-finder)
|
||||
```
|
||||
|
||||
## Usage
|
||||
To see if there is an alias defined for the command, pass it as an argument to `alias-finder`. This can also run automatically before each command you input - add `ZSH_ALIAS_FINDER_AUTOMATIC=true` to your zshrc if you want this.
|
||||
|
||||
## Options
|
||||
|
||||
- Use `--longer` or `-l` to allow the aliases to be longer than the input (match aliases if they contain the input).
|
||||
- Use `--exact` or `-e` to avoid matching aliases that are shorter than the input.
|
||||
|
||||
## Examples
|
||||
```
|
||||
$ alias-finder "git pull"
|
||||
gl='git pull'
|
||||
g=git
|
||||
```
|
||||
```
|
||||
$ alias-finder "web_search google oh my zsh"
|
||||
google='web_search google'
|
||||
```
|
||||
```
|
||||
$ alias-finder "git commit -v"
|
||||
gc="git commit -v"
|
||||
g=git
|
||||
```
|
||||
```
|
||||
$ alias-finder -e "git commit -v"
|
||||
gc='git commit -v'
|
||||
```
|
||||
```
|
||||
$ alias-finder -l "git commit -v"
|
||||
gc='git commit -v'
|
||||
'gc!'='git commit -v --amend'
|
||||
gca='git commit -v -a'
|
||||
'gca!'='git commit -v -a --amend'
|
||||
'gcan!'='git commit -v -a --no-edit --amend'
|
||||
'gcans!'='git commit -v -a -s --no-edit --amend'
|
||||
'gcn!'='git commit -v --no-edit --amend'
|
||||
```
|
46
zsh/.oh-my-zsh/plugins/alias-finder/alias-finder.plugin.zsh
Normal file
46
zsh/.oh-my-zsh/plugins/alias-finder/alias-finder.plugin.zsh
Normal file
@ -0,0 +1,46 @@
|
||||
alias-finder() {
|
||||
local cmd="" exact="" longer="" wordStart="" wordEnd="" multiWordEnd=""
|
||||
for i in $@; do
|
||||
case $i in
|
||||
-e|--exact) exact=true;;
|
||||
-l|--longer) longer=true;;
|
||||
*)
|
||||
if [[ -z $cmd ]]; then
|
||||
cmd=$i
|
||||
else
|
||||
cmd="$cmd $i"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
cmd=$(sed 's/[].\|$(){}?+*^[]/\\&/g' <<< $cmd) # adds escaping for grep
|
||||
if (( $(wc -l <<< $cmd) == 1 )); then
|
||||
while [[ $cmd != "" ]]; do
|
||||
if [[ $longer = true ]]; then
|
||||
wordStart="'{0,1}"
|
||||
else
|
||||
wordEnd="$"
|
||||
multiWordEnd="'$"
|
||||
fi
|
||||
if [[ $cmd == *" "* ]]; then
|
||||
local finder="'$cmd$multiWordEnd"
|
||||
else
|
||||
local finder=$wordStart$cmd$wordEnd
|
||||
fi
|
||||
alias | grep -E "=$finder"
|
||||
if [[ $exact = true || $longer = true ]]; then
|
||||
break
|
||||
else
|
||||
cmd=$(sed -E 's/ {0,1}[^ ]*$//' <<< $cmd) # removes last word
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
preexec_alias-finder() {
|
||||
if [[ $ZSH_ALIAS_FINDER_AUTOMATIC = true ]]; then
|
||||
alias-finder $1
|
||||
fi
|
||||
}
|
||||
|
||||
preexec_functions+=(preexec_alias-finder)
|
14
zsh/.oh-my-zsh/plugins/autoenv/README.md
Normal file
14
zsh/.oh-my-zsh/plugins/autoenv/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Autoenv plugin
|
||||
|
||||
This plugin loads the [Autoenv](https://github.com/inishchith/autoenv).
|
||||
|
||||
To use it, add `autoenv` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... autoenv)
|
||||
```
|
||||
## Requirements
|
||||
|
||||
In order to make this work, you will need to have the autoenv installed.
|
||||
|
||||
More info on the usage and install: https://github.com/inishchith/autoenv
|
15
zsh/.oh-my-zsh/plugins/cake/README.md
Normal file
15
zsh/.oh-my-zsh/plugins/cake/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Cake
|
||||
|
||||
This plugin provides completion for [CakePHP](https://cakephp.org/).
|
||||
|
||||
To use it add cake to the plugins array in your zshrc file.
|
||||
|
||||
```bash
|
||||
plugins=(... cake)
|
||||
```
|
||||
|
||||
## Note
|
||||
|
||||
This plugin generates a cache file of the cake tasks found, named `.cake_task_cache`, in the current working directory.
|
||||
It is regenerated when the Cakefile is newer than the cache file. It is advised that you add the cake file to your
|
||||
`.gitignore` files.
|
16
zsh/.oh-my-zsh/plugins/cakephp3/README.md
Normal file
16
zsh/.oh-my-zsh/plugins/cakephp3/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
# cakephp3 plugin
|
||||
|
||||
The plugin adds aliases and autocompletion for [cakephp3](https://book.cakephp.org/3.0/en/index.html).
|
||||
|
||||
To use it, add `cakephp3` to the plugins array of your zshrc file:
|
||||
```
|
||||
plugins=(... cakephp3)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command |
|
||||
|-----------|-------------------------------|
|
||||
| c3 | `bin/cake` |
|
||||
| c3cache | `bin/cake orm_cache clear` |
|
||||
| c3migrate | `bin/cake migrations migrate` |
|
20
zsh/.oh-my-zsh/plugins/chruby/README.md
Normal file
20
zsh/.oh-my-zsh/plugins/chruby/README.md
Normal file
@ -0,0 +1,20 @@
|
||||
# chruby plugin
|
||||
|
||||
This plugin loads [chruby](https://github.com/postmodern/chruby), a tool that changes the
|
||||
current Ruby version, and completion and a prompt function to display the Ruby version.
|
||||
Supports brew and manual installation of chruby.
|
||||
|
||||
To use it, add `chruby` to the plugins array in your zshrc file:
|
||||
```zsh
|
||||
plugins=(... chruby)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
If you'd prefer to specify an explicit path to load chruby from
|
||||
you can set variables like so:
|
||||
|
||||
```
|
||||
zstyle :omz:plugins:chruby path /local/path/to/chruby.sh
|
||||
zstyle :omz:plugins:chruby auto /local/path/to/auto.sh
|
||||
```
|
24
zsh/.oh-my-zsh/plugins/cloudapp/README.md
Normal file
24
zsh/.oh-my-zsh/plugins/cloudapp/README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# CloudApp plugin
|
||||
|
||||
[CloudApp](https://www.getcloudapp.com) brings screen recording, screenshots, and GIF creation to the cloud, in an easy-to-use enterprise-level app. The CloudApp plugin allows you to upload a file to your CloadApp account from the command line.
|
||||
|
||||
To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file:
|
||||
|
||||
```
|
||||
plugins=(... dash)
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
1. [Aaron Russell's `cloudapp_api` gem](https://github.com/aaronrussell/cloudapp_api#installation)
|
||||
|
||||
2. That you set your CloudApp credentials in `~/.cloudapp` as a simple text file like below:
|
||||
```
|
||||
email
|
||||
password
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
- `cloudapp <filename>`: uploads `<filename>` to your CloudApp account, and if you're using
|
||||
macOS, copies the URL to your clipboard.
|
48
zsh/.oh-my-zsh/plugins/colemak/README.md
Normal file
48
zsh/.oh-my-zsh/plugins/colemak/README.md
Normal file
@ -0,0 +1,48 @@
|
||||
# Colemak plugin
|
||||
|
||||
This plugin remaps keys in `zsh`'s [`vi`-style navigation mode](http://zsh.sourceforge.net/Doc/Release/Zsh-Line-Editor.html#Keymaps)
|
||||
for a [Colemak](https://colemak.com/) keyboard layout, to match the QWERTY position:
|
||||
|
||||
![Colemak layout on a US keyboard](https://colemak.com/wiki/images/6/6c/Colemak2.png)
|
||||
|
||||
To use it, add it to the plugins array in your `~/.zshrc` file:
|
||||
|
||||
```
|
||||
plugins=(... colemak)
|
||||
```
|
||||
|
||||
You will also need to enable `vi` mode, so add another line to `~/.zshrc`:
|
||||
```
|
||||
bindkey -v
|
||||
```
|
||||
|
||||
Restart your shell and hit the `<ESC>` key to activate `vicmd` (navigation) mode,
|
||||
and start navigating `zsh` with your new keybindings!
|
||||
|
||||
## Key bindings for vicmd
|
||||
|
||||
| Old | New | Binding | Description |
|
||||
|------------|------------|---------------------------|----------------------------------------------------|
|
||||
| `CTRL`+`j` | `CTRL`+`n` | accept-line | Insert new line |
|
||||
| `j` | `n` | down-line-or-history | Move one line down or command history forwards |
|
||||
| `k` | `e` | up-line-or-history | Move one line up or command history backwards |
|
||||
| `l` | `i` | vi-forward-char | Move one character to the right |
|
||||
| `n` | `k` | vi-repeat-search | Repeat command search forwards |
|
||||
| `N` | `K` | vi-rev-repeat-search | Repeat command search backwards |
|
||||
| `i` | `u` | vi-insert | Enter insert mode |
|
||||
| `I` | `U` | vi-insert-bol | Move to first non-blank char and enter insert mode |
|
||||
| `<none>` | `l` | vi-undo-change | Undo change |
|
||||
| `J` | `N` | vi-join | Join the current line with the next one |
|
||||
| `e` | `j` | vi-forward-word-end | Move to the end of the next word |
|
||||
| `E` | `J` | vi-forward-blank-word-end | Move to end of the current or next word |
|
||||
|
||||
## Key bindings for less
|
||||
|
||||
| Keyboard shortcut | `less` key binding |
|
||||
|-------------------|--------------------|
|
||||
| `n` | forw-line |
|
||||
| `e` | back-line |
|
||||
| `k` | repeat-search |
|
||||
| `ESC`+`k` | repeat-search-all |
|
||||
| `K` | reverse-search |
|
||||
| `ESC`+`K` | reverse-search-all |
|
15
zsh/.oh-my-zsh/plugins/colored-man-pages/README.md
Normal file
15
zsh/.oh-my-zsh/plugins/colored-man-pages/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Colored man pages plugin
|
||||
|
||||
This plugin adds colors to man pages.
|
||||
|
||||
To use it, add `colored-man-pages` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... colored-man-pages)
|
||||
```
|
||||
|
||||
You can also try to color other pages by prefixing the respective command with `colored`:
|
||||
|
||||
```zsh
|
||||
colored git help clone
|
||||
```
|
121
zsh/.oh-my-zsh/plugins/common-aliases/README.md
Normal file
121
zsh/.oh-my-zsh/plugins/common-aliases/README.md
Normal file
@ -0,0 +1,121 @@
|
||||
# Common Aliases Plugin
|
||||
|
||||
This plugin creates helpful shortcut aliases for many commonly used commands.
|
||||
|
||||
To use it add `common-aliases` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... common-aliases)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
### ls command
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|---------------|--------------------------------------------------------------------------------|
|
||||
| l | `ls -lFh` | List files as a long list, show size, type, human-readable |
|
||||
| la | `ls -lAFh` | List almost all files as a long list show size, type, human-readable |
|
||||
| lr | `ls -tRFh` | List files recursively sorted by date, show type, human-readable |
|
||||
| lt | `ls -ltFh` | List files as a long list sorted by date, show type, human-readable |
|
||||
| ll | `ls -l` | List files as a long list |
|
||||
| ldot | `ls -ld .*` | List dot files as a long list |
|
||||
| lS | `ls -1FSsh` | List files showing only size and name sorted by size |
|
||||
| lart | `ls -1Fcart` | List all files sorted in reverse of create/modification time (oldest first) |
|
||||
| lrt | `ls -1Fcrt` | List files sorted in reverse of create/modification time(oldest first) |
|
||||
|
||||
### File handling
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|-----------------------|------------------------------------------------------------------------------------|
|
||||
| rm | `rm -i` | Remove a file |
|
||||
| cp | `cp -i` | Copy a file |
|
||||
| mv | `mv -i` | Move a file |
|
||||
| zshrc | `${=EDITOR} ~/.zshrc` | Quickly access the ~/.zshrc file |
|
||||
| dud | `du -d 1 -h` | Display the size of files at depth 1 in current location in human-readable form |
|
||||
| duf | `du -sh` | Display the size of files in current location in human-readable form |
|
||||
| t | `tail -f` | Shorthand for tail which outputs the last part of a file |
|
||||
|
||||
### find and grep
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|-----------------------------------------------------|-----------------------------------------|
|
||||
| fd | `find . -type d -name` | Find a directory with the given name |
|
||||
| ff | `find . -type f -name` | Find a file with the given name |
|
||||
| grep | `grep --color` | Searches for a query string |
|
||||
| sgrep | `grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}` | Useful for searching within files |
|
||||
|
||||
### Other Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-----------|---------------------|-------------------------------------------------------------|
|
||||
| h | `history` | Lists all recently used commands |
|
||||
| hgrep | `fc -El 0 \| grep` | Searches for a word in the list of previously used commands |
|
||||
| help | `man` | Opens up the man page for a command |
|
||||
| p | `ps -f` | Displays currently executing processes |
|
||||
| sortnr | `sort -n -r` | Used to sort the lines of a text file |
|
||||
| unexport | `unset` | Used to unset an environment variable |
|
||||
|
||||
## Global aliases
|
||||
|
||||
These aliases are expanded in any position in the command line, meaning you can use them even at the
|
||||
end of the command you've typed. Examples:
|
||||
|
||||
Quickly pipe to less:
|
||||
```zsh
|
||||
$ ls -l /var/log L
|
||||
# will run
|
||||
$ ls -l /var/log | less
|
||||
```
|
||||
Silences stderr output:
|
||||
```zsh
|
||||
$ find . -type f NE
|
||||
# will run
|
||||
$ find . -type f 2>/dev/null
|
||||
```
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|-----------------------------|-------------------------------------------------------------|
|
||||
| H | `\| head` | Pipes output to head which outputs the first part of a file |
|
||||
| T | `\| tail` | Pipes output to tail which outputs the last part of a file |
|
||||
| G | `\| grep` | Pipes output to grep to search for some word |
|
||||
| L | `\| less` | Pipes output to less, useful for paging |
|
||||
| M | `\| most` | Pipes output to more, useful for paging |
|
||||
| LL | `2>&1 \| less` | Writes stderr to stdout and passes it to less |
|
||||
| CA | `2>&1 \| cat -A` | Writes stderr to stdout and passes it to cat |
|
||||
| NE | `2 > /dev/null` | Silences stderr |
|
||||
| NUL | `> /dev/null 2>&1` | Silences both stdout and stderr |
|
||||
| P | `2>&1\| pygmentize -l pytb` | Writes stderr to stdout and passes it to pygmentize |
|
||||
|
||||
## File extension aliases
|
||||
|
||||
These are special aliases that are triggered when a file name is passed as the command. For example,
|
||||
if the pdf file extension is aliased to `acroread` (a popular Linux pdf reader), when running `file.pdf`
|
||||
that file will be open with `acroread`.
|
||||
|
||||
### Reading Docs
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|-------------|-------------------------------------|
|
||||
| pdf | `acroread` | Opens up a document using acroread |
|
||||
| ps | `gv` | Opens up a .ps file using gv |
|
||||
| dvi | `xdvi` | Opens up a .dvi file using xdvi |
|
||||
| chm | `xchm` | Opens up a .chm file using xchm |
|
||||
| djvu | `djview` | Opens up a .djvu file using djview |
|
||||
|
||||
### Listing files inside a packed file
|
||||
|
||||
| Alias | Command | Description |
|
||||
|---------|-------------|-------------------------------------|
|
||||
| zip | `unzip -l` | Lists files inside a .zip file |
|
||||
| rar | `unrar l` | Lists files inside a .rar file |
|
||||
| tar | `tar tf` | Lists files inside a .tar file |
|
||||
| tar.gz | `echo` | Lists files inside a .tar.gz file |
|
||||
| ace | `unace l` | Lists files inside a .ace file |
|
||||
|
||||
### Some other features
|
||||
|
||||
- Opens urls in terminal using browser specified by the variable `$BROWSER`
|
||||
- Opens C, C++, Tex and text files using editor specified by the variable `$EDITOR`
|
||||
- Opens images using image viewer specified by the variable `$XIVIEWER`
|
||||
- Opens videos and other media using mplayer
|
8
zsh/.oh-my-zsh/plugins/compleat/README.md
Normal file
8
zsh/.oh-my-zsh/plugins/compleat/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# compleat plugin
|
||||
|
||||
This plugin looks for [compleat](https://github.com/mbrubeck/compleat) and loads its completion.
|
||||
|
||||
To use it, add compleat to the plugins array in your zshrc file:
|
||||
```
|
||||
plugins=(... compleat)
|
||||
```
|
28
zsh/.oh-my-zsh/plugins/dash/README.md
Normal file
28
zsh/.oh-my-zsh/plugins/dash/README.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Dash plugin
|
||||
|
||||
This plugin adds command line functionality for [Dash](https://kapeli.com/dash),
|
||||
an API Documentation Browser for macOS. This plugin requires Dash to be installed
|
||||
to work.
|
||||
|
||||
To use it, add `dash` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... dash)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
- Open and switch to the dash application.
|
||||
```
|
||||
dash
|
||||
```
|
||||
|
||||
- Query for something in dash app: `dash query`
|
||||
```
|
||||
dash golang
|
||||
```
|
||||
|
||||
- You can optionally provide a keyword: `dash [keyword:]query`
|
||||
```
|
||||
dash python:tuple
|
||||
```
|
51
zsh/.oh-my-zsh/plugins/dnote/README.md
Normal file
51
zsh/.oh-my-zsh/plugins/dnote/README.md
Normal file
@ -0,0 +1,51 @@
|
||||
# Dnote Plugin
|
||||
|
||||
This plugin adds auto-completion for [Dnote](https://dnote.io) project.
|
||||
|
||||
To use it, add `dnote` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(dnote)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
At the basic level, this plugin completes all Dnote commands.
|
||||
|
||||
```zsh
|
||||
$ dnote a(press <TAB> here)
|
||||
```
|
||||
|
||||
would result in:
|
||||
|
||||
```zsh
|
||||
$ dnote add
|
||||
```
|
||||
|
||||
For some commands, this plugin dynamically suggests matching book names.
|
||||
|
||||
For instance, if you have three books that begin with 'j': 'javascript', 'job', 'js',
|
||||
|
||||
```zsh
|
||||
$ dnote view j(press <TAB> here)
|
||||
```
|
||||
|
||||
would result in:
|
||||
|
||||
```zsh
|
||||
$ dnote v j
|
||||
javascript job js
|
||||
```
|
||||
|
||||
As another example,
|
||||
|
||||
```zsh
|
||||
$ dnote edit ja(press <TAB> here)
|
||||
```
|
||||
|
||||
would result in:
|
||||
|
||||
|
||||
```zsh
|
||||
$ dnote v javascript
|
||||
``````
|
39
zsh/.oh-my-zsh/plugins/dnote/_dnote
Normal file
39
zsh/.oh-my-zsh/plugins/dnote/_dnote
Normal file
@ -0,0 +1,39 @@
|
||||
#compdef dnote
|
||||
|
||||
local -a _1st_arguments
|
||||
|
||||
_1st_arguments=(
|
||||
'add:add a new note'
|
||||
'view:list books, notes, or view a content'
|
||||
'edit:edit a note or a book'
|
||||
'remove:remove a note or a book'
|
||||
'find:find notes by keywords'
|
||||
'sync:sync data with the server'
|
||||
'login:login to the dnote server'
|
||||
'logout:logout from the dnote server'
|
||||
'version:print the current version'
|
||||
'help:get help about any command'
|
||||
)
|
||||
|
||||
get_booknames() {
|
||||
local names=$(dnote view --name-only)
|
||||
local -a ret
|
||||
|
||||
while read -r line; do
|
||||
ret+=("${line}")
|
||||
done <<< "$names"
|
||||
|
||||
echo "$ret"
|
||||
}
|
||||
|
||||
if (( CURRENT == 2 )); then
|
||||
_describe -t commands "dnote subcommand" _1st_arguments
|
||||
return
|
||||
elif (( CURRENT == 3 )); then
|
||||
case "$words[2]" in
|
||||
v|view|a|add)
|
||||
_alternative \
|
||||
"names:book names:($(get_booknames))"
|
||||
esac
|
||||
fi
|
||||
|
83
zsh/.oh-my-zsh/plugins/drush/README.md
Normal file
83
zsh/.oh-my-zsh/plugins/drush/README.md
Normal file
@ -0,0 +1,83 @@
|
||||
# Drush
|
||||
|
||||
## Description
|
||||
This plugin offers aliases and functions to make the work with drush easier and more productive.
|
||||
|
||||
To enable it, add the `drush` to your `plugins` array in `~/.zshrc`:
|
||||
|
||||
```
|
||||
plugins=(... drush)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
| Alias | Description | Command |
|
||||
|-------|-----------------------------------------------------------------------|-----------------------------|
|
||||
| dr | Display drush help | drush |
|
||||
| drca | Clear all drupal caches. | drush cc all |
|
||||
| drcb | Clear block cache. | drush cc block |
|
||||
| drcg | Clear registry cache. | drush cc registry |
|
||||
| drcj | Clear css-js cache. | drush cc css-js |
|
||||
| drcm | Clear menu cache. | drush cc menu |
|
||||
| drcml | Clear module-list cache. | drush cc module-list |
|
||||
| drcr | Run all cron hooks in all active modules for specified site. | drush core-cron |
|
||||
| drct | Clear theme-registry cache. | drush cc theme-registry |
|
||||
| drcv | Clear views cache. (Make sure that the views module is enabled) | drush cc views |
|
||||
| drdmp | Backup database in a new dump.sql file | drush drush sql-dump --ordered-dump --result-file=dump.sql|
|
||||
| drf | Display features status | drush features |
|
||||
| drfr | Revert a feature module on your site. | drush features-revert -y |
|
||||
| drfu | Update a feature module on your site. | drush features-update -y |
|
||||
| drfra | Revert all enabled feature module on your site. | drush features-revert-all |
|
||||
| drif | Flush all derived images. | drush image-flush --all |
|
||||
| drpm | Show a list of available modules. | drush pm-list --type=module |
|
||||
| drst | Provides a birds-eye view of the current Drupal installation, if any. | drush core-status |
|
||||
| drup | Apply any database updates required (as with running update.php). | drush updatedb |
|
||||
| drups | List any pending database updates. | drush updatedb-status |
|
||||
| drv | Show drush version. | drush version |
|
||||
| drvd | Delete a variable. | drush variable-del |
|
||||
| drvg | Get a list of some or all site variables and values. | drush variable-get |
|
||||
| drvs | Set a variable. | drush variable-set |
|
||||
|
||||
## Functions
|
||||
|
||||
### dren
|
||||
Download and enable one or more extensions (modules or themes).
|
||||
Must be invoked with one or more parameters. e.g.:
|
||||
`dren devel` or `dren devel module_filter views`
|
||||
|
||||
### drf
|
||||
Edit drushrc, site alias, and Drupal settings.php files.
|
||||
Can be invoked with one or without parameters. e.g.:
|
||||
`drf 1`
|
||||
|
||||
### dris
|
||||
Disable one or more extensions (modules or themes)
|
||||
Must be invoked with one or more parameters. e.g.:
|
||||
`dris devel` or `dris devel module_filter views`
|
||||
|
||||
### drpu
|
||||
Uninstall one or more modules.
|
||||
Must be invoked with one or more parameters. e.g.:
|
||||
`drpu devel` or `drpu devel module_filter views`
|
||||
|
||||
### drnew
|
||||
Creates a brand new drupal website.
|
||||
Note: As soon as the installation is complete, drush will print a username and a random password into the terminal:
|
||||
```
|
||||
Installation complete. User name: admin User password: cf7t8yqNEm
|
||||
```
|
||||
|
||||
## Additional features
|
||||
|
||||
### Autocomplete
|
||||
The [completion script for drush](https://github.com/drush-ops/drush/blob/8.0.1/drush.complete.sh) comes enabled with this plugin.
|
||||
So, it is possible to type a command:
|
||||
```
|
||||
drush sql
|
||||
```
|
||||
|
||||
And as soon as the tab key is pressed, the script will display the available commands:
|
||||
```
|
||||
drush sql
|
||||
sqlc sql-conf sql-create sql-dump sql-query sql-sanitize
|
||||
sql-cli sql-connect sql-drop sqlq sqlsan sql-sync
|
||||
```
|
50
zsh/.oh-my-zsh/plugins/drush/drush.complete.sh
Normal file
50
zsh/.oh-my-zsh/plugins/drush/drush.complete.sh
Normal file
@ -0,0 +1,50 @@
|
||||
# BASH completion script for Drush.
|
||||
#
|
||||
# Place this in your /etc/bash_completion.d/ directory or source it from your
|
||||
# ~/.bash_completion or ~/.bash_profile files. Alternatively, source
|
||||
# examples/example.bashrc instead, as it will automatically find and source
|
||||
# this file.
|
||||
#
|
||||
# If you're using ZSH instead of BASH, add the following to your ~/.zshrc file
|
||||
# and source it.
|
||||
#
|
||||
# autoload bashcompinit
|
||||
# bashcompinit
|
||||
# source /path/to/your/drush.complete.sh
|
||||
|
||||
# Ensure drush is available.
|
||||
which drush > /dev/null || alias drush &> /dev/null || return
|
||||
|
||||
__drush_ps1() {
|
||||
f="${TMPDIR:-/tmp/}/drush-env-${USER}/drush-drupal-site-$$"
|
||||
if [ -f $f ]
|
||||
then
|
||||
__DRUPAL_SITE=$(cat "$f")
|
||||
else
|
||||
__DRUPAL_SITE="$DRUPAL_SITE"
|
||||
fi
|
||||
|
||||
# Set DRUSH_PS1_SHOWCOLORHINTS to a non-empty value and define a
|
||||
# __drush_ps1_colorize_alias() function for color hints in your Drush PS1
|
||||
# prompt. See example.prompt.sh for an example implementation.
|
||||
if [ -n "${__DRUPAL_SITE-}" ] && [ -n "${DRUSH_PS1_SHOWCOLORHINTS-}" ]; then
|
||||
__drush_ps1_colorize_alias
|
||||
fi
|
||||
|
||||
[[ -n "$__DRUPAL_SITE" ]] && printf "${1:- (%s)}" "$__DRUPAL_SITE"
|
||||
}
|
||||
|
||||
# Completion function, uses the "drush complete" command to retrieve
|
||||
# completions for a specific command line COMP_WORDS.
|
||||
_drush_completion() {
|
||||
# Set IFS to newline (locally), since we only use newline separators, and
|
||||
# need to retain spaces (or not) after completions.
|
||||
local IFS=$'\n'
|
||||
# The '< /dev/null' is a work around for a bug in php libedit stdin handling.
|
||||
# Note that libedit in place of libreadline in some distributions. See:
|
||||
# https://bugs.launchpad.net/ubuntu/+source/php5/+bug/322214
|
||||
COMPREPLY=( $(drush --early=includes/complete.inc "${COMP_WORDS[@]}" < /dev/null 2> /dev/null) )
|
||||
}
|
||||
|
||||
# Register our completion function. We include common short aliases for Drush.
|
||||
complete -o bashdefault -o default -o nospace -F _drush_completion d dr drush drush5 drush6 drush7 drush8 drush.php
|
104
zsh/.oh-my-zsh/plugins/drush/drush.plugin.zsh
Normal file
104
zsh/.oh-my-zsh/plugins/drush/drush.plugin.zsh
Normal file
@ -0,0 +1,104 @@
|
||||
# Drush support.
|
||||
|
||||
function dren() {
|
||||
drush en $@ -y
|
||||
}
|
||||
|
||||
function dris() {
|
||||
drush pm-disable $@ -y
|
||||
}
|
||||
|
||||
function drpu() {
|
||||
drush pm-uninstall $@ -y
|
||||
}
|
||||
|
||||
function drf() {
|
||||
if [[ $1 == "" ]] then
|
||||
drush core-config
|
||||
else
|
||||
drush core-config --choice=$1
|
||||
fi
|
||||
}
|
||||
|
||||
function drfi() {
|
||||
if [[ $1 == "fields" ]]; then
|
||||
drush field-info fields
|
||||
elif [[ $1 == "types" ]]; then
|
||||
drush field-info types
|
||||
else
|
||||
drush field-info
|
||||
fi
|
||||
}
|
||||
|
||||
function drnew() {
|
||||
|
||||
cd ~
|
||||
echo "Website's name: "
|
||||
read WEBSITE_NAME
|
||||
|
||||
HOST=http://$(hostname -i)/
|
||||
|
||||
if [[ $WEBSITE_NAME == "" ]] then
|
||||
MINUTES=$(date +%M:%S)
|
||||
WEBSITE_NAME="Drupal-$MINUTES"
|
||||
echo "Your website will be named: $WEBSITE_NAME"
|
||||
fi
|
||||
|
||||
drush dl drupal --drupal-project-rename=$WEBSITE_NAME
|
||||
|
||||
echo "Type your localhost directory: (Leave empty for /var/www/html/)"
|
||||
read DIRECTORY
|
||||
|
||||
if [[ $DIRECTORY == "" ]] then
|
||||
DIRECTORY="/var/www/html/"
|
||||
fi
|
||||
|
||||
echo "Moving to $DIRECTORY$WEBSITE_NAME"
|
||||
sudo mv $WEBSITE_NAME $DIRECTORY
|
||||
cd $DIRECTORY$WEBSITE_NAME
|
||||
|
||||
echo "Database's user: "
|
||||
read DATABASE_USR
|
||||
echo "Database's password: "
|
||||
read -s DATABASE_PWD
|
||||
echo "Database's name for your project: "
|
||||
read DATABASE
|
||||
|
||||
DB_URL="mysql://$DATABASE_USR:$DATABASE_PWD@localhost/$DATABASE"
|
||||
drush site-install standard --db-url=$DB_URL --site-name=$WEBSITE_NAME
|
||||
|
||||
open_command $HOST$WEBSITE_NAME
|
||||
echo "Done"
|
||||
|
||||
}
|
||||
|
||||
# Aliases, sorted alphabetically.
|
||||
alias dr="drush"
|
||||
alias drca="drush cc all" # Deprecated for Drush 8
|
||||
alias drcb="drush cc block" # Deprecated for Drush 8
|
||||
alias drcg="drush cc registry" # Deprecated for Drush 8
|
||||
alias drcj="drush cc css-js"
|
||||
alias drcm="drush cc menu"
|
||||
alias drcml="drush cc module-list"
|
||||
alias drcr="drush core-cron"
|
||||
alias drct="drush cc theme-registry"
|
||||
alias drcv="drush cc views"
|
||||
alias drdmp="drush sql-dump --ordered-dump --result-file=dump.sql"
|
||||
alias drf="drush features"
|
||||
alias drfr="drush features-revert -y"
|
||||
alias drfu="drush features-update -y"
|
||||
alias drfra="drush features-revert-all"
|
||||
alias drif="drush image-flush --all"
|
||||
alias drpm="drush pm-list --type=module"
|
||||
alias drst="drush core-status"
|
||||
alias drup="drush updatedb"
|
||||
alias drups="drush updatedb-status"
|
||||
alias drv="drush version"
|
||||
alias drvd="drush variable-del"
|
||||
alias drvg="drush variable-get"
|
||||
alias drvs="drush variable-set"
|
||||
|
||||
# Enable drush autocomplete support
|
||||
autoload bashcompinit
|
||||
bashcompinit
|
||||
source $(dirname $0)/drush.complete.sh
|
11
zsh/.oh-my-zsh/plugins/eecms/README.md
Normal file
11
zsh/.oh-my-zsh/plugins/eecms/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# eecms plugin
|
||||
|
||||
This plugin adds auto-completion of console commands for [`eecms`](https://github.com/ExpressionEngine/ExpressionEngine).
|
||||
|
||||
To use it, add `eecms` to the plugins array of your `.zshrc` file:
|
||||
```
|
||||
plugins=(... eecms)
|
||||
```
|
||||
|
||||
It also adds the alias `eecms` which finds the eecms file in the current project
|
||||
and runs it with php.
|
39
zsh/.oh-my-zsh/plugins/emotty/README.md
Normal file
39
zsh/.oh-my-zsh/plugins/emotty/README.md
Normal file
@ -0,0 +1,39 @@
|
||||
# emotty plugin
|
||||
|
||||
This plugin returns an emoji for the current $TTY number so it can be used
|
||||
in a prompt.
|
||||
|
||||
To use it, add emotty to the plugins array in your zshrc file:
|
||||
```
|
||||
plugins=(... emotty)
|
||||
```
|
||||
|
||||
**NOTE:** it requires the [emoji plugin](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/emoji).
|
||||
|
||||
## Usage
|
||||
|
||||
The function `emotty` displays an emoji from the current character set (default: `emoji`), based
|
||||
on the number associated to the `$TTY`.
|
||||
|
||||
There are different sets of emoji characters available, to choose a different
|
||||
set, set `$emotty_set` to the name of the set you would like to use, e.g.:
|
||||
```
|
||||
emotty_set=nature
|
||||
```
|
||||
|
||||
### Character Sets
|
||||
|
||||
- emoji
|
||||
- loral
|
||||
- love
|
||||
- nature
|
||||
- stellar
|
||||
- zodiac
|
||||
|
||||
Use the `display_emotty` function to list the emojis in the current character set, or
|
||||
the character set passed as the first argument. For example:
|
||||
|
||||
```
|
||||
$ display_emotty zodiac
|
||||
<list of all the emojis in the zodiac character set>
|
||||
```
|
21
zsh/.oh-my-zsh/plugins/fasd/README.md
Normal file
21
zsh/.oh-my-zsh/plugins/fasd/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# fasd
|
||||
|
||||
[`Fasd`](https://github.com/clvv/fasd) (pronounced similar to "fast") is a command-line productivity booster. Fasd offers quick access to files and directories for POSIX shells.
|
||||
|
||||
To use it, add `fasd` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... fd)
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
Please find detailed installation guide [`here`](https://github.com/clvv/fasd#install)
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|-------------------------------------------|-------------------------------------------------------------|
|
||||
| v | `fasd -f -e "$EDITOR"` | List frequent/recent files matching the given filename. |
|
||||
| o | `fasd -a -e xdg-open` | List frequent/recent files and directories matching. |
|
||||
| j | `fasd_cd -d -i` | cd with interactive selection |
|
9
zsh/.oh-my-zsh/plugins/fbterm/README.md
Normal file
9
zsh/.oh-my-zsh/plugins/fbterm/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# fbterm
|
||||
|
||||
This plugin automatically starts [fbterm](https://github.com/zhangyuanwei/fbterm)
|
||||
if on a real TTY (`/dev/tty*`).
|
||||
|
||||
To use it, add fbterm to the plugins array of your zshrc file:
|
||||
```
|
||||
plugins=(... fbterm)
|
||||
```
|
13
zsh/.oh-my-zsh/plugins/fd/README.md
Normal file
13
zsh/.oh-my-zsh/plugins/fd/README.md
Normal file
@ -0,0 +1,13 @@
|
||||
# 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.
|
83
zsh/.oh-my-zsh/plugins/fd/_fd
Normal file
83
zsh/.oh-my-zsh/plugins/fd/_fd
Normal file
@ -0,0 +1,83 @@
|
||||
#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 "$@"
|
21
zsh/.oh-my-zsh/plugins/flutter/README.md
Normal file
21
zsh/.oh-my-zsh/plugins/flutter/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
## Flutter plugin
|
||||
|
||||
The Flutter plugin provides completion and useful aliases
|
||||
|
||||
To use it, add flutter to the plugins array of your zshrc file:
|
||||
|
||||
```
|
||||
plugins=(... flutter)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| :--------- | :--------------------- | :------------------------------------------------------------------------- |
|
||||
| `fl` | `flutter` | Shorthand for flutter command |
|
||||
| `flr` | `flutter run` | Runs flutter app |
|
||||
| `fldoc` | `flutter doctor` | Runs flutter doctor |
|
||||
| `flb` | `flutter build` | Build flutter application |
|
||||
| `flattach` | `flutter attach` | Attaches flutter to a running flutter application with enabled observatory |
|
||||
| `flget` | `flutter packages get` | Installs dependencies |
|
||||
| `flc` | `flutter clean` | Cleans flutter porject |
|
37
zsh/.oh-my-zsh/plugins/flutter/_flutter
Normal file
37
zsh/.oh-my-zsh/plugins/flutter/_flutter
Normal file
@ -0,0 +1,37 @@
|
||||
#compdef flutter
|
||||
#autoload
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
"analyze":"Analyze the project's Dart code."
|
||||
"assemble":"Assemble and build flutter resources."
|
||||
"attach":"Attach to a running application."
|
||||
"build":"Flutter build commands."
|
||||
"channel":"List or switch flutter channels."
|
||||
"clean":"Delete the build/ and .dart_tool/ directories."
|
||||
"config":"Configure Flutter settings."
|
||||
"create":"Create a new Flutter project."
|
||||
"devices":"List all connected devices."
|
||||
"doctor":"Show information about the installed tooling."
|
||||
"drive":"Runs Flutter Driver tests for the current project."
|
||||
"emulators":"List, launch and create emulators."
|
||||
"format":" Format one or more dart files."
|
||||
"help":"Display help information for flutter."
|
||||
"install":"Install a Flutter app on an attached device."
|
||||
"logs":"Show log output for running Flutter apps."
|
||||
"make-host-app-editable":"Moves host apps from generated directories to non-generated directories so that they can be edited by developers."
|
||||
"precache":"Populates the Flutter tool's cache of binary artifacts."
|
||||
"pub":"Commands for managing Flutter packages."
|
||||
"run":"Run your Flutter app on an attached device."
|
||||
"screenshot":"Take a screenshot from a connected device."
|
||||
"test":"Run Flutter unit tests for the current project."
|
||||
"upgrade":"Upgrade your copy of Flutter."
|
||||
"version":"List or switch flutter versions."
|
||||
)
|
||||
|
||||
_arguments -C '*:: :->subcmds'
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "flutter command" _1st_arguments
|
||||
return
|
||||
fi
|
7
zsh/.oh-my-zsh/plugins/flutter/flutter.plugin.zsh
Normal file
7
zsh/.oh-my-zsh/plugins/flutter/flutter.plugin.zsh
Normal file
@ -0,0 +1,7 @@
|
||||
alias fl="flutter"
|
||||
alias flr="flutter run"
|
||||
alias fldoc="flutter doctor"
|
||||
alias flb="flutter build"
|
||||
alias flattach="flutter attach"
|
||||
alias flget="flutter packages get"
|
||||
alias flc="flutter clean"
|
7
zsh/.oh-my-zsh/plugins/gatsby/README.md
Normal file
7
zsh/.oh-my-zsh/plugins/gatsby/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# gatsby autocomplete plugin
|
||||
|
||||
* Adds autocomplete options for all gatsby commands.
|
||||
|
||||
## Requirements
|
||||
|
||||
In order to make this work, you will need to have gatsby set up in your path.
|
24
zsh/.oh-my-zsh/plugins/gatsby/_gatsby
Normal file
24
zsh/.oh-my-zsh/plugins/gatsby/_gatsby
Normal file
@ -0,0 +1,24 @@
|
||||
#compdef gatsby
|
||||
#autoload
|
||||
|
||||
# in order to make this work, you will need to have gatsby
|
||||
# https://www.gatsbyjs.org/
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'develop:Start development server. Watches files, rebuilds, and hot reloads if something changes'
|
||||
'build:Build a Gatsby project.'
|
||||
'serve:Serve previously built Gatsby site.'
|
||||
'info:Get environment information for debugging and issue reporting'
|
||||
'clean:Wipe the local gatsby environment including built assets and cache'
|
||||
'repl:Get a node repl with context of Gatsby environment, see (add docs link here)'
|
||||
'new: [rootPath] [starter] Create new Gatsby project.'
|
||||
'telemetry:Enable or disable Gatsby anonymous analytics collection.'
|
||||
)
|
||||
|
||||
_arguments -C '*:: :->subcmds' && return 0
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "gatsby subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
24
zsh/.oh-my-zsh/plugins/gcloud/README.md
Normal file
24
zsh/.oh-my-zsh/plugins/gcloud/README.md
Normal file
@ -0,0 +1,24 @@
|
||||
# gcloud
|
||||
|
||||
This plugin provides completion support for the
|
||||
[Google Cloud SDK CLI](https://cloud.google.com/sdk/gcloud/).
|
||||
|
||||
To use it, add `gcloud` to the plugins array in your zshrc file.
|
||||
|
||||
```zsh
|
||||
plugins=(... gcloud)
|
||||
```
|
||||
|
||||
It relies on you having installed the SDK using one of the supported options
|
||||
listed [here](https://cloud.google.com/sdk/install).
|
||||
|
||||
## Plugin Options
|
||||
|
||||
* Set `CLOUDSDK_HOME` in your `zshrc` file before you load oh-my-zsh if you have
|
||||
your GCloud SDK installed in a non-standard location. The plugin will use this
|
||||
as the base for your SDK if it finds it set already.
|
||||
|
||||
* If you do not have a `python2` in your `PATH` you'll also need to set the
|
||||
`CLOUDSDK_PYTHON` environment variable at the end of your `.zshrc`. This is
|
||||
used by the SDK to call a compatible interpreter when you run one of the
|
||||
SDK commands.
|
33
zsh/.oh-my-zsh/plugins/gcloud/gcloud.plugin.zsh
Normal file
33
zsh/.oh-my-zsh/plugins/gcloud/gcloud.plugin.zsh
Normal file
@ -0,0 +1,33 @@
|
||||
#####################################################
|
||||
# gcloud plugin for oh-my-zsh #
|
||||
# Author: Ian Chesal (github.com/ianchesal) #
|
||||
#####################################################
|
||||
|
||||
if [[ -z "${CLOUDSDK_HOME}" ]]; then
|
||||
search_locations=(
|
||||
"$HOME/google-cloud-sdk"
|
||||
"/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk"
|
||||
"/usr/share/google-cloud-sdk"
|
||||
"/snap/google-cloud-sdk/current"
|
||||
"/usr/lib64/google-cloud-sdk/"
|
||||
"/opt/google-cloud-sdk"
|
||||
)
|
||||
|
||||
for gcloud_sdk_location in $search_locations; do
|
||||
if [[ -d "${gcloud_sdk_location}" ]]; then
|
||||
CLOUDSDK_HOME="${gcloud_sdk_location}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if (( ${+CLOUDSDK_HOME} )); then
|
||||
if (( ! $+commands[gcloud] )); then
|
||||
# Only source this if GCloud isn't already on the path
|
||||
if [[ -f "${CLOUDSDK_HOME}/path.zsh.inc" ]]; then
|
||||
source "${CLOUDSDK_HOME}/path.zsh.inc"
|
||||
fi
|
||||
fi
|
||||
source "${CLOUDSDK_HOME}/completion.zsh.inc"
|
||||
export CLOUDSDK_HOME
|
||||
fi
|
16
zsh/.oh-my-zsh/plugins/git-escape-magic/README.md
Normal file
16
zsh/.oh-my-zsh/plugins/git-escape-magic/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Git Escape Magic
|
||||
|
||||
This plugin is copied from the original at
|
||||
https://github.com/knu/zsh-git-escape-magic. All credit for the
|
||||
functionality enabled by this plugin should go to @knu.
|
||||
|
||||
An excerpt from that project's readme explains its purpose.
|
||||
|
||||
> It eliminates the need for manually escaping those meta-characters. The zle function it provides is context aware and recognizes the characteristics of each subcommand of git. Every time you type one of these meta-characters on a git command line, it automatically escapes the meta-character with a backslash as necessary and as appropriate.
|
||||
|
||||
## Usage
|
||||
|
||||
To use this plugin, add it to your list of plugins in your `.zshrc` file.
|
||||
|
||||
**NOTE**: If you use url-quote-magic, it must be included before this
|
||||
plugin runs to prevent any conflicts.
|
135
zsh/.oh-my-zsh/plugins/git-escape-magic/git-escape-magic
Normal file
135
zsh/.oh-my-zsh/plugins/git-escape-magic/git-escape-magic
Normal file
@ -0,0 +1,135 @@
|
||||
# -*- mode: sh -*-
|
||||
#
|
||||
# git-escape-magic - zle tweak for git command line arguments
|
||||
#
|
||||
# Copyright (c) 2011, 2012, 2014 Akinori MUSHA
|
||||
# Licensed under the 2-clause BSD license.
|
||||
#
|
||||
# This tweak eliminates the need for manually escaping shell
|
||||
# meta-characters such as [~^{}] that are used for specifying a git
|
||||
# object (commit or tree). Every time you type one of these
|
||||
# characters on a git command line, it is automatically escaped with a
|
||||
# backslash as necessary and as appropriate.
|
||||
#
|
||||
# If you want to use this with url-quote-magic, make sure to enable it
|
||||
# first.
|
||||
#
|
||||
# Usage:
|
||||
# autoload -Uz git-escape-magic
|
||||
# git-escape-magic
|
||||
#
|
||||
|
||||
git-escape-magic.self-insert() {
|
||||
emulate -L zsh
|
||||
setopt extendedglob
|
||||
local self_insert_function
|
||||
zstyle -s ':git-escape-magic' self-insert-function self_insert_function
|
||||
|
||||
if [[ "$KEYS" == [{}~^]* ]] && {
|
||||
local qkey="${(q)KEYS}"
|
||||
[[ "$KEYS" != "$qkey" ]]
|
||||
} && {
|
||||
local lbuf="$LBUFFER$qkey"
|
||||
[[ "${(Q)LBUFFER}$KEYS" == "${(Q)lbuf}" ]]
|
||||
} && {
|
||||
local -a words
|
||||
words=("${(@Q)${(z)lbuf}}")
|
||||
[[ "$words[(i)(*/|)git(|-[^/]##)]" -le $#words ]]
|
||||
}
|
||||
then
|
||||
local i
|
||||
i="$words[(I)([;(){\&]|\&[\&\!]|\|\||[=<>]\(*)]"
|
||||
if [[ $i -gt 0 ]]; then
|
||||
shift $((i-1)) words
|
||||
if [[ "$words[1]" == [\=\<\>]\(* ]]; then
|
||||
words[1]="${words[1]#[=<>]\(}"
|
||||
else
|
||||
[[ "$words[1]" == \; && $words[2] == (then|else|elif|do) ]] && shift words
|
||||
shift words
|
||||
fi
|
||||
fi
|
||||
while [[ "$words[1]" == (if|while|until|\!) ]]; do
|
||||
shift words
|
||||
done
|
||||
while [[ "$words[1]" == [A-Za-z_][A-Za-z0-9_]#=* ]]; do
|
||||
shift words
|
||||
done
|
||||
[[ "$words[1]" == (*/|)git(|-[^/]##) ]] && {
|
||||
local subcommand
|
||||
subcommand="${words[1]##*/git-}"
|
||||
if [[ -z "$subcommand" ]]; then
|
||||
shift words
|
||||
subcommand="$words[1]"
|
||||
fi
|
||||
[[ $#words -ge 2 ]]
|
||||
} &&
|
||||
case "$subcommand" in
|
||||
# commands that may take pathspec but never take refspec with [{}~^]
|
||||
(add|rm|am|apply|check-attr|checkout-index|clean|clone|config|diff-files|hash-object|help|index-pack|mailinfo|mailsplit|merge-file|merge-index|mergetool|mktag|mv|pack-objects|pack-redundant|relink|send-email|show-index|show-ref|stage|status|verify-pack)
|
||||
false ;;
|
||||
# commands that may take pathspec but rarely take refspec with [{}~^]
|
||||
(for-each-ref|grep|ls-files|update-index)
|
||||
false ;;
|
||||
(archive|ls-tree)
|
||||
! [[ $#words -ge 3 &&
|
||||
"$words[-2]" == [^-]* ]] ;;
|
||||
(diff-tree)
|
||||
! [[ $#words -ge 4 &&
|
||||
"$words[-2]" == [^-]* &&
|
||||
"$words[-3]" == [^-]* ]] ;;
|
||||
(*)
|
||||
[[ $words[(i)--] -gt $#words ]] ;;
|
||||
esac &&
|
||||
case "${words[-1]%%"$KEYS"}" in
|
||||
(*[@^])
|
||||
[[ "$KEYS" == [{~^]* ]] ;;
|
||||
(*[@^]\{[^}]##)
|
||||
[[ "$KEYS" == \}* ]] ;;
|
||||
(?*)
|
||||
[[ "$KEYS" == [~^]* ]] ;;
|
||||
(*)
|
||||
false ;;
|
||||
esac &&
|
||||
LBUFFER="$LBUFFER\\"
|
||||
fi
|
||||
|
||||
zle "$self_insert_function"
|
||||
}
|
||||
|
||||
git-escape-magic.on() {
|
||||
emulate -L zsh
|
||||
local self_insert_function="${$(zle -lL | awk \
|
||||
'$1=="zle"&&$2=="-N"&&$3=="self-insert"{print $4;exit}'):-.self-insert}"
|
||||
|
||||
[[ "$self_insert_function" == git-escape-magic.self-insert ]] &&
|
||||
return 0
|
||||
|
||||
# For url-quote-magic which does not zle -N itself
|
||||
zle -la "$self_insert_function" || zle -N "$self_insert_function"
|
||||
|
||||
zstyle ':git-escape-magic' self-insert-function "$self_insert_function"
|
||||
|
||||
zle -A git-escape-magic.self-insert self-insert
|
||||
return 0
|
||||
}
|
||||
|
||||
git-escape-magic.off() {
|
||||
emulate -L zsh
|
||||
local self_insert_function
|
||||
zstyle -s ':git-escape-magic' self-insert-function self_insert_function
|
||||
|
||||
[[ -n "$self_insert_function" ]] &&
|
||||
zle -A "$self_insert_function" self-insert
|
||||
return 0
|
||||
}
|
||||
|
||||
zle -N git-escape-magic.self-insert
|
||||
zle -N git-escape-magic.on
|
||||
zle -N git-escape-magic.off
|
||||
|
||||
git-escape-magic() {
|
||||
git-escape-magic.on
|
||||
}
|
||||
|
||||
[[ -o kshautoload ]] || git-escape-magic "$@"
|
||||
|
@ -0,0 +1,9 @@
|
||||
# Automatically detect and escape zsh globbing meta-characters when used with
|
||||
# git refspec characters like `[^~{}]`. NOTE: This must be loaded _after_
|
||||
# url-quote-magic.
|
||||
#
|
||||
# This trick is detailed at https://github.com/knu/zsh-git-escape-magic and is
|
||||
# what allowed this plugin to exist.
|
||||
|
||||
autoload -Uz git-escape-magic
|
||||
git-escape-magic
|
61
zsh/.oh-my-zsh/plugins/git-prompt/README.md
Normal file
61
zsh/.oh-my-zsh/plugins/git-prompt/README.md
Normal file
@ -0,0 +1,61 @@
|
||||
# git-prompt plugin
|
||||
|
||||
A `zsh` prompt that displays information about the current git repository. In particular:
|
||||
the branch name, difference with remote branch, number of files staged or changed, etc.
|
||||
|
||||
To use it, add `git-prompt` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... git-prompt)
|
||||
```
|
||||
|
||||
See the [original repository](https://github.com/olivierverdier/zsh-git-prompt).
|
||||
|
||||
## Examples
|
||||
|
||||
The prompt may look like the following:
|
||||
|
||||
- `(master↑3|✚1)`: on branch `master`, ahead of remote by 3 commits, 1 file changed but not staged
|
||||
- `(status|●2)`: on branch `status`, 2 files staged
|
||||
- `(master|✚7…)`: on branch `master`, 7 files changed, some files untracked
|
||||
- `(master|✖2✚3)`: on branch `master`, 2 conflicts, 3 files changed
|
||||
- `(experimental↓2↑3|✔)`: on branch `experimental`; your branch has diverged by 3 commits, remote by 2 commits; the repository is otherwise clean
|
||||
- `(:70c2952|✔)`: not on any branch; parent commit has hash `70c2952`; the repository is otherwise clean
|
||||
|
||||
## Prompt Structure
|
||||
|
||||
By default, the general appearance of the prompt is:
|
||||
|
||||
```
|
||||
(<branch><branch tracking>|<local status>)
|
||||
```
|
||||
|
||||
The symbols are as follows:
|
||||
|
||||
### Local Status Symbols
|
||||
|
||||
| Symbol | Meaning |
|
||||
|--------|--------------------------------|
|
||||
| ✔ | repository clean |
|
||||
| ●n | there are `n` staged files |
|
||||
| ✖n | there are `n` unmerged files |
|
||||
| ✚n | there are `n` unstaged files |
|
||||
| … | there are some untracked files |
|
||||
|
||||
### Branch Tracking Symbols
|
||||
|
||||
| Symbol | Meaning |
|
||||
|--------|---------------------------------------------------------------|
|
||||
| ↑n | ahead of remote by `n` commits |
|
||||
| ↓n | behind remote by `n` commits |
|
||||
| ↓m↑n | branches diverged: other by `m` commits, yours by `n` commits |
|
||||
|
||||
## Customisation
|
||||
|
||||
- Set the variable `ZSH_THEME_GIT_PROMPT_CACHE` to any value in order to enable caching.
|
||||
- You may also change a number of variables (whose name start with `ZSH_THEME_GIT_PROMPT_`)
|
||||
to change the appearance of the prompt. Take a look at the bottom of the [plugin file](git-prompt.plugin.zsh)`
|
||||
to see what variables are available.
|
||||
|
||||
|
||||
**Enjoy!**
|
14
zsh/.oh-my-zsh/plugins/git-remote-branch/README.md
Normal file
14
zsh/.oh-my-zsh/plugins/git-remote-branch/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# git-remote-branch plugin
|
||||
|
||||
This plugin adds completion for [`grb`](https://github.com/webmat/git_remote_branch),
|
||||
or `git_remote_branch`.
|
||||
|
||||
To use it, add `git-remote-branch` to the plugins array of your `.zshrc` file:
|
||||
```
|
||||
plugins=(... git-remote-branch)
|
||||
```
|
||||
|
||||
## Deprecation
|
||||
|
||||
[git_remote_branch was archived in 2018](https://github.com/webmat/git_remote_branch#archived),
|
||||
meaning it's not actively maintained anymore. Use at your own risk.
|
9
zsh/.oh-my-zsh/plugins/gitfast/update
Executable file
9
zsh/.oh-my-zsh/plugins/gitfast/update
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
url="https://git.kernel.org/pub/scm/git/git.git/plain/contrib/completion"
|
||||
version="2.16.0"
|
||||
|
||||
curl -s -o _git "${url}/git-completion.zsh?h=v${version}" &&
|
||||
curl -s -o git-completion.bash "${url}/git-completion.bash?h=v${version}" &&
|
||||
curl -s -o git-prompt.sh "${url}/git-prompt.sh?h=v${version}" &&
|
||||
git apply updates.patch
|
56
zsh/.oh-my-zsh/plugins/gitfast/updates.patch
Normal file
56
zsh/.oh-my-zsh/plugins/gitfast/updates.patch
Normal file
@ -0,0 +1,56 @@
|
||||
diff --git b/plugins/gitfast/_git a/plugins/gitfast/_git
|
||||
index e2554130..a2e3bef5 100644
|
||||
--- b/plugins/gitfast/_git
|
||||
+++ a/plugins/gitfast/_git
|
||||
@@ -30,7 +30,7 @@ if [ -z "$script" ]; then
|
||||
local -a locations
|
||||
local e
|
||||
locations=(
|
||||
- $(dirname ${funcsourcetrace[1]%:*})/git-completion.bash
|
||||
+ "$(dirname ${funcsourcetrace[1]%:*})/git-completion.bash"
|
||||
'/etc/bash_completion.d/git' # fedora, old debian
|
||||
'/usr/share/bash-completion/completions/git' # arch, ubuntu, new debian
|
||||
'/usr/share/bash-completion/git' # gentoo
|
||||
@@ -214,8 +214,10 @@ _git ()
|
||||
|
||||
if (( $+functions[__${service}_zsh_main] )); then
|
||||
__${service}_zsh_main
|
||||
- else
|
||||
+ elif (( $+functions[__${service}_main] )); then
|
||||
emulate ksh -c __${service}_main
|
||||
+ elif (( $+functions[_${service}] )); then
|
||||
+ emulate ksh -c _${service}
|
||||
fi
|
||||
|
||||
let _ret && _default && _ret=0
|
||||
diff --git b/plugins/gitfast/git-completion.bash a/plugins/gitfast/git-completion.bash
|
||||
index 9c8f7380..14012cab 100644
|
||||
--- b/plugins/gitfast/git-completion.bash
|
||||
+++ a/plugins/gitfast/git-completion.bash
|
||||
@@ -2915,6 +2915,6 @@ __git_complete gitk __gitk_main
|
||||
# when the user has tab-completed the executable name and consequently
|
||||
# included the '.exe' suffix.
|
||||
#
|
||||
-if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
|
||||
+if [[ "$OSTYPE" = cygwin* ]]; then
|
||||
__git_complete git.exe __git_main
|
||||
fi
|
||||
diff --git b/plugins/gitfast/git-prompt.sh a/plugins/gitfast/git-prompt.sh
|
||||
index 97eacd78..c1de34eb 100644
|
||||
--- b/plugins/gitfast/git-prompt.sh
|
||||
+++ a/plugins/gitfast/git-prompt.sh
|
||||
@@ -502,9 +502,11 @@ __git_ps1 ()
|
||||
|
||||
local z="${GIT_PS1_STATESEPARATOR-" "}"
|
||||
|
||||
- # NO color option unless in PROMPT_COMMAND mode
|
||||
- if [ $pcmode = yes ] && [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
|
||||
- __git_ps1_colorize_gitstring
|
||||
+ # NO color option unless in PROMPT_COMMAND mode or it's Zsh
|
||||
+ if [ -n "${GIT_PS1_SHOWCOLORHINTS-}" ]; then
|
||||
+ if [ $pcmode = yes ] || [ -n "${ZSH_VERSION-}" ]; then
|
||||
+ __git_ps1_colorize_gitstring
|
||||
+ fi
|
||||
fi
|
||||
|
||||
b=${b##refs/heads/}
|
181
zsh/.oh-my-zsh/plugins/httpie/_httpie
Normal file
181
zsh/.oh-my-zsh/plugins/httpie/_httpie
Normal file
@ -0,0 +1,181 @@
|
||||
#compdef http
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2015 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for httpie 0.7.2 (http://httpie.org)
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * Akira Maeda <https://github.com/glidenote>
|
||||
# * Valodim <https://github.com/Valodim>
|
||||
# * Claus Klingberg <https://github.com/cjk>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_httpie_params () {
|
||||
|
||||
local ret=1 expl
|
||||
|
||||
# or a url
|
||||
if (( CURRENT <= NORMARG+1 )) && [[ $words[NORMARG] != *:* ]] ; then
|
||||
_httpie_urls && ret=0
|
||||
|
||||
# regular param, if we already have a url
|
||||
elif (( CURRENT > NORMARG )); then
|
||||
|
||||
# if the suffix is precisely : this is shorthand for a header
|
||||
if [[ -prefix ':' ]]; then
|
||||
PREFIX=
|
||||
SUFFIX=:
|
||||
fi
|
||||
|
||||
# if we are in front of a : (possibly due to the PREFIX move before)
|
||||
if [[ -suffix ':' ]]; then
|
||||
|
||||
# this is rather buggy with normal tab behavior :\
|
||||
compstate[insert]=menu
|
||||
_wanted http_header expl 'HTTP Header' \
|
||||
compadd -s ':' -S '' -- Content-Type Cookie && return 0
|
||||
fi
|
||||
|
||||
# ignore all prefix stuff
|
||||
compset -P '(#b)([^:@=]#)'
|
||||
local name=$match[1]
|
||||
|
||||
if compset -P '='; then
|
||||
_message "$name data field value"
|
||||
elif compset -P '@'; then
|
||||
_files
|
||||
elif compset -P ':=@'; then
|
||||
_files
|
||||
elif compset -P ':='; then
|
||||
_message "$name raw json data"
|
||||
elif compset -P '=='; then
|
||||
_message "$name url parameter value"
|
||||
elif compset -P ':'; then
|
||||
_message "$name header content"
|
||||
else
|
||||
typeset -a ops
|
||||
ops=(
|
||||
'=:data field'
|
||||
'\::header'
|
||||
'==:request parameter'
|
||||
'@:data file field'
|
||||
'\:=:raw json field'
|
||||
'\:=@:raw json field file path'
|
||||
)
|
||||
_describe -t httpparams "parameter types" ops -Q -S ''
|
||||
fi
|
||||
|
||||
ret=0
|
||||
|
||||
fi
|
||||
|
||||
# first arg may be a request method
|
||||
(( CURRENT == NORMARG )) &&
|
||||
_wanted http_method expl 'Request Method' \
|
||||
compadd GET POST PUT DELETE HEAD OPTIONS TRACE CONNECT PATCH LINK UNLINK && ret=0
|
||||
|
||||
return $ret
|
||||
|
||||
}
|
||||
|
||||
_httpie_urls() {
|
||||
|
||||
local ret=1
|
||||
|
||||
if ! [[ -prefix [-+.a-z0-9]#:// ]]; then
|
||||
local expl
|
||||
compset -S '[^:/]*' && compstate[to_end]=''
|
||||
_wanted url-schemas expl 'URL schema' compadd -S '' http:// https:// && ret=0
|
||||
else
|
||||
_urls && ret=0
|
||||
fi
|
||||
|
||||
return $ret
|
||||
|
||||
}
|
||||
|
||||
_httpie_printflags () {
|
||||
|
||||
local ret=1
|
||||
|
||||
# not sure why this is necessary, but it will complete "-pH" style without it
|
||||
[[ $IPREFIX == "-p" ]] && IPREFIX+=" "
|
||||
|
||||
compset -P '(#b)([a-zA-Z]#)'
|
||||
|
||||
local -a flags
|
||||
[[ $match[1] != *H* ]] && flags+=( "H:request headers" )
|
||||
[[ $match[1] != *B* ]] && flags+=( "B:request body" )
|
||||
[[ $match[1] != *h* ]] && flags+=( "h:response headers" )
|
||||
[[ $match[1] != *b* ]] && flags+=( "b:response body" )
|
||||
|
||||
_describe -t printflags "print flags" flags -S '' && ret=0
|
||||
|
||||
return $ret
|
||||
|
||||
}
|
||||
|
||||
integer NORMARG
|
||||
|
||||
_arguments -n -C -s \
|
||||
'(-j --json -f)'{-j,--json}'[Data items from the command line are serialized as a JSON object.]' \
|
||||
'(-f --form -j)'{-f,--form}'[Data items from the command line are serialized as form fields.]' \
|
||||
'--pretty=[Controls output processing.]:output format:(all colors format none)' \
|
||||
'(-s --style)'{-s,--style}'=[Output coloring style]:STYLE:(autumn borland bw colorful default emacs friendly fruity manni monokai murphy native pastie perldoc ttr solarized tango trac vim vs)' \
|
||||
'(-p --print)'{-p,--print}'=[String specifying what the output should contain]:print flags:_httpie_printflags' \
|
||||
'(-v --verbose)'{-v,--verbose}'[Print the whole request as well as the response.]' \
|
||||
'(-p -h --headers)'{-h,--headers}'[Print only the response headers.]' \
|
||||
'(-p -b --body)'{-b,--body}'[Print only the response body.]' \
|
||||
'(-S --stream)'{-S,--stream}'[Always stream the output by line, i.e., behave like `tail -f`.]' \
|
||||
'(-o --output)'{-o,--output}'=[Save output to FILE.]:output file:_files' \
|
||||
'(-d --download)'{-d,--download}'=[Do not print the response body to stdout.]' \
|
||||
'(-c --continue)'{-c,--continue}'[Resume an interrupted download.]' \
|
||||
'(--session-read-only)--session=[Create, or reuse and update a session.]:session name (or path)' \
|
||||
'(--session)--session-read-only=[Create or read a session without updating it form the request/response exchange.]:session name (or path)' \
|
||||
'(-a --auth)'{-a,--auth}'=[If only the username is provided (-a username)]:USER\:PASS' \
|
||||
'--auth-type=[The authentication mechanism to be used. Defaults to "basic".]:AUTH-TYPE:(basic digest)' \
|
||||
'--proxy=[String mapping protocol to the URL of the proxy.]:PROXY' \
|
||||
'--follow[Allow full redirects.]' \
|
||||
"--verify=[Enable or disable verification of ssl certificates.]:verify certificate:(yes no)" \
|
||||
'--allow-redirects[Set this flag if full redirects are allowed (e.g. re-POST-ing of data at new ``Location``)]' \
|
||||
'--timeout=[Float describes the timeout of the request (Use socket.setdefaulttimeout() as fallback).]:timeout (seconds)' \
|
||||
'--check-status[This flag instructs HTTPie to also check the HTTP status code and exit with an error if the status indicates one.]' \
|
||||
'--ignore-stdin[Do not attempt to read stdin.]' \
|
||||
'(- *)--help[show help message.]' \
|
||||
"(- *)--version[show program's version number and exit.]" \
|
||||
'--traceback[Prints exception traceback should one occur.]' \
|
||||
'--debug[Prints exception traceback should one occur and other information useful for debugging HTTPie itself.]' \
|
||||
'*:args:_httpie_params' && return 0
|
21
zsh/.oh-my-zsh/plugins/jruby/README.md
Normal file
21
zsh/.oh-my-zsh/plugins/jruby/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# JRuby plugin
|
||||
|
||||
This plugin adds aliases for [JRuby](https://www.jruby.org/).
|
||||
|
||||
To use it, add `jruby` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... jruby)
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
This plugin assumes you already have jruby installed and available in your [path](https://www.jruby.org/getting-started).
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command |
|
||||
| ------------ | ---------------------------------------------------------------- |
|
||||
| `jrspec` | `jruby --debug -S rspec --debug` |
|
||||
| `jprofile` | `jruby --profile.api -S rspec` |
|
||||
| `jexec` | `jruby -S` |
|
9
zsh/.oh-my-zsh/plugins/lein/README.md
Normal file
9
zsh/.oh-my-zsh/plugins/lein/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Leiningen plugin
|
||||
|
||||
This plugin adds completions for the [Leiningen](https://leiningen.org/) Clojure build tool.
|
||||
|
||||
To use it, add `lein` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... lein)
|
||||
```
|
26
zsh/.oh-my-zsh/plugins/lighthouse/README.md
Normal file
26
zsh/.oh-my-zsh/plugins/lighthouse/README.md
Normal file
@ -0,0 +1,26 @@
|
||||
# Lighthouse plugin
|
||||
|
||||
This plugin adds commands to manage [Lighthouse](https://lighthouseapp.com/).
|
||||
|
||||
To use it, add `lighthouse` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... lighthouse)
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
* `open_lighthouse_ticket <issue>` (alias: `lho`):
|
||||
|
||||
Opens the URL to the issue passed as an argument. To use it, add a `.lighthouse-url`
|
||||
file in your directory with the URL to the individual project.
|
||||
|
||||
Example:
|
||||
```zsh
|
||||
$ cat .lighthouse-url
|
||||
https://rails.lighthouseapp.com/projects/8994
|
||||
|
||||
$ lho 23
|
||||
Opening ticket #23
|
||||
# The browser goes to https://rails.lighthouseapp.com/projects/8994/tickets/23
|
||||
```
|
20
zsh/.oh-my-zsh/plugins/mysql-macports/README.md
Normal file
20
zsh/.oh-my-zsh/plugins/mysql-macports/README.md
Normal file
@ -0,0 +1,20 @@
|
||||
# MySQL-Macports plugin
|
||||
|
||||
This plugin adds aliases for some of the commonly used [MySQL](https://www.mysql.com/) commands when installed using [MacPorts](https://www.macports.org/) on macOS.
|
||||
|
||||
To use it, add `mysql-macports` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... mysql-macports)
|
||||
```
|
||||
|
||||
For instructions on how to install MySQL using MacPorts, read the [MacPorts wiki](https://trac.macports.org/wiki/howto/MySQL/).
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| ------------ | --------------------------------------------------------- | ------------------------------------------ |
|
||||
| mysqlstart | `sudo /opt/local/share/mysql5/mysql/mysql.server start` | Start the MySQL server. |
|
||||
| mysqlstop | `sudo /opt/local/share/mysql5/mysql/mysql.server stop` | Stop the MySQL server. |
|
||||
| mysqlrestart | `sudo /opt/local/share/mysql5/mysql/mysql.server restart` | Restart the MySQL server. |
|
||||
| mysqlstatus | `mysqladmin5 -u root -p ping` | Check whether the MySQL server is running. |
|
21
zsh/.oh-my-zsh/plugins/n98-magerun/README.md
Normal file
21
zsh/.oh-my-zsh/plugins/n98-magerun/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# n98-magerun plugin
|
||||
|
||||
The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time.
|
||||
|
||||
The [n98-magerun plugin](https://github.com/netz98/n98-magerun) provides many
|
||||
[useful aliases](#aliases) as well as completion for the `n98-magerun` command.
|
||||
|
||||
Enable it by adding `n98-magerun` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... n98-magerun)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| --------- | -------------------------------------------------- | --------------------------------------------------------------------------------- |
|
||||
| n98 | `n98-magerun.phar` | The N98-Magerun phar-file (Version 1) |
|
||||
| n98-2 | `n98-magerun2.phar` | The N98-Magerun phar-file (Version 2) |
|
||||
| mage-get | `wget https://files.magerun.net/n98-magerun.phar` | Download the latest stable N98-Magerun phar-file from the file-server (Version 1) |
|
||||
| mage2-get | `wget https://files.magerun.net/n98-magerun2.phar` | Download the latest stable N98-Magerun phar-file from the file-server (Version 2) |
|
13
zsh/.oh-my-zsh/plugins/oc/README.md
Normal file
13
zsh/.oh-my-zsh/plugins/oc/README.md
Normal file
@ -0,0 +1,13 @@
|
||||
# OC - OpenShift CLI
|
||||
|
||||
This plugin provides autocompletion for [OC](https://docs.openshift.com/container-platform/3.7/cli_reference/index.html) commands, building, managing and updating operations.
|
||||
|
||||
To use it, add `oc` to the plugins array of your zshrc file:
|
||||
|
||||
```bash
|
||||
plugins=(... oc)
|
||||
```
|
||||
|
||||
## Contributors
|
||||
|
||||
+ [kevinkirkup](https://github.com/kevinkirkup) - Plugin Author
|
54
zsh/.oh-my-zsh/plugins/otp/otp.plugin.zsh
Normal file
54
zsh/.oh-my-zsh/plugins/otp/otp.plugin.zsh
Normal file
@ -0,0 +1,54 @@
|
||||
export OTP_HOME=~/.otp
|
||||
mkdir -p $OTP_HOME
|
||||
|
||||
function ot () {
|
||||
if ! command -v oathtool > /dev/null 2>&1; then
|
||||
echo "Note: you need to install oathtool or oath-toolkit, depending on your OS or distribution."
|
||||
return 1
|
||||
fi
|
||||
|
||||
if ! command -v gpg > /dev/null 2>&1; then
|
||||
echo "Note: you need to install gpg and create an ID using 'gpg --gen-key', unless you have one already."
|
||||
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>"
|
||||
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
|
||||
fi
|
||||
}
|
||||
|
||||
function otp_add_device () {
|
||||
if [[ "x$1" == "x" ]] then
|
||||
echo "usage: otp_add <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"
|
||||
|
||||
rm -f $OTP_HOME/$1.otp.asc
|
||||
gpg --armor --encrypt --output $OTP_HOME/$1.otp.asc /dev/stdin
|
||||
fi
|
||||
}
|
||||
|
||||
function otp_devices () {
|
||||
reply=($(find $OTP_HOME -name \*.otp.asc | xargs basename -s .otp.asc))
|
||||
}
|
||||
|
||||
compctl -K otp_devices ot
|
22
zsh/.oh-my-zsh/plugins/pass/README.md
Normal file
22
zsh/.oh-my-zsh/plugins/pass/README.md
Normal file
@ -0,0 +1,22 @@
|
||||
# pass
|
||||
|
||||
This plugin provides completion for the [pass](https://www.passwordstore.org/) password manager.
|
||||
|
||||
To use it, add `pass` to the plugins array in your zshrc file.
|
||||
|
||||
```
|
||||
plugins=(... pass)
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Multiple repositories
|
||||
|
||||
If you use multiple repositories, you can configure completion like this:
|
||||
```zsh
|
||||
compdef _pass workpass
|
||||
zstyle ':completion::complete:workpass::' prefix "$HOME/work/pass"
|
||||
workpass() {
|
||||
PASSWORD_STORE_DIR=$HOME/work/pass pass $@
|
||||
}
|
||||
```
|
37
zsh/.oh-my-zsh/plugins/perl/README.md
Normal file
37
zsh/.oh-my-zsh/plugins/perl/README.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Perl
|
||||
|
||||
This plugin adds [perl](https://www.perl.org/) useful aliases/functions.
|
||||
|
||||
To use it, add `perl` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... perl)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Aliases | Command | Description |
|
||||
| :------------ | :----------------- | :------------------------------------- |
|
||||
| pbi | `perlbrew install` | Install specific perl version |
|
||||
| pbl | `perlbrew list` | List all perl version installed |
|
||||
| pbo | `perlbrew off` | Go back to the system perl |
|
||||
| pbs | `perlbrew switch` | Turn it back on |
|
||||
| pbu | `perlbrew use` | Use specific version of perl |
|
||||
| pd | `perldoc` | Show the perl documentation |
|
||||
| ple | `perl -wlne` | Use perl like awk/sed |
|
||||
| latest-perl | `curl ...` | Show the latest stable release of Perl |
|
||||
|
||||
## Functions
|
||||
|
||||
* `newpl`: creates a basic Perl script file and opens it with $EDITOR.
|
||||
|
||||
* `pgs`: Perl Global Substitution: `pgs <find_pattern> <replace_pattern> <filename>`
|
||||
Looks for `<find_pattern>` and replaces it with `<replace_pattern>` in `<filename>`.
|
||||
|
||||
* `prep`: Perl grep, because 'grep -P' is terrible: `prep <pattern> [<filename>]`
|
||||
Lets you work with pipes or files (if no `<filename>` provided, use stdin).
|
||||
|
||||
## Requirements
|
||||
|
||||
In order to make this work, you will need to have perl installed.
|
||||
More info on the usage and install: https://www.perl.org/get.html
|
8
zsh/.oh-my-zsh/plugins/phing/README.md
Normal file
8
zsh/.oh-my-zsh/plugins/phing/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Phing plugin
|
||||
|
||||
This plugin adds autocompletion for [`phing`](https://github.com/phingofficial/phing) targets.
|
||||
|
||||
To use it, add `phing` to the plugins array of your `.zshrc` file:
|
||||
```
|
||||
plugins=(... eecms)
|
||||
```
|
19
zsh/.oh-my-zsh/plugins/pip/README.md
Normal file
19
zsh/.oh-my-zsh/plugins/pip/README.md
Normal file
@ -0,0 +1,19 @@
|
||||
# pip plugin
|
||||
|
||||
This plugin adds completion for [pip](https://pip.pypa.io/en/latest/),
|
||||
the Python package manager.
|
||||
|
||||
To use it, add `pip` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... pip)
|
||||
```
|
||||
|
||||
## pip cache
|
||||
|
||||
The pip plugin caches the names of available pip packages from the PyPI index.
|
||||
To trigger the caching process, try to complete `pip install`,
|
||||
or you can run `zsh-pip-cache-packages` directly.
|
||||
|
||||
To reset the cache, run `zsh-pip-clear-cache` and it will be rebuilt next
|
||||
the next time you autocomplete `pip install`.
|
28
zsh/.oh-my-zsh/plugins/pipenv/README.md
Normal file
28
zsh/.oh-my-zsh/plugins/pipenv/README.md
Normal file
@ -0,0 +1,28 @@
|
||||
# Pipenv
|
||||
|
||||
## Installation
|
||||
In your `.zshrc` file, add `pipenv` to the plugins section
|
||||
|
||||
```
|
||||
plugins=(... pipenv ...)
|
||||
```
|
||||
|
||||
## Features
|
||||
This plugin provides some features to simplify the use of Pipenv while working on ZSH.
|
||||
- Adds completion for pipenv
|
||||
- Auto activates and deactivates pipenv shell
|
||||
- Adds short aliases for common pipenv commands
|
||||
- `pch` is aliased to `pipenv check`
|
||||
- `pcl` is aliased to `pipenv clean`
|
||||
- `pgr` is aliased to `pipenv graph`
|
||||
- `pi` is aliased to `pipenv install`
|
||||
- `pidev` is aliased to `pipenv install --dev`
|
||||
- `pl` is aliased to `pipenv lock`
|
||||
- `po` is aliased to `pipenv open`
|
||||
- `prun` is aliased to `pipenv run`
|
||||
- `psh` is aliased to `pipenv shell`
|
||||
- `psy` is aliased to `pipenv sync`
|
||||
- `pu` is aliased to `pipenv uninstall`
|
||||
- `pwh` is aliased to `pipenv --where`
|
||||
- `pvenv` is aliased to `pipenv --venv`
|
||||
- `ppy` is aliased to `pipenv --py`
|
42
zsh/.oh-my-zsh/plugins/pipenv/pipenv.plugin.zsh
Normal file
42
zsh/.oh-my-zsh/plugins/pipenv/pipenv.plugin.zsh
Normal file
@ -0,0 +1,42 @@
|
||||
# Pipenv completion
|
||||
_pipenv() {
|
||||
eval $(env COMMANDLINE="${words[1,$CURRENT]}" _PIPENV_COMPLETE=complete-zsh pipenv)
|
||||
}
|
||||
compdef _pipenv pipenv
|
||||
|
||||
# Automatic pipenv shell activation/deactivation
|
||||
_togglePipenvShell() {
|
||||
# deactivate shell if Pipfile doesn't exist and not in a subdir
|
||||
if [[ ! -a "$PWD/Pipfile" ]]; then
|
||||
if [[ "$PIPENV_ACTIVE" == 1 ]]; then
|
||||
if [[ "$PWD" != "$pipfile_dir"* ]]; then
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# activate the shell if Pipfile exists
|
||||
if [[ "$PIPENV_ACTIVE" != 1 ]]; then
|
||||
if [[ -a "$PWD/Pipfile" ]]; then
|
||||
export pipfile_dir="$PWD"
|
||||
pipenv shell
|
||||
fi
|
||||
fi
|
||||
}
|
||||
chpwd_functions+=(_togglePipenvShell)
|
||||
|
||||
# Aliases
|
||||
alias pch="pipenv check"
|
||||
alias pcl="pipenv clean"
|
||||
alias pgr="pipenv graph"
|
||||
alias pi="pipenv install"
|
||||
alias pidev="pipenv install --dev"
|
||||
alias pl="pipenv lock"
|
||||
alias po="pipenv open"
|
||||
alias prun="pipenv run"
|
||||
alias psh="pipenv shell"
|
||||
alias psy="pipenv sync"
|
||||
alias pu="pipenv uninstall"
|
||||
alias pwh="pipenv --where"
|
||||
alias pvenv="pipenv --venv"
|
||||
alias ppy="pipenv --py"
|
26
zsh/.oh-my-zsh/plugins/please/README.md
Normal file
26
zsh/.oh-my-zsh/plugins/please/README.md
Normal file
@ -0,0 +1,26 @@
|
||||
# please plugin
|
||||
|
||||
[Please](https://please.build) is a cross-language build system with an emphasis on
|
||||
high performance, extensibility and reproduceability. It supports a number of popular
|
||||
languages and can automate nearly any aspect of your build process.
|
||||
|
||||
This plugin adds autocomplete and major aliases for `plz`, the command line tool for
|
||||
Please.
|
||||
|
||||
To use it, add `please` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... please)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command |
|
||||
|-------|-------------|
|
||||
| `pb` | `plz build` |
|
||||
| `pt` | `plz test` |
|
||||
| `pw` | `plz watch` |
|
||||
|
||||
## Maintainer
|
||||
|
||||
[@thought-machine](https://github.com/thought-machine)
|
7
zsh/.oh-my-zsh/plugins/please/please.plugin.zsh
Normal file
7
zsh/.oh-my-zsh/plugins/please/please.plugin.zsh
Normal file
@ -0,0 +1,7 @@
|
||||
if (( $+commands[plz] )); then
|
||||
source <(plz --completion_script)
|
||||
fi
|
||||
|
||||
alias pb='plz build'
|
||||
alias pt='plz test'
|
||||
alias pw='plz watch'
|
10
zsh/.oh-my-zsh/plugins/pod/README.md
Normal file
10
zsh/.oh-my-zsh/plugins/pod/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# pod
|
||||
|
||||
This plugin adds completion for [`CocoaPods`](https://cocoapods.org/).
|
||||
CocoaPods is a dependency manager for Swift and Objective-C Cocoa projects.
|
||||
|
||||
To use it, add `pod` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... pod)
|
||||
```
|
21
zsh/.oh-my-zsh/plugins/pow/README.md
Normal file
21
zsh/.oh-my-zsh/plugins/pow/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# pow plugin
|
||||
|
||||
This plugin adds completion and commands for [pow](http://pow.cx/), a
|
||||
zero-configuration Rack server for macOS.
|
||||
|
||||
To use it, add pow to the plugins array of your zshrc file:
|
||||
|
||||
```sh
|
||||
plugins=(... pow)
|
||||
```
|
||||
|
||||
## Commands
|
||||
|
||||
- `kapow` will restart an app.
|
||||
|
||||
```bash
|
||||
kapow myapp
|
||||
```
|
||||
|
||||
- `kaput` will show the standard output from any pow app.
|
||||
- `repow` will restart the pow process.
|
8
zsh/.oh-my-zsh/plugins/powder/README.md
Normal file
8
zsh/.oh-my-zsh/plugins/powder/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Powder
|
||||
|
||||
This plugin provides completion for [powder](https://github.com/powder-rb/powder/).
|
||||
|
||||
To use it, add powder to the plugins array of your zshrc file:
|
||||
```
|
||||
plugins=(... powder)
|
||||
```
|
10
zsh/.oh-my-zsh/plugins/powify/README.md
Normal file
10
zsh/.oh-my-zsh/plugins/powify/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# powify plugin
|
||||
|
||||
This plugin adds autocompletion for [powify](https://github.com/sethvargo/powify),
|
||||
an easy-to-use wrapper for Basecamp's [pow](https://github.com/basecamp/pow).
|
||||
|
||||
To use it, add powify to the plugins array of your zshrc file:
|
||||
|
||||
```sh
|
||||
plugins=(... powify)
|
||||
```
|
25
zsh/.oh-my-zsh/plugins/profiles/README.md
Normal file
25
zsh/.oh-my-zsh/plugins/profiles/README.md
Normal file
@ -0,0 +1,25 @@
|
||||
# profiles plugin
|
||||
|
||||
This plugin allows you to create separate configuration files for zsh based
|
||||
on your long hostname (including the domain).
|
||||
|
||||
To use it, add profiles to the plugins array of your zshrc file:
|
||||
|
||||
```sh
|
||||
plugins=(... profiles)
|
||||
```
|
||||
|
||||
It takes your `$HOST` variable and looks for files named according to the
|
||||
domain parts in `$ZSH_CUSTOM/profiles/` directory.
|
||||
|
||||
For example, for `HOST=host.domain.com`, it will try to load the following files,
|
||||
in this order:
|
||||
|
||||
```text
|
||||
$ZSH_CUSTOM/profiles/com
|
||||
$ZSH_CUSTOM/profiles/domain.com
|
||||
$ZSH_CUSTOM/profiles/host.domain.com
|
||||
```
|
||||
|
||||
This means that if there are conflicting settings on those files, the one to take
|
||||
precedence will be the last applied, i.e. the one in host.domain.com.
|
16
zsh/.oh-my-zsh/plugins/pyenv/README.md
Normal file
16
zsh/.oh-my-zsh/plugins/pyenv/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
# pyenv
|
||||
|
||||
This plugin looks for [pyenv](https://github.com/pyenv/pyenv), a Simple Python version
|
||||
management system, and loads it if it's found. It also loads pyenv-virtualenv, a pyenv
|
||||
plugin to manage virtualenv, if it's found.
|
||||
|
||||
To use it, add `pyenv` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... pyenv)
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
- `pyenv_prompt_info`: displays the Python version in use by pyenv; or the global Python
|
||||
version, if pyenv wasn't found.
|
83
zsh/.oh-my-zsh/plugins/rails/README.md
Normal file
83
zsh/.oh-my-zsh/plugins/rails/README.md
Normal file
@ -0,0 +1,83 @@
|
||||
# Rails
|
||||
|
||||
This plugin adds completion for [Ruby On Rails Framework](https://rubyonrails.org/) and [Rake](https://ruby.github.io/rake/) commands, as well as some aliases for logs and environment variables.
|
||||
|
||||
To use it, add `rails` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... rails)
|
||||
```
|
||||
|
||||
## List of Aliases
|
||||
|
||||
### Rails aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|----------------------------|----------------------------------------------------|
|
||||
| `rc` | `rails console` | Interact with your Rails app from the CLI |
|
||||
| `rcs` | `rails console --sandbox` | Test code in a sandbox, without changing any data |
|
||||
| `rd` | `rails destroy` | Undo a generate operation |
|
||||
| `rdb` | `rails dbconsole` | Interact with your db from the console |
|
||||
| `rgen` | `rails generate` | Generate boilerplate code |
|
||||
| `rgm` | `rails generate migration` | Generate a db migration |
|
||||
| `rp` | `rails plugin` | Run a Rails plugin command |
|
||||
| `ru` | `rails runner` | Run Ruby code in the context of Rails |
|
||||
| `rs` | `rails server` | Launch a web server |
|
||||
| `rsd` | `rails server --debugger` | Launch a web server with debugger |
|
||||
| `rsp` | `rails server --port` | Launch a web server and specify the listening port |
|
||||
|
||||
### Rake aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|---------|---------------------------------|--------------------------------------------------------|
|
||||
| `rdm` | `rake db:migrate` | Run pending db migrations |
|
||||
| `rdms` | `rake db:migrate:status` | Show current db migration status |
|
||||
| `rdmtc` | `rake db:migrate db:test:clone` | Run pending migrations and clone db into test database |
|
||||
| `rdr` | `rake db:rollback` | Roll back the last migration |
|
||||
| `rdc` | `rake db:create` | Create the database |
|
||||
| `rds` | `rake db:seed` | Seed the database |
|
||||
| `rdd` | `rake db:drop` | Delete the database |
|
||||
| `rdrs` | `rake db:reset` | Delete the database and set it up again |
|
||||
| `rdtc` | `rake db:test:clone` | Clone the database into the test database |
|
||||
| `rdtp` | `rake db:test:prepare` | Duplicate the db schema into your test database |
|
||||
| `rdsl` | `rake db:schema:load` | Load the database schema |
|
||||
| `rlc` | `rake log:clear` | Clear Rails logs |
|
||||
| `rn` | `rake notes` | Search for notes (`FIXME`, `TODO`) in code comments |
|
||||
| `rr` | `rake routes` | List all defined routes |
|
||||
| `rrg` | `rake routes | grep` | List and filter the defined routes |
|
||||
| `rt` | `rake test` | Run Rails tests |
|
||||
| `rmd` | `rake middleware` | Interact with Rails middlewares |
|
||||
| `rsts` | `rake stats` | Print code statistics |
|
||||
|
||||
### Utility aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-----------|-------------------------------|------------------------------------------------|
|
||||
| `devlog` | `tail -f log/development.log` | Show and follow changes to the development log |
|
||||
| `prodlog` | `tail -f log/production.log` | Show and follow changes to the production log |
|
||||
| `testlog` | `tail -f log/test.log` | Show and follow changes to the test log |
|
||||
|
||||
### Environment settings
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|-------------------------|---------------------------------|
|
||||
| `RED` | `RAILS_ENV=development` | Sets `RAILS_ENV` to development |
|
||||
| `REP` | `RAILS_ENV=production` | Sets `RAILS_ENV` to production |
|
||||
| `RET` | `RAILS_ENV=test` | Sets `RAILS_ENV` to test |
|
||||
|
||||
These are global aliases. Use in combination with a command or just run them
|
||||
separately. For example: `REP rake db:migrate` will migrate the production db.
|
||||
|
||||
### Legacy stuff
|
||||
|
||||
| Alias | Command |
|
||||
|---------|------------------------------------|
|
||||
| `sstat` | `thin --stats "/thin/stats" start` |
|
||||
| `sg` | `ruby script/generate` |
|
||||
| `sd` | `ruby script/destroy` |
|
||||
| `sp` | `ruby script/plugin` |
|
||||
| `sr` | `ruby script/runner` |
|
||||
| `ssp` | `ruby script/spec` |
|
||||
| `sc` | `ruby script/console` |
|
||||
| `sd` | `ruby script/server --debugger` |
|
||||
|
37
zsh/.oh-my-zsh/plugins/rake/README.md
Normal file
37
zsh/.oh-my-zsh/plugins/rake/README.md
Normal file
@ -0,0 +1,37 @@
|
||||
# Rake plugin
|
||||
|
||||
This plugin adds support for [rake](https://ruby.github.io/rake/), the Ruby
|
||||
build tool or Ruby Make.
|
||||
|
||||
To use it, add `rake` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... rake)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
The plugin aliases the rake command so you can pass arguments when invoking rake tasks
|
||||
without having to escape the brackets, i.e., you can run
|
||||
```
|
||||
rake namespace:task['argument']
|
||||
```
|
||||
instead of having to do
|
||||
```
|
||||
rake namespace:task\['argument'\]
|
||||
```
|
||||
|
||||
| Alias | Command | Description |
|
||||
|--------|--------------------------------|-----------------------------------------------|
|
||||
| rake | `noglob rake` | Allows unescaped square brackets |
|
||||
| brake | `noglob bundle exec rake` | Same as above but call rake using bundler |
|
||||
| srake | `noglob sudo rake` | Same as rake but using sudo |
|
||||
| sbrake | `noglob sudo bundle exec rake` | Same as above but using both sudo and bundler |
|
||||
|
||||
## Jim Weirich
|
||||
|
||||
The plugin also aliases `rake` to [`jimweirich`](https://github.com/jimweirich), author of Rake
|
||||
and big time contributor to the Ruby open source community. He passed away in 2014:
|
||||
|
||||
> Thank you Jim for everything you contributed to the Ruby and open source community
|
||||
> over the years. We will miss you dearly. — [**@robbyrussell**](https://github.com/robbyrussell/oh-my-zsh/commit/598a9c6f990756386517d66b6bcf77e53791e905)
|
26
zsh/.oh-my-zsh/plugins/rbenv/README.md
Normal file
26
zsh/.oh-my-zsh/plugins/rbenv/README.md
Normal file
@ -0,0 +1,26 @@
|
||||
# rbenv plugin
|
||||
|
||||
The primary job of this plugin is to provide `rbenv_prompt_info` which can be added to your theme to include Ruby
|
||||
version and gemset information into your prompt.
|
||||
|
||||
Some functionality of this plugin will not work unless you also have the rbenv plugin *gemset* installed.
|
||||
https://github.com/jf/rbenv-gemset
|
||||
|
||||
To use it, add `rbenv` to the plugins array in your zshrc file:
|
||||
```zsh
|
||||
plugins=(... rbenv)
|
||||
```
|
||||
|
||||
## Alias
|
||||
|
||||
| Alias | Command | Description |
|
||||
|----------------|---------------------|----------------------------------|
|
||||
| rubies | `rbenv versions` | List the installed Ruby versions |
|
||||
| gemsets | `rbenv gemset list` | List the existing gemsets |
|
||||
|
||||
## Functions
|
||||
|
||||
* `current_ruby`: The version of Ruby currently being used.
|
||||
* `current_gemset`: The name of the current gemset.
|
||||
* `gems`: Lists installed gems with enhanced formatting and color.
|
||||
* `rbenv_prompt_info`: For adding information to your prompt. Format: `<ruby version>@<current gemset>`.
|
9
zsh/.oh-my-zsh/plugins/rebar/README.md
Normal file
9
zsh/.oh-my-zsh/plugins/rebar/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# rebar plugin
|
||||
|
||||
This plugin adds completions for the [rebar](https://www.rebar3.org/) Erlang build tool.
|
||||
|
||||
To use it, add `rebar` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... rebar)
|
||||
```
|
15
zsh/.oh-my-zsh/plugins/redis-cli/README.md
Normal file
15
zsh/.oh-my-zsh/plugins/redis-cli/README.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Redis-CLI
|
||||
|
||||
This plugin adds [redis-cli](https://redis.io/topics/rediscli) completion, based off of Homebrew completion.
|
||||
|
||||
To use it, add `redis-cli` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... redis-cli)
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
In order to make this work, you will need to have redis installed.
|
||||
|
||||
More info on the usage and install: https://redis.io/topics/quickstart
|
13
zsh/.oh-my-zsh/plugins/ripgrep/README.md
Normal file
13
zsh/.oh-my-zsh/plugins/ripgrep/README.md
Normal file
@ -0,0 +1,13 @@
|
||||
# ripgrep
|
||||
|
||||
This plugin adds completion for the text search tool [`ripgrep`](https://github.com/BurntSushi/ripgrep), also known as `rg`.
|
||||
|
||||
To use it, add `ripgrep` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... ripgrep)
|
||||
```
|
||||
|
||||
Completion is taken from the ripgrep release [`11.0.2`](https://github.com/BurntSushi/ripgrep/releases/tag/11.0.2).
|
||||
|
||||
Updated on August 16th, 2019.
|
612
zsh/.oh-my-zsh/plugins/ripgrep/_ripgrep
Normal file
612
zsh/.oh-my-zsh/plugins/ripgrep/_ripgrep
Normal file
@ -0,0 +1,612 @@
|
||||
#compdef rg
|
||||
|
||||
##
|
||||
# zsh completion function for ripgrep
|
||||
#
|
||||
# Run ci/test_complete.sh after building to ensure that the options supported by
|
||||
# this function stay in synch with the `rg` binary.
|
||||
#
|
||||
# For convenience, a completion reference guide is included at the bottom of
|
||||
# this file.
|
||||
#
|
||||
# Originally based on code from the zsh-users project — see copyright notice
|
||||
# below.
|
||||
|
||||
_rg() {
|
||||
local curcontext=$curcontext no='!' descr ret=1
|
||||
local -a context line state state_descr args tmp suf
|
||||
local -A opt_args
|
||||
|
||||
# ripgrep has many options which negate the effect of a more common one — for
|
||||
# example, `--no-column` to negate `--column`, and `--messages` to negate
|
||||
# `--no-messages`. There are so many of these, and they're so infrequently
|
||||
# used, that some users will probably find it irritating if they're completed
|
||||
# indiscriminately, so let's not do that unless either the current prefix
|
||||
# matches one of those negation options or the user has the `complete-all`
|
||||
# style set. Note that this prefix check has to be updated manually to account
|
||||
# for all of the potential negation options listed below!
|
||||
if
|
||||
# We also want to list all of these options during testing
|
||||
[[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] ||
|
||||
# (--[imnp]* => --ignore*, --messages, --no-*, --pcre2-unicode)
|
||||
[[ $PREFIX$SUFFIX == --[imnp]* ]] ||
|
||||
zstyle -t ":complete:$curcontext:*" complete-all
|
||||
then
|
||||
no=
|
||||
fi
|
||||
|
||||
# We make heavy use of argument groups here to prevent the option specs from
|
||||
# growing unwieldy. These aren't supported in zsh <5.4, though, so we'll strip
|
||||
# them out below if necessary. This makes the exclusions inaccurate on those
|
||||
# older versions, but oh well — it's not that big a deal
|
||||
args=(
|
||||
+ '(exclusive)' # Misc. fully exclusive options
|
||||
'(: * -)'{-h,--help}'[display help information]'
|
||||
'(: * -)'{-V,--version}'[display version information]'
|
||||
'(: * -)'--pcre2-version'[print the version of PCRE2 used by ripgrep, if available]'
|
||||
|
||||
+ '(buffered)' # buffering options
|
||||
'--line-buffered[force line buffering]'
|
||||
$no"--no-line-buffered[don't force line buffering]"
|
||||
'--block-buffered[force block buffering]'
|
||||
$no"--no-block-buffered[don't force block buffering]"
|
||||
|
||||
+ '(case)' # Case-sensitivity options
|
||||
{-i,--ignore-case}'[search case-insensitively]'
|
||||
{-s,--case-sensitive}'[search case-sensitively]'
|
||||
{-S,--smart-case}'[search case-insensitively if pattern is all lowercase]'
|
||||
|
||||
+ '(context-a)' # Context (after) options
|
||||
'(context-c)'{-A+,--after-context=}'[specify lines to show after each match]:number of lines'
|
||||
|
||||
+ '(context-b)' # Context (before) options
|
||||
'(context-c)'{-B+,--before-context=}'[specify lines to show before each match]:number of lines'
|
||||
|
||||
+ '(context-c)' # Context (combined) options
|
||||
'(context-a context-b)'{-C+,--context=}'[specify lines to show before and after each match]:number of lines'
|
||||
|
||||
+ '(column)' # Column options
|
||||
'--column[show column numbers for matches]'
|
||||
$no"--no-column[don't show column numbers for matches]"
|
||||
|
||||
+ '(count)' # Counting options
|
||||
{-c,--count}'[only show count of matching lines for each file]'
|
||||
'--count-matches[only show count of individual matches for each file]'
|
||||
|
||||
+ '(encoding)' # Encoding options
|
||||
{-E+,--encoding=}'[specify text encoding of files to search]: :_rg_encodings'
|
||||
$no'--no-encoding[use default text encoding]'
|
||||
|
||||
+ file # File-input options
|
||||
'(1)*'{-f+,--file=}'[specify file containing patterns to search for]: :_files'
|
||||
|
||||
+ '(file-match)' # Files with/without match options
|
||||
'(stats)'{-l,--files-with-matches}'[only show names of files with matches]'
|
||||
'(stats)--files-without-match[only show names of files without matches]'
|
||||
|
||||
+ '(file-name)' # File-name options
|
||||
{-H,--with-filename}'[show file name for matches]'
|
||||
{-I,--no-filename}"[don't show file name for matches]"
|
||||
|
||||
+ '(file-system)' # File system options
|
||||
"--one-file-system[don't descend into directories on other file systems]"
|
||||
$no'--no-one-file-system[descend into directories on other file systems]'
|
||||
|
||||
+ '(fixed)' # Fixed-string options
|
||||
{-F,--fixed-strings}'[treat pattern as literal string instead of regular expression]'
|
||||
$no"--no-fixed-strings[don't treat pattern as literal string]"
|
||||
|
||||
+ '(follow)' # Symlink-following options
|
||||
{-L,--follow}'[follow symlinks]'
|
||||
$no"--no-follow[don't follow symlinks]"
|
||||
|
||||
+ glob # File-glob options
|
||||
'*'{-g+,--glob=}'[include/exclude files matching specified glob]:glob'
|
||||
'*--iglob=[include/exclude files matching specified case-insensitive glob]:glob'
|
||||
|
||||
+ '(glob-case-insensitive)' # File-glob case sensitivity options
|
||||
'--glob-case-insensitive[treat -g/--glob patterns case insensitively]'
|
||||
$no'--no-glob-case-insensitive[treat -g/--glob patterns case sensitively]'
|
||||
|
||||
+ '(heading)' # Heading options
|
||||
'(pretty-vimgrep)--heading[show matches grouped by file name]'
|
||||
"(pretty-vimgrep)--no-heading[don't show matches grouped by file name]"
|
||||
|
||||
+ '(hidden)' # Hidden-file options
|
||||
'--hidden[search hidden files and directories]'
|
||||
$no"--no-hidden[don't search hidden files and directories]"
|
||||
|
||||
+ '(hybrid)' # hybrid regex options
|
||||
'--auto-hybrid-regex[dynamically use PCRE2 if necessary]'
|
||||
$no"--no-auto-hybrid-regex[don't dynamically use PCRE2 if necessary]"
|
||||
|
||||
+ '(ignore)' # Ignore-file options
|
||||
"(--no-ignore-global --no-ignore-parent --no-ignore-vcs --no-ignore-dot)--no-ignore[don't respect ignore files]"
|
||||
$no'(--ignore-global --ignore-parent --ignore-vcs --ignore-dot)--ignore[respect ignore files]'
|
||||
|
||||
+ '(ignore-file-case-insensitive)' # Ignore-file case sensitivity options
|
||||
'--ignore-file-case-insensitive[process ignore files case insensitively]'
|
||||
$no'--no-ignore-file-case-insensitive[process ignore files case sensitively]'
|
||||
|
||||
+ '(ignore-global)' # Global ignore-file options
|
||||
"--no-ignore-global[don't respect global ignore files]"
|
||||
$no'--ignore-global[respect global ignore files]'
|
||||
|
||||
+ '(ignore-parent)' # Parent ignore-file options
|
||||
"--no-ignore-parent[don't respect ignore files in parent directories]"
|
||||
$no'--ignore-parent[respect ignore files in parent directories]'
|
||||
|
||||
+ '(ignore-vcs)' # VCS ignore-file options
|
||||
"--no-ignore-vcs[don't respect version control ignore files]"
|
||||
$no'--ignore-vcs[respect version control ignore files]'
|
||||
|
||||
+ '(ignore-dot)' # .ignore-file options
|
||||
"--no-ignore-dot[don't respect .ignore files]"
|
||||
$no'--ignore-dot[respect .ignore files]'
|
||||
|
||||
+ '(json)' # JSON options
|
||||
'--json[output results in JSON Lines format]'
|
||||
$no"--no-json[don't output results in JSON Lines format]"
|
||||
|
||||
+ '(line-number)' # Line-number options
|
||||
{-n,--line-number}'[show line numbers for matches]'
|
||||
{-N,--no-line-number}"[don't show line numbers for matches]"
|
||||
|
||||
+ '(line-terminator)' # Line-terminator options
|
||||
'--crlf[use CRLF as line terminator]'
|
||||
$no"--no-crlf[don't use CRLF as line terminator]"
|
||||
'(text)--null-data[use NUL as line terminator]'
|
||||
|
||||
+ '(max-columns-preview)' # max column preview options
|
||||
'--max-columns-preview[show preview for long lines (with -M)]'
|
||||
$no"--no-max-columns-preview[don't show preview for long lines (with -M)]"
|
||||
|
||||
+ '(max-depth)' # Directory-depth options
|
||||
'--max-depth=[specify max number of directories to descend]:number of directories'
|
||||
'!--maxdepth=:number of directories'
|
||||
|
||||
+ '(messages)' # Error-message options
|
||||
'(--no-ignore-messages)--no-messages[suppress some error messages]'
|
||||
$no"--messages[don't suppress error messages affected by --no-messages]"
|
||||
|
||||
+ '(messages-ignore)' # Ignore-error message options
|
||||
"--no-ignore-messages[don't show ignore-file parse error messages]"
|
||||
$no'--ignore-messages[show ignore-file parse error messages]'
|
||||
|
||||
+ '(mmap)' # mmap options
|
||||
'--mmap[search using memory maps when possible]'
|
||||
"--no-mmap[don't search using memory maps]"
|
||||
|
||||
+ '(multiline)' # Multiline options
|
||||
{-U,--multiline}'[permit matching across multiple lines]'
|
||||
$no'(multiline-dotall)--no-multiline[restrict matches to at most one line each]'
|
||||
|
||||
+ '(multiline-dotall)' # Multiline DOTALL options
|
||||
'(--no-multiline)--multiline-dotall[allow "." to match newline (with -U)]'
|
||||
$no"(--no-multiline)--no-multiline-dotall[don't allow \".\" to match newline (with -U)]"
|
||||
|
||||
+ '(only)' # Only-match options
|
||||
{-o,--only-matching}'[show only matching part of each line]'
|
||||
|
||||
+ '(passthru)' # Pass-through options
|
||||
'(--vimgrep)--passthru[show both matching and non-matching lines]'
|
||||
'!(--vimgrep)--passthrough'
|
||||
|
||||
+ '(pcre2)' # PCRE2 options
|
||||
{-P,--pcre2}'[enable matching with PCRE2]'
|
||||
$no'(pcre2-unicode)--no-pcre2[disable matching with PCRE2]'
|
||||
|
||||
+ '(pcre2-unicode)' # PCRE2 Unicode options
|
||||
$no'(--no-pcre2 --no-pcre2-unicode)--pcre2-unicode[enable PCRE2 Unicode mode (with -P)]'
|
||||
'(--no-pcre2 --pcre2-unicode)--no-pcre2-unicode[disable PCRE2 Unicode mode (with -P)]'
|
||||
|
||||
+ '(pre)' # Preprocessing options
|
||||
'(-z --search-zip)--pre=[specify preprocessor utility]:preprocessor utility:_command_names -e'
|
||||
$no'--no-pre[disable preprocessor utility]'
|
||||
|
||||
+ pre-glob # Preprocessing glob options
|
||||
'*--pre-glob[include/exclude files for preprocessing with --pre]'
|
||||
|
||||
+ '(pretty-vimgrep)' # Pretty/vimgrep display options
|
||||
'(heading)'{-p,--pretty}'[alias for --color=always --heading -n]'
|
||||
'(heading passthru)--vimgrep[show results in vim-compatible format]'
|
||||
|
||||
+ regexp # Explicit pattern options
|
||||
'(1 file)*'{-e+,--regexp=}'[specify pattern]:pattern'
|
||||
|
||||
+ '(replace)' # Replacement options
|
||||
{-r+,--replace=}'[specify string used to replace matches]:replace string'
|
||||
|
||||
+ '(sort)' # File-sorting options
|
||||
'(threads)--sort=[sort results in ascending order (disables parallelism)]:sort method:((
|
||||
none\:"no sorting"
|
||||
path\:"sort by file path"
|
||||
modified\:"sort by last modified time"
|
||||
accessed\:"sort by last accessed time"
|
||||
created\:"sort by creation time"
|
||||
))'
|
||||
'(threads)--sortr=[sort results in descending order (disables parallelism)]:sort method:((
|
||||
none\:"no sorting"
|
||||
path\:"sort by file path"
|
||||
modified\:"sort by last modified time"
|
||||
accessed\:"sort by last accessed time"
|
||||
created\:"sort by creation time"
|
||||
))'
|
||||
'!(threads)--sort-files[sort results by file path (disables parallelism)]'
|
||||
|
||||
+ '(stats)' # Statistics options
|
||||
'(--files file-match)--stats[show search statistics]'
|
||||
$no"--no-stats[don't show search statistics]"
|
||||
|
||||
+ '(text)' # Binary-search options
|
||||
{-a,--text}'[search binary files as if they were text]'
|
||||
"--binary[search binary files, don't print binary data]"
|
||||
$no"--no-binary[don't search binary files]"
|
||||
$no"(--null-data)--no-text[don't search binary files as if they were text]"
|
||||
|
||||
+ '(threads)' # Thread-count options
|
||||
'(sort)'{-j+,--threads=}'[specify approximate number of threads to use]:number of threads'
|
||||
|
||||
+ '(trim)' # Trim options
|
||||
'--trim[trim any ASCII whitespace prefix from each line]'
|
||||
$no"--no-trim[don't trim ASCII whitespace prefix from each line]"
|
||||
|
||||
+ type # Type options
|
||||
'*'{-t+,--type=}'[only search files matching specified type]: :_rg_types'
|
||||
'*--type-add=[add new glob for specified file type]: :->typespec'
|
||||
'*--type-clear=[clear globs previously defined for specified file type]: :_rg_types'
|
||||
# This should actually be exclusive with everything but other type options
|
||||
'(: *)--type-list[show all supported file types and their associated globs]'
|
||||
'*'{-T+,--type-not=}"[don't search files matching specified file type]: :_rg_types"
|
||||
|
||||
+ '(word-line)' # Whole-word/line match options
|
||||
{-w,--word-regexp}'[only show matches surrounded by word boundaries]'
|
||||
{-x,--line-regexp}'[only show matches surrounded by line boundaries]'
|
||||
|
||||
+ '(zip)' # Compression options
|
||||
'(--pre)'{-z,--search-zip}'[search in compressed files]'
|
||||
$no"--no-search-zip[don't search in compressed files]"
|
||||
|
||||
+ misc # Other options — no need to separate these at the moment
|
||||
'(-b --byte-offset)'{-b,--byte-offset}'[show 0-based byte offset for each matching line]'
|
||||
'--color=[specify when to use colors in output]:when:((
|
||||
never\:"never use colors"
|
||||
auto\:"use colors or not based on stdout, TERM, etc."
|
||||
always\:"always use colors"
|
||||
ansi\:"always use ANSI colors (even on Windows)"
|
||||
))'
|
||||
'*--colors=[specify color and style settings]: :->colorspec'
|
||||
'--context-separator=[specify string used to separate non-continuous context lines in output]:separator'
|
||||
'--debug[show debug messages]'
|
||||
'--dfa-size-limit=[specify upper size limit of generated DFA]:DFA size (bytes)'
|
||||
"(1 stats)--files[show each file that would be searched (but don't search)]"
|
||||
'*--ignore-file=[specify additional ignore file]:ignore file:_files'
|
||||
'(-v --invert-match)'{-v,--invert-match}'[invert matching]'
|
||||
'(-M --max-columns)'{-M+,--max-columns=}'[specify max length of lines to print]:number of bytes'
|
||||
'(-m --max-count)'{-m+,--max-count=}'[specify max number of matches per file]:number of matches'
|
||||
'--max-filesize=[specify size above which files should be ignored]:file size (bytes)'
|
||||
"--no-config[don't load configuration files]"
|
||||
'(-0 --null)'{-0,--null}'[print NUL byte after file names]'
|
||||
'--path-separator=[specify path separator to use when printing file names]:separator'
|
||||
'(-q --quiet)'{-q,--quiet}'[suppress normal output]'
|
||||
'--regex-size-limit=[specify upper size limit of compiled regex]:regex size (bytes)'
|
||||
'*'{-u,--unrestricted}'[reduce level of "smart" searching]'
|
||||
|
||||
+ operand # Operands
|
||||
'(--files --type-list file regexp)1: :_guard "^-*" pattern'
|
||||
'(--type-list)*: :_files'
|
||||
)
|
||||
|
||||
# This is used with test_complete.sh to verify that there are no options
|
||||
# listed in the help output that aren't also defined here
|
||||
[[ $_RG_COMPLETE_LIST_ARGS == (1|t*|y*) ]] && {
|
||||
print -rl - $args
|
||||
return 0
|
||||
}
|
||||
|
||||
# Strip out argument groups where unsupported (see above)
|
||||
[[ $ZSH_VERSION == (4|5.<0-3>)(.*)# ]] &&
|
||||
args=( ${(@)args:#(#i)(+|[a-z0-9][a-z0-9_-]#|\([a-z0-9][a-z0-9_-]#\))} )
|
||||
|
||||
_arguments -C -s -S : $args && ret=0
|
||||
|
||||
case $state in
|
||||
colorspec)
|
||||
if [[ ${IPREFIX#--*=}$PREFIX == [^:]# ]]; then
|
||||
suf=( -qS: )
|
||||
tmp=(
|
||||
'column:specify coloring for column numbers'
|
||||
'line:specify coloring for line numbers'
|
||||
'match:specify coloring for match text'
|
||||
'path:specify coloring for file names'
|
||||
)
|
||||
descr='color/style type'
|
||||
elif [[ ${IPREFIX#--*=}$PREFIX == (column|line|match|path):[^:]# ]]; then
|
||||
suf=( -qS: )
|
||||
tmp=(
|
||||
'none:clear color/style for type'
|
||||
'bg:specify background color'
|
||||
'fg:specify foreground color'
|
||||
'style:specify text style'
|
||||
)
|
||||
descr='color/style attribute'
|
||||
elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:(bg|fg):[^:]# ]]; then
|
||||
tmp=( black blue green red cyan magenta yellow white )
|
||||
descr='color name or r,g,b'
|
||||
elif [[ ${IPREFIX#--*=}$PREFIX == [^:]##:style:[^:]# ]]; then
|
||||
tmp=( {,no}bold {,no}intense {,no}underline )
|
||||
descr='style name'
|
||||
else
|
||||
_message -e colorspec 'no more arguments'
|
||||
fi
|
||||
|
||||
(( $#tmp )) && {
|
||||
compset -P '*:'
|
||||
_describe -t colorspec $descr tmp $suf && ret=0
|
||||
}
|
||||
;;
|
||||
|
||||
typespec)
|
||||
if compset -P '[^:]##:include:'; then
|
||||
_sequence -s , _rg_types && ret=0
|
||||
# @todo This bit in particular could be better, but it's a little
|
||||
# complex, and attempting to solve it seems to run us up against a crash
|
||||
# bug — zsh # 40362
|
||||
elif compset -P '[^:]##:'; then
|
||||
_message 'glob or include directive' && ret=1
|
||||
elif [[ ! -prefix *:* ]]; then
|
||||
_rg_types -qS : && ret=0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
# Complete encodings
|
||||
_rg_encodings() {
|
||||
local -a expl
|
||||
local -aU _encodings
|
||||
|
||||
# This is impossible to read, but these encodings rarely if ever change, so it
|
||||
# probably doesn't matter. They are derived from the list given here:
|
||||
# https://encoding.spec.whatwg.org/#concept-encoding-get
|
||||
_encodings=(
|
||||
{{,us-}ascii,arabic,chinese,cyrillic,greek{,8},hebrew,korean}
|
||||
logical visual mac {,cs}macintosh x-mac-{cyrillic,roman,ukrainian}
|
||||
866 ibm{819,866} csibm866
|
||||
big5{,-hkscs} {cn-,cs}big5 x-x-big5
|
||||
cp{819,866,125{0..8}} x-cp125{0..8}
|
||||
csiso2022{jp,kr} csiso8859{6,8}{e,i}
|
||||
csisolatin{{1..6},9} csisolatin{arabic,cyrillic,greek,hebrew}
|
||||
ecma-{114,118} asmo-708 elot_928 sun_eu_greek
|
||||
euc-{jp,kr} x-euc-jp cseuckr cseucpkdfmtjapanese
|
||||
{,x-}gbk csiso58gb231280 gb18030 {,cs}gb2312 gb_2312{,-80} hz-gb-2312
|
||||
iso-2022-{cn,cn-ext,jp,kr}
|
||||
iso8859{,-}{{1..11},13,14,15}
|
||||
iso-8859-{{1..11},{6,8}-{e,i},13,14,15,16} iso_8859-{{1..9},15}
|
||||
iso_8859-{1,2,6,7}:1987 iso_8859-{3,4,5,8}:1988 iso_8859-9:1989
|
||||
iso-ir-{58,100,101,109,110,126,127,138,144,148,149,157}
|
||||
koi{,8,8-r,8-ru,8-u,8_r} cskoi8r
|
||||
ks_c_5601-{1987,1989} ksc{,_}5691 csksc56011987
|
||||
latin{1..6} l{{1..6},9}
|
||||
shift{-,_}jis csshiftjis {,x-}sjis ms_kanji ms932
|
||||
utf{,-}8 utf-16{,be,le} unicode-1-1-utf-8
|
||||
windows-{31j,874,949,125{0..8}} dos-874 tis-620 ansi_x3.4-1968
|
||||
x-user-defined auto none
|
||||
)
|
||||
|
||||
_wanted encodings expl encoding compadd -a "$@" - _encodings
|
||||
}
|
||||
|
||||
# Complete file types
|
||||
_rg_types() {
|
||||
local -a expl
|
||||
local -aU _types
|
||||
|
||||
_types=( ${(@)${(f)"$( _call_program types rg --type-list )"}%%:*} )
|
||||
|
||||
_wanted types expl 'file type' compadd -a "$@" - _types
|
||||
}
|
||||
|
||||
_rg "$@"
|
||||
|
||||
################################################################################
|
||||
# ZSH COMPLETION REFERENCE
|
||||
#
|
||||
# For the convenience of developers who aren't especially familiar with zsh
|
||||
# completion functions, a brief reference guide follows. This is in no way
|
||||
# comprehensive; it covers just enough of the basic structure, syntax, and
|
||||
# conventions to help someone make simple changes like adding new options. For
|
||||
# more complete documentation regarding zsh completion functions, please see the
|
||||
# following:
|
||||
#
|
||||
# * http://zsh.sourceforge.net/Doc/Release/Completion-System.html
|
||||
# * https://github.com/zsh-users/zsh/blob/master/Etc/completion-style-guide
|
||||
#
|
||||
# OVERVIEW
|
||||
#
|
||||
# Most zsh completion functions are defined in terms of `_arguments`, which is a
|
||||
# shell function that takes a series of argument specifications. The specs for
|
||||
# `rg` are stored in an array, which is common for more complex functions; the
|
||||
# elements of the array are passed to `_arguments` on invocation.
|
||||
#
|
||||
# ARGUMENT-SPECIFICATION SYNTAX
|
||||
#
|
||||
# The following is a contrived example of the argument specs for a simple tool:
|
||||
#
|
||||
# '(: * -)'{-h,--help}'[display help information]'
|
||||
# '(-q -v --quiet --verbose)'{-q,--quiet}'[decrease output verbosity]'
|
||||
# '!(-q -v --quiet --verbose)--silent'
|
||||
# '(-q -v --quiet --verbose)'{-v,--verbose}'[increase output verbosity]'
|
||||
# '--color=[specify when to use colors]:when:(always never auto)'
|
||||
# '*:example file:_files'
|
||||
#
|
||||
# Although there may appear to be six specs here, there are actually nine; we
|
||||
# use brace expansion to combine specs for options that go by multiple names,
|
||||
# like `-q` and `--quiet`. This is customary, and ties in with the fact that zsh
|
||||
# merges completion possibilities together when they have the same description.
|
||||
#
|
||||
# The first line defines the option `-h`/`--help`. With most tools, it isn't
|
||||
# useful to complete anything after `--help` because it effectively overrides
|
||||
# all others; the `(: * -)` at the beginning of the spec tells zsh not to
|
||||
# complete any other operands (`:` and `*`) or options (`-`) after this one has
|
||||
# been used. The `[...]` at the end associates a description with `-h`/`--help`;
|
||||
# as mentioned, zsh will see the identical descriptions and merge these options
|
||||
# together when offering completion possibilities.
|
||||
#
|
||||
# The next line defines `-q`/`--quiet`. Here we don't want to suppress further
|
||||
# completions entirely, but we don't want to offer `-q` if `--quiet` has been
|
||||
# given (since they do the same thing), nor do we want to offer `-v` (since it
|
||||
# doesn't make sense to be quiet and verbose at the same time). We don't need to
|
||||
# tell zsh not to offer `--quiet` a second time, since that's the default
|
||||
# behaviour, but since this line expands to two specs describing `-q` *and*
|
||||
# `--quiet` we do need to explicitly list all of them here.
|
||||
#
|
||||
# The next line defines a hidden option `--silent` — maybe it's a deprecated
|
||||
# synonym for `--quiet`. The leading `!` indicates that zsh shouldn't offer this
|
||||
# option during completion. The benefit of providing a spec for an option that
|
||||
# shouldn't be completed is that, if someone *does* use it, we can correctly
|
||||
# suppress completion of other options afterwards.
|
||||
#
|
||||
# The next line defines `-v`/`--verbose`; this works just like `-q`/`--quiet`.
|
||||
#
|
||||
# The next line defines `--color`. In this example, `--color` doesn't have a
|
||||
# corresponding short option, so we don't need to use brace expansion. Further,
|
||||
# there are no other options it's exclusive with (just itself), so we don't need
|
||||
# to define those at the beginning. However, it does take a mandatory argument.
|
||||
# The `=` at the end of `--color=` indicates that the argument may appear either
|
||||
# like `--color always` or like `--color=always`; this is how most GNU-style
|
||||
# command-line tools work. The corresponding short option would normally use `+`
|
||||
# — for example, `-c+` would allow either `-c always` or `-calways`. For this
|
||||
# option, the arguments are known ahead of time, so we can simply list them in
|
||||
# parentheses at the end (`when` is used as the description for the argument).
|
||||
#
|
||||
# The last line defines an operand (a non-option argument). In this example, the
|
||||
# operand can be used any number of times (the leading `*`), and it should be a
|
||||
# file path, so we tell zsh to call the `_files` function to complete it. The
|
||||
# `example file` in the middle is the description to use for this operand; we
|
||||
# could use a space instead to accept the default provided by `_files`.
|
||||
#
|
||||
# GROUPING ARGUMENT SPECIFICATIONS
|
||||
#
|
||||
# Newer versions of zsh support grouping argument specs together. All specs
|
||||
# following a `+` and then a group name are considered to be members of the
|
||||
# named group. Grouping is useful mostly for organisational purposes; it makes
|
||||
# the relationship between different options more obvious, and makes it easier
|
||||
# to specify exclusions.
|
||||
#
|
||||
# We could rewrite our example above using grouping as follows:
|
||||
#
|
||||
# '(: * -)'{-h,--help}'[display help information]'
|
||||
# '--color=[specify when to use colors]:when:(always never auto)'
|
||||
# '*:example file:_files'
|
||||
# + '(verbosity)'
|
||||
# {-q,--quiet}'[decrease output verbosity]'
|
||||
# '!--silent'
|
||||
# {-v,--verbose}'[increase output verbosity]'
|
||||
#
|
||||
# Here we take advantage of a useful feature of spec grouping — when the group
|
||||
# name is surrounded by parentheses, as in `(verbosity)`, it tells zsh that all
|
||||
# of the options in that group are exclusive with each other. As a result, we
|
||||
# don't need to manually list out the exclusions at the beginning of each
|
||||
# option.
|
||||
#
|
||||
# Groups can also be referred to by name in other argument specs; for example:
|
||||
#
|
||||
# '(xyz)--aaa' '*: :_files'
|
||||
# + xyz --xxx --yyy --zzz
|
||||
#
|
||||
# Here we use the group name `xyz` to tell zsh that `--xxx`, `--yyy`, and
|
||||
# `--zzz` are not to be completed after `--aaa`. This makes the exclusion list
|
||||
# much more compact and reusable.
|
||||
#
|
||||
# CONVENTIONS
|
||||
#
|
||||
# zsh completion functions generally adhere to the following conventions:
|
||||
#
|
||||
# * Use two spaces for indentation
|
||||
# * Combine specs for options with different names using brace expansion
|
||||
# * In combined specs, list the short option first (as in `{-a,--text}`)
|
||||
# * Use `+` or `=` as described above for options that take arguments
|
||||
# * Provide a description for all options, option-arguments, and operands
|
||||
# * Capitalise/punctuate argument descriptions as phrases, not complete
|
||||
# sentences — 'display help information', never 'Display help information.'
|
||||
# (but still capitalise acronyms and proper names)
|
||||
# * Write argument descriptions as verb phrases — 'display x', 'enable y',
|
||||
# 'use z'
|
||||
# * Word descriptions to make it clear when an option expects an argument;
|
||||
# usually this is done with the word 'specify', as in 'specify x' or
|
||||
# 'use specified x')
|
||||
# * Write argument descriptions as tersely as possible — for example, articles
|
||||
# like 'a' and 'the' should be omitted unless it would be confusing
|
||||
#
|
||||
# Other conventions currently used by this function:
|
||||
#
|
||||
# * Order argument specs alphabetically by group name, then option name
|
||||
# * Group options that are directly related, mutually exclusive, or frequently
|
||||
# referenced by other argument specs
|
||||
# * Use only characters in the set [a-z0-9_-] in group names
|
||||
# * Order exclusion lists as follows: short options, long options, groups
|
||||
# * Use American English in descriptions
|
||||
# * Use 'don't' in descriptions instead of 'do not'
|
||||
# * Word descriptions for related options as similarly as possible. For example,
|
||||
# `--foo[enable foo]` and `--no-foo[disable foo]`, or `--foo[use foo]` and
|
||||
# `--no-foo[don't use foo]`
|
||||
# * Word descriptions to make it clear when an option only makes sense with
|
||||
# another option, usually by adding '(with -x)' to the end
|
||||
# * Don't quote strings or variables unnecessarily. When quotes are required,
|
||||
# prefer single-quotes to double-quotes
|
||||
# * Prefix option specs with `$no` when the option serves only to negate the
|
||||
# behaviour of another option that must be provided explicitly by the user.
|
||||
# This prevents rarely used options from cluttering up the completion menu
|
||||
################################################################################
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Copyright (c) 2011 Github zsh-users - http://github.com/zsh-users
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the zsh-users nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
|
||||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
# ------------------------------------------------------------------------------
|
||||
# Description
|
||||
# -----------
|
||||
#
|
||||
# Completion script for ripgrep
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
# Authors
|
||||
# -------
|
||||
#
|
||||
# * arcizan <ghostrevery@gmail.com>
|
||||
# * MaskRay <i@maskray.me>
|
||||
#
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# coding: utf-8-unix
|
||||
# indent-tabs-mode: nil
|
||||
# sh-indentation: 2
|
||||
# sh-basic-offset: 2
|
||||
# End:
|
||||
# vim: ft=zsh sw=2 ts=2 et
|
10
zsh/.oh-my-zsh/plugins/ros/README.mkd
Normal file
10
zsh/.oh-my-zsh/plugins/ros/README.mkd
Normal file
@ -0,0 +1,10 @@
|
||||
# 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)
|
||||
```
|
||||
|
64
zsh/.oh-my-zsh/plugins/ros/_ros
Normal file
64
zsh/.oh-my-zsh/plugins/ros/_ros
Normal file
@ -0,0 +1,64 @@
|
||||
#compdef ros
|
||||
#autoload
|
||||
|
||||
# roswell zsh completion, based on gem completion
|
||||
|
||||
local -a _1st_arguments
|
||||
_1st_arguments=(
|
||||
'run: Run repl'
|
||||
'install:Install a given implementation or a system for roswell environment'
|
||||
'update:Update installed systems.'
|
||||
'build:Make executable from script.'
|
||||
'use:Change default implementation.'
|
||||
'init:a new ros script, optionally based on a template.'
|
||||
'fmt:Indent lisp source.'
|
||||
'list:Information'
|
||||
'template:[WIP] Manage templates'
|
||||
'delete:Delete installed implementations'
|
||||
'config:Get and set options'
|
||||
'version:Show the roswell version information'
|
||||
"help:Use \"ros help [command]\" for more information about a command."$'\n\t\t'"Use \"ros help [topic]\" for more information about the topic."
|
||||
)
|
||||
|
||||
#local expl
|
||||
|
||||
_arguments \
|
||||
'(--version)'--version'[Print version information and quit]' \
|
||||
'(-w --wrap)'{-w,--wrap}'[\[CODE\] Run roswell with a shell wrapper CODE]' \
|
||||
'(-m --image)'{-m,--image}'[\[IMAGE\] continue from Lisp image IMAGE]' \
|
||||
'(-M --module)'{-M,--module}'[\[NAME\] Execute ros script found in ROSWELLPATH. (pythons -m)]' \
|
||||
'(-L --lisp)'{-L,--lisp}'[\[NAME\] Run roswell with a lisp impl NAME\[/VERSION\].]' \
|
||||
'(-l --load)'{-l,--load}'[\[FILE\] load lisp FILE while building]' \
|
||||
'(-S --source-registry)'{-S,--source-registry}'[\[X\] override source registry of asdf systems]' \
|
||||
'(-s --system --load-system)'{-s,--system,--load-system}'[\[SYSTEM\] load asdf SYSTEM while building]' \
|
||||
'(-p --package)'{-p,--package}'[\[PACKAGE\] change current package to \[PACKAGE\]]' \
|
||||
'(-sp --system-package)'{-sp,--system-package}'[\[SP\] combination of -s \[SP\] and -p \[SP\]]' \
|
||||
'(-e --eval)'{-e,--eval}'[\[FORM\] evaluate \[FORM\] while building]' \
|
||||
'--require'--require'[\[MODULE\] require \[MODULE\] while building]' \
|
||||
'(-q --quit)'{-q,--quit}'[quit lisp here]' \
|
||||
'(-r --restart)'{-r,--restart}'[\[FUNC\] restart from build by calling (\[FUNC\])]' \
|
||||
'(-E --entry)'{-E,--entry}'[\[FUNC\] restart from build by calling (\[FUNC\] argv)]' \
|
||||
'(-i --init)'{-i,--init}'[\[FORM\] evaluate \[FORM\] after restart]' \
|
||||
'(-ip --print)'{-ip,--print}'[\[FORM\] evaluate and princ \[FORM\] after restart]' \
|
||||
'(-iw --write)'{-iw,--write}'[\[FORM\] evaluate and write \[FORM\] after restart]' \
|
||||
'(-F --final)'{-F,--final}'[\[FORM\] evaluate \[FORM\] before dumping IMAGE]' \
|
||||
'(\+R --no-rc)'{\+R,--no-rc}'[skip /etc/rosrc, ~/.roswell/init.lisp]' \
|
||||
'(-A --asdf)'{-A,--asdf}'[use new asdf]' \
|
||||
'(\+Q --no-quicklisp)'{\+Q,--no-quicklisp}'[do not use quicklisp]' \
|
||||
'(-v --verbose)'{-v,--verbose}'[be quite noisy while building]' \
|
||||
'--quiet'--quiet'[be quite quiet while building default]' \
|
||||
'--test'--test'[for test purpose]' \
|
||||
'*:: :->subcmds' && return 0
|
||||
|
||||
|
||||
if (( CURRENT == 1 )); then
|
||||
_describe -t commands "ros subcommand" _1st_arguments
|
||||
return
|
||||
fi
|
||||
|
||||
# _files
|
||||
case "$words[1]" in
|
||||
-l|--load)
|
||||
_files
|
||||
;;
|
||||
esac
|
9
zsh/.oh-my-zsh/plugins/rust/README.md
Normal file
9
zsh/.oh-my-zsh/plugins/rust/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# rust
|
||||
|
||||
This plugin adds completion for [`rustc`](https://doc.rust-lang.org/rustc/index.html), the compiler for the Rust programming language.
|
||||
|
||||
To use it, add `rust` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... rust)
|
||||
```
|
19
zsh/.oh-my-zsh/plugins/rvm/README.md
Normal file
19
zsh/.oh-my-zsh/plugins/rvm/README.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Ruby Version Manager plugin
|
||||
|
||||
This plugin adds some utility functions and completions for [Ruby Version Manager](https://rvm.io/).
|
||||
|
||||
To use it, add `rvm` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... rvm)
|
||||
```
|
||||
|
||||
## Functions
|
||||
| Alias | Command |
|
||||
|----------------|----------------------|
|
||||
| `rb18` | `rvm use ruby-1.8.7` |
|
||||
| `rb19` | `rvm use ruby-1.9.3` |
|
||||
| `rb20` | `rvm use ruby-2.0.0` |
|
||||
| `rb21` | `rvm use ruby-2.1.2` |
|
||||
| `rvm-update` | `rvm get head` |
|
||||
| `gems` | `gem list` |
|
9
zsh/.oh-my-zsh/plugins/safe-paste/README.md
Normal file
9
zsh/.oh-my-zsh/plugins/safe-paste/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# safe-paste
|
||||
|
||||
Preventing any code from actually running while pasting, so you have a chance to review what was actually pasted before running it.
|
||||
|
||||
To use it, add `safe-paste` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... safe-paste)
|
||||
```
|
10
zsh/.oh-my-zsh/plugins/screen/README.md
Normal file
10
zsh/.oh-my-zsh/plugins/screen/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# screen
|
||||
|
||||
This plugin sets title and hardstatus of the tab window for [screen](https://www.gnu.org/software/screen/),
|
||||
the terminal multiplexer.
|
||||
|
||||
To use it add `screen` to the plugins array in your zshrc file.
|
||||
|
||||
```zsh
|
||||
plugins=(... screen)
|
||||
```
|
8
zsh/.oh-my-zsh/plugins/sdk/README.md
Normal file
8
zsh/.oh-my-zsh/plugins/sdk/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# sdk
|
||||
|
||||
Plugin for SDKMAN, a tool for managing parallel versions of multiple Software Development Kits on most Unix based systems.
|
||||
Provides autocompletion for all known commands.
|
||||
|
||||
## Requirements
|
||||
|
||||
* [SDKMAN](http://sdkman.io/)
|
82
zsh/.oh-my-zsh/plugins/sdk/sdk.plugin.zsh
Normal file
82
zsh/.oh-my-zsh/plugins/sdk/sdk.plugin.zsh
Normal file
@ -0,0 +1,82 @@
|
||||
### SDKMAN Autocomplete for Oh My Zsh
|
||||
|
||||
# This is the output from sdkman. All the these options are supported at the
|
||||
# moment.
|
||||
|
||||
# Usage: sdk <command> [candidate] [version]
|
||||
# sdk offline <enable|disable>
|
||||
#
|
||||
# commands:
|
||||
# install or i <candidate> [version]
|
||||
# uninstall or rm <candidate> <version>
|
||||
# list or ls [candidate]
|
||||
# use or u <candidate> [version]
|
||||
# default or d <candidate> [version]
|
||||
# current or c [candidate]
|
||||
# upgrade or ug [candidate]
|
||||
# version or v
|
||||
# broadcast or b
|
||||
# help or h
|
||||
# offline [enable|disable]
|
||||
# selfupdate [force]
|
||||
# update
|
||||
# flush <candidates|broadcast|archives|temp>
|
||||
#
|
||||
# candidate : the SDK to install: groovy, scala, grails, gradle, kotlin, etc.
|
||||
# use list command for comprehensive list of candidates
|
||||
# eg: $ sdk list
|
||||
#
|
||||
# version : where optional, defaults to latest stable if not provided
|
||||
# eg: $ sdk install groovy
|
||||
|
||||
local _sdk_commands=(
|
||||
install i
|
||||
uninstall rm
|
||||
list ls
|
||||
use u
|
||||
default d
|
||||
current c
|
||||
upgrade ug
|
||||
version v
|
||||
broadcast b
|
||||
help h
|
||||
offline
|
||||
selfupdate
|
||||
update
|
||||
flush
|
||||
)
|
||||
|
||||
_listInstalledVersions() {
|
||||
__sdkman_build_version_csv $1 | sed -e "s/,/ /g"
|
||||
}
|
||||
|
||||
_listInstallableVersions() {
|
||||
__sdkman_list_versions $1 | grep "^ " | sed -e "s/\* /*/g" | \
|
||||
sed -e "s/>//g" | xargs -n 1 echo | grep -v "^*"
|
||||
}
|
||||
|
||||
_listAllVersion() {
|
||||
__sdkman_list_versions $1 | grep "^ " | sed -e "s/\*/ /g" | sed -e "s/>//g"
|
||||
}
|
||||
|
||||
_sdk () {
|
||||
case $CURRENT in
|
||||
2) compadd -- $_sdk_commands ;;
|
||||
3) case "$words[2]" in
|
||||
i|install|rm|uninstall|ls|list|u|use|d|default|c|current|ug|upgrade)
|
||||
compadd -- $SDKMAN_CANDIDATES ;;
|
||||
offline) compadd -- enable disable ;;
|
||||
selfupdate) compadd -- force ;;
|
||||
flush) compadd -- candidates broadcast archives temp ;;
|
||||
esac
|
||||
;;
|
||||
4) case "$words[2]" in
|
||||
rm|uninstall|d|default) compadd -- $(_listInstalledVersions $words[3]) ;;
|
||||
i|install) compadd -- $(_listInstallableVersions $words[3]) ;;
|
||||
u|use) compadd -- $(_listAllVersion $words[3]) ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
compdef _sdk sdk
|
11
zsh/.oh-my-zsh/plugins/sfdx/README.md
Normal file
11
zsh/.oh-my-zsh/plugins/sfdx/README.md
Normal file
@ -0,0 +1,11 @@
|
||||
# sfdx plugin
|
||||
|
||||
This plugin provides autocompletion for the [Salesforce DX](https://developer.salesforce.com/tools/sfdxcli) CLI.
|
||||
|
||||
To use it, add `sfdx` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... sfdx)
|
||||
```
|
||||
|
||||
Original repository: https://github.com/wadewegner/salesforce-cli-zsh-completion
|
1110
zsh/.oh-my-zsh/plugins/sfdx/_sfdx
Normal file
1110
zsh/.oh-my-zsh/plugins/sfdx/_sfdx
Normal file
File diff suppressed because it is too large
Load Diff
118
zsh/.oh-my-zsh/plugins/singlechar/README.md
Normal file
118
zsh/.oh-my-zsh/plugins/singlechar/README.md
Normal file
@ -0,0 +1,118 @@
|
||||
# Singlechar plugin
|
||||
|
||||
This plugin adds single char shortcuts (and combinations) for some commands.
|
||||
|
||||
To use it, add `singlechar` to the plugins array of your zshrc file:
|
||||
```
|
||||
plugins=(... singlechar)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
### CAT, GREP, CURL, WGET
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|------------------|-------------|
|
||||
| y | `grep -Ri` | Find case-insensitive string in all files and directories, recursively. Follows symlinks. |
|
||||
| n | `grep -Rvi` | Same as above but only show lines that don't match the string. |
|
||||
| f | `grep -Rli` | Same as 'y' but only print the filenames where the string is found. |
|
||||
| fn | `grep -Rlvi` | Same as above but only show files that don't contain the string. |
|
||||
| f. | `find . \| grep` | Grep list of files in current directory |
|
||||
| f: | `find` | 'find' command |
|
||||
| p | `less` | 'less' command |
|
||||
| m | `man` | 'man' command |
|
||||
| d | `wget` | 'wget' command |
|
||||
| u | `curl` | 'curl' command |
|
||||
| c | `cat` | 'cat' command |
|
||||
| w | `echo >` | Write arguments to file, overwriting it if it exists. |
|
||||
| a | `echo >>` | Write arguments to file, appending them if the file exists. |
|
||||
| w: | `cat >` | Write stdin to file, overwriting if it exists. |
|
||||
| a: | `cat >>` | Write stdin to file, appending it if the file exists. |
|
||||
|
||||
### XARGS
|
||||
|
||||
These aliases are versions of the aliases above but using xargs. This can be used
|
||||
by piping the arguments to the xargs aliases.
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|----------------------|---------------------------------|
|
||||
| x | `xargs` | 'xargs' command |
|
||||
| xy | `xargs grep -Ri` | Same as 'y' alias using xargs. |
|
||||
| xn | `xargs grep -Rvi` | Same as 'n' alias using xargs. |
|
||||
| xf | `xargs grep -Rli` | Same as 'f' alias using xargs. |
|
||||
| xfn | `xargs grep -Rlvi` | Same as 'fn' alias using xargs. |
|
||||
| xf. | `xargs find \| grep` | Same as 'f.' alias using xargs. |
|
||||
| xf: | `xargs find` | Same as 'f:' alias using xargs. |
|
||||
| xc | `xargs cat` | Same as 'c' alias using xargs. |
|
||||
| xp | `xargs less` | Same as 'p' alias using xargs. |
|
||||
| xm | `xargs man` | Same as 'm' alias using xargs. |
|
||||
| xd | `xargs wget` | Same as 'd' alias using xargs. |
|
||||
| xu | `xargs curl` | Same as 'u' alias using xargs. |
|
||||
| xw | `xargs echo >` | Same as 'w' alias using xargs. |
|
||||
| xa | `xargs echo >>` | Same as 'a' alias using xargs. |
|
||||
| xw: | `xargs cat >` | Same as 'w:' alias using xargs. |
|
||||
| xa: | `xargs >>` | Same as 'a:' alias using xargs. |
|
||||
|
||||
### SUDO
|
||||
|
||||
These aliases are versions of the aliases above in [CAT, GREP, CURL, WGET](#cat-grep-curl-wget)
|
||||
but using sudo to run them with root permission.
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|-----------------------|--------------------------------|
|
||||
| s | `sudo` | 'sudo' command |
|
||||
| sy | `sudo grep -Ri` | Same as 'y' alias using sudo. |
|
||||
| sn | `sudo grep -Riv` | Same as 'n' alias using sudo. |
|
||||
| sf | `sudo grep -Rli` | Same as 'f' alias using sudo. |
|
||||
| sfn | `sudo grep -Rlvi` | Same as 'fn' alias using sudo. |
|
||||
| sf. | `sudo find . \| grep` | Same as 'f.' alias using sudo. |
|
||||
| sf: | `sudo find` | Same as 'f:' alias using sudo. |
|
||||
| sp | `sudo less` | Same as 'p' alias using sudo. |
|
||||
| sm | `sudo man` | Same as 'm' alias using sudo. |
|
||||
| sd | `sudo wget` | Same as 'd' alias using sudo. |
|
||||
| sc | `sudo cat` | Same as 'c' alias using sudo. |
|
||||
| sw | `sudo echo >` | Same as 'w' alias using sudo. |
|
||||
| sa | `sudo echo >>` | Same as 'a' alias using sudo. |
|
||||
| sw: | `sudo cat >` | Same as 'w:' alias using sudo. |
|
||||
| sa: | `sudo cat >>` | Same as 'a:' alias using sudo. |
|
||||
|
||||
### SUDO-XARGS
|
||||
|
||||
Same as above but using both sudo and xargs.
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|---------------------------|---------------------------------|
|
||||
| sx | `sudo xargs` | 'sudo xargs' command |
|
||||
| sxy | `sudo xargs grep -Ri` | Same as 'xy' alias using sudo. |
|
||||
| sxn | `sudo xargs grep -Riv` | Same as 'xn' alias using sudo. |
|
||||
| sxf | `sudo xargs grep -li` | Same as 'xf' alias using sudo. |
|
||||
| sxfn | `sudo xargs grep -lvi` | Same as 'xfn' alias using sudo. |
|
||||
| sxf. | `sudo xargs find \| grep` | Same as 'xf.' alias using sudo. |
|
||||
| sxf: | `sudo xargs find` | Same as 'xf:' alias using sudo. |
|
||||
| sxp | `sudo xargs less` | Same as 'xp' alias using sudo. |
|
||||
| sxm | `sudo xargs man` | Same as 'xm' alias using sudo. |
|
||||
| sxd | `sudo xargs wget` | Same as 'xd' alias using sudo. |
|
||||
| sxu | `sudo xargs curl` | Same as 'xu' alias using sudo. |
|
||||
| sxc | `sudo xargs cat` | Same as 'xc' alias using sudo. |
|
||||
| sxw | `sudo xargs echo >` | Same as 'xw' alias using sudo. |
|
||||
| sxa | `sudo xargs echo >>` | Same as 'xa' alias using sudo. |
|
||||
| sxw: | `sudo xargs cat >` | Same as 'xw:' alias using sudo. |
|
||||
| sxa: | `sudo xargs cat >>` | Same as 'xa:' alias using sudo. |
|
||||
|
||||
## Options
|
||||
|
||||
The commands `grep`, `sudo`, `wget`, `curl`, and `less` can be configured to use other commands
|
||||
via the setup variables below, before Oh My Zsh is sourced. If they are not set yet, they will
|
||||
use their default values:
|
||||
|
||||
| Setup variable | Default value |
|
||||
|----------------|---------------|
|
||||
| GREP | `grep` |
|
||||
| ROOT | `sudo` |
|
||||
| WGET | `wget` |
|
||||
| CURL | `curl` |
|
||||
| PAGER | `less` |
|
||||
|
||||
## Author
|
||||
|
||||
- [Karolin Varner](https://github.com/koraa)
|
31
zsh/.oh-my-zsh/plugins/sprunge/README.md
Normal file
31
zsh/.oh-my-zsh/plugins/sprunge/README.md
Normal file
@ -0,0 +1,31 @@
|
||||
# Sprunge plugin
|
||||
|
||||
This plugin uploads data and fetch URL from the pastebin http://sprunge.us
|
||||
|
||||
To enable it, add 'sprunge' to your plugins:
|
||||
```
|
||||
plugins=(... sprunge)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
| Command | Description |
|
||||
|------------------------------|-------------------------------------------|
|
||||
| `sprunge filename.txt` | Uploads filename.txt |
|
||||
| `sprunge "this is a string"` | Uploads plain text |
|
||||
| `sprunge < filename.txt` | Redirects filename.txt content to sprunge |
|
||||
| `echo data \| sprunge` | Any piped data will be uploaded |
|
||||
|
||||
Once sprunge has processed the input it will give you a unique HTTP address:
|
||||
```
|
||||
$ sprunge "hello"
|
||||
http://sprunge.us/XxjnKz
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
- Sprunge accepts piped data, stdin redirection, text strings as input or filenames.
|
||||
Only one of these can be used at a time.
|
||||
- Argument precedence goes as follows: stdin > piped input > text strings.
|
||||
- If a filename is mispelled or doesn't have the necessary path description, it will NOT
|
||||
generate an error, but instead treat it as a text string.
|
12
zsh/.oh-my-zsh/plugins/supervisor/README.md
Normal file
12
zsh/.oh-my-zsh/plugins/supervisor/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
# supervisor plugin
|
||||
|
||||
This plugin adds tab-completion for `supervisord`/`supervisorctl` in [Supervisor](http://supervisord.org/).
|
||||
Supervisor is a client/server system that allows its users to monitor and control a number
|
||||
of processes on UNIX-like operating systems.
|
||||
|
||||
To use it, add `supervisor` to the plugins array in your zshrc file:
|
||||
```zsh
|
||||
plugins=(... supervisor)
|
||||
```
|
||||
|
||||
These scripts are from [zshcompfunc4supervisor](https://bitbucket.org/hhatto/zshcompfunc4supervisor).
|
9
zsh/.oh-my-zsh/plugins/terminitor/README.md
Normal file
9
zsh/.oh-my-zsh/plugins/terminitor/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Terminitor plugin
|
||||
|
||||
This plugin adds completions for the [Terminitor](https://github.com/achiurizo/terminitor) development workflow setup tool.
|
||||
|
||||
To use it, add `terminitor` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... terminitor)
|
||||
```
|
10
zsh/.oh-my-zsh/plugins/thor/README.md
Normal file
10
zsh/.oh-my-zsh/plugins/thor/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Thor plugin
|
||||
|
||||
This plugin adds completion for [Thor](http://whatisthor.com/),
|
||||
a ruby toolkit for building powerful command-line interfaces.
|
||||
|
||||
To use it, add `thor` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... thor)
|
||||
```
|
17
zsh/.oh-my-zsh/plugins/timer/README.md
Normal file
17
zsh/.oh-my-zsh/plugins/timer/README.md
Normal file
@ -0,0 +1,17 @@
|
||||
This plugin allows to display command's execution time in a very nonintrusive way.
|
||||
|
||||
Timer can be tuned by these two variables:
|
||||
* `TIMER_PRECISION` allows to control number of decimal places (default `1`)
|
||||
* `TIMER_FORMAT` allows to adjust display format (default `'/%d'`)
|
||||
|
||||
Sample session:
|
||||
|
||||
me@here:~$ sleep 1 /1.0s
|
||||
me@here:~$ sleep 73 /1m13.0s
|
||||
me@here:~$ TIMER_FORMAT='[%d]'; TIMER_PRECISION=2 [0.00s]
|
||||
me@here:~$ head -c50 < /dev/urandom | hexdump
|
||||
0000000 b2 16 20 f0 29 1f 61 2d 8a 29 20 8c 8c 39 5a ab
|
||||
0000010 21 47 0e f9 ee a4 76 46 71 9e 4f 6b a4 c4 51 cb
|
||||
0000020 f9 1f 7e b9 6f 2c ae dd cf 40 6d 64 a8 fb d3 db
|
||||
0000030 09 37
|
||||
0000032 [0.02s]
|
29
zsh/.oh-my-zsh/plugins/timer/timer.plugin.zsh
Normal file
29
zsh/.oh-my-zsh/plugins/timer/timer.plugin.zsh
Normal file
@ -0,0 +1,29 @@
|
||||
__timer_current_time() {
|
||||
perl -MTime::HiRes=time -e'print time'
|
||||
}
|
||||
|
||||
__timer_format_duration() {
|
||||
local mins=$(printf '%.0f' $(($1 / 60)))
|
||||
local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins)))
|
||||
local duration_str=$(echo "${mins}m${secs}s")
|
||||
local format="${TIMER_FORMAT:-/%d}"
|
||||
echo "${format//\%d/${duration_str#0m}}"
|
||||
}
|
||||
|
||||
__timer_save_time_preexec() {
|
||||
__timer_cmd_start_time=$(__timer_current_time)
|
||||
}
|
||||
|
||||
__timer_display_timer_precmd() {
|
||||
if [ -n "${__timer_cmd_start_time}" ]; then
|
||||
local cmd_end_time=$(__timer_current_time)
|
||||
local tdiff=$((cmd_end_time - __timer_cmd_start_time))
|
||||
unset __timer_cmd_start_time
|
||||
local tdiffstr=$(__timer_format_duration ${tdiff})
|
||||
local cols=$((COLUMNS - ${#tdiffstr} - 1))
|
||||
echo -e "\033[1A\033[${cols}C ${tdiffstr}"
|
||||
fi
|
||||
}
|
||||
|
||||
preexec_functions+=(__timer_save_time_preexec)
|
||||
precmd_functions+=(__timer_display_timer_precmd)
|
13
zsh/.oh-my-zsh/plugins/torrent/README.md
Normal file
13
zsh/.oh-my-zsh/plugins/torrent/README.md
Normal file
@ -0,0 +1,13 @@
|
||||
# torrent
|
||||
|
||||
This plugin creates a Torrent file based on a [MagnetURI](https://en.wikipedia.org/wiki/Magnet_URI_scheme).
|
||||
|
||||
To use it, add `torrent` to the plugins array in your zshrc file.
|
||||
|
||||
```zsh
|
||||
plugins=(... torrent)
|
||||
```
|
||||
|
||||
## Plugin commands
|
||||
|
||||
* `magnet_to_torrent <MagnetURI>`: creates Torrent file.
|
12
zsh/.oh-my-zsh/plugins/tugboat/README.md
Normal file
12
zsh/.oh-my-zsh/plugins/tugboat/README.md
Normal file
@ -0,0 +1,12 @@
|
||||
# Tugboat plugin
|
||||
|
||||
This plugin adds autocompletion for Tugboat, a command line tool for interacting with your
|
||||
[DigitalOcean droplets](https://www.digitalocean.com/products/droplets/).
|
||||
|
||||
To use it, add it to the plugins array in your `~/.zshrc` file:
|
||||
|
||||
```zsh
|
||||
plugins=(... tugboat)
|
||||
```
|
||||
|
||||
Further documentation for Tugboat can be found in the [Tugboat repository](https://github.com/petems/tugboat).
|
18
zsh/.oh-my-zsh/plugins/ufw/README.md
Normal file
18
zsh/.oh-my-zsh/plugins/ufw/README.md
Normal file
@ -0,0 +1,18 @@
|
||||
# UFW plugin
|
||||
|
||||
This plugin adds completion for managing everybody's favorite Uncomplicated Firewall (UFW),
|
||||
a simple interface for managing iptables. Learn more about [`UFW`](https://wiki.ubuntu.com/UncomplicatedFirewall).
|
||||
|
||||
To use it, add ufw to the plugins array of your zshrc file:
|
||||
```
|
||||
plugins=(... ufw)
|
||||
```
|
||||
|
||||
Some of the commands include:
|
||||
|
||||
* `allow <port>/<optional: protocol>` add an allow rule
|
||||
* `default` set default policy
|
||||
* `delete <port>/<optional: protocol>` delete RULE
|
||||
* `deny <port>/<optional: protocol>` add deny rule
|
||||
* `disable` disables the firewall
|
||||
* `enable` enables the firewall
|
38
zsh/.oh-my-zsh/plugins/virtualenvwrapper/README.md
Normal file
38
zsh/.oh-my-zsh/plugins/virtualenvwrapper/README.md
Normal file
@ -0,0 +1,38 @@
|
||||
# Virtualenvwrapper plugin
|
||||
|
||||
This plugin loads Python's [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/) shell tools.
|
||||
|
||||
To use it, add `virtualenvwrapper` to the plugins array in your zshrc file:
|
||||
|
||||
```zsh
|
||||
plugins=(... virtualenvwrapper)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
The plugin allows to automatically activate virtualenvs on cd into git repositories with a matching name:
|
||||
|
||||
```
|
||||
➜ github $ cd ansible
|
||||
(ansible) ➜ ansible git:(devel) $ cd docs
|
||||
(ansible) ➜ docs git:(devel) $ cd ..
|
||||
(ansible) ➜ ansible git:(devel) $ cd ..
|
||||
➜ github $
|
||||
```
|
||||
|
||||
We can override this by having a `.venv` file in the directory containing a differently named virtualenv:
|
||||
|
||||
```
|
||||
➜ github $ cat ansible/.venv
|
||||
myvirtualenv
|
||||
➜ github $ cd ansible
|
||||
(myvirtualenv) ➜ ansible git:(devel) $ cd ..
|
||||
➜ github $
|
||||
```
|
||||
|
||||
We can disable this behaviour by setting `DISABLE_VENV_CD=1` before Oh My Zsh is sourced:
|
||||
```zsh
|
||||
DISABLE_VENV_CD=1
|
||||
plugins=(... virtualenvwrapper)
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
```
|
14
zsh/.oh-my-zsh/plugins/yii/README.md
Normal file
14
zsh/.oh-my-zsh/plugins/yii/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
# Yii plugin
|
||||
|
||||
The plugin adds autocomplete commands and subcommands for [yii](https://www.yiiframework.com/).
|
||||
|
||||
To use it, add `yii` to the plugins array of your zshrc file:
|
||||
```
|
||||
plugins=(... yii)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command |
|
||||
|--------|----------------------|
|
||||
| yiic | `protected/yiic` |
|
50
zsh/.oh-my-zsh/themes/pygmalion-virtualenv.zsh-theme
Normal file
50
zsh/.oh-my-zsh/themes/pygmalion-virtualenv.zsh-theme
Normal file
@ -0,0 +1,50 @@
|
||||
# Yay! High voltage and arrows!
|
||||
|
||||
|
||||
function _virtualenv_prompt_info {
|
||||
if [[ -n "$(whence virtualenv_prompt_info)" ]]; then
|
||||
if [ -n "$(whence pyenv_prompt_info)" ]; then
|
||||
if [ "$1" = "inline" ]; then
|
||||
ZSH_THEME_VIRTUAL_ENV_PROMPT_PREFIX=%{$fg[blue]%}"::%{$fg[red]%}"
|
||||
ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX=""
|
||||
virtualenv_prompt_info
|
||||
fi
|
||||
[ "$(pyenv_prompt_info)" = "${PYENV_PROMPT_DEFAULT_VERSION}" ] && virtualenv_prompt_info
|
||||
else
|
||||
virtualenv_prompt_info
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
prompt_setup_pygmalion(){
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[green]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[yellow]%}⚡%{$reset_color%}"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||
|
||||
base_prompt='$(_virtualenv_prompt_info)%{$fg[magenta]%}%n%{$reset_color%}%{$fg[cyan]%}@%{$reset_color%}%{$fg[yellow]%}%m%{$reset_color%}%{$fg[red]%}:%{$reset_color%}%{$fg[cyan]%}%0~%{$reset_color%}%{$fg[red]%}|%{$reset_color%}'
|
||||
post_prompt='%{$fg[cyan]%}⇒%{$reset_color%} '
|
||||
|
||||
base_prompt_nocolor=$(echo "$base_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||
post_prompt_nocolor=$(echo "$post_prompt" | perl -pe "s/%\{[^}]+\}//g")
|
||||
|
||||
precmd_functions+=(prompt_pygmalion_precmd)
|
||||
}
|
||||
|
||||
prompt_pygmalion_precmd(){
|
||||
local gitinfo=$(git_prompt_info)
|
||||
local gitinfo_nocolor=$(echo "$gitinfo" | perl -pe "s/%\{[^}]+\}//g")
|
||||
local exp_nocolor="$(print -P \"$base_prompt_nocolor$gitinfo_nocolor$post_prompt_nocolor\")"
|
||||
local prompt_length=${#exp_nocolor}
|
||||
|
||||
local nl=""
|
||||
|
||||
if [[ $prompt_length -gt 40 ]]; then
|
||||
nl=$'\n%{\r%}';
|
||||
fi
|
||||
PROMPT="$base_prompt$gitinfo$nl$post_prompt"
|
||||
}
|
||||
|
||||
prompt_setup_pygmalion
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user