Credit to @lemnos and all contributors.
Note:
- If using Nupm, or the
<package_root>/themes
directory of this package/repository is in your$env.NU_LIB_DIRS
, then most of the commands below can be run from anywhere on your system. - Otherwise, all examples assume they are run from the
<package_root>/themes
directory.
source nu-themes/<theme>.nu
For example, to use the dracula
theme:
source nu-themes/dracula.nu
The theme should be activated!
Note that these settings are for the current shell only.
Add the command above to your config.nu
file as shown in the Configuration chapter of The Book.
Note that, if not using Nupm or a NU_LIB_DIR
path, you should use the fully qualified path to the themes directory on your system. For example:
source ~/nu_scripts/themes/nu-themes/dracula.nu
Currently, this is done by simply manually listing the contents of the nu-themes
directory:
ls <package_root>/themes/nu-themes
Themes are composed of two parts:
- A Nushell
color_config
record which is used to set$env.config.color_config
- A command to update your terminal's foreground, background, and cursor colors. While this assumes that your terminal supports the appropriate OSC codes, the codes need are very basic and should be supported by most any terminal.
You may wish to set the Nushell color_config
without changing your terminal's colors, or vice-versa. These themes provide additional commands that allow you to accomplish this.
Important: Notice that while the "Basic usage" above uses source
to activate the theme, the following examples import the theme module with a use
statement.
For example, to load and use the tokyo-night
theme's colors without changing the terminal settings:
> use nu-themes/tokyo-night.nu
> tokyo-night
> use nu-themes/tokyo-night.nu
> tokyo-night set color_config
or
> use nu-themes/tokyo-night.nu
> $env.config.color_config = (tokyo-night)
Or you can change the terminal settings to use the theme's foreground/background/cursor colors without changing the Nushell color_config
.
Again, using the tokyo-night
theme as an example:
> use nu-themes/tokyo-night.nu
> tokyo-night update terminal
The parent nu_scripts
package can be installed and updated using Nupm.
-
Install Nupm by following the Nupm instructions
-
Download the
nu_scripts
repositorygit clone https://github.com/nushell/nu_scripts
-
Activate the
nupm
module withuse nupm
-
Install the
nu-scripts
packagenupm install --path --force nu_scripts
Note installing the
nu-scripts
package will installnu-themes
and other modules
Here are screenshots of our themes.