|
|
|
@ -5505,38 +5505,7 @@ And put these lines in your vimrc: >
|
|
|
|
|
autocmd BufRead,BufNewFile *.[ch] endif
|
|
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
17. Window-local syntax *:ownsyntax*
|
|
|
|
|
|
|
|
|
|
Normally all windows on a buffer share the same syntax settings. It is
|
|
|
|
|
possible, however, to set a particular window on a file to have its own
|
|
|
|
|
private syntax setting. A possible example would be to edit LaTeX source
|
|
|
|
|
with conventional highlighting in one window, while seeing the same source
|
|
|
|
|
highlighted differently (so as to hide control sequences and indicate bold,
|
|
|
|
|
italic etc regions) in another. The 'scrollbind' option is useful here.
|
|
|
|
|
|
|
|
|
|
To set the current window to have the syntax "foo", separately from all other
|
|
|
|
|
windows on the buffer: >
|
|
|
|
|
:ownsyntax foo
|
|
|
|
|
< *w:current_syntax*
|
|
|
|
|
This will set the "w:current_syntax" variable to "foo". The value of
|
|
|
|
|
"b:current_syntax" does not change. This is implemented by saving and
|
|
|
|
|
restoring "b:current_syntax", since the syntax files do set
|
|
|
|
|
"b:current_syntax". The value set by the syntax file is assigned to
|
|
|
|
|
"w:current_syntax".
|
|
|
|
|
Note: This resets the 'spell', 'spellcapcheck', 'spellfile' and 'spelloptions'
|
|
|
|
|
options.
|
|
|
|
|
|
|
|
|
|
Once a window has its own syntax, syntax commands executed from other windows
|
|
|
|
|
on the same buffer (including :syntax clear) have no effect. Conversely,
|
|
|
|
|
syntax commands executed from that window do not affect other windows on the
|
|
|
|
|
same buffer.
|
|
|
|
|
|
|
|
|
|
A window with its own syntax reverts to normal behavior when another buffer
|
|
|
|
|
is loaded into that window or the file is reloaded.
|
|
|
|
|
When splitting the window, the new window will use the original syntax.
|
|
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
18. Color xterms *xterm-color* *color-xterm*
|
|
|
|
|
17. Color xterms *xterm-color* *color-xterm*
|
|
|
|
|
|
|
|
|
|
*colortest.vim*
|
|
|
|
|
To test your color setup, a file has been included in the Vim distribution.
|
|
|
|
@ -5546,7 +5515,7 @@ To use it, execute this command: >
|
|
|
|
|
Nvim uses 256-color and |true-color| terminal capabilities wherever possible.
|
|
|
|
|
|
|
|
|
|
==============================================================================
|
|
|
|
|
19. When syntax is slow *:syntime*
|
|
|
|
|
18. When syntax is slow *:syntime*
|
|
|
|
|
|
|
|
|
|
This is aimed at authors of a syntax file.
|
|
|
|
|
|
|
|
|
|