https://github.com/zdharma-continuum/declare-zsh
https://github.com/zdharma-continuum/declare-zsh
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zdharma-continuum/declare-zsh
- Owner: zdharma-continuum
- License: other
- Created: 2021-11-06T20:09:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-06T18:06:33.000Z (almost 2 years ago)
- Last Synced: 2025-03-24T02:21:53.700Z (3 months ago)
- Language: Shell
- Size: 239 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# declare-zsh
[**declare-zsh**](https://github.com/zdharma-continuum/declare-zsh) is a parser for `zinit` commands in `.zshrc`. It allows to
perform the following actions on `.zshrc` **from the command-line**:- enable and disable selected plugins and snippets,
- add plugins and snippets,
- delete plugins and snippets,
- it currently supports the classic Zinit syntax only, i.e.: the one with two (`zinit ice …`, `zinit load/snippet …`)
commands.______________________________________________________________________
In other words, by issuing a `declzsh` command the user deploys a task of:
1. Reading and parsing of the `~/.zshrc`.
1. Making changes (like removal of a plugin, i.e. of `zinit load {the-removed-plugin}` command together with the
possible associated `zinit ice …` command) and then…1. Writing the result back to the `zshrc` (by default, the result is stored to `~/.zshrc_gen` file for safety, but the
author wants to emhasize very strongly, that **breaking something within the parsed `zshrc` is nearly impossible**
and the tool can be safely used with option `-o ~/.zshrc` which points `declzsh` to the original `zshrc` as the
destination output file).## Examples & Screenshots
1. Example **disabling** of a plugin via the **toggle** option **-TT** – this works because the commands preceded by `:`
are ignored by the shell: 2. Example **addition** of a plugin via the option **-AA** – in order to also set up ice modifiers enclose them in a
preceding square-bracket block, i.e. `declzsh -AA '[ wait"1" lucid ] zdharma/null'`:
3. Example **deletion** of a plugin via the **purge** option **-PP** – the argument is treated as pattern, pass `*` to
delete all plugins and snippets!:
## Usage
Multiple actions, i.e. multiple options like `-AA`, `-PP`, `-DD`, etc. are possible in a single `declzsh` run.
