mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
Merge cc1ed8d4e5 into f1934d2c76
This commit is contained in:
commit
d5383475e0
2 changed files with 53 additions and 0 deletions
32
plugins/zig/README.md
Normal file
32
plugins/zig/README.md
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
# zig
|
||||||
|
|
||||||
|
To use it, add `zig` to the plugins array in your zshrc file:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
plugins=(... zig)
|
||||||
|
```
|
||||||
|
# Alias
|
||||||
|
|
||||||
|
| Alias | Command | Description |
|
||||||
|
|:----------------------|:-------------------------------------------------|:-----------------------------------------------------|
|
||||||
|
| `zbuild` | `zig build` | `Build project from build.zig` |
|
||||||
|
| `zbuildrun` | `zig build run` | `Build and run project from build.zig` |
|
||||||
|
| `zbuildtest` | `zig build test` | `Build, run and test project from build.zig` |
|
||||||
|
| `zbuildexe` | `zig init-exe` | `Initialize a "zig build" application in the cwd` |
|
||||||
|
| `zbuildlib` | `zig init-lib` | `Initialize a "zig build" library in the cwd` |
|
||||||
|
| `zfmt` | `zig fmt` | `Reformat Zig source into canonical form` |
|
||||||
|
| `zlint` | `zig ast-check` | `Look for simple compile errors in any set of files` |
|
||||||
|
| `c2zig` | `zig translate-c` | `Convert C code to Zig code` |
|
||||||
|
| `ztest` | `zig test` | `Create and run a test build` |
|
||||||
|
| `zrun` | `zig run` | `Create executable and run immediately` |
|
||||||
|
| `zversion` | `zig version` | `Print version number and exit` |
|
||||||
|
| `zfind` | `find . -name "*.zig"` | `Find all zig files` |
|
||||||
|
|
||||||
|
# Export
|
||||||
|
|
||||||
|
| Export | Command | Description |
|
||||||
|
|:----------------------|:-------------------------------------------------|:-----------------------------------------------------|
|
||||||
|
| `ZCC` | `zig cc` | `Use Zig as a drop-in C compiler` |
|
||||||
|
| `ZCXX` | `zig c++` | `Use Zig as a drop-in C++ compiler` |
|
||||||
|
|
||||||
|
**Note:** Export the commands without modify the default values (`CC` & `CXX`).
|
||||||
21
plugins/zig/zig.plugin.zsh
Normal file
21
plugins/zig/zig.plugin.zsh
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
|
||||||
|
# Zig as C & CXX compiler (clang wrapper)
|
||||||
|
export ZCC="zig cc -fno-sanitize=all -lc"
|
||||||
|
export ZCXX="zig c++ -fno-sanitize=all -lc -lc++"
|
||||||
|
|
||||||
|
# Zig build-system project
|
||||||
|
alias zbuild="zig build"
|
||||||
|
alias zbuildrun="zig build run"
|
||||||
|
alias zbuildtest="zig build test"
|
||||||
|
alias zbuildexe="zig init-exe"
|
||||||
|
alias zbuildlib="zig init-lib"
|
||||||
|
|
||||||
|
# Other Commands
|
||||||
|
alias zfmt="zig fmt"
|
||||||
|
alias zlint="zig ast-check"
|
||||||
|
alias c2zig="zig translate-c"
|
||||||
|
alias ztest="zig test"
|
||||||
|
alias zrun="zig run"
|
||||||
|
alias zversion="zig version"
|
||||||
|
|
||||||
|
alias zfind='find . -name "*.zig"'
|
||||||
Loading…
Add table
Add a link
Reference in a new issue