Skip to content

Instantly share code, notes, and snippets.

View fdncred's full-sized avatar

Darren Schroeder fdncred

View GitHub Profile
@fdncred
fdncred / config_loading.md
Last active October 23, 2024 22:35
nushell config file loading

Config file loading rules

  1. default_config.nu and default_env.nu refer to the files that are compiled inside of the nushell executable and are also located in our repo.
  2. personal env.nu/config.nu/login.nu refer to the files that are in the $nu.default-config-dir that you have personally edited.
  3. specified config.nu/env.nu refer to files that are specified on the command line with the --config and --env-config command line parameters.

nu

  • ✅ Always reads the nushell standard library
  • ✅ Always reads personal plugin.msgpackz file if it exists
@fdncred
fdncred / nushell-stdin.md
Last active February 16, 2024 08:16
nushell stdin redesign

Nushell stdin redesign

From Ian on Discord

run interactive repl
  nu

execute commands before interactive repl:
 nu -e "commands"
@fdncred
fdncred / nushell_bashisms.md
Last active April 15, 2024 14:22
nushell bashisms

Bashisms

What is a bashism

A bashism is a command, operator, or syntax in the repl that most people associate with bash.

What bashisms does Nushell support?

Bang Bang syntax

@fdncred
fdncred / editor_motions.md
Last active April 20, 2024 12:50
editor motions

Key combinations

Hover / Tooltip

Vscode

Just put your cursor over the text, use mouse to scroll text

Neovim

@fdncred
fdncred / memory-perf.md
Last active May 7, 2024 12:49
memory perf

Nushell Memory Utilization

2023-08-29 07:13:21.667983800 -05:00

 let before = (sys).mem.used
 $before
9,382,694,912
 mut csv = open ~\OneDrive\vdi\DBScripts\Output\violations-20220731-20230801.csv
 $csv | length
1046339
@fdncred
fdncred / pr.nu
Created July 18, 2024 15:33
rich_in_nu
# emulate the python rich print
# test case 1: pr "hello world"
# test case 2: pr "hello world" --style bold
# test case 3: pr "hello world" --style 'bold underline'
# test case 4: pr "hello world" --style 'dim italic red'
def pr [
msg,
--style: string,
] {
let style = if $style == null {