setsyntax : Set options specific for the syntax group under cursor
script karma |
Rating 0/0,
Downloaded by 1769 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Tom Link |
|
script type |
utility |
|
description |
This plugin sets options/variables according to the syntax under the
cursor. It was originally created in response to
http://groups.google.com/group/vim_use/browse_frm/thread/ff624d5a68f0a562
and to solve a similar problem. While this plugin solves that other
related problem it doesn't seem to work properly for tex files.
Configuration:
g:setsyntax_options (default: {})
This variable is a dictionary of dictionaries of dictionaries.
{FILETYPE => {SYNREGEXP => {OPTION/VARIABLE: VALUE}}}
Example:
let g:setsyntax_options['tex'] = {'^texMathZone': {'&l:tw': 0}}
:SetSyntax SYNTAX,... VAR VALUE ...
:SetSyntax /REGEXP/ VAR VALUE ...
Set syntax-specific options for the current buffer. When using a
REGEXP, the syntax names have to be already defined, i.e. you can use
the REGEXP only after the syntax file was loaded.
VAR must be a variable name (see |:let| and |:let-&| for details).
I.e., if you want to set a option, e.g. spelllang, don't use
SetSyntax /^texMath/ spelllang ""
but instead use:
SetSyntax /^texMath/ &l:spelllang ""
VALUE actually is an expression that will be evaluated when setting
the variable.
NOTE: Blanks in VALUE must be escaped with a backslash. See the help
page on <f-args> for details.
|
|
install details |
Edit the vba file and type: >
:so %
See :help vimball for details. If you have difficulties or use vim 7.0,
please make sure, you have the current version of vimball (vimscript
#1502) installed.
This script requires hookcursormoved (vimscript #2037) and tlib
(vimscript #1863) to be installed.
Also available via git
http://github.com/tomtom/setsyntax_vim |
|
script versions (upload new version)
Click on the package to download.
ip used for rating: 142.132.191.50
|