NOflake/users/tao/nushell/extras/alias.nu

78 lines
1.7 KiB
Text
Raw Normal View History

2025-02-20 14:55:55 -08:00
alias b = btm
2025-04-08 15:12:18 -07:00
alias d = dirs
alias da = dirs add
alias dg = dirs goto
alias dn = dirs next
alias dp = dirs prev
alias dr = dirs drop
2025-03-17 18:09:46 -07:00
alias fetch = fastfetch
2025-02-20 14:55:55 -08:00
alias follow = readlink -f
2025-04-08 15:12:18 -07:00
alias p = pueue
alias snapper = snapper -c home
alias zl = zellij
alias cringe = sudo bootctl set-oneshot auto-windows
2025-03-17 18:09:46 -07:00
def h [query?: path] {
(if ($query != null) {sk -1 -q ($query | path basename)} else {sk -1})
| complete
| if $in.exit_code == 0 {
$in.stdout | str trim | hx $in
}
}
def srg [] {
sk --ansi -i -c 'rg --color=always --line-number "{}"'
}
2025-02-20 14:55:55 -08:00
alias j = jj
alias ja = jj log -r 'all()'
alias jc = jj desc
alias jd = jj diff
alias je = jj edit
alias jf = jj git fetch
alias jg = jj git clone --colocate
alias jp = jj git push
alias js = jj status
alias jw = jj workspace update-stale
2025-03-08 22:35:46 -08:00
def jm --wrapped [-r: string = "@", ...rest] {
2025-03-06 17:44:40 -08:00
mut r = $r
if (jj log -r @ --no-pager --no-graph --template 'if(empty,"empty")' | $in == "empty") {
$r = "@-"
}
2025-03-08 22:35:46 -08:00
jj bookmark set main -r $r ...$rest
2025-02-20 23:37:01 -08:00
jj git push
}
2025-03-17 18:09:46 -07:00
alias la = ls -a
2025-06-22 21:49:42 -07:00
alias ll = ls -l
alias lal = ls -la
2025-03-17 18:09:46 -07:00
alias ccp = cp -prv
alias mvp = mv-full -pv
def --env c [path: path = "~"] {
cd $path
l
}
2025-12-02 17:33:57 -08:00
def l --wrapped [path: path = ".", ...rest] {
2025-12-07 00:40:55 -08:00
ls -t $path ...$rest | insert ext {|row| $row.name | parse "{name}.{ext}" | get ext | get 0? } | sort-by --natural type ext name | reject type ext
2025-03-17 18:09:46 -07:00
}
2025-06-22 21:49:42 -07:00
alias list-automounts = systemctl list-units --type=automount
def remount [] {
2025-12-03 01:44:01 -08:00
let reload = list-automounts | detect columns --guess | drop 5 | get DESCRIPTION | input list --multi
2025-06-22 21:49:42 -07:00
for mount in $reload {
2025-12-03 01:44:01 -08:00
sudo systemctl restart $mount
2025-06-22 21:49:42 -07:00
}
}
2025-10-08 18:29:19 -07:00
def cpedit [file: path] {
mv $file $"($file).sym"; cp $"($file).sym" $file; chmod +w $file
}
2025-10-16 17:25:13 -07:00
alias core-job = job
2025-10-08 18:29:19 -07:00
alias job = job list