commit
78bbf7a6e5
47 changed files with 1428 additions and 543 deletions
@ -0,0 +1,19 @@ |
|||||||
|
## APACHE2 MACPORTS PLUGIN |
||||||
|
|
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
### FEATURES |
||||||
|
|
||||||
|
| Alias | Function | Description | |
||||||
|
|:--------------:|:-------------------------------------------------------------------------------|----------------------:| |
||||||
|
| apache2restart | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart | Restart apache daemon | |
||||||
|
| apache2start | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start | Start apache daemon | |
||||||
|
| apache2stop | sudo /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop | Stop apache daemon | |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
### CONTRIBUTORS |
||||||
|
- Alexander Rinass (alex@rinass.net) |
||||||
|
|
||||||
|
--- |
||||||
@ -0,0 +1,64 @@ |
|||||||
|
## ARCHLINUX PLUGIN |
||||||
|
|
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
### FEATURES |
||||||
|
|
||||||
|
| Alias | Function | Description | |
||||||
|
|:------------:|-----------------------------------------|:--------------------------------------------------------------------------------------------------------------------| |
||||||
|
| pacin | sudo pacman -S | Install specific package(s) from the repositories | |
||||||
|
| pacins | sudo pacman -U | Install specific package not from the repositories but from a file | |
||||||
|
| pacinsd | sudo pacman -S --asdeps | Install given package(s) as dependencies of another package | |
||||||
|
| pacloc | pacman -Qi | Display information about a given package in the local database | |
||||||
|
| paclocs | pacman -Qs | Search for package(s) in the local database | |
||||||
|
| paclsorphans | sudo pacman -Qdt' | List all orphaned packages | |
||||||
|
| pacmir | sudo pacman -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist | |
||||||
|
| pacre | sudo pacman -R | Remove the specified package(s), retaining its configuration(s) and required dependencies | |
||||||
|
| pacrem | sudo pacman -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies | |
||||||
|
| pacrep | pacman -Si | Display information about a given package in the repositories | |
||||||
|
| pacreps | pacman -Ss | Search for package(s) in the repositories | |
||||||
|
| pacrmorphans | sudo pacman -Rs $(pacman -Qtdq)' | Delete all orphaned packages | |
||||||
|
| pacupd | sudo pacman -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories | |
||||||
|
| pacupd | sudo pacman -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories | |
||||||
|
| pacupd | sudo pacman -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories | |
||||||
|
| pacupd | sudo pacman -Sy | Update and refresh the local package database against repositories | |
||||||
|
| pacupg | sudo pacman -Syu | Synchronize with repositories before upgrading packages that are out of date on the local system. | |
||||||
|
| yaconf | yaourt -C | Fix all configuration files with vimdiff | |
||||||
|
| yain | yaourt -S | Install specific package(s) from the repositories | |
||||||
|
| yains | yaourt -U | Install specific package not from the repositories but from a file | |
||||||
|
| yainsd | yaourt -S --asdeps | Install given package(s) as dependencies of another package | |
||||||
|
| yaloc | yaourt -Qi | Display information about a given package in the local database | |
||||||
|
| yalocs | yaourt -Qs | Search for package(s) in the local database | |
||||||
|
| yalst | yaourt -Qe | List installed packages, even those installed from AUR (they're tagged as "local") | |
||||||
|
| yamir | yaourt -Syy | Force refresh of all package lists after updating /etc/pacman.d/mirrorlist | |
||||||
|
| yaorph | yaourt -Qtd | Remove orphans using yaourt | |
||||||
|
| yare | yaourt -R | Remove the specified package(s), retaining its configuration(s) and required dependencies | |
||||||
|
| yarem | yaourt -Rns | Remove the specified package(s), its configuration(s) and unneeded dependencies | |
||||||
|
| yarep | yaourt -Si | Display information about a given package in the repositories | |
||||||
|
| yareps | yaourt -Ss | Search for package(s) in the repositories | |
||||||
|
| yasu | yaourt --sucre | Same as yaupg, but without confirmation | |
||||||
|
| yaupd | yaourt -Sy && sudo abs && sudo aur | Update and refresh the local package, ABS and AUR databases against repositories | |
||||||
|
| yaupd | yaourt -Sy && sudo abs | Update and refresh the local package and ABS databases against repositories | |
||||||
|
| yaupd | yaourt -Sy && sudo aur | Update and refresh the local package and AUR databases against repositories | |
||||||
|
| yaupd | yaourt -Sy | Update and refresh the local package database against repositories | |
||||||
|
| yaupg | yaourt -Syua | Synchronize with repositories before upgrading packages (AUR packages too) that are out of date on the local system | |
||||||
|
|
||||||
|
| Function | Description | |
||||||
|
|----------------|:------------------------------------------------------------------------------------------------------------------| |
||||||
|
| pacdisowned | List all disowned files in your system | |
||||||
|
| paclist | List all installed packages with a short description - [Source](https://bbs.archlinux.org/viewtopic.php?id=93683) | |
||||||
|
| pacmanallkeys | Get all keys for developers and trusted users | |
||||||
|
| pacmansignkeys | | |
||||||
|
|
||||||
|
--- |
||||||
|
|
||||||
|
### CONTRIBUTORS |
||||||
|
- Benjamin Boudreau - dreurmail@gmail.com |
||||||
|
- Celso Miranda - contacto@celsomiranda.net |
||||||
|
- KhasMek - Boushh@gmail.com |
||||||
|
- Martin Putniorz - mputniorz@gmail.com |
||||||
|
- MatthR3D - matthr3d@gmail.com |
||||||
|
- ornicar - thibault.duplessis@gmail.com |
||||||
|
|
||||||
|
--- |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
## atom |
||||||
|
|
||||||
|
Plugin for Atom, a cross platform text and code editor, available for Linux, Mac OS X, and Windows. |
||||||
|
|
||||||
|
### Requirements |
||||||
|
|
||||||
|
* [Atom](https://atom.io/) |
||||||
|
|
||||||
|
### Usage |
||||||
|
|
||||||
|
* If `at` command is called without an argument, launch Atom |
||||||
|
|
||||||
|
* If `at` is passed a directory, `cd` to it and open it in Atom |
||||||
|
|
||||||
|
* If `at` is passed a file, open it in Atom |
||||||
|
|
||||||
|
* if `att` command is called, it is equivalent to `at .`, opening the current folder in Atom |
||||||
@ -0,0 +1,13 @@ |
|||||||
|
## forklift |
||||||
|
|
||||||
|
Plugin for ForkLift, an FTP application for OS X. |
||||||
|
|
||||||
|
### Requirements |
||||||
|
|
||||||
|
* [ForkLift](http://forkliftapp.com/forklift/) |
||||||
|
|
||||||
|
### Usage |
||||||
|
|
||||||
|
* If `fl` is called without arguments then the current folder is opened in ForkLift. Is equivalent to `fl .` |
||||||
|
|
||||||
|
* If `fl` is called with a directory as the argument, then that directory is opened in ForkLift |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
## history |
||||||
|
|
||||||
|
Provides a couple of convenient aliases for using the `history` command to examine your command line history. |
||||||
|
|
||||||
|
### Requirements |
||||||
|
|
||||||
|
* None. |
||||||
|
|
||||||
|
### Usage |
||||||
|
|
||||||
|
* If `h` is called, your command history is listed. Equivalent to using `history` |
||||||
|
|
||||||
|
* If `hsi` is called with an argument, a **case insensitive** `grep` search is performed on your command history, looking for commands that match the argument provided |
||||||
|
|
||||||
|
* If `hsi` is called without an argument you will help on `grep` arguments |
||||||
@ -0,0 +1,6 @@ |
|||||||
|
## HTTPie |
||||||
|
**Maintainer:** [lululau](https://github.com/lululau) |
||||||
|
|
||||||
|
This plugin adds completion for HTTPie, which is a command line HTTP client, a user-friendly cURL replacement. |
||||||
|
|
||||||
|
[HTTPie Homepage](http://httpie.org) |
||||||
@ -0,0 +1,41 @@ |
|||||||
|
# author: Peter Eisentraut |
||||||
|
# source: https://gist.github.com/petere/10307599 |
||||||
|
# compdef kitchen |
||||||
|
|
||||||
|
_kitchen() { |
||||||
|
local curcontext="$curcontext" state line |
||||||
|
typeset -A opt_args |
||||||
|
|
||||||
|
_arguments '1: :->cmds'\ |
||||||
|
'2: :->args' |
||||||
|
|
||||||
|
case $state in |
||||||
|
cmds) |
||||||
|
_arguments "1:Commands:(console converge create destroy diagnose driver help init list login setup test verify version)" |
||||||
|
;; |
||||||
|
args) |
||||||
|
case $line[1] in |
||||||
|
converge|create|destroy|diagnose|list|setup|test|verify) |
||||||
|
compadd "$@" all |
||||||
|
_kitchen_instances |
||||||
|
;; |
||||||
|
login) |
||||||
|
_kitchen_instances |
||||||
|
;; |
||||||
|
esac |
||||||
|
;; |
||||||
|
esac |
||||||
|
} |
||||||
|
|
||||||
|
_kitchen_instances() { |
||||||
|
if [[ $_kitchen_instances_cache_dir != $PWD ]]; then |
||||||
|
unset _kitchen_instances_cache |
||||||
|
fi |
||||||
|
if [[ ${+_kitchen_instances_cache} -eq 0 ]]; then |
||||||
|
_kitchen_instances_cache=(${(f)"$(bundle exec kitchen list -b 2>/dev/null || kitchen list -b 2>/dev/null)"}) |
||||||
|
_kitchen_instances_cache_dir=$PWD |
||||||
|
fi |
||||||
|
compadd -a _kitchen_instances_cache |
||||||
|
} |
||||||
|
|
||||||
|
_kitchen "$@" |
||||||
@ -0,0 +1,64 @@ |
|||||||
|
# Mercurial plugin |
||||||
|
### Usage |
||||||
|
Update .zshrc: |
||||||
|
|
||||||
|
1. Add name to the list of plugins, e.g. `plugins = (..., mercurial, ...)` |
||||||
|
(that is pretty obvious). |
||||||
|
2. Change PROMPT variable of current theme to contain current folder mercurial repo info: |
||||||
|
|
||||||
|
robbyrussel theme is used by default, so you need to modify PROMPT var |
||||||
|
from [this file](https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/robbyrussell.zsh-theme) |
||||||
|
by adding `$(hg_prompt_info)` after `$(git_prompt_info)`, so currently it |
||||||
|
looks next: |
||||||
|
|
||||||
|
```diff |
||||||
|
- PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' |
||||||
|
+ PROMPT='${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)$(hg_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' |
||||||
|
``` |
||||||
|
|
||||||
|
and put modified var at the end of **.zshrc**. |
||||||
|
3. Initialize additional vars used in plugin. So in short put next in **.zshrc**: |
||||||
|
|
||||||
|
``` |
||||||
|
ZSH_THEME_HG_PROMPT_PREFIX="%{$fg_bold[magenta]%}hg:(%{$fg[red]%}" |
||||||
|
ZSH_THEME_HG_PROMPT_SUFFIX="%{$reset_color%}" |
||||||
|
ZSH_THEME_HG_PROMPT_DIRTY="%{$fg[magenta]%}) %{$fg[yellow]%}✗%{$reset_color%}" |
||||||
|
ZSH_THEME_HG_PROMPT_CLEAN="%{$fg[magenta]%})" |
||||||
|
``` |
||||||
|
|
||||||
|
### What's inside? |
||||||
|
#### Adds handy aliases: |
||||||
|
###### general |
||||||
|
* `hgc` - `hg commit` |
||||||
|
* `hgb` - `hg branch` |
||||||
|
* `hgba` - `hg branches` |
||||||
|
* `hgbk` - `hg bookmarks` |
||||||
|
* `hgco` - `hg checkout` |
||||||
|
* `hgd` - `hg diff` |
||||||
|
* `hged` - `hg diffmerge` |
||||||
|
|
||||||
|
###### pull and update |
||||||
|
* `hgi` - `hg incoming` |
||||||
|
* `hgl` - `hg pull -u` |
||||||
|
* `hglr` - `hg pull --rebase` |
||||||
|
* `hgo` - `hg outgoing` |
||||||
|
* `hgp` - `hg push` |
||||||
|
* `hgs` - `hg status` |
||||||
|
* `hgsl` - `hg log --limit 20 --template "{node|short} | {date|isodatesec} | {author|user}: {desc|strip|firstline}\n"` |
||||||
|
|
||||||
|
###### this is the 'git commit --amend' equivalent |
||||||
|
* `hgca` - `hg qimport -r tip ; hg qrefresh -e ; hg qfinish tip` |
||||||
|
|
||||||
|
###### list unresolved files (since hg does not list unmerged files in the status command) |
||||||
|
* `hgun` - `hg resolve --list` |
||||||
|
|
||||||
|
#### Displays repo branch and directory status in prompt |
||||||
|
This is the same as git plugin does. |
||||||
|
|
||||||
|
**Note**: additional changes to **.zshrc** are required in order for this to |
||||||
|
work. |
||||||
|
|
||||||
|
### Mantainers |
||||||
|
[ptrv](https://github.com/ptrv) - original creator |
||||||
|
|
||||||
|
[oshybystyi](https://github.com/oshybystyi) - created this README and know how most of code works |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
# mix-fast |
||||||
|
|
||||||
|
Fast mix autocompletion plugin. |
||||||
|
|
||||||
|
This script caches the output for later usage and significantly speeds it up. |
||||||
|
It generates a .mix_tasks cache file for current project. Currently if you want |
||||||
|
to update cache you should remove .mix_tasks file |
||||||
|
|
||||||
|
Inspired by and based on rake-fast zsh plugin. |
||||||
|
|
||||||
|
This is entirely based on [this pull request by Ullrich Schäfer](https://github.com/robb/.dotfiles/pull/10/), which is inspired by [this Ruby on Rails trick from 2006](http://weblog.rubyonrails.org/2006/3/9/fast-mix-task-completion-for-zsh/). |
||||||
|
|
||||||
|
|
||||||
|
## Installation |
||||||
|
|
||||||
|
Just add the plugin to your `.zshrc`: |
||||||
|
|
||||||
|
```bash |
||||||
|
plugins=(foo bar mix-fast) |
||||||
|
``` |
||||||
|
|
||||||
|
You might consider adding `.mix_tasks` to your [global .gitignore](https://help.github.com/articles/ignoring-files#global-gitignore) |
||||||
|
|
||||||
|
## Usage |
||||||
|
|
||||||
|
`mix`, then press tab |
||||||
|
|
||||||
|
Currently maintained by [styx](https://github.com/styx/) |
||||||
@ -0,0 +1,29 @@ |
|||||||
|
_mix_refresh () { |
||||||
|
if [ -f .mix_tasks ]; then |
||||||
|
rm .mix_tasks |
||||||
|
fi |
||||||
|
echo "Generating .mix_tasks..." > /dev/stderr |
||||||
|
_mix_generate |
||||||
|
cat .mix_tasks |
||||||
|
} |
||||||
|
|
||||||
|
_mix_does_task_list_need_generating () { |
||||||
|
[ ! -f .mix_tasks ]; |
||||||
|
} |
||||||
|
|
||||||
|
_mix_generate () { |
||||||
|
mix --help | grep -v 'iex -S' | tail -n +2 | cut -d " " -f 2 > .mix_tasks |
||||||
|
} |
||||||
|
|
||||||
|
_mix () { |
||||||
|
if [ -f mix.exs ]; then |
||||||
|
if _mix_does_task_list_need_generating; then |
||||||
|
echo "\nGenerating .mix_tasks..." > /dev/stderr |
||||||
|
_mix_generate |
||||||
|
fi |
||||||
|
compadd `cat .mix_tasks` |
||||||
|
fi |
||||||
|
} |
||||||
|
|
||||||
|
compdef _mix mix |
||||||
|
alias mix_refresh='_mix_refresh' |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
_paver_does_target_list_need_generating () { |
||||||
|
[ ! -f .paver_targets ] && return 0; |
||||||
|
[ pavement.py -nt .paver_targets ] && return 0; |
||||||
|
return 1; |
||||||
|
} |
||||||
|
|
||||||
|
_paver () { |
||||||
|
if [ -f pavement.py ]; then |
||||||
|
if _paver_does_target_list_need_generating; then |
||||||
|
paver --help 2>&1 |grep '-'|grep -v -e '--'|awk -F '-' '{print $1}'|tr -d ' ' > .paver_targets |
||||||
|
fi |
||||||
|
compadd `cat .paver_targets` |
||||||
|
fi |
||||||
|
} |
||||||
|
|
||||||
|
compdef _paver paver |
||||||
File diff suppressed because it is too large
Load Diff
@ -1,4 +0,0 @@ |
|||||||
echo "It looks like you have been using the 'rails3' plugin," |
|
||||||
echo "which has been deprecated in favor of a newly consolidated 'rails' plugin." |
|
||||||
echo "You will want to modify your ~/.zshrc configuration to begin using it." |
|
||||||
echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240" |
|
||||||
@ -1,4 +0,0 @@ |
|||||||
echo "It looks like you have been using the 'rails4' plugin," |
|
||||||
echo "which has been deprecated in favor of a newly consolidated 'rails' plugin." |
|
||||||
echo "You will want to modify your ~/.zshrc configuration to begin using it." |
|
||||||
echo "Learn more at https://github.com/robbyrussell/oh-my-zsh/pull/2240" |
|
||||||
@ -0,0 +1,106 @@ |
|||||||
|
#compdef tugboat |
||||||
|
#autoload |
||||||
|
|
||||||
|
# Tugboat zsh autocompletion |
||||||
|
|
||||||
|
|
||||||
|
local -a _commands |
||||||
|
_commands=( |
||||||
|
'add-key:[NAME] Upload an ssh public key.' |
||||||
|
'authorize:Authorize a DigitalOcean account with tugboat.' |
||||||
|
'create:[NAME] Create a droplet.' |
||||||
|
'destroy:[FUZZY_NAME] Destroy a droplet.' |
||||||
|
'destroy_image:[FUZZY_NAME] Destroy an image.' |
||||||
|
'droplets:Retrieve a list of your droplets.' |
||||||
|
'halt:[FUZZY_NAME] Shutdown a droplet.' |
||||||
|
'help:[COMMAND] Describe commands or a specific command.' |
||||||
|
'images:Retrieve a list of your images.' |
||||||
|
'info:[FUZZY_NAME] [OPTIONS] Show a droplets information.' |
||||||
|
'info_image:[FUZZY_NAME] [OPTIONS] Show an images information.' |
||||||
|
'keys:Show available SSH keys.' |
||||||
|
'password-reset:[FUZZY_NAME] Reset root password.' |
||||||
|
'rebuild:[FUZZY_NAME] [IMAGE_NAME] Rebuild a droplet.' |
||||||
|
'regions:Show regions.' |
||||||
|
'resize:[FUZZY_NAME -s, --size=N] Resize a droplet.' |
||||||
|
'restart:[FUZZY_NAME] Restart a droplet.' |
||||||
|
'sizes:Show available droplet sizes.' |
||||||
|
'snapshot:[SNAPSHOT_NAME] [FUZZY_NAME] [OPTIONS] Queue a snapshot of the droplet.' |
||||||
|
'ssh:[FUZZY_NAME] SSH into a droplet.' |
||||||
|
'start:[FUZZY_NAME] Start a droplet.' |
||||||
|
'verify:Check your DigitalOcean credentials.' |
||||||
|
'version:Show version.' |
||||||
|
'wait:[FUZZY_NAME] Wait for a droplet to reach a state.' |
||||||
|
) |
||||||
|
|
||||||
|
local -a _create_arguments |
||||||
|
_create_arguments=( |
||||||
|
'-s:[--size=N] The size_id of the droplet' |
||||||
|
'-i:[--image=N] The image_id of the droplet' |
||||||
|
'-r:[--region=N] The region_id of the droplet' |
||||||
|
'-k:[--keys=KEYS] A comma separated list of SSH key ids to add to the droplet' |
||||||
|
'-p:[--private-networking] Enable private networking on the droplet' |
||||||
|
'-b:[--backups-enabled] Enable backups on the droplet' |
||||||
|
'-q:[--quiet]' |
||||||
|
) |
||||||
|
|
||||||
|
__task_list () |
||||||
|
{ |
||||||
|
local expl |
||||||
|
declare -a tasks |
||||||
|
|
||||||
|
arguments=(add-key authorize create destroy destroy_image droplets halt help images info info_image keys password-reset rebuild regions resize restart sizes snapshot ssh start verify version wait) |
||||||
|
|
||||||
|
_wanted tasks expl 'help' compadd $arguments |
||||||
|
} |
||||||
|
|
||||||
|
__droplets_list () |
||||||
|
{ |
||||||
|
_wanted application expl 'command' compadd $(command tugboat droplets | cut -d " " -f1) |
||||||
|
} |
||||||
|
|
||||||
|
__tugboat-create () |
||||||
|
{ |
||||||
|
local curcontext="$curcontext" state line |
||||||
|
typeset -A opt_args |
||||||
|
|
||||||
|
_arguments -C \ |
||||||
|
':command:->command' \ |
||||||
|
'*::options:->options' |
||||||
|
|
||||||
|
case $state in |
||||||
|
(command) |
||||||
|
_describe -t commands "gem subcommand" _create_arguments |
||||||
|
return |
||||||
|
;; |
||||||
|
esac |
||||||
|
} |
||||||
|
|
||||||
|
local curcontext="$curcontext" state line |
||||||
|
typeset -A opt_args |
||||||
|
|
||||||
|
_arguments -C \ |
||||||
|
':command:->command' \ |
||||||
|
'*::options:->options' |
||||||
|
|
||||||
|
case $state in |
||||||
|
(command) |
||||||
|
_describe -t commands "gem subcommand" _commands |
||||||
|
return |
||||||
|
;; |
||||||
|
|
||||||
|
(options) |
||||||
|
case $line[1] in |
||||||
|
(help) |
||||||
|
_arguments ':feature:__task_list' |
||||||
|
;; |
||||||
|
|
||||||
|
(ssh) |
||||||
|
_arguments ':feature:__droplets_list' |
||||||
|
;; |
||||||
|
|
||||||
|
(create) |
||||||
|
_arguments ':feature:__tugboat-create' |
||||||
|
;; |
||||||
|
esac |
||||||
|
;; |
||||||
|
esac |
||||||
@ -0,0 +1,75 @@ |
|||||||
|
vi-mode |
||||||
|
======= |
||||||
|
This plugin increase `vi-like` zsh functionality. |
||||||
|
|
||||||
|
Use `ESC` or `CTRL-[` to enter `Normal mode`. |
||||||
|
|
||||||
|
|
||||||
|
History |
||||||
|
------- |
||||||
|
|
||||||
|
- `ctrl-p` : Previous command in history |
||||||
|
- `ctrl-n` : Next command in history |
||||||
|
- `/` : Search backward in history |
||||||
|
- `n` : Repeat the last `/` |
||||||
|
|
||||||
|
|
||||||
|
Mode indicators |
||||||
|
--------------- |
||||||
|
|
||||||
|
*Normal mode* is indicated with red `<<<` mark at the right prompt, when it |
||||||
|
wasn't defined by theme. |
||||||
|
|
||||||
|
|
||||||
|
Vim edition |
||||||
|
----------- |
||||||
|
|
||||||
|
- `v` : Edit current command line in Vim |
||||||
|
|
||||||
|
|
||||||
|
Movement |
||||||
|
-------- |
||||||
|
|
||||||
|
- `$` : To the end of the line |
||||||
|
- `^` : To the first non-blank character of the line |
||||||
|
- `0` : To the first character of the line |
||||||
|
- `w` : [count] words forward |
||||||
|
- `W` : [count] WORDS forward |
||||||
|
- `e` : Forward to the end of word [count] inclusive |
||||||
|
- `E` : Forward to the end of WORD [count] inclusive |
||||||
|
- `b` : [count] words backward |
||||||
|
- `B` : [count] WORDS backward |
||||||
|
- `t{char}` : Till before [count]'th occurrence of {char} to the right |
||||||
|
- `T{char}` : Till before [count]'th occurrence of {char} to the left |
||||||
|
- `f{char}` : To [count]'th occurrence of {char} to the right |
||||||
|
- `F{char}` : To [count]'th occurrence of {char} to the left |
||||||
|
- `;` : Repeat latest f, t, F or T [count] times |
||||||
|
- `,` : Repeat latest f, t, F or T in opposite direction |
||||||
|
|
||||||
|
|
||||||
|
Insertion |
||||||
|
--------- |
||||||
|
|
||||||
|
- `i` : Insert text before the cursor |
||||||
|
- `I` : Insert text before the first character in the line |
||||||
|
- `a` : Append text after the cursor |
||||||
|
- `A` : Append text at the end of the line |
||||||
|
- `o` : Insert new command line below the current one |
||||||
|
- `O` : Insert new command line above the current one |
||||||
|
|
||||||
|
|
||||||
|
Delete and Insert |
||||||
|
----------------- |
||||||
|
|
||||||
|
- `ctrl-h` : While in *Insert mode*: delete character after the cursor |
||||||
|
- `ctrl-w` : While in *Insert mode*: delete word after the cursor |
||||||
|
- `d{motion}` : Delete text that {motion} moves over |
||||||
|
- `dd` : Delete line |
||||||
|
- `D` : Delete characters under the cursor until the end of the line |
||||||
|
- `c{motion}` : Delete {motion} text and start insert |
||||||
|
- `cc` : Delete line and start insert |
||||||
|
- `C` : Delete to the end of the line and start insert |
||||||
|
- `r{char}` : Replace the character under the cursor with {char} |
||||||
|
- `R` : Enter replace mode: Each character replaces existing one |
||||||
|
- `x` : Delete [count] characters under and after the cursor |
||||||
|
- `X` : Delete [count] characters before the cursor |
||||||
@ -1,44 +1,74 @@ |
|||||||
# reference colors |
# Michele Bologna's theme |
||||||
GREEN="%{$fg_bold[green]%}" |
# http://michelebologna.net |
||||||
RED="%{$fg_bold[red]%}" |
# |
||||||
CYAN="%{$fg_bold[cyan]%}" |
# This a theme for oh-my-zsh. Features a colored prompt with: |
||||||
YELLOW="%{$fg_bold[yellow]%}" |
# * username@host: [jobs] [git] workdir % |
||||||
BLUE="%{$fg_bold[blue]%}" |
# * hostname color is based on hostname characters. When using as root, the |
||||||
MAGENTA="%{$fg_bold[magenta]%}" |
# prompt shows only the hostname in red color. |
||||||
WHITE="%{$fg_bold[white]%}" |
# * [jobs], if applicable, counts the number of suspended jobs tty |
||||||
|
# * [git], if applicable, represents the status of your git repo (more on that |
||||||
COLOR_ARRAY=($GREEN $RED $CYAN $YELLOW $BLUE $MAGENTA $WHITE) |
# later) |
||||||
|
# * '%' prompt will be green if last command return value is 0, yellow otherwise. |
||||||
# color reset |
# |
||||||
RESET_COLOR="%{$reset_color%}" |
# git prompt is inspired by official git contrib prompt: |
||||||
|
# https://github.com/git/git/tree/master/contrib/completion/git-prompt.sh |
||||||
# which color should be applied? |
# and it adds: |
||||||
USERNAME_NORMAL_COLOR=$WHITE |
# * the current branch |
||||||
USERNAME_ROOT_COLOR=$RED |
# * '%' if there are untracked files |
||||||
HOSTNAME_NORMAL_COLOR=$BLUE |
# * '$' if there are stashed changes |
||||||
# uncomment next line if you want auto-generated hostname color |
# * '*' if there are modified files |
||||||
#for i in $HOST; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]] |
# * '+' if there are added files |
||||||
HOSTNAME_ROOT_COLOR=$RED |
# * '<' if local repo is behind remote repo |
||||||
HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR) |
# * '>' if local repo is ahead remote repo |
||||||
CURRENT_DIR_COLOR=$CYAN |
# * '=' if local repo is equal to remote repo (in sync) |
||||||
|
# * '<>' if local repo is diverged |
||||||
# zsh commands |
|
||||||
USERNAME_COMMAND="%n" |
local green="%{$fg_bold[green]%}" |
||||||
HOSTNAME_COMMAND="%m" |
local red="%{$fg_bold[red]%}" |
||||||
CURRENT_DIR="%~" |
local cyan="%{$fg_bold[cyan]%}" |
||||||
|
local yellow="%{$fg_bold[yellow]%}" |
||||||
# output: colors + commands |
local blue="%{$fg_bold[blue]%}" |
||||||
USERNAME_OUTPUT="%(!..$USERNAME_NORMAL_COLOR$USERNAME_COMMAND$RESET_COLOR@)" |
local magenta="%{$fg_bold[magenta]%}" |
||||||
HOSTNAME_OUTPUT="$HOSTNAME_COLOR$HOSTNAME_COMMAND$RESET_COLOR" |
local white="%{$fg_bold[white]%}" |
||||||
CURRENT_DIR_OUTPUT="$CURRENT_DIR_COLOR$CURRENT_DIR" |
local reset="%{$reset_color%}" |
||||||
LAST_COMMAND_OUTPUT="%(?.%(!.$RED.$GREEN).$YELLOW)" |
|
||||||
|
local -a color_array |
||||||
# git theming |
color_array=($green $red $cyan $yellow $blue $magenta $white) |
||||||
ZSH_THEME_GIT_PROMPT_PREFIX="(" |
|
||||||
|
local username_normal_color=$white |
||||||
|
local username_root_color=$red |
||||||
|
local hostname_root_color=$red |
||||||
|
|
||||||
|
# calculating hostname color with hostname characters |
||||||
|
for i in `hostname`; local hostname_normal_color=$color_array[$[((#i))%7+1]] |
||||||
|
local -a hostname_color |
||||||
|
hostname_color=%(!.$hostname_root_color.$hostname_normal_color) |
||||||
|
|
||||||
|
local current_dir_color=$blue |
||||||
|
local username_command="%n" |
||||||
|
local hostname_command="%m" |
||||||
|
local current_dir="%~" |
||||||
|
|
||||||
|
local username_output="%(!..$username_normal_color$username_command$reset@)" |
||||||
|
local hostname_output="$hostname_color$hostname_command$reset" |
||||||
|
local current_dir_output="$current_dir_color$current_dir$reset" |
||||||
|
local jobs_bg="${red}fg: %j$reset" |
||||||
|
local last_command_output="%(?.%(!.$red.$green).$yellow)" |
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="" |
||||||
ZSH_THEME_GIT_PROMPT_SUFFIX="" |
ZSH_THEME_GIT_PROMPT_SUFFIX="" |
||||||
ZSH_THEME_GIT_PROMPT_DIRTY=")$RED*" |
ZSH_THEME_GIT_PROMPT_DIRTY="" |
||||||
ZSH_THEME_GIT_PROMPT_CLEAN=")" |
ZSH_THEME_GIT_PROMPT_CLEAN="" |
||||||
|
ZSH_THEME_GIT_PROMPT_UNTRACKED="%%" |
||||||
|
ZSH_THEME_GIT_PROMPT_MODIFIED="*" |
||||||
|
ZSH_THEME_GIT_PROMPT_ADDED="+" |
||||||
|
ZSH_THEME_GIT_PROMPT_STASHED="$" |
||||||
|
ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE="=" |
||||||
|
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=">" |
||||||
|
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE="<" |
||||||
|
ZSH_THEME_GIT_PROMPT_DIVERGED_REMOTE="<>" |
||||||
|
|
||||||
# wrap all together |
PROMPT='$username_output$hostname_output:$current_dir_output%1(j. [$jobs_bg].)' |
||||||
PROMPT='$USERNAME_OUTPUT$HOSTNAME_OUTPUT:$CURRENT_DIR_OUTPUT $LAST_COMMAND_OUTPUT%#$RESET_COLOR ' |
PROMPT+='$(__git_ps1)' |
||||||
RPROMPT='%1(j.fg: [%j].) $GREEN$(git_prompt_info)$RESET_COLOR [%@]' |
PROMPT+=" $last_command_output%#$reset " |
||||||
|
RPROMPT='' |
||||||
|
|||||||
@ -0,0 +1,25 @@ |
|||||||
|
# terminal coloring |
||||||
|
export CLICOLOR=1 |
||||||
|
export LSCOLORS=dxFxCxDxBxegedabagacad |
||||||
|
|
||||||
|
local git_branch='$(git_prompt_info)%{$reset_color%}$(git_remote_status)' |
||||||
|
|
||||||
|
PROMPT="%{$fg[green]%}╭─%n@%m %{$reset_color%}%{$fg[yellow]%}in %~ %{$reset_color%}${git_branch} |
||||||
|
%{$fg[green]%}╰\$ %{$reset_color%}" |
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[yellow]%}on " |
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" |
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_DIRTY="%{$reset_color%}%{$fg[red]%} ✘ %{$reset_color%}" |
||||||
|
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%} ✔ %{$reset_color%}" |
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_DETAILED=true |
||||||
|
ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_PREFIX="%{$fg[yellow]%}(" |
||||||
|
ZSH_THEME_GIT_PROMPT_REMOTE_STATUS_SUFFIX="%{$fg[yellow]%})%{$reset_color%}" |
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE=" +" |
||||||
|
ZSH_THEME_GIT_PROMPT_AHEAD_REMOTE_COLOR=%{$fg[green]%} |
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE=" -" |
||||||
|
ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR=%{$fg[red]%} |
||||||
|
|
||||||
Loading…
Reference in new issue