Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nomyfan/alias-rs
A utility to manage aliases across shells. 跨shell的命令别名管理工具。
https://github.com/nomyfan/alias-rs
alias alias-management aliases bash powershell rust rust-lang unix-shell zsh
Last synced: 3 months ago
JSON representation
A utility to manage aliases across shells. 跨shell的命令别名管理工具。
- Host: GitHub
- URL: https://github.com/nomyfan/alias-rs
- Owner: nomyfan
- Created: 2023-11-02T09:37:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-19T11:58:50.000Z (9 months ago)
- Last Synced: 2024-04-19T12:58:26.027Z (9 months ago)
- Topics: alias, alias-management, aliases, bash, powershell, rust, rust-lang, unix-shell, zsh
- Language: Rust
- Homepage:
- Size: 18.6 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# alias-rs
A utility to manage aliases across shells.
## Installation
```
cargo install --git https://github.com/nomyfan/alias-rs
```## Usage
### PowerShell
Add this into your `$PROFILE`.
```pwsh
Invoke-Expression (&als init powershell | Out-String)
```### zsh
Add this into your `.zshrc`.
```shell
eval "$(als init zsh)"
```### bash
Add this into your `.bashrc`.
```shell
eval "$(als init bash)"
```### fish
Add this into your `config.fish`.
```shell
als init fish | source
```## Alias config
Put a config file in `~/.config/alias.toml`.
### Format
All aliases are defined in the `aliases` table, with alias name as key.
### Example
```toml
[aliases]
# pnpm
p = "pnpm"
pi = "pnpm install"
pa = "pnpm add"
pb = "pnpm build"
# nvim
vim = "nvim"[aliases.cls]
zsh = "clear"[aliases.opengh]
zsh = "node $HOME/.ss/JavaScript/opengh.mjs"
powershell = "node (Join-Path $HOME -ChildPath .ss -AdditionalChildPath JavaScript,opengh.mjs)"[aliases.rmrf]
zsh = "rm -rf"
powershell = "Remove-Item -Recurse -Force"```