aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/usr_30.txt
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
commit931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch)
treed8c1843a95da5ea0bb4acc09f7e37843d9995c86 /runtime/doc/usr_30.txt
parent142d9041391780ac15b89886a54015fdc5c73995 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-userreg.tar.gz
rneovim-userreg.tar.bz2
rneovim-userreg.zip
Merge remote-tracking branch 'upstream/master' into userreguserreg
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':