forked from ohmyzsh/ohmyzsh
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'ohmyzsh:master' into master
- Loading branch information
Showing
14 changed files
with
207 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# tldr plugin | ||
|
||
This plugin adds a shortcut to insert tldr before the previous command. | ||
Heavily inspired from [Man plugin](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/man). | ||
|
||
To use it, add `tldr` to the plugins array in your zshrc file: | ||
|
||
```zsh | ||
plugins=(... tldr) | ||
``` | ||
|
||
# Keyboard Shortcuts | ||
| Shortcut | Description | | ||
|------------------------------------|----------------------------------------------------------------------------| | ||
| <kbd>Esc</kbd> + tldr | add tldr before the previous command to see the tldr page for this command | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
tldr-command-line() { | ||
# if there is no command typed, use the last command | ||
[[ -z "$BUFFER" ]] && zle up-history | ||
|
||
# if typed command begins with tldr, do nothing | ||
[[ "$BUFFER" = tldr\ * ]] && return | ||
|
||
# get command and possible subcommand | ||
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags | ||
local -a args | ||
args=(${${(Az)BUFFER}[1]} ${${(Az)BUFFER}[2]}) | ||
|
||
BUFFER="tldr ${args[1]}" | ||
} | ||
|
||
zle -N tldr-command-line | ||
# Defined shortcut keys: [Esc]tldr | ||
bindkey "\e"tldr tldr-command-line | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.