/nushell-config

Nushell configuration files

Primary LanguageNushell

Installation

  1. Make a fork of this repository

    The nushell APIs are unstable and break things often. I don't keep up with the latest nushell release so sometimes things will be broken because they are out-of-date. Or I may update to a new version that won't work for you.

  2. Clone this repository to a directory like ~/.config/nu

    NOT ~/.config/nushell. This does not replace config.nu nor env.nu nor any of the other default files

  3. Run git submodule update --init --recursive to load nupm

  4. Edit your env.nu to add ~/.config/nu to your $env.NU_LIB_DIRS

    Your env.nu lives next to config.nu which you can edit with config nu, then use your editor tools to switch to the other file. Also, $env.NU_LIB_DIRS | first | path dirname | path join "env.nu" should be the path to your env.nu

  5. Edit your config.nu and add source init.nu to the bottom

    This loads the init.nu from this repository.

  6. Start a new nu instance

    A command like help ssh should show nushell-format help for the ssh command. This indicates everything loaded correctly.

Support

I don't update to the latest nushell consistently so things may be broken or out of date.

This repository is updated to at least nushell 0.94.0

Commands

For commands I use frequently I've created enhanced completions and wrappers that provide tables, lists, and records as output instead of the plain-text forms. Not all commands are fully-wrapped.

Wrappers

Supporting the above commands are some wrappers that are not loaded as shell commands by default. They're designed for supporting the commands listed above so they are neither named nor namespaced in a friendly way.

One you have $env.NU_LIB_DIRS set up you can load the wrappers from scripts (or into your shell):

# Load all `export`ed items from wrapper/ssh.nu
use wrapper ssh *

# Load only the listed items from wrapper/tmux.nu
use wrapper tmux [environment update-environment]

# Load only list_dependencies from wrapper/cargo.nu
use wrapper cargo list_dependencies

For more information see the nushell module documentation