Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
startup: treat stdin as input instead of commands
Treat stdin as input by default (so the "-" file is not needed): echo foo | nvim It works even if file args are given: echo foo | nvim file1.txt file2.txt When you want to execute commands, use `-s -` instead: echo ifoo | nvim -s - Why? Because: - Execution of input is (1) almost always unintentional/confusing, and (2) potentially destructive. - Avoids the need for time-delayed warning. #7659 - The *common* case is to open text in a buffer, not send commands. Other alternatives for executing commands: - Replay a register. E.g. the following mostly works, except @q aborts on any "beep" (e.g. if the cursor can't move). nvim -c '%d q|norm @q' - - Future: Let `:%source` work with unsaved buffer contents? closes #2087 closes #7659
- Loading branch information
Showing
2 changed files
with
70 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters