feat: add sed
-remove-newlines abbreviation
#835
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this version of the
sed
command:!
),1 obviating the need to modify$LBUFFER
2\n
is saved here as\\n
)3 so that when printed to the console, the newline recipe appears correctly as\n
4 rather than as a mid-command linebreak5Footnotes
sed -e ':a' -e 'N' -e '$! b a' -e 's/\n//g'
performs the same task, but uses an exclamation point (!
), which requires modifying$LBUFFER
2 ↩olets/zsh-abbr #84 ↩ ↩2
abbr -g "sed -n 'H;${x;s/\\n//gp;}'"
↩sed -n 'H;${x;s/\n//gp;}'
↩sed -n 'H;${x;s/⏎//gp;}' # such that ⏎ is a literal newline
↩