mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-31 11:49:50 +00:00
Compare commits
2 Commits
99b243b9a9
...
e076690551
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e076690551 | ||
|
|
233e81db4e |
@@ -22,14 +22,15 @@ Try: sudo apt install <selected package>
|
|||||||
|
|
||||||
It works out of the box with the command-not-found packages for:
|
It works out of the box with the command-not-found packages for:
|
||||||
|
|
||||||
- [Ubuntu](https://www.porcheron.info/command-not-found-for-zsh/)
|
- [Ubuntu](https://launchpad.net/ubuntu/+source/command-not-found)
|
||||||
- [Debian](https://packages.debian.org/search?keywords=command-not-found)
|
- [Debian](https://packages.debian.org/search?keywords=command-not-found)
|
||||||
- [Arch Linux](https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found)
|
- [Arch Linux](https://wiki.archlinux.org/title/Zsh#pkgfile_"command_not_found"_handler)
|
||||||
- [macOS (Homebrew)](https://github.com/Homebrew/homebrew-command-not-found)
|
- [macOS (Homebrew)](https://github.com/Homebrew/brew/blob/main/docs/Command-Not-Found.md)
|
||||||
- [Fedora](https://fedoraproject.org/wiki/Features/PackageKitCommandNotFound)
|
- [Fedora](https://fedoraproject.org/wiki/Features/PackageKitCommandNotFound)
|
||||||
- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/command-not-found)
|
- [NixOS](https://github.com/NixOS/nixpkgs/tree/master/nixos/modules/programs/command-not-found)
|
||||||
- [Termux](https://github.com/termux/command-not-found)
|
- [Termux](https://github.com/termux/command-not-found)
|
||||||
- [SUSE](https://www.unix.com/man-page/suse/1/command-not-found/)
|
- [SUSE](https://www.unix.com/man-page/suse/1/command-not-found/)
|
||||||
- [Gentoo](https://github.com/AndrewAmmerlaan/command-not-found-gentoo/tree/main)
|
- [Gentoo](https://github.com/AndrewAmmerlaan/command-not-found-gentoo/tree/main)
|
||||||
|
- [Void Linux](https://codeberg.org/classabbyamp/xbps-command-not-found)
|
||||||
|
|
||||||
You can add support for other platforms by submitting a Pull Request.
|
You can add support for other platforms by submitting a Pull Request.
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
## Platforms with a built-in command-not-found handler init file
|
## Platforms with a built-in command-not-found handler init file
|
||||||
|
|
||||||
for file (
|
for file (
|
||||||
# Arch Linux. Must have pkgfile installed: https://wiki.archlinux.org/index.php/Pkgfile#Command_not_found
|
# Arch Linux. Must have pkgfile installed: https://wiki.archlinux.org/title/Zsh#pkgfile_"command_not_found"_handler
|
||||||
/usr/share/doc/pkgfile/command-not-found.zsh
|
/usr/share/doc/pkgfile/command-not-found.zsh
|
||||||
# Homebrew: https://github.com/Homebrew/homebrew-command-not-found
|
# Void Linux: https://codeberg.org/classabbyamp/xbps-command-not-found
|
||||||
|
/usr/share/zsh/plugins/xbps-command-not-found/xbps-command-not-found.zsh
|
||||||
|
# Homebrew: https://github.com/Homebrew/brew/blob/main/docs/Command-Not-Found.md
|
||||||
/opt/homebrew/Library/Homebrew/command-not-found/handler.sh
|
/opt/homebrew/Library/Homebrew/command-not-found/handler.sh
|
||||||
/usr/local/Homebrew/Library/Homebrew/command-not-found/handler.sh
|
/usr/local/Homebrew/Library/Homebrew/command-not-found/handler.sh
|
||||||
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/command-not-found/handler.sh
|
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/command-not-found/handler.sh
|
||||||
# Old homebrew implementation
|
# Old homebrew implementation
|
||||||
/opt/homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh
|
/opt/homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh
|
||||||
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh
|
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh
|
||||||
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh
|
/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-command-not-found/handler.sh
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# gitignore
|
# gitignore
|
||||||
|
|
||||||
This plugin enables you the use of [gitignore.io](https://www.toptal.com/developers/gitignore) from the command line. You need an active internet connection.
|
This plugin enables you to use [gitignore.io](https://www.gitignore.io) from the command line. You need an active internet connection to fetch templates. The plugin uses the gitignore.io CDN endpoint to simplify access and improve reliability.
|
||||||
|
|
||||||
To use it, add `gitignore` to the plugins array in your zshrc file:
|
To use it, add `gitignore` to the plugins array in your zshrc file:
|
||||||
|
|
||||||
@@ -14,4 +14,4 @@ plugins=(... gitignore)
|
|||||||
|
|
||||||
* `gi [TEMPLATENAME]`: Show git-ignore output on the command line, e.g. `gi java` to exclude class and package files.
|
* `gi [TEMPLATENAME]`: Show git-ignore output on the command line, e.g. `gi java` to exclude class and package files.
|
||||||
|
|
||||||
* `gi [TEMPLATENAME] >> .gitignore`: Appending programming language settings to your projects .gitignore.
|
* `gi [TEMPLATENAME] >> .gitignore`: Append the template rules to your project's `.gitignore` file.
|
||||||
|
|||||||
@@ -1,12 +1,21 @@
|
|||||||
function gi() { curl -fLw '\n' https://www.toptal.com/developers/gitignore/api/"${(j:,:)@}" }
|
# gitignore plugin for oh-my-zsh
|
||||||
|
# Uses gitignore.io CDN endpoint
|
||||||
|
function _gi_curl() {
|
||||||
|
curl -sfL "https://www.gitignore.io/api/$1"
|
||||||
|
}
|
||||||
|
|
||||||
|
function gi() {
|
||||||
|
local query="${(j:,:)@}"
|
||||||
|
_gi_curl "$query" || return 1
|
||||||
|
}
|
||||||
|
|
||||||
_gitignoreio_get_command_list() {
|
_gitignoreio_get_command_list() {
|
||||||
curl -sfL https://www.toptal.com/developers/gitignore/api/list | tr "," "\n"
|
_gi_curl "list" | tr "," "\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
_gitignoreio () {
|
_gitignoreio () {
|
||||||
compset -P '*,'
|
compset -P '*,'
|
||||||
compadd -S '' `_gitignoreio_get_command_list`
|
compadd -S '' $(_gitignoreio_get_command_list)
|
||||||
}
|
}
|
||||||
|
|
||||||
compdef _gitignoreio gi
|
compdef _gitignoreio gi
|
||||||
Reference in New Issue
Block a user