diff --git a/nushell/aliases/pj_aliases.nu b/nushell/aliases/pj_aliases.nu new file mode 100644 index 0000000..fc87197 --- /dev/null +++ b/nushell/aliases/pj_aliases.nu @@ -0,0 +1,19 @@ +alias l = ls +alias ll = ls -l +alias la = ls -a +alias lla = ls -la +alias lh = ls -lh +alias lt = ls -l | sort-by modified | reverse + +alias cdi = cd (ls **/ | get name | str join "\n" | fzf) + +if $env.OS == "Windows_NT" { + +} else { + alias py = python3 +} + +alias weather = curl wttr.in +alias moon = curl wttr.in/Moon +alias quote = curl https://api.quotable.io/random | from json | get content +alias dadjoke = curl -H "Accept: application/json" https://icanhazdadjoke.com/ | from json | get joke diff --git a/nushell/cache/.gitkeep b/nushell/cache/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/nushell/modules/pj.nu b/nushell/modules/pj.nu new file mode 100644 index 0000000..b514753 --- /dev/null +++ b/nushell/modules/pj.nu @@ -0,0 +1,9 @@ +use pj_starship.nu +use pj_zoxide.nu + +export def --env init [] { + # zoxide + pj_zoxide init + # starship + pj_starship init +} diff --git a/nushell/modules/pj_starship.nu b/nushell/modules/pj_starship.nu new file mode 100644 index 0000000..0280771 --- /dev/null +++ b/nushell/modules/pj_starship.nu @@ -0,0 +1,11 @@ +export def --env config [name: string] { + $env.starship_config = ($env.NU_POLYJUICE_PATH | path join ".." "starship" $"starship_($name).toml") +} + +export def --env init [] { + let starship_nushell_path = ($env.NU_POLYJUICE_AUTOLOAD_DIRS | path join "starship.nu") + if ($starship_nushell_path | path exists) { + rm $starship_nushell_path + } + starship init nu | save -f $starship_nushell_path +} diff --git a/nushell/modules/pj_zoxide.nu b/nushell/modules/pj_zoxide.nu new file mode 100644 index 0000000..f8d728b --- /dev/null +++ b/nushell/modules/pj_zoxide.nu @@ -0,0 +1,7 @@ +export def --env init [] { + let zoxide_nushell_path = ($env.NU_POLYJUICE_AUTOLOAD_DIRS | path join "zoxide.nu") + if ($zoxide_nushell_path | path exists) { + rm $zoxide_nushell_path + } + zoxide init nushell --cmd z | save -f $zoxide_nushell_path +} diff --git a/nushell/nu_polyjuice.nu b/nushell/nu_polyjuice.nu new file mode 100644 index 0000000..8be4f45 --- /dev/null +++ b/nushell/nu_polyjuice.nu @@ -0,0 +1,17 @@ +# basic settings +$env.config.show_banner = false + +# Terminal Polyjuice Files's Path +$env.NU_POLYJUICE_PATH = $env.FILE_PWD +$env.NU_POLYJUICE_CACHE_PATH = $env.NU_POLYJUICE_PATH + "/cache" +$env.NU_POLYJUICE_AUTOLOAD_DIRS = ($nu.user-autoload-dirs) + +# modules +use modules/pj.nu +use modules/pj_starship.nu +use modules/pj_zoxide.nu + +source aliases/pj_aliases.nu + +# starship +pj_starship config "default"