Skip to content

Commit e275fbb

Browse files
authored
add abbreviations section (#2182)
1 parent 3ead759 commit e275fbb

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

book/line_editor.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,3 +821,23 @@ $env.config.keybindings ++= [
821821
}
822822
]
823823
```
824+
825+
## Abbreviations
826+
827+
Reedline abbreviations are a convenient way to expand a command into a
828+
different command that is often longer and/or more complex. This is similiar to
829+
an `alias` with two main exceptions: (1) the expanded command is what gets
830+
stored to history, (2) the expanded command can be edited before being used.
831+
832+
Abbreviations are expanded on `space` or `enter` and you can add them to your config
833+
like this
834+
835+
```nushell
836+
$env.config.abbreviations = {
837+
ll: ls -l
838+
gs: git status
839+
ptop: ps | sort-by cpu -r | first 15
840+
}
841+
```
842+
843+
You can see the currently active abbreviations with `abbr list`

0 commit comments

Comments
 (0)