dotfiles/nushell/config.nu

69 lines
1.6 KiB
Plaintext
Raw Normal View History

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
}
# 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] {
builtin_ls -a (if $dir == null { "" } else { $dir }) | sort-by type name -i
}
def ll [dir?: string] {
builtin_ls (if $dir == null { "" } else { $dir }) | sort-by type name -i
}
# cool df
2023-11-07 15:48:00 +01:00
def df [] {
^df -h
2023-11-07 17:53:57 +01:00
| str replace "Sys. de fichiers" "@1"
| str replace "Monté sur" "@2"
2023-11-07 15:48:00 +01:00
| detect columns
2023-11-07 17:53:57 +01:00
| rename "Sys. de fichiers" "Taille" "Utilisé" "Dispo" "Uti%" "Monté sur"
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