80 lines
1.8 KiB
Plaintext
80 lines
1.8 KiB
Plaintext
source ~/.config/nushell/init.nu
|
|
|
|
# Change default config
|
|
$env.config.cursor_shape = {
|
|
emacs: block
|
|
vi_insert: block
|
|
vi_normal: underscore
|
|
}
|
|
|
|
$env.config.history = {
|
|
max_size: 100_000_000_000_000
|
|
sync_on_enter: true
|
|
file_format: "sqlite"
|
|
isolation: false
|
|
}
|
|
|
|
$env.config.filesize = {
|
|
metric: false
|
|
format: "auto"
|
|
}
|
|
|
|
# ls aliases
|
|
alias builtin_ls = ls
|
|
|
|
def l [dir?: string] {
|
|
builtin_ls (if $dir == null { "" } else { $dir }) | sort-by type name -i | grid -c
|
|
}
|
|
|
|
def ls [dir?: string] {
|
|
builtin_ls (if $dir == null { "" } else { $dir }) | sort-by type name -i | grid -c
|
|
}
|
|
|
|
def la [dir?: string] {
|
|
builtin_ls -al (if $dir == null { "" } else { $dir }) | sort-by type name -i | select mode name target user size modified
|
|
}
|
|
|
|
def ll [dir?: string] {
|
|
builtin_ls -l (if $dir == null { "" } else { $dir }) | sort-by type name -i | select name type target user size modified
|
|
}
|
|
|
|
# cool df
|
|
def df [] {
|
|
^df -h
|
|
| str replace "Mounted on" "@"
|
|
| detect columns
|
|
| rename "Filesystem" "Size" "Used" "Avail" "Use%" "Mounted on"
|
|
}
|
|
|
|
# vim aliases
|
|
alias v = nvim
|
|
|
|
# git aliases
|
|
alias g = git
|
|
alias ga = git add
|
|
alias gaa = git add --all
|
|
alias gco = git checkout
|
|
alias gcb = git checkout -b
|
|
alias gc = git commit --verbose
|
|
alias gca = git commit --verbose --all
|
|
alias gd = git diff
|
|
alias glog = git log --oneline --decorate --graph
|
|
alias gl = git pull
|
|
alias gp = git push
|
|
alias gst = git status
|
|
alias gs = git status
|
|
def gpsup [] { git push --set-upstream origin (git rev-parse --abbrev-ref HEAD) }
|
|
|
|
# Useful aliases
|
|
alias :q = exit
|
|
alias pdf = evince
|
|
alias u = update
|
|
alias rg = rg -uu
|
|
alias p = pass
|
|
alias pc = pass --clip
|
|
export def-env mkcd [dir: string] { mkdir $dir; cd $dir }
|
|
export def-env cdg [key: string] { cd (CLICOLOR_FORCE=1 pgd $key) }
|
|
|
|
# Start tfetch
|
|
tfetch
|