Home Explore Blog CI



nushell

4th chunk of `blog/2021-06-01-nushell_0_32.md`
ad29fd873202ea963866f142fd1d494217d682a0e651e0da000000010000085b


## Better line editing support (schrieveslaach, fdncred)

### Partial completions

With 0.32, you can use ctrl+right arrow to do a partial completion from a completion hint.

### Delete word

You can also use alt+backspace to delete whole words.

### And more

For a full list of updated line editing capabilities, check out the update [sample keybinding file](https://github.com/nushell/nushell/blob/main/docs/sample_config/keybindings.yml).

## Explicit block parameters (sophiajt)

You can now name block parameters. You can use this to help make working with blocks easier to read.

```shell
> ls | each { |row| echo $row.name }
```

## `do` supports passing arguments (stepnivik)

You can now pass arguments to give the running block as part of a `do` call:

```shell
> do { |x| $x + 100} 55
155
```

## New `for..in` command (sophiajt)

With the new `for..in` command, you can write more natural iterating loops:

```shell
> for $x in 1..3 { echo ($x + 10) }
───┬────
 0 │ 11
 1 │ 12
 2 │ 13
───┴────
```

## Flags can now use equals (andrasio)

You can now use `=` between a flag and its value.

For example, in addition to:

```shell
> seq --separator ':' 1 10
1:2:3:4:5:6:7:8:9:10
```

You can also write:

```shell
> seq --separator=':' 1 10
1:2:3:4:5:6:7:8:9:10
```

## Other improvements

### Simple string concatenation (sophiajt)

You can now create a new string by concatenating two strings `"hello " + "world"`.

### Path relative-to (kubouch)

Implements path relative-to subcommand. It converts the input path as a relative to the argument path, like this:

```shell
> 'eggs/bacon/sausage/spam' | path relative-to 'eggs/bacon/sausage'
spam
```

There are also additional [`path`-related fixes](https://github.com/nushell/nushell/pull/3441).

### Negative indexing for range (alexshadley)

You can now pass negative ranges to the `range` command, and it will work from the back of the input.

```
> echo [1 2 3 4 5] | range (-3..)
```

Will return `[3, 4, 5]`.

### Default integer is now signed 64-bit (sophiajt)

Title: Nushell Updates: Line Editing, Block Parameters, `do` Arguments, `for..in` Command, and More
Summary
Nushell has been updated with several improvements, including enhanced line editing (partial completions, delete word), explicit block parameters, `do` command support for arguments, a new `for..in` command for natural iterating loops, and the ability to use equals signs between flags and their values. Other improvements include simple string concatenation, path relative-to subcommand, negative indexing for range, and a default signed 64-bit integer.