diff --git a/doc/nano.texi b/doc/nano.texi
index ac6149114c5aae3d56f3b46b46b0a35b085ccd95..ac68b4b2c5f1251c854c27901f41307682ebefb8 100644
--- a/doc/nano.texi
+++ b/doc/nano.texi
@@ -753,9 +753,6 @@ And either @var{fgcolor} or ,@var{bgcolor} may be left out.
 Save the last hundred search strings and replacement strings and
 executed commands, so they can be easily reused in later sessions.
 
-@item set justifytrim
-When justifying text, trailing whitespace will automatically be removed.
-
 @item set keycolor @var{fgcolor},@var{bgcolor}
 Use this color combination for the shortcut key combos
 in the two help lines at the bottom of the screen.
@@ -899,6 +896,10 @@ Save automatically on exit, don't prompt.
 Use this color combination for the title bar.
 @xref{@code{set functioncolor}} for valid color names.
 
+@item set trimblanks
+Remove trailing whitespace from wrapped lines when automatic
+hard-wrapping occurs or when text is justified.
+
 @item set unix
 Save a file by default in Unix format.  This overrides nano's
 default behavior of saving a file in the format that it had.
diff --git a/doc/nanorc.5 b/doc/nanorc.5
index 25277a5e1f70fd3d983d2c2448da5cc2abac5c6a..1b05a28775cfbce5f9370a030cbfa3d6e04d0077 100644
--- a/doc/nanorc.5
+++ b/doc/nanorc.5
@@ -118,9 +118,6 @@ See \fBset titlecolor\fR for more details.
 Save the last hundred search strings and replacement strings and
 executed commands, so they can be easily reused in later sessions.
 .TP
-.B set justifytrim
-When justifying text, trailing whitespace will automatically be removed.
-.TP
 .B set keycolor \fIfgcolor\fR,\fIbgcolor\fR
 Specify the color combination to use for the shortcut key combos
 in the two help lines at the bottom of the screen.
@@ -269,6 +266,10 @@ Valid names for the foreground and background colors are:
 The name of the foreground color may be prefixed with \fBbright\fR.
 And either "\fIfgcolor\fR" or ",\fIbgcolor\fR" may be left out.
 .TP
+.B set trimblanks
+Remove trailing whitespace from wrapped lines when automatic
+hard-wrapping occurs or when text is justified.
+.TP
 .B set unix
 Save a file by default in Unix format.  This overrides nano's
 default behavior of saving a file in the format that it had.
diff --git a/doc/sample.nanorc.in b/doc/sample.nanorc.in
index 7f6218c569618d281aff6917f53160713866f4eb..77744ba50b1441dce87bf22fbaa176d591dc5db0 100644
--- a/doc/sample.nanorc.in
+++ b/doc/sample.nanorc.in
@@ -57,9 +57,6 @@
 ## Remember the used search/replace strings for the next session.
 # set historylog
 
-## Make the justify command kill whitespace at the end of lines.
-# set justifytrim
-
 ## Display line numbers to the left of the text.
 # set linenumbers
 
@@ -175,6 +172,9 @@
 ## Save automatically on exit; don't prompt.
 # set tempfile
 
+## Snip whitespace at the end of lines when justifying or hard-wrapping.
+# set trimblanks
+
 ## Disallow file modification.  Why would you want this in an rcfile? ;)
 # set view
 
diff --git a/src/nano.h b/src/nano.h
index 3343b9a4f73d673bac70e03d95611b1435fbeae7..7ce36646b64710df8ece8cda3e8ceca7b328f84b 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -527,7 +527,7 @@ enum
     LOCKING,
     NOREAD_MODE,
     MAKE_IT_UNIX,
-    JUSTIFY_TRIM,
+    TRIM_BLANKS,
     SHOW_CURSOR,
     LINE_NUMBERS,
     NO_PAUSES,
