Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions abbreviations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Custom abbreviations

This current directory provides custom abbreviations. They can be used by importing their exported abbreviations via:

```nushell
use path/to/<command>/<command>-abbreviations.nu *
```

With `path/to/<command>` being either the relative path of the file to your current working directory or its absolute path.
9 changes: 9 additions & 0 deletions abbreviations/bat/bat-abbreviations.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
$env.config.abbreviations = {
...$env.config.abbreviations
b: "bat"
bn: "bat --number"
bnl: "bat --number --line-range"
bp: "bat --plain"
bpl: "bat --plain --line-range"
bl: "bat --line-range"
}
6 changes: 6 additions & 0 deletions abbreviations/chezmoi/chezmoi-abbreviations.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export alias ch = chezmoi
export alias chad = chezmoi add
export alias chap = chezmoi apply
export alias chd = chezmoi diff
export alias chda = chezmoi data
export alias chs = chezmoi status
53 changes: 53 additions & 0 deletions abbreviations/docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# docker abbreviations in nushell

This plugin adds the following abbreviations:

| Alias | Command | Description |
| ------- | --------------------------------- | ---------------------------------------------------------------------------------------- |
| dbl | docker build | Build an image from a Dockerfile |
| dcin | docker container inspect | Display detailed information on one or more containers |
| dcls | docker container ls | List all the running docker containers |
| dclsa | docker container ls -a | List all running and stopped containers |
| dib | docker image build | Build an image from a Dockerfile (same as docker build) |
| dii | docker image inspect | Display detailed information on one or more images |
| dils | docker image ls | List docker images |
| dipu | docker image push | Push an image or repository to a remote registry |
| dirm | docker image rm | Remove one or more images |
| dit | docker image tag | Add a name and tag to a particular image |
| dlo | docker container logs | Fetch the logs of a docker container |
| dnc | docker network create | Create a new network |
| dncn | docker network connect | Connect a container to a network |
| dndcn | docker network disconnect | Disconnect a container from a network |
| dni | docker network inspect | Return information about one or more networks |
| dnls | docker network ls | List all networks the engine daemon knows about, including those spanning multiple hosts |
| dnrm | docker network rm | Remove one or more networks |
| dpo | docker container port | List port mappings or a specific mapping for the container |
| dpu | docker pull | Pull an image or a repository from a registry |
| dr | docker container run | Create a new container and start it using the specified command |
| drit | docker container run -it | Create a new container and start it in an interactive shell |
| drm | docker container rm | Remove the specified container(s) |
| drm! | docker container rm -f | Force the removal of a running container (uses SIGKILL) |
| dst | docker container start | Start one or more stopped containers |
| drs | docker container restart | Restart one or more containers |
| dstp | docker container stop | Stop one or more running containers |
| dtop | docker top | Display the running processes of a container |
| dvi | docker volume inspect | Display detailed information about one or more volumes |
| dvls | docker volume ls | List all the volumes known to docker |
| dvprune | docker volume prune | Cleanup dangling volumes |
| dxc | docker container exec | Run a new command in a running container |
| dxcit | docker container exec -it | Run a new command in a running container in an interactive shell |
| dsta | docker ps -q \| xargs docker stop | Stop all running containers |

## install and use

- install

```nushell
use {project_path}/abbreviations/docker/docker.nu
```

- use

```nushell
docker-abbreviations + tab
```
37 changes: 37 additions & 0 deletions abbreviations/docker/docker-abbreviations.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
export alias dbl = docker build
export alias dcin = docker container inspect
export alias dcls = docker container ls
export alias dclsa = docker container ls -a
export alias dib = docker image build
export alias dii = docker image inspect
export alias dils = docker image ls
export alias dipu = docker image push
export alias dirm = docker image rm
export alias dit = docker image tag
export alias dlo = docker container logs
export alias dnc = docker network create
export alias dncn = docker network connect
export alias dndcn = docker network disconnect
export alias dni = docker network inspect
export alias dnls = docker network ls
export alias dnrm = docker network rm
export alias dpo = docker container port
export alias dpu = docker pull
export alias dr = docker container run
export alias drit = docker container run -it
export alias drm = docker container rm
export alias drm! = docker container rm -f
export alias dst = docker container start
export alias drs = docker container restart
export alias dstp = docker container stop
export alias dtop = docker top
export alias dvi = docker volume inspect
export alias dvls = docker volume ls
export alias dvprune = docker volume prune
export alias dxc = docker container exec
export alias dxcit = docker container exec -it

