Mercurial > vim
comparison runtime/doc/change.txt @ 14519:5c5908e81e93
Update runtime files.
commit https://github.com/vim/vim/commit/d473c8c101262702ea9eeb14907ee20a786942b2
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 11 18:00:22 2018 +0200
Update runtime files.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 11 Aug 2018 18:15:06 +0200 |
parents | 0a69e6e708f9 |
children | 40ef13331e02 |
comparison
equal
deleted
inserted
replaced
14518:f05e63d1d2e0 | 14519:5c5908e81e93 |
---|---|
1445 to the name of an external program for Vim to use for text formatting. The | 1445 to the name of an external program for Vim to use for text formatting. The |
1446 'textwidth' and other options have no effect on formatting by an external | 1446 'textwidth' and other options have no effect on formatting by an external |
1447 program. | 1447 program. |
1448 | 1448 |
1449 *format-formatexpr* | 1449 *format-formatexpr* |
1450 The 'formatexpr' option can be set to a Vim Script function that performs | 1450 The 'formatexpr' option can be set to a Vim script function that performs |
1451 reformatting of the buffer. This should usually happen in an |ftplugin|, | 1451 reformatting of the buffer. This should usually happen in an |ftplugin|, |
1452 since formatting is highly dependent on the type of file. It makes | 1452 since formatting is highly dependent on the type of file. It makes |
1453 sense to use an |autoload| script, so the corresponding script is only loaded | 1453 sense to use an |autoload| script, so the corresponding script is only loaded |
1454 when actually needed and the script should be called <filetype>format.vim. | 1454 when actually needed and the script should be called <filetype>format.vim. |
1455 | 1455 |
1479 return 0 | 1479 return 0 |
1480 endfunc | 1480 endfunc |
1481 | 1481 |
1482 You can then enable the formatting by executing: > | 1482 You can then enable the formatting by executing: > |
1483 setlocal formatexpr=format#Format() | 1483 setlocal formatexpr=format#Format() |
1484 > | 1484 |
1485 Note: this function explicitly returns non-zero when called from insert mode | 1485 Note: this function explicitly returns non-zero when called from insert mode |
1486 (which basically means, text is inserted beyond the 'textwidth' limit). This | 1486 (which basically means, text is inserted beyond the 'textwidth' limit). This |
1487 causes Vim to fall back to reformat the text by using the internal formatter. | 1487 causes Vim to fall back to reformat the text by using the internal formatter. |
1488 | 1488 |
1489 However, if the |gq| command is used to reformat the text, the function | 1489 However, if the |gq| command is used to reformat the text, the function |