2023-11-07 15:48:00 +01:00
|
|
|
source ~/.config/nushell/init.nu
|
2023-11-07 14:26:22 +01:00
|
|
|
|
2023-11-07 17:53:57 +01:00
|
|
|
# Change default config
|
|
|
|
$env.config.cursor_shape = {
|
|
|
|
emacs: block
|
|
|
|
vi_insert: block
|
|
|
|
vi_normal: underscore
|
|
|
|
}
|
|
|
|
|
2023-11-07 18:27:51 +01:00
|
|
|
$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"
|
|
|
|
}
|
|
|
|
|
2023-11-07 17:53:57 +01:00
|
|
|
# ls aliases
|
2023-11-07 14:26:22 +01:00
|
|
|
alias builtin_ls = ls
|
|
|
|
|
2023-11-07 17:53:57 +01:00
|
|
|
def l [dir?: string] {
|
|
|
|
builtin_ls (if $dir == null { "" } else { $dir }) | sort-by type name -i | grid -c
|
2023-11-07 14:26:22 +01:00
|
|
|
}
|
|
|
|
|
2023-11-07 17:53:57 +01:00
|
|
|
def ls [dir?: string] {
|
|
|
|
builtin_ls (if $dir == null { "" } else { $dir }) | sort-by type name -i | grid -c
|
2023-11-07 14:26:22 +01:00
|
|
|
}
|
2023-11-07 15:48:00 +01:00
|
|
|
|
2023-11-07 17:53:57 +01:00
|
|
|
def la [dir?: string] {
|
2023-11-07 18:27:51 +01:00
|
|
|
builtin_ls -al (if $dir == null { "" } else { $dir }) | sort-by type name -i | select mode name target user size modified
|
2023-11-07 17:53:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
def ll [dir?: string] {
|
2023-11-07 18:27:51 +01:00
|
|
|
builtin_ls -l (if $dir == null { "" } else { $dir }) | sort-by type name -i | select name type target user size modified
|
2023-11-07 17:53:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# cool df
|
2023-11-07 15:48:00 +01:00
|
|
|
def df [] {
|
|
|
|
^df -h
|
2023-11-07 18:27:51 +01:00
|
|
|
| str replace "Mounted on" "@"
|
2023-11-07 15:48:00 +01:00
|
|
|
| detect columns
|
2023-11-07 18:27:51 +01:00
|
|
|
| rename "Filesystem" "Size" "Used" "Avail" "Use%" "Mounted on"
|
2023-11-07 15:48:00 +01:00
|
|
|
}
|
|
|
|
|
2023-11-07 17:53:57 +01:00
|
|
|
# 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
|