# Alias for `docker ps -q | xargs docker stop`
export def dsta [] {
docker ps -q | xargs docker stop
}
6 changes: 6 additions & 0 deletions abbreviations/exa/exa-abbreviations.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export alias x = exa --icons
export alias xa = exa --icons --all
export alias xl = exa --long
export alias xla = exa --long --all
export alias xt = exa --icons --tree
export alias xta = exa --icons --tree --all
6 changes: 6 additions & 0 deletions abbreviations/eza/eza-abbreviations.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export alias x = eza --icons
export alias xa = eza --icons --all
export alias xl = eza --long
export alias xla = eza --long --all
export alias xt = eza --icons --tree
export alias xta = eza --icons --tree --all
190 changes: 190 additions & 0 deletions abbreviations/git/git-abbreviations.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
# returns the name of the current branch
# TODO: uncomment
# export def git_current_branch [] {
# ^git rev-parse --abbrev-ref HEAD
# }

# TODO: uncomment
# export def git_main_branch [] {
# git remote show origin
# | lines
# | str trim
# | find --regex 'HEAD .*?[:: ].+'
# | first
# | ansi strip
# | str replace --regex 'HEAD .*?[:: ]\s*(.+)' '$1'
# }

#
# Abbreviations
# (sorted alphabetically)
#

