Skip to content

Instantly share code, notes, and snippets.

@amtoine
Created April 12, 2023 16:57
Show Gist options
  • Save amtoine/4c748237ccd09a4ad745ed46d87fea3d to your computer and use it in GitHub Desktop.
Save amtoine/4c748237ccd09a4ad745ed46d87fea3d to your computer and use it in GitHub Desktop.
make a system alias

make a system alias

you can make a "system alias" with the following nushell snippet

(
    let command = (which batcat | get path.0);
    sudo cp $command ($command | path dirname | path join "bat")
) | ignore

this will copy the batcat command and make it a bat clone in the same directory as batcat. that can be useful on ubuntu for instance where the binary is called batcat, which conflicts with an arch-based config, which uses bat 😋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment