repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

nushell: adjust aliases

f0df0325715d864cc8122c6675ee3062051ccbe5

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (1)

+3 / −5 text lines

Diff layout

nushell/modules/aliases.nu

Modified

+3 / −5 text lines

11# Semantic aliases
22export alias show = bat
33export def list [] { ls --all --long --du --mime-type | where type == dir | append (ls --all --long --du --mime-type | where type != dir) }
4export alias web = firefox
4export alias walk = yazi
5export alias browse = firefox
56export alias code = nvim
67export alias edit = nvim --clean
78# TODO ewrite bak command
1011# https://gist.github.com/mullnerz/9fff80593d6b442d5c1b
1112export alias archive = wget -mpck --html-extension --user-agent="" -e robots=off --wait 1 -P .
14# FIXME: README preview does not work (in WSL2)
1315def --env workspace [] {
1416 fd --type directory --max-depth 1 . $env.WORKSPACE | fzf --ansi --preview 'mdcat {}README.md' --preview-window 'up:69%,border-bottom' | cd $in
1517}
1618export alias w = workspace
18export def --env lk [] {
19 cd (walk --icons)
20}
21
2220def open-editor-with-content-search [ initial_query:string = ''] {
2321 rg --color=always --line-number --no-heading --smart-case $initial_query | fzf --ansi --delimiter : --preview 'bat --color=always {1} --highlight-line {2}' --color "hl:-1:underline,hl+:-1:underline:reverse" --preview-window 'up,60%,border-bottom,+{2}+3/3,~3' | parse '{file}:{number}:{line}' | each { nvim -c $in.number -c $"?\\V($in.line | str trim )" $in.file }