$env.config.abbreviations = {
...$env.config.abbreviations
ga: "git add"
gaa: "git add --all"
gapa: "git add --patch"
gau: "git add --update"
gav: "git add --verbose"
gap: "git apply"
gapt: "git apply --3way"
gb: "git branch"
gba: "git branch --all"
gbd: "git branch --delete"
gbD: "git branch --delete --force"
gbl: "git blame -b -w"
gbm: "git branch --move"
gbmc: "git branch --move (git_current_branch)"
gbnm: "git branch --no-merged"
gbr: "git branch --remote"
gbs: "git bisect"
gbsb: "git bisect bad"
gbsg: "git bisect good"
gbsn: "git bisect new"
gbso: "git bisect old"
gbsr: "git bisect reset"
gbss: "git bisect start"
gc: "git commit --verbose"
gc!: "git commit --verbose --amend"
gcn: "git commit --verbose --no-edit"
gcn!: "git commit --verbose --no-edit --amend"
gca: "git commit --verbose --all"
gca!: "git commit --verbose --all --amend"
gcan!: "git commit --verbose --all --no-edit --amend"
gcans!: "git commit --verbose --all --signoff --no-edit --amend"
gcam: "git commit --all --message"
gcas: "git commit --all --signoff"
gcasm: "git commit --all --signoff --message"
gcb: "git checkout -b"
gcd: "git checkout develop"
gcf: "git config --list"
gcl: "git clone --recurse-submodules"
gclean: "git clean --interactive -d"
gpristine: "git reset --hard; git clean -d --force -x"
gcm: "git checkout (git_main_branch)"
gcmsg: "git commit --message"
gco: "git checkout"
gcor: "git checkout --recurse-submodules"
gcount: "git shortlog --summary --numbered"
gcp: "git cherry-pick"
gcpa: "git cherry-pick --abort"
gcpc: "git cherry-pick --continue"
gcs: "git commit --gpg-sign"
gcss: "git commit --gpg-sign --signoff"
gcssm: "git commit --gpg-sign --signoff --message"
gd: "git diff"
gdca: "git diff --cached"
gdcw: "git diff --cached --word-diff"
gdct: "git describe --tags (git rev-list --tags --max-count=1)"
gds: "git diff --staged"
gdt: "git diff-tree --no-commit-id --name-only -r"
gdup: "git diff @{upstream}"
gdw: "git diff --word-diff"
gf: "git fetch"
gfa: "git fetch --all --prune"
gfo: "git fetch origin"
gg: "git gui citool"
gga: "git gui citool --amend"
ghh: "git help"
gignore: "git update-index --assume-unchanged"
gl: "git log"
glg: "git log --stat"
glgp: "git log --stat --patch"
glgg: "git log --graph"
glgga: "git log --graph --decorate --all"
glgm: "git log --graph --max-count=10"
glo: "git log --oneline --decorate"
glod: "git log --graph $'--pretty=%Cred%h%Creset -%C(char lp)auto(char rp)%d%Creset %s %Cgreen(char lp)%ad(char rp) %C(char lp)bold blue(char rp)<%an>%Creset'"
glods: "git log --graph $'--pretty=%Cred%h%Creset -%C(char lp)auto(char rp)%d%Creset %s %Cgreen(char lp)%ad(char rp) %C(char lp)bold blue(char rp)<%an>%Creset' --date=short"
glog: "git log --oneline --decorate --graph"
gloga: "git log --oneline --decorate --graph --all"
glol: "git log --graph $'--pretty=%Cred%h%Creset -%C(char lp)auto(char rp)%d%Creset %s %Cgreen(char lp)%ar(char rp) %C(char lp)bold blue(char rp)<%an>%Creset'"
glola: "git log --graph $'--pretty=%Cred%h%Creset -%C(char lp)auto(char rp)%d%Creset %s %Cgreen(char lp)%ar(char rp) %C(char lp)bold blue(char rp)<%an>%Creset' --all"
glols: "git log --graph $'--pretty=%Cred%h%Creset -%C(char lp)auto(char rp)%d%Creset %s %Cgreen(char lp)%ar(char rp) %C(char lp)bold blue(char rp)<%an>%Creset' --stat"
gm: "git merge"
gmtl: "git mergetool --no-prompt"
gmtlvim: "git mergetool --no-prompt --tool=vimdiff"
gma: "git merge --abort"
gmom: "git merge $\"origin/(git_main_branch)\""
gp: "git push"
gpd: "git push --dry-run"
gpf: "git push --force-with-lease"
gpf!: "git push --force"
gpl: "git pull"
gpoat: "git push origin --all; git push origin --tags"
gpod: "git push origin --delete"
gpodc: "git push origin --delete (git_current_branch)"
gpr: "git pull --rebase"
gpu: "git push upstream"
gpv: "git push --verbose"
gr: "git remote"
gpra: "git pull --rebase --autostash"
gprav: "git pull --rebase --autostash --verbose"
gprv: "git pull --rebase --verbose"
gpsup: "git push --set-upstream origin (git_current_branch)"
gra: "git remote add"
grb: "git rebase"
grba: "git rebase --abort"
grbc: "git rebase --continue"
grbd: "git rebase develop"
grbi: "git rebase --interactive"
grbm: "git rebase (git_main_branch)"
grbo: "git rebase --onto"
grbs: "git rebase --skip"
grev: "git revert"
grh: "git reset"
grhh: "git reset --hard"
groh: "git reset $\"origin/(git_current_branch)\" --hard"
grm: "git rm"
grmc: "git rm --cached"
grmv: "git remote rename"
grrm: "git remote remove"
grs: "git restore"
grset: "git remote set-url"
grss: "git restore --source"
grst: "git restore --staged"
grt: "cd (git rev-parse --show-toplevel | complete | if $in.exit_code == 0 { $in.stdout | str trim } else { '.' })"
gru: "git reset --"
grup: "git remote update"
grv: "git remote --verbose"
gsb: "git status --short --branch"
gsd: "git svn dcommit"
gsh: "git show"
gshs: "git show -s"
gsi: "git submodule init"
gsps: "git show --pretty=short --show-signature"
gsr: "git svn rebase"
gss: "git status --short"
gst: "git status"
gsta: "git stash push"
gstaa: "git stash apply"
gstc: "git stash clear"
gstd: "git stash drop"
gstl: "git stash list"
gstp: "git stash pop"
gsts: "git stash show --text"
gstu: "gsta --include-untracked"
gstall: "git stash --all"
gsu: "git submodule update"
gsw: "git switch"
gswc: "git switch --create"
gts: "git tag --sign"
gtv: "git tag | lines | sort"
glum: "git pull upstream (git_main_branch)"
gunignore: "git update-index --no-assume-unchanged"
gup: "git pull --rebase"
gupv: "git pull --rebase --verbose"
gupa: "git pull --rebase --autostash"
gupav: "git pull --rebase --autostash --verbose"
gwch: "git whatchanged -p --abbrev-commit --pretty=medium"
gwt: "git worktree"
gwtls: "git worktree list"
gwtmv: "git worktree move"
gwtm: "git worktree remove"
gam: "git am"
gamc: "git am --continue"
gams: "git am --skip"
gama: "git am --abort"
gamscp: "git am --show-current-patch"
}
Loading