diff --git a/src/rcfile.c b/src/rcfile.c
index 7a619c31651d69deaff22bcfcace2a03c0bf2019..6d5433151e567f72bfd2d0a2834d69e0fb7dd179 100644
--- a/src/rcfile.c
+++ b/src/rcfile.c
@@ -96,7 +96,7 @@ static const rcoption rcopts[] = {
     {"casesensitive", CASE_SENSITIVE},
     {"cut", CUT_FROM_CURSOR},  /* deprecated form, remove in 2020 */
     {"cutfromcursor", CUT_FROM_CURSOR},
-    {"justifytrim", JUSTIFY_TRIM},
+    {"justifytrim", TRIM_BLANKS},  /* deprecated form, remove in 2020 */
     {"locking", LOCKING},
     {"matchbrackets", 0},
     {"noconvert", NO_CONVERT},
@@ -106,6 +106,7 @@ static const rcoption rcopts[] = {
     {"smooth", SMOOTH_SCROLL},
     {"softwrap", SOFTWRAP},
     {"tabstospaces", TABS_TO_SPACES},
+    {"trimblanks", TRIM_BLANKS},
     {"unix", MAKE_IT_UNIX},
     {"whitespace", 0},
     {"wordbounds", WORD_BOUNDS},
diff --git a/src/text.c b/src/text.c
index b1b1727ca7948a663f2743cab13397147299c3c1..b5ba75e6f98509aee05de8390cc871aca73b3dfd 100644
--- a/src/text.c
+++ b/src/text.c
@@ -1642,7 +1642,7 @@ bool do_wrap(filestruct *line)
     openfile->current_x = wrap_loc;
 
     /* When requested, snip trailing blanks off the wrapped line. */
-    if (ISSET(JUSTIFY_TRIM)) {
+    if (ISSET(TRIM_BLANKS)) {
 	size_t cur_x = move_mbleft(line->data, wrap_loc);
 
 	while (is_blank_mbchar(line->data + cur_x)) {
@@ -2414,7 +2414,7 @@ void do_justify(bool full_justify)
 	    }
 #endif
 	    /* When requested, snip all trailing blanks. */
-	    if (ISSET(JUSTIFY_TRIM)) {
+	    if (ISSET(TRIM_BLANKS)) {
 		while (break_pos > 0 &&
 			is_blank_mbchar(&openfile->current->data[break_pos - 1])) {
 		    break_pos--;
diff --git a/syntax/nanorc.nanorc b/syntax/nanorc.nanorc
index 89153eda00896bea69fbc46aea6b15ce18f0fe78..9882d6b0f95c080aa7327903792bf49dc4f78cf2 100644
--- a/syntax/nanorc.nanorc
+++ b/syntax/nanorc.nanorc
@@ -7,7 +7,7 @@ comment "#"
 icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|comment|linter|formatter|i?color|extendsyntax).*$"
 
 # Keywords
-icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|atblanks|autoindent|backup|backwards|boldtext|casesensitive|constantshow|cutfromcursor|fill[[:space:]]+-?[[:digit:]]+|historylog|justifytrim|linenumbers|locking|morespace|mouse|multibuffer|noconvert|nohelp|nopauses|nonewlines|nowrap|positionlog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|showcursor|smarthome|smooth|softwrap|suspend|tabsize[[:space:]]+[1-9][0-9]*|tabstospaces|tempfile|unix|view|wordbounds)\>"
+icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|atblanks|autoindent|backup|backwards|boldtext|casesensitive|constantshow|cutfromcursor|fill[[:space:]]+-?[[:digit:]]+|historylog|linenumbers|locking|morespace|mouse|multibuffer|noconvert|nohelp|nopauses|nonewlines|nowrap|positionlog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|showcursor|smarthome|smooth|softwrap|suspend|tabsize[[:space:]]+[1-9][0-9]*|tabstospaces|tempfile|trimblanks|unix|view|wordbounds)\>"
 icolor yellow "^[[:space:]]*set[[:space:]]+((function|key|number|selected|status|title)color)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
 icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|functioncolor|keycolor|matchbrackets|numbercolor|operatingdir|punct|quotestr|selectedcolor|speller|statuscolor|titlecolor|whitespace|wordchars)[[:space:]]+"
 icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^([[:alpha:]]|[]0-9\^_]|Space)|M-([[:alpha:]]|[]!"#$%&'()*+,./0-9:;<=>?@\^_`{|}~-]|Space))|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]+(all|main|search|replace(with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)([[:space:]]+#|[[:space:]]*$)"