Mercurial > vim
comparison runtime/doc/syntax.txt @ 7687:61354fabf8a2 v7.4.1142
commit https://github.com/vim/vim/commit/b8060fe862f684b591f9ac679eac5b2594d6c5a0
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 19 22:29:28 2016 +0100
patch 7.4.1142
Problem: Cannot define keyword characters for a syntax file.
Solution: Add the ":syn iskeyword" command. (Christian Brabandt)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 19 Jan 2016 22:30:07 +0100 |
parents | aea5ebf352c4 |
children | ca19726d5e83 |
comparison
equal
deleted
inserted
replaced
7686:fad587cb360a | 7687:61354fabf8a2 |
---|---|
1 *syntax.txt* For Vim version 7.4. Last change: 2015 Dec 19 | 1 *syntax.txt* For Vim version 7.4. Last change: 2016 Jan 19 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
3436 |spell-syntax|. When there is no @Spell and no @NoSpell cluster then | 3436 |spell-syntax|. When there is no @Spell and no @NoSpell cluster then |
3437 spell checking is done for "default" and "toplevel". | 3437 spell checking is done for "default" and "toplevel". |
3438 | 3438 |
3439 To activate spell checking the 'spell' option must be set. | 3439 To activate spell checking the 'spell' option must be set. |
3440 | 3440 |
3441 SYNTAX ISKEYWORD SETTING *:syn-iskeyword* | |
3442 | |
3443 :sy[ntax] iskeyword [clear | {option}] | |
3444 This defines the keyword characters. It's like the 'iskeyword' option | |
3445 for but only applies to syntax highlighting. | |
3446 | |
3447 clear: Syntax specific iskeyword setting is disabled and the | |
3448 buffer-local 'iskeyword' setting is used. | |
3449 {option} Set the syntax 'iskeyword' option to a new value. | |
3450 | |
3451 Example: > | |
3452 :syntax iskeyword @,48-57,192-255,$,_ | |
3453 < | |
3454 This would set the syntax specific iskeyword option to include all | |
3455 alphabetic characters, plus the numeric characters, all accented | |
3456 characters and also includes the "_" and the "$". | |
3457 | |
3458 If no argument is given, the current value will be output. | |
3459 | |
3460 Setting this option influences what |/\k| matches in syntax patterns | |
3461 and also determines where |:syn-keywords| will be checked for a new | |
3462 match. | |
3463 | |
3464 It is recommended when writing syntax files, to use this command | |
3465 to the correct value for the specific syntax language and not change | |
3466 the 'iskeyword' option. | |
3441 | 3467 |
3442 DEFINING KEYWORDS *:syn-keyword* | 3468 DEFINING KEYWORDS *:syn-keyword* |
3443 | 3469 |
3444 :sy[ntax] keyword {group-name} [{options}] {keyword} .. [{options}] | 3470 :sy[ntax] keyword {group-name} [{options}] {keyword} .. [{options}] |
3445 | 3471 |
3467 Don't forget that a keyword can only be recognized if all the | 3493 Don't forget that a keyword can only be recognized if all the |
3468 characters are included in the 'iskeyword' option. If one character | 3494 characters are included in the 'iskeyword' option. If one character |
3469 isn't, the keyword will never be recognized. | 3495 isn't, the keyword will never be recognized. |
3470 Multi-byte characters can also be used. These do not have to be in | 3496 Multi-byte characters can also be used. These do not have to be in |
3471 'iskeyword'. | 3497 'iskeyword'. |
3498 See |:syn-iskeyword| for defining syntax specific iskeyword settings. | |
3472 | 3499 |
3473 A keyword always has higher priority than a match or region, the | 3500 A keyword always has higher priority than a match or region, the |
3474 keyword is used if more than one item matches. Keywords do not nest | 3501 keyword is used if more than one item matches. Keywords do not nest |
3475 and a keyword can't contain anything else. | 3502 and a keyword can't contain anything else. |
3476 | 3503 |