aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/usr_30.txt
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /runtime/doc/usr_30.txt
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-aucmd_textputpost.tar.gz
rneovim-aucmd_textputpost.tar.bz2
rneovim-aucmd_textputpost.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'runtime/doc/usr_30.txt')
-rw-r--r--runtime/doc/usr_30.txt40
1 files changed, 20 insertions, 20 deletions
diff --git a/runtime/doc/usr_30.txt b/runtime/doc/usr_30.txt
index 7e7b3b21f4..a0d22482c3 100644
--- a/runtime/doc/usr_30.txt
+++ b/runtime/doc/usr_30.txt
@@ -517,12 +517,12 @@ The other way around works just as well: >
One of the great things about Vim is that it understands comments. You can
ask Vim to format a comment and it will do the right thing.
- Suppose, for example, that you have the following comment:
+ Suppose, for example, that you have the following comment: >c
- /* ~
- * This is a test ~
- * of the text formatting. ~
- */ ~
+ /*
+ * This is a test
+ * of the text formatting.
+ */
You then ask Vim to format it by positioning the cursor at the start of the
comment and type: >
@@ -530,33 +530,33 @@ comment and type: >
gq]/
"gq" is the operator to format text. "]/" is the motion that takes you to the
-end of a comment. The result is:
+end of a comment. The result is: >c
- /* ~
- * This is a test of the text formatting. ~
- */ ~
+ /*
+ * This is a test of the text formatting.
+ */
Notice that Vim properly handled the beginning of each line.
An alternative is to select the text that is to be formatted in Visual mode
and type "gq".
To add a new line to the comment, position the cursor on the middle line and
-press "o". The result looks like this:
+press "o". The result looks like this: >c
- /* ~
- * This is a test of the text formatting. ~
- * ~
- */ ~
+ /*
+ * This is a test of the text formatting.
+ *
+ */
Vim has automatically inserted a star and a space for you. Now you can type
the comment text. When it gets longer than 'textwidth', Vim will break the
-line. Again, the star is inserted automatically:
+line. Again, the star is inserted automatically: >c
- /* ~
- * This is a test of the text formatting. ~
- * Typing a lot of text here will make Vim ~
- * break ~
- */ ~
+ /*
+ * This is a test of the text formatting.
+ * Typing a lot of text here will make Vim
+ * break
+ */
For this to work some flags must be present in 'formatoptions':