mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-25 01:47:25 +08:00
Compare commits
No commits in common. "aca048814b2462501ab82938ff2473661182fffb" and "9f9d3b7d247b3c3e21542abaaf107e3d15aac1a5" have entirely different histories.
aca048814b
...
9f9d3b7d24
@ -47,7 +47,7 @@ fi
|
|||||||
# enable diff color if possible.
|
# enable diff color if possible.
|
||||||
if command diff --color /dev/null /dev/null &>/dev/null; then
|
if command diff --color /dev/null /dev/null &>/dev/null; then
|
||||||
function color-diff {
|
function color-diff {
|
||||||
command diff --color $@
|
diff --color $@
|
||||||
}
|
}
|
||||||
alias diff="color-diff"
|
alias diff="color-diff"
|
||||||
compdef _diff color-diff # compdef is already loaded by this point
|
compdef _diff color-diff # compdef is already loaded by this point
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
# extract plugin
|
# extract plugin
|
||||||
|
|
||||||
This plugin defines a function called `extract` that extracts the archive file you pass it, and it supports a
|
This plugin defines a function called `extract` that extracts the archive file
|
||||||
wide variety of archive filetypes.
|
you pass it, and it supports a wide variety of archive filetypes.
|
||||||
|
|
||||||
This way you don't have to know what specific command extracts a file, you just do `extract <filename>` and
|
This way you don't have to know what specific command extracts a file, you just
|
||||||
the function takes care of the rest.
|
do `extract <filename>` and the function takes care of the rest.
|
||||||
|
|
||||||
To use it, add `extract` to the plugins array in your zshrc file:
|
To use it, add `extract` to the plugins array in your zshrc file:
|
||||||
|
|
||||||
@ -15,7 +15,7 @@ plugins=(... extract)
|
|||||||
## Supported file extensions
|
## Supported file extensions
|
||||||
|
|
||||||
| Extension | Description |
|
| Extension | Description |
|
||||||
| :---------------- | :----------------------------------- |
|
|:------------------|:-------------------------------------|
|
||||||
| `7z` | 7zip file |
|
| `7z` | 7zip file |
|
||||||
| `Z` | Z archive (LZW) |
|
| `Z` | Z archive (LZW) |
|
||||||
| `apk` | Android app file |
|
| `apk` | Android app file |
|
||||||
@ -32,7 +32,6 @@ plugins=(... extract)
|
|||||||
| `lrz` | LRZ archive |
|
| `lrz` | LRZ archive |
|
||||||
| `lz4` | LZ4 archive |
|
| `lz4` | LZ4 archive |
|
||||||
| `lzma` | LZMA archive |
|
| `lzma` | LZMA archive |
|
||||||
| `obscpio` | cpio archive used on OBS |
|
|
||||||
| `rar` | WinRAR archive |
|
| `rar` | WinRAR archive |
|
||||||
| `rpm` | RPM package |
|
| `rpm` | RPM package |
|
||||||
| `sublime-package` | Sublime Text package |
|
| `sublime-package` | Sublime Text package |
|
||||||
@ -58,5 +57,5 @@ plugins=(... extract)
|
|||||||
| `zst` | Zstandard file (zstd) |
|
| `zst` | Zstandard file (zstd) |
|
||||||
| `zpaq` | Zpaq file |
|
| `zpaq` | Zpaq file |
|
||||||
|
|
||||||
See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for more information
|
See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for
|
||||||
regarding archive formats.
|
more information regarding archive formats.
|
||||||
|
|||||||
@ -3,5 +3,5 @@
|
|||||||
|
|
||||||
_arguments \
|
_arguments \
|
||||||
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
|
'(-r --remove)'{-r,--remove}'[Remove archive.]' \
|
||||||
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|cpio|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|obscpio|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst|zpaq)(-.)'" \
|
"*::archive file:_files -g '(#i)*.(7z|Z|apk|aar|bz2|cab|cpio|deb|ear|gz|ipa|ipsw|jar|lrz|lz4|lzma|rar|rpm|sublime-package|tar|tar.bz2|tar.gz|tar.lrz|tar.lz|tar.lz4|tar.xz|tar.zma|tar.zst|tbz|tbz2|tgz|tlz|txz|tzst|war|whl|xpi|xz|zip|zst|zpaq)(-.)'" \
|
||||||
&& return 0
|
&& return 0
|
||||||
|
|||||||
@ -72,7 +72,7 @@ EOF
|
|||||||
builtin cd -q ..; command rm *.tar.* debian-binary ;;
|
builtin cd -q ..; command rm *.tar.* debian-binary ;;
|
||||||
(*.zst) unzstd "$file" ;;
|
(*.zst) unzstd "$file" ;;
|
||||||
(*.cab) cabextract -d "$extract_dir" "$file" ;;
|
(*.cab) cabextract -d "$extract_dir" "$file" ;;
|
||||||
(*.cpio|*.obscpio) cpio -idmvF "$file" ;;
|
(*.cpio) cpio -idmvF "$file" ;;
|
||||||
(*.zpaq) zpaq x "$file" ;;
|
(*.zpaq) zpaq x "$file" ;;
|
||||||
(*)
|
(*)
|
||||||
echo "extract: '$file' cannot be extracted" >&2
|
echo "extract: '$file' cannot be extracted" >&2
|
||||||
|
|||||||
@ -3,5 +3,10 @@
|
|||||||
# If marked is passed a file, open it in Marked
|
# If marked is passed a file, open it in Marked
|
||||||
#
|
#
|
||||||
function marked() {
|
function marked() {
|
||||||
open -a "marked 2.app" "$1"
|
if [ "$1" ]
|
||||||
|
then
|
||||||
|
open -a "marked 2.app" "$1"
|
||||||
|
else
|
||||||
|
open -a "marked 2.app"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,17 +0,0 @@
|
|||||||
## marktext
|
|
||||||
|
|
||||||
Plugin for MarkText, a previewer for Markdown files on Mac OS X
|
|
||||||
|
|
||||||
### Requirements
|
|
||||||
|
|
||||||
* [MarkText](https://github.com/marktext/marktext)
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
|
|
||||||
* If `marktext` is called without an argument, open MarkText
|
|
||||||
|
|
||||||
* If `marktext` is passed a file, open it in MarkText
|
|
||||||
|
|
||||||
### Credits
|
|
||||||
|
|
||||||
* just copied from plugins/marked2, all credits to marked2 plugin author
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
#
|
|
||||||
# If marktext is called without an argument, open MarkText
|
|
||||||
# If marktext is passed a file, open it in MarkText
|
|
||||||
#
|
|
||||||
function marktext() {
|
|
||||||
open -a "MarkText.app" "$1"
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user