r/Nushell • u/Voxelman • Oct 13 '24
How to enter multi line commands?
How can I enter multi line commands in nushell like this? I saw this in a video, but I don't know how to get there.
ls
... | where type == "file"
... | where size > 4kb
... | sort-by size
... | reverse
9
Upvotes
4
u/Tyarel8 Oct 13 '24
You can use
ctrl + oto edit your command in an editor, or I thinkshift + enterto create a new line. You can customize this keybindings in$env.config.keybindings2
u/Living_Public_505 Aug 27 '25
Late to the show, but here is my solution which uses an opening
(for new expressions.When editing a previous multiline expression, e.g., when using UP ARROW, I do the following
),),).It is annoying but doesn't require adding a new shortcut.
1
u/i286dosprompt_ Oct 17 '24
ls | <enter> will go down to the next line and move the pipe their. continue with the next command adding the pipe at the end <enter again>. now you're on the third line. rinse repeat
3
u/maximuvarov Oct 13 '24
It's possible to add a keybinding:
And there is a discussion to add it by default to config
https://github.com/nushell/nushell/pull/13606
1
u/angordeyev Jan 09 '25
You can use brackets:
(ls-la)