Skip to content

Commit

Permalink
Replace use of tr(1) with awk(1).
Browse files Browse the repository at this point in the history
Unfortunately, GNU tr(1) is not Unicode-aware,
so we should use awk(1) instead. See
https://www.pixelbeat.org/docs/coreutils_i18n/ for more on the
situation of the support of Unicode in coreutils.

Apparently, awk is for this better than sed, because Unicode is
consistenly provided on all major versions of awk.

Signed-off-by: Matěj Cepl <mcepl@cepl.eu>
Supersedes: https://lists.sr.ht/~martanne/devel/patches/49113
Supersedes: https://lists.sr.ht/~martanne/devel/patches/49114
  • Loading branch information
mcepl authored and rnpnr committed Feb 6, 2024
1 parent 34e6962 commit d3e4af1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config.def.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ static const KeyBinding bindings_operators[] = {
{ "c", ACTION(OPERATOR_CHANGE) },
{ "d", ACTION(OPERATOR_DELETE) },
{ "g~", ALIAS(":|tr '[:lower:][:upper:]' '[:upper:][:lower:]'<Enter>") },
{ "gu", ALIAS(":|tr '[:upper:]' '[:lower:]'<Enter>")},
{ "gU", ALIAS(":|tr '[:lower:]' '[:upper:]'<Enter>")},
{ "gu", ALIAS(":|awk '{printf \"%s\", tolower($0)}'<Enter>")},
{ "gU", ALIAS(":|awk '{printf \"%s\", toupper($0)}'<Enter>")},
{ "p", ACTION(PUT_AFTER) },
{ "P", ACTION(PUT_BEFORE) },
{ "y", ACTION(OPERATOR_YANK) },
Expand Down

0 comments on commit d3e4af1

Please sign in to comment.