mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
vim-patch:partial:6ebe4f970b8b (#20860)
Update runtime files
6ebe4f970b
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
parent
356244d50b
commit
6884f017b5
@ -712,6 +712,9 @@ func! tohtml#GetUserSettings() "{{{
|
||||
call tohtml#GetOption(user_settings, 'no_foldcolumn', user_settings.ignore_folding)
|
||||
call tohtml#GetOption(user_settings, 'hover_unfold', 0 )
|
||||
call tohtml#GetOption(user_settings, 'no_pre', 0 )
|
||||
call tohtml#GetOption(user_settings, 'no_doc', 0 )
|
||||
call tohtml#GetOption(user_settings, 'no_links', 0 )
|
||||
call tohtml#GetOption(user_settings, 'no_modeline', 0 )
|
||||
call tohtml#GetOption(user_settings, 'no_invalid', 0 )
|
||||
call tohtml#GetOption(user_settings, 'whole_filler', 0 )
|
||||
call tohtml#GetOption(user_settings, 'use_xhtml', 0 )
|
||||
@ -752,7 +755,7 @@ func! tohtml#GetUserSettings() "{{{
|
||||
|
||||
" pre_wrap doesn't do anything if not using pre or not using CSS
|
||||
if user_settings.no_pre || !user_settings.use_css
|
||||
let user_settings.pre_wrap=0
|
||||
let user_settings.pre_wrap = 0
|
||||
endif
|
||||
"}}}
|
||||
|
||||
|
@ -1198,11 +1198,9 @@ col({expr}) The result is a Number, which is the byte index of the column
|
||||
buffer.
|
||||
For the cursor position, when 'virtualedit' is active, the
|
||||
column is one higher if the cursor is after the end of the
|
||||
line. This can be used to obtain the column in Insert mode: >
|
||||
:imap <F2> <C-O>:let save_ve = &ve<CR>
|
||||
\<C-O>:set ve=all<CR>
|
||||
\<C-O>:echo col(".") .. "\n" <Bar>
|
||||
\let &ve = save_ve<CR>
|
||||
line. Also, when using a <Cmd> mapping the cursor isn't
|
||||
moved, this can be used to obtain the column in Insert mode: >
|
||||
:imap <F2> <Cmd>echo col(".")<CR>
|
||||
|
||||
< Can also be used as a |method|: >
|
||||
GetPos()->col()
|
||||
|
@ -1,70 +1,70 @@
|
||||
*ft_rust.txt* For Vim version 8.1. Last change: 2017 Nov 02
|
||||
*ft_rust.txt* Nvim
|
||||
|
||||
This is documentation for the Rust filetype plugin.
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *rust*
|
||||
CONTENTS *rust*
|
||||
|
||||
1. Introduction |rust-intro|
|
||||
2. Settings |rust-settings|
|
||||
3. Commands |rust-commands|
|
||||
4. Mappings |rust-mappings|
|
||||
1. Introduction |rust-intro|
|
||||
2. Settings |rust-settings|
|
||||
3. Commands |rust-commands|
|
||||
4. Mappings |rust-mappings|
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *rust-intro*
|
||||
INTRODUCTION *rust-intro*
|
||||
|
||||
This plugin provides syntax and supporting functionality for the Rust
|
||||
filetype.
|
||||
|
||||
==============================================================================
|
||||
SETTINGS *rust-settings*
|
||||
SETTINGS *rust-settings*
|
||||
|
||||
This plugin has a few variables you can define in your vimrc that change the
|
||||
behavior of the plugin.
|
||||
|
||||
*g:rustc_path*
|
||||
*g:rustc_path*
|
||||
g:rustc_path~
|
||||
Set this option to the path to rustc for use in the |:RustRun| and
|
||||
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
|
||||
let g:rustc_path = $HOME .. "/bin/rustc"
|
||||
<
|
||||
|
||||
*g:rustc_makeprg_no_percent*
|
||||
*g:rustc_makeprg_no_percent*
|
||||
g:rustc_makeprg_no_percent~
|
||||
Set this option to 1 to have 'makeprg' default to "rustc" instead of
|
||||
"rustc %": >
|
||||
let g:rustc_makeprg_no_percent = 1
|
||||
<
|
||||
|
||||
*g:rust_conceal*
|
||||
*g:rust_conceal*
|
||||
g:rust_conceal~
|
||||
Set this option to turn on the basic |conceal| support: >
|
||||
let g:rust_conceal = 1
|
||||
<
|
||||
|
||||
*g:rust_conceal_mod_path*
|
||||
*g:rust_conceal_mod_path*
|
||||
g:rust_conceal_mod_path~
|
||||
Set this option to turn on |conceal| for the path connecting token
|
||||
"::": >
|
||||
let g:rust_conceal_mod_path = 1
|
||||
<
|
||||
|
||||
*g:rust_conceal_pub*
|
||||
*g:rust_conceal_pub*
|
||||
g:rust_conceal_pub~
|
||||
Set this option to turn on |conceal| for the "pub" token: >
|
||||
let g:rust_conceal_pub = 1
|
||||
<
|
||||
|
||||
*g:rust_recommended_style*
|
||||
*g:rust_recommended_style*
|
||||
g:rust_recommended_style~
|
||||
Set this option to enable vim indentation and textwidth settings to
|
||||
conform to style conventions of the rust standard library (i.e. use 4
|
||||
spaces for indents and sets 'textwidth' to 99). This option is enabled
|
||||
Set this option to enable vim indentation and textwidth settings to
|
||||
conform to style conventions of the rust standard library (i.e. use 4
|
||||
spaces for indents and sets 'textwidth' to 99). This option is enabled
|
||||
by default. To disable it: >
|
||||
let g:rust_recommended_style = 0
|
||||
<
|
||||
|
||||
*g:rust_fold*
|
||||
*g:rust_fold*
|
||||
g:rust_fold~
|
||||
Set this option to turn on |folding|: >
|
||||
let g:rust_fold = 1
|
||||
@ -76,39 +76,39 @@ g:rust_fold~
|
||||
2 Braced blocks are folded. 'foldlevel' is left at the
|
||||
global value (all folds are closed by default).
|
||||
|
||||
*g:rust_bang_comment_leader*
|
||||
*g:rust_bang_comment_leader*
|
||||
g:rust_bang_comment_leader~
|
||||
Set this option to 1 to preserve the leader on multi-line doc comments
|
||||
using the /*! syntax: >
|
||||
let g:rust_bang_comment_leader = 1
|
||||
<
|
||||
|
||||
*g:ftplugin_rust_source_path*
|
||||
*g:ftplugin_rust_source_path*
|
||||
g:ftplugin_rust_source_path~
|
||||
Set this option to a path that should be prepended to 'path' for Rust
|
||||
source files: >
|
||||
let g:ftplugin_rust_source_path = $HOME .. '/dev/rust'
|
||||
<
|
||||
|
||||
*g:rustfmt_command*
|
||||
*g:rustfmt_command*
|
||||
g:rustfmt_command~
|
||||
Set this option to the name of the "rustfmt" executable in your $PATH. If
|
||||
not specified it defaults to "rustfmt" : >
|
||||
let g:rustfmt_command = 'rustfmt'
|
||||
<
|
||||
*g:rustfmt_autosave*
|
||||
*g:rustfmt_autosave*
|
||||
g:rustfmt_autosave~
|
||||
Set this option to 1 to run |:RustFmt| automatically when saving a
|
||||
buffer. If not specified it defaults to 0 : >
|
||||
let g:rustfmt_autosave = 0
|
||||
<
|
||||
*g:rustfmt_fail_silently*
|
||||
*g:rustfmt_fail_silently*
|
||||
g:rustfmt_fail_silently~
|
||||
Set this option to 1 to prevent "rustfmt" from populating the
|
||||
|location-list| with errors. If not specified it defaults to 0: >
|
||||
let g:rustfmt_fail_silently = 0
|
||||
<
|
||||
*g:rustfmt_options*
|
||||
*g:rustfmt_options*
|
||||
g:rustfmt_options~
|
||||
Set this option to a string of options to pass to "rustfmt". The
|
||||
write-mode is already set to "overwrite". If not specified it
|
||||
@ -116,13 +116,13 @@ g:rustfmt_options~
|
||||
let g:rustfmt_options = ''
|
||||
<
|
||||
|
||||
*g:rust_playpen_url*
|
||||
*g:rust_playpen_url*
|
||||
g:rust_playpen_url~
|
||||
Set this option to override the URL for the playpen to use: >
|
||||
let g:rust_playpen_url = 'https://play.rust-lang.org/'
|
||||
<
|
||||
|
||||
*g:rust_shortener_url*
|
||||
*g:rust_shortener_url*
|
||||
g:rust_shortener_url~
|
||||
Set this option to override the URL for the URL shortener: >
|
||||
let g:rust_shortener_url = 'https://is.gd/'
|
||||
@ -130,9 +130,9 @@ g:rust_shortener_url~
|
||||
|
||||
|
||||
==============================================================================
|
||||
COMMANDS *rust-commands*
|
||||
COMMANDS *rust-commands*
|
||||
|
||||
:RustRun [args] *:RustRun*
|
||||
:RustRun [args] *:RustRun*
|
||||
:RustRun! [rustc-args] [--] [args]
|
||||
Compiles and runs the current file. If it has unsaved changes,
|
||||
it will be saved first using |:update|. If the current file is
|
||||
@ -150,7 +150,7 @@ COMMANDS *rust-commands*
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustExpand [args] *:RustExpand*
|
||||
:RustExpand [args] *:RustExpand*
|
||||
:RustExpand! [TYPE] [args]
|
||||
Expands the current file using --pretty and displays the
|
||||
results in a new split. If the current file has unsaved
|
||||
@ -169,7 +169,7 @@ COMMANDS *rust-commands*
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustEmitIr [args] *:RustEmitIr*
|
||||
:RustEmitIr [args] *:RustEmitIr*
|
||||
Compiles the current file to LLVM IR and displays the results
|
||||
in a new split. If the current file has unsaved changes, it
|
||||
will be saved first using |:update|. If the current file is an
|
||||
@ -180,7 +180,7 @@ COMMANDS *rust-commands*
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustEmitAsm [args] *:RustEmitAsm*
|
||||
:RustEmitAsm [args] *:RustEmitAsm*
|
||||
Compiles the current file to assembly and displays the results
|
||||
in a new split. If the current file has unsaved changes, it
|
||||
will be saved first using |:update|. If the current file is an
|
||||
@ -191,7 +191,7 @@ COMMANDS *rust-commands*
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustPlay *:RustPlay*
|
||||
:RustPlay *:RustPlay*
|
||||
This command will only work if you have web-api.vim installed
|
||||
(available at https://github.com/mattn/webapi-vim). It sends the
|
||||
current selection, or if nothing is selected, the entirety of the
|
||||
@ -204,7 +204,7 @@ COMMANDS *rust-commands*
|
||||
|g:rust_shortener_url| is the base URL for the shortener, by
|
||||
default "https://is.gd/"
|
||||
|
||||
:RustFmt *:RustFmt*
|
||||
:RustFmt *:RustFmt*
|
||||
Runs |g:rustfmt_command| on the current buffer. If
|
||||
|g:rustfmt_options| is set then those will be passed to the
|
||||
executable.
|
||||
@ -214,12 +214,12 @@ COMMANDS *rust-commands*
|
||||
|g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1
|
||||
then it will not populate the |location-list|.
|
||||
|
||||
:RustFmtRange *:RustFmtRange*
|
||||
:RustFmtRange *:RustFmtRange*
|
||||
Runs |g:rustfmt_command| with selected range. See
|
||||
|:RustFmt| for any other information.
|
||||
|
||||
==============================================================================
|
||||
MAPPINGS *rust-mappings*
|
||||
MAPPINGS *rust-mappings*
|
||||
|
||||
This plugin defines mappings for |[[| and |]]| to support hanging indents.
|
||||
|
||||
|
@ -601,6 +601,7 @@ probably means that some other program changed the file. You will have to
|
||||
find out what happened, and decide which version of the file you want to keep.
|
||||
Set the 'autoread' option if you want to do this automatically.
|
||||
This message is not given when 'buftype' is not empty.
|
||||
Also see the |FileChangedShell| autocommand.
|
||||
|
||||
There is one situation where you get this message even though there is nothing
|
||||
wrong: If you save a file in Windows on the day the daylight saving time
|
||||
|
@ -80,20 +80,20 @@ Copyright 2005-2017: *tar-copyright*
|
||||
|
||||
These options are variables that one may change, typically in one's
|
||||
<.vimrc> file.
|
||||
Default
|
||||
Variable Value Explanation
|
||||
Default
|
||||
Variable Value Explanation
|
||||
*g:tar_browseoptions* "Ptf" used to get a list of contents
|
||||
*g:tar_readoptions* "OPxf" used to extract a file from a tarball
|
||||
*g:tar_cmd* "tar" the name of the tar program
|
||||
*g:tar_nomax* 0 if true, file window will not be maximized
|
||||
*g:tar_secure* undef if exists:
|
||||
*g:tar_readoptions* "OPxf" used to extract a file from a tarball
|
||||
*g:tar_cmd* "tar" the name of the tar program
|
||||
*g:tar_nomax* 0 if true, file window will not be maximized
|
||||
*g:tar_secure* undef if exists:
|
||||
"--"s will be used to prevent unwanted
|
||||
option expansion in tar commands.
|
||||
Please be sure that your tar command
|
||||
accepts "--"; Posix compliant tar
|
||||
utilities do accept them.
|
||||
if not exists:
|
||||
The tar plugin will reject any tar
|
||||
The tar plugin will reject any tar
|
||||
files or member files that begin with
|
||||
"-"
|
||||
Not all tar's support the "--" which is why
|
||||
|
@ -39,7 +39,7 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
|
||||
|
||||
OPTIONS~
|
||||
|
||||
*g:zip_nomax*
|
||||
*g:zip_nomax*
|
||||
|
||||
If this variable exists and is true, the file window will not be
|
||||
automatically maximized when opened.
|
||||
@ -54,21 +54,21 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
|
||||
under Windows ("). If you'd rather have no quotes, simply set
|
||||
g:zip_shq to the empty string (let g:zip_shq= "") in your <.vimrc>.
|
||||
|
||||
*g:zip_unzipcmd*
|
||||
*g:zip_unzipcmd*
|
||||
Use this option to specify the program which does the duty of "unzip".
|
||||
It's used during browsing. By default: >
|
||||
let g:zip_unzipcmd= "unzip"
|
||||
let g:zip_unzipcmd= "unzip"
|
||||
<
|
||||
*g:zip_zipcmd*
|
||||
Use this option to specify the program which does the duty of "zip".
|
||||
It's used during the writing (updating) of a file already in a zip
|
||||
file; by default: >
|
||||
let g:zip_zipcmd= "zip"
|
||||
let g:zip_zipcmd= "zip"
|
||||
<
|
||||
*g:zip_extractcmd*
|
||||
This option specifies the program (and any options needed) used to
|
||||
extract a file from a zip archive. By default, >
|
||||
let g:zip_extractcmd= g:zip_unzipcmd
|
||||
let g:zip_extractcmd= g:zip_unzipcmd
|
||||
<
|
||||
PREVENTING LOADING~
|
||||
|
||||
@ -103,14 +103,14 @@ Copyright: Copyright (C) 2005-2015 Charles E Campbell *zip-copyright*
|
||||
==============================================================================
|
||||
4. History *zip-history* {{{1
|
||||
v32 Oct 22, 2021 * to avoid an issue with a vim 8.2 patch, zipfile: has
|
||||
been changed to zipfile:// . This often shows up
|
||||
been changed to zipfile:// . This often shows up
|
||||
as zipfile:/// with zipped files that are root-based.
|
||||
v29 Apr 02, 2017 * (Klartext) reported that an encrypted zip file could
|
||||
opened but the swapfile held unencrypted contents.
|
||||
opened but the swapfile held unencrypted contents.
|
||||
The solution is to edit the contents of a zip file
|
||||
using the |:noswapfile| modifier.
|
||||
v28 Oct 08, 2014 * changed the sanity checks for executables to reflect
|
||||
the command actually to be attempted in zip#Read()
|
||||
the command actually to be attempted in zip#Read()
|
||||
and zip#Write()
|
||||
* added the extraction of a file capability
|
||||
Nov 30, 2015 * added *.epub to the |g:zipPlugin_ext| list
|
||||
|
@ -464,7 +464,7 @@ Force to omit the line numbers: >
|
||||
Go back to the default to use 'number' by deleting the variable: >
|
||||
:unlet g:html_number_lines
|
||||
<
|
||||
*g:html_line_ids*
|
||||
*g:html_line_ids*
|
||||
Default: 1 if |g:html_number_lines| is set, 0 otherwise.
|
||||
When 1, adds an HTML id attribute to each line number, or to an empty <span>
|
||||
inserted for that purpose if no line numbers are shown. This ID attribute
|
||||
@ -656,6 +656,22 @@ the rendered page generated by 2html.vim.
|
||||
>
|
||||
:let g:html_no_pre = 1
|
||||
<
|
||||
*g:html_no_doc*
|
||||
Default: 0.
|
||||
When 1 it doesn't generate a full HTML document with a DOCTYPE, <head>,
|
||||
<body>, etc. If |g:html_use_css| is enabled (the default) you'll have to
|
||||
define the CSS manually. The |g:html_dynamic_folds| and |g:html_line_ids|
|
||||
settings (off by default) also insert some JavaScript.
|
||||
|
||||
|
||||
*g:html_no_links*
|
||||
Default: 0.
|
||||
Don't generate <a> tags for text that looks like an URL.
|
||||
|
||||
*g:html_no_modeline*
|
||||
Default: 0.
|
||||
Don't generate a modeline disabling folding.
|
||||
|
||||
*g:html_expand_tabs*
|
||||
Default: 0 if 'tabstop' is 8, 'expandtab' is 0, 'vartabstop' is not in use,
|
||||
and no fold column or line numbers occur in the generated HTML;
|
||||
@ -2897,7 +2913,7 @@ Default folding is rather detailed, i.e., small syntax units like "if", "do",
|
||||
|
||||
You can set "ruby_foldable_groups" to restrict which groups are foldable: >
|
||||
|
||||
:let ruby_foldable_groups = 'if case %'
|
||||
:let ruby_foldable_groups = 'if case %'
|
||||
<
|
||||
The value is a space-separated list of keywords:
|
||||
|
||||
@ -2905,22 +2921,22 @@ The value is a space-separated list of keywords:
|
||||
-------- ------------------------------------- ~
|
||||
ALL Most block syntax (default)
|
||||
NONE Nothing
|
||||
if "if" or "unless" block
|
||||
if "if" or "unless" block
|
||||
def "def" block
|
||||
class "class" block
|
||||
module "module" block
|
||||
do "do" block
|
||||
do "do" block
|
||||
begin "begin" block
|
||||
case "case" block
|
||||
for "for", "while", "until" loops
|
||||
{ Curly bracket block or hash literal
|
||||
[ Array literal
|
||||
% Literal with "%" notation, e.g.: %w(STRING), %!STRING!
|
||||
/ Regexp
|
||||
{ Curly bracket block or hash literal
|
||||
[ Array literal
|
||||
% Literal with "%" notation, e.g.: %w(STRING), %!STRING!
|
||||
/ Regexp
|
||||
string String and shell command output (surrounded by ', ", `)
|
||||
: Symbol
|
||||
# Multiline comment
|
||||
<< Here documents
|
||||
: Symbol
|
||||
# Multiline comment
|
||||
<< Here documents
|
||||
__END__ Source code after "__END__" directive
|
||||
|
||||
*ruby_no_expensive*
|
||||
@ -3750,7 +3766,7 @@ SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
|
||||
|
||||
clear: Syntax specific iskeyword setting is disabled and the
|
||||
buffer-local 'iskeyword' setting is used.
|
||||
{option} Set the syntax 'iskeyword' option to a new value.
|
||||
{option} Set the syntax 'iskeyword' option to a new value.
|
||||
|
||||
Example: >
|
||||
:syntax iskeyword @,48-57,192-255,$,_
|
||||
@ -5110,7 +5126,7 @@ guisp={color-name} *guisp*
|
||||
"gg" is the Green value
|
||||
"bb" is the Blue value
|
||||
All values are hexadecimal, range from "00" to "ff". Examples: >
|
||||
:highlight Comment guifg=#11f0c3 guibg=#ff00ff
|
||||
:highlight Comment guifg=#11f0c3 guibg=#ff00ff
|
||||
<
|
||||
blend={integer} *highlight-blend*
|
||||
Override the blend level for a highlight group within the popupmenu
|
||||
|
@ -380,6 +380,8 @@ and then drag) will result in whole words to be selected. This continues
|
||||
until the button is released, at which point the selection is per character
|
||||
again.
|
||||
|
||||
For scrolling with the mouse see |scroll-mouse-wheel|.
|
||||
|
||||
In Insert mode, when a selection is started, Vim goes into Normal mode
|
||||
temporarily. When Visual or Select mode ends, it returns to Insert mode.
|
||||
This is like using CTRL-O in Insert mode. Select mode is used when the
|
||||
|
16
runtime/ftplugin/apache.vim
Normal file
16
runtime/ftplugin/apache.vim
Normal file
@ -0,0 +1,16 @@
|
||||
" Vim filetype plugin
|
||||
" Language: apache configuration file
|
||||
" Maintainer: Per Juchtmans <dubgeiser+vimNOSPAM@gmail.com>
|
||||
" Last Change: 2022 Oct 22
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
let b:undo_ftplugin = "setlocal comments< commentstring<"
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet:
|
14
runtime/ftplugin/openvpn.vim
Normal file
14
runtime/ftplugin/openvpn.vim
Normal file
@ -0,0 +1,14 @@
|
||||
" Vim filetype plugin
|
||||
" Language: OpenVPN
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Last Change: 2022 Oct 16
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal iskeyword+=-,.,/
|
||||
setlocal comments=:#,:; commentstring=#%s
|
||||
|
||||
let b:undo_ftplugin = 'setl isk< com< cms<'
|
@ -815,202 +815,204 @@ endif
|
||||
|
||||
" HTML header, with the title and generator ;-). Left free space for the CSS,
|
||||
" to be filled at the end.
|
||||
call extend(s:lines, [
|
||||
\ "<html>",
|
||||
\ "<head>"])
|
||||
" include encoding as close to the top as possible, but only if not already
|
||||
" contained in XML information (to avoid haggling over content type)
|
||||
if s:settings.encoding != "" && !s:settings.use_xhtml
|
||||
if s:html5
|
||||
call add(s:lines, '<meta charset="' . s:settings.encoding . '"' . s:tag_close)
|
||||
else
|
||||
call add(s:lines, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . s:tag_close)
|
||||
endif
|
||||
endif
|
||||
call extend(s:lines, [
|
||||
\ ("<title>".expand("%:p:~")."</title>"),
|
||||
\ ("<meta name=\"Generator\" content=\"Vim/".v:version/100.".".v:version%100.'"'.s:tag_close),
|
||||
\ ("<meta name=\"plugin-version\" content=\"".s:pluginversion.'"'.s:tag_close)
|
||||
\ ])
|
||||
call add(s:lines, '<meta name="syntax" content="'.s:current_syntax.'"'.s:tag_close)
|
||||
call add(s:lines, '<meta name="settings" content="'.
|
||||
\ join(filter(keys(s:settings),'s:settings[v:val]'),',').
|
||||
\ ',prevent_copy='.s:settings.prevent_copy.
|
||||
\ ',use_input_for_pc='.s:settings.use_input_for_pc.
|
||||
\ '"'.s:tag_close)
|
||||
call add(s:lines, '<meta name="colorscheme" content="'.
|
||||
\ (exists('g:colors_name')
|
||||
\ ? g:colors_name
|
||||
\ : 'none'). '"'.s:tag_close)
|
||||
|
||||
if s:settings.use_css
|
||||
if !s:settings.no_doc
|
||||
call extend(s:lines, [
|
||||
\ "<style" . (s:html5 ? "" : " type=\"text/css\"") . ">",
|
||||
\ s:settings.use_xhtml ? "" : "<!--"])
|
||||
let s:ieonly = []
|
||||
if s:settings.dynamic_folds
|
||||
if s:settings.hover_unfold
|
||||
" if we are doing hover_unfold, use css 2 with css 1 fallback for IE6
|
||||
call extend(s:lines, [
|
||||
\ ".FoldColumn { text-decoration: none; white-space: pre; }",
|
||||
\ "",
|
||||
\ "body * { margin: 0; padding: 0; }", "",
|
||||
\ ".open-fold > span.Folded { display: none; }",
|
||||
\ ".open-fold > .fulltext { display: inline; }",
|
||||
\ ".closed-fold > .fulltext { display: none; }",
|
||||
\ ".closed-fold > span.Folded { display: inline; }",
|
||||
\ "",
|
||||
\ ".open-fold > .toggle-open { display: none; }",
|
||||
\ ".open-fold > .toggle-closed { display: inline; }",
|
||||
\ ".closed-fold > .toggle-open { display: inline; }",
|
||||
\ ".closed-fold > .toggle-closed { display: none; }",
|
||||
\ "", "",
|
||||
\ '/* opening a fold while hovering won''t be supported by IE6 and other',
|
||||
\ "similar browsers, but it should fail gracefully. */",
|
||||
\ ".closed-fold:hover > .fulltext { display: inline; }",
|
||||
\ ".closed-fold:hover > .toggle-filler { display: none; }",
|
||||
\ ".closed-fold:hover > .Folded { display: none; }"])
|
||||
" TODO: IE6 is REALLY old and I can't even test it anymore. Maybe we
|
||||
" should remove this? Leave it in for now, it was working at one point,
|
||||
" and doesn't affect any modern browsers. Even newer IE versions should
|
||||
" support the above code and ignore the following.
|
||||
let s:ieonly = [
|
||||
\ "<!--[if lt IE 7]><style type=\"text/css\">",
|
||||
\ ".open-fold .fulltext { display: inline; }",
|
||||
\ ".open-fold span.Folded { display: none; }",
|
||||
\ ".open-fold .toggle-open { display: none; }",
|
||||
\ ".open-fold .toggle-closed { display: inline; }",
|
||||
\ "",
|
||||
\ ".closed-fold .fulltext { display: none; }",
|
||||
\ ".closed-fold span.Folded { display: inline; }",
|
||||
\ ".closed-fold .toggle-open { display: inline; }",
|
||||
\ ".closed-fold .toggle-closed { display: none; }",
|
||||
\ "</style>",
|
||||
\ "<![endif]-->",
|
||||
\]
|
||||
\ "<html>",
|
||||
\ "<head>"])
|
||||
" include encoding as close to the top as possible, but only if not already
|
||||
" contained in XML information (to avoid haggling over content type)
|
||||
if s:settings.encoding != "" && !s:settings.use_xhtml
|
||||
if s:html5
|
||||
call add(s:lines, '<meta charset="' . s:settings.encoding . '"' . s:tag_close)
|
||||
else
|
||||
" if we aren't doing hover_unfold, use CSS 1 only
|
||||
call extend(s:lines, [
|
||||
\ ".FoldColumn { text-decoration: none; white-space: pre; }",
|
||||
\ ".open-fold .fulltext { display: inline; }",
|
||||
\ ".open-fold span.Folded { display: none; }",
|
||||
\ ".open-fold .toggle-open { display: none; }",
|
||||
\ ".open-fold .toggle-closed { display: inline; }",
|
||||
\ "",
|
||||
\ ".closed-fold .fulltext { display: none; }",
|
||||
\ ".closed-fold span.Folded { display: inline; }",
|
||||
\ ".closed-fold .toggle-open { display: inline; }",
|
||||
\ ".closed-fold .toggle-closed { display: none; }",
|
||||
\])
|
||||
call add(s:lines, "<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:settings.encoding . '"' . s:tag_close)
|
||||
endif
|
||||
endif
|
||||
" else we aren't doing any dynamic folding, no need for any special rules
|
||||
|
||||
call extend(s:lines, [
|
||||
\ s:settings.use_xhtml ? "" : '-->',
|
||||
\ "</style>",
|
||||
\])
|
||||
call extend(s:lines, s:ieonly)
|
||||
unlet s:ieonly
|
||||
endif
|
||||
|
||||
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids
|
||||
|
||||
" insert script tag if needed
|
||||
if s:uses_script
|
||||
call extend(s:lines, [
|
||||
\ "",
|
||||
\ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">",
|
||||
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
|
||||
endif
|
||||
|
||||
" insert javascript to toggle folds open and closed
|
||||
if s:settings.dynamic_folds
|
||||
call extend(s:lines, [
|
||||
\ "",
|
||||
\ "function toggleFold(objID)",
|
||||
\ "{",
|
||||
\ " var fold;",
|
||||
\ " fold = document.getElementById(objID);",
|
||||
\ " if (fold.className == 'closed-fold')",
|
||||
\ " {",
|
||||
\ " fold.className = 'open-fold';",
|
||||
\ " }",
|
||||
\ " else if (fold.className == 'open-fold')",
|
||||
\ " {",
|
||||
\ " fold.className = 'closed-fold';",
|
||||
\ " }",
|
||||
\ "}"
|
||||
\ ("<title>".expand("%:p:~")."</title>"),
|
||||
\ ("<meta name=\"Generator\" content=\"Vim/".v:version/100.".".v:version%100.'"'.s:tag_close),
|
||||
\ ("<meta name=\"plugin-version\" content=\"".s:pluginversion.'"'.s:tag_close)
|
||||
\ ])
|
||||
endif
|
||||
call add(s:lines, '<meta name="syntax" content="'.s:current_syntax.'"'.s:tag_close)
|
||||
call add(s:lines, '<meta name="settings" content="'.
|
||||
\ join(filter(keys(s:settings),'s:settings[v:val]'),',').
|
||||
\ ',prevent_copy='.s:settings.prevent_copy.
|
||||
\ ',use_input_for_pc='.s:settings.use_input_for_pc.
|
||||
\ '"'.s:tag_close)
|
||||
call add(s:lines, '<meta name="colorscheme" content="'.
|
||||
\ (exists('g:colors_name')
|
||||
\ ? g:colors_name
|
||||
\ : 'none'). '"'.s:tag_close)
|
||||
|
||||
if s:settings.line_ids
|
||||
" insert javascript to get IDs from line numbers, and to open a fold before
|
||||
" jumping to any lines contained therein
|
||||
call extend(s:lines, [
|
||||
\ "",
|
||||
\ "/* function to open any folds containing a jumped-to line before jumping to it */",
|
||||
\ "function JumpToLine()",
|
||||
\ "{",
|
||||
\ " var lineNum;",
|
||||
\ " lineNum = window.location.hash;",
|
||||
\ " lineNum = lineNum.substr(1); /* strip off '#' */",
|
||||
\ "",
|
||||
\ " if (lineNum.indexOf('L') == -1) {",
|
||||
\ " lineNum = 'L'+lineNum;",
|
||||
\ " }",
|
||||
\ " var lineElem = document.getElementById(lineNum);"
|
||||
\ ])
|
||||
if s:settings.use_css
|
||||
call extend(s:lines, [
|
||||
\ "<style" . (s:html5 ? "" : " type=\"text/css\"") . ">",
|
||||
\ s:settings.use_xhtml ? "" : "<!--"])
|
||||
let s:ieonly = []
|
||||
if s:settings.dynamic_folds
|
||||
if s:settings.hover_unfold
|
||||
" if we are doing hover_unfold, use css 2 with css 1 fallback for IE6
|
||||
call extend(s:lines, [
|
||||
\ ".FoldColumn { text-decoration: none; white-space: pre; }",
|
||||
\ "",
|
||||
\ "body * { margin: 0; padding: 0; }", "",
|
||||
\ ".open-fold > span.Folded { display: none; }",
|
||||
\ ".open-fold > .fulltext { display: inline; }",
|
||||
\ ".closed-fold > .fulltext { display: none; }",
|
||||
\ ".closed-fold > span.Folded { display: inline; }",
|
||||
\ "",
|
||||
\ ".open-fold > .toggle-open { display: none; }",
|
||||
\ ".open-fold > .toggle-closed { display: inline; }",
|
||||
\ ".closed-fold > .toggle-open { display: inline; }",
|
||||
\ ".closed-fold > .toggle-closed { display: none; }",
|
||||
\ "", "",
|
||||
\ '/* opening a fold while hovering won''t be supported by IE6 and other',
|
||||
\ "similar browsers, but it should fail gracefully. */",
|
||||
\ ".closed-fold:hover > .fulltext { display: inline; }",
|
||||
\ ".closed-fold:hover > .toggle-filler { display: none; }",
|
||||
\ ".closed-fold:hover > .Folded { display: none; }"])
|
||||
" TODO: IE6 is REALLY old and I can't even test it anymore. Maybe we
|
||||
" should remove this? Leave it in for now, it was working at one point,
|
||||
" and doesn't affect any modern browsers. Even newer IE versions should
|
||||
" support the above code and ignore the following.
|
||||
let s:ieonly = [
|
||||
\ "<!--[if lt IE 7]><style type=\"text/css\">",
|
||||
\ ".open-fold .fulltext { display: inline; }",
|
||||
\ ".open-fold span.Folded { display: none; }",
|
||||
\ ".open-fold .toggle-open { display: none; }",
|
||||
\ ".open-fold .toggle-closed { display: inline; }",
|
||||
\ "",
|
||||
\ ".closed-fold .fulltext { display: none; }",
|
||||
\ ".closed-fold span.Folded { display: inline; }",
|
||||
\ ".closed-fold .toggle-open { display: inline; }",
|
||||
\ ".closed-fold .toggle-closed { display: none; }",
|
||||
\ "</style>",
|
||||
\ "<![endif]-->",
|
||||
\]
|
||||
else
|
||||
" if we aren't doing hover_unfold, use CSS 1 only
|
||||
call extend(s:lines, [
|
||||
\ ".FoldColumn { text-decoration: none; white-space: pre; }",
|
||||
\ ".open-fold .fulltext { display: inline; }",
|
||||
\ ".open-fold span.Folded { display: none; }",
|
||||
\ ".open-fold .toggle-open { display: none; }",
|
||||
\ ".open-fold .toggle-closed { display: inline; }",
|
||||
\ "",
|
||||
\ ".closed-fold .fulltext { display: none; }",
|
||||
\ ".closed-fold span.Folded { display: inline; }",
|
||||
\ ".closed-fold .toggle-open { display: inline; }",
|
||||
\ ".closed-fold .toggle-closed { display: none; }",
|
||||
\])
|
||||
endif
|
||||
endif
|
||||
" else we aren't doing any dynamic folding, no need for any special rules
|
||||
|
||||
call extend(s:lines, [
|
||||
\ s:settings.use_xhtml ? "" : '-->',
|
||||
\ "</style>",
|
||||
\])
|
||||
call extend(s:lines, s:ieonly)
|
||||
unlet s:ieonly
|
||||
endif
|
||||
|
||||
let s:uses_script = s:settings.dynamic_folds || s:settings.line_ids
|
||||
|
||||
" insert script tag if needed
|
||||
if s:uses_script
|
||||
call extend(s:lines, [
|
||||
\ "",
|
||||
\ "<script" . (s:html5 ? "" : " type='text/javascript'") . ">",
|
||||
\ s:settings.use_xhtml ? '//<![CDATA[' : "<!--"])
|
||||
endif
|
||||
|
||||
" insert javascript to toggle folds open and closed
|
||||
if s:settings.dynamic_folds
|
||||
call extend(s:lines, [
|
||||
\ "",
|
||||
\ " /* navigate upwards in the DOM tree to open all folds containing the line */",
|
||||
\ " var node = lineElem;",
|
||||
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
|
||||
\ "function toggleFold(objID)",
|
||||
\ "{",
|
||||
\ " var fold;",
|
||||
\ " fold = document.getElementById(objID);",
|
||||
\ " if (fold.className == 'closed-fold')",
|
||||
\ " {",
|
||||
\ " if (node.className == 'closed-fold')",
|
||||
\ " {",
|
||||
\ " node.className = 'open-fold';",
|
||||
\ " }",
|
||||
\ " node = node.parentNode;",
|
||||
\ " fold.className = 'open-fold';",
|
||||
\ " }",
|
||||
\ " else if (fold.className == 'open-fold')",
|
||||
\ " {",
|
||||
\ " fold.className = 'closed-fold';",
|
||||
\ " }",
|
||||
\ "}"
|
||||
\ ])
|
||||
endif
|
||||
call extend(s:lines, [
|
||||
\ " /* Always jump to new location even if the line was hidden inside a fold, or",
|
||||
\ " * we corrected the raw number to a line ID.",
|
||||
\ " */",
|
||||
\ " if (lineElem) {",
|
||||
\ " lineElem.scrollIntoView(true);",
|
||||
\ " }",
|
||||
\ " return true;",
|
||||
\ "}",
|
||||
\ "if ('onhashchange' in window) {",
|
||||
\ " window.onhashchange = JumpToLine;",
|
||||
\ "}"
|
||||
\ ])
|
||||
endif
|
||||
|
||||
" insert script closing tag if needed
|
||||
if s:uses_script
|
||||
call extend(s:lines, [
|
||||
\ '',
|
||||
\ s:settings.use_xhtml ? '//]]>' : '-->',
|
||||
\ "</script>"
|
||||
\ ])
|
||||
endif
|
||||
if s:settings.line_ids
|
||||
" insert javascript to get IDs from line numbers, and to open a fold before
|
||||
" jumping to any lines contained therein
|
||||
call extend(s:lines, [
|
||||
\ "",
|
||||
\ "/* function to open any folds containing a jumped-to line before jumping to it */",
|
||||
\ "function JumpToLine()",
|
||||
\ "{",
|
||||
\ " var lineNum;",
|
||||
\ " lineNum = window.location.hash;",
|
||||
\ " lineNum = lineNum.substr(1); /* strip off '#' */",
|
||||
\ "",
|
||||
\ " if (lineNum.indexOf('L') == -1) {",
|
||||
\ " lineNum = 'L'+lineNum;",
|
||||
\ " }",
|
||||
\ " var lineElem = document.getElementById(lineNum);"
|
||||
\ ])
|
||||
|
||||
call extend(s:lines, ["</head>",
|
||||
\ "<body".(s:settings.line_ids ? " onload='JumpToLine();'" : "").">"])
|
||||
if s:settings.dynamic_folds
|
||||
call extend(s:lines, [
|
||||
\ "",
|
||||
\ " /* navigate upwards in the DOM tree to open all folds containing the line */",
|
||||
\ " var node = lineElem;",
|
||||
\ " while (node && node.id != 'vimCodeElement".s:settings.id_suffix."')",
|
||||
\ " {",
|
||||
\ " if (node.className == 'closed-fold')",
|
||||
\ " {",
|
||||
\ " node.className = 'open-fold';",
|
||||
\ " }",
|
||||
\ " node = node.parentNode;",
|
||||
\ " }",
|
||||
\ ])
|
||||
endif
|
||||
call extend(s:lines, [
|
||||
\ " /* Always jump to new location even if the line was hidden inside a fold, or",
|
||||
\ " * we corrected the raw number to a line ID.",
|
||||
\ " */",
|
||||
\ " if (lineElem) {",
|
||||
\ " lineElem.scrollIntoView(true);",
|
||||
\ " }",
|
||||
\ " return true;",
|
||||
\ "}",
|
||||
\ "if ('onhashchange' in window) {",
|
||||
\ " window.onhashchange = JumpToLine;",
|
||||
\ "}"
|
||||
\ ])
|
||||
endif
|
||||
|
||||
" insert script closing tag if needed
|
||||
if s:uses_script
|
||||
call extend(s:lines, [
|
||||
\ '',
|
||||
\ s:settings.use_xhtml ? '//]]>' : '-->',
|
||||
\ "</script>"
|
||||
\ ])
|
||||
endif
|
||||
|
||||
call extend(s:lines, ["</head>",
|
||||
\ "<body".(s:settings.line_ids ? " onload='JumpToLine();'" : "").">"])
|
||||
endif
|
||||
|
||||
if s:settings.no_pre
|
||||
" if we're not using CSS we use a font tag which can't have a div inside
|
||||
if s:settings.use_css
|
||||
call extend(s:lines, ["<div id='vimCodeElement".s:settings.id_suffix."'>"])
|
||||
call extend(s:lines, ["<div id='vimCodeElement" .. s:settings.id_suffix .. "'>"])
|
||||
endif
|
||||
else
|
||||
call extend(s:lines, ["<pre id='vimCodeElement".s:settings.id_suffix."'>"])
|
||||
call extend(s:lines, ["<pre id='vimCodeElement" .. s:settings.id_suffix .. "'>"])
|
||||
endif
|
||||
|
||||
exe s:orgwin . "wincmd w"
|
||||
@ -1721,12 +1723,15 @@ endif
|
||||
if s:settings.no_pre
|
||||
if !s:settings.use_css
|
||||
" Close off the font tag that encapsulates the whole <body>
|
||||
call extend(s:lines, ["</font>", "</body>", "</html>"])
|
||||
call extend(s:lines, ["</font>"])
|
||||
else
|
||||
call extend(s:lines, ["</div>", "</body>", "</html>"])
|
||||
call extend(s:lines, ["</div>"])
|
||||
endif
|
||||
else
|
||||
call extend(s:lines, ["</pre>", "</body>", "</html>"])
|
||||
call extend(s:lines, ["</pre>"])
|
||||
endif
|
||||
if !s:settings.no_doc
|
||||
call extend(s:lines, ["</body>", "</html>"])
|
||||
endif
|
||||
|
||||
exe s:newwin . "wincmd w"
|
||||
@ -1742,15 +1747,15 @@ unlet s:lines
|
||||
" The generated HTML is admittedly ugly and takes a LONG time to fold.
|
||||
" Make sure the user doesn't do syntax folding when loading a generated file,
|
||||
" using a modeline.
|
||||
call append(line('$'), "<!-- vim: set foldmethod=manual : -->")
|
||||
|
||||
" Now, when we finally know which, we define the colors and styles
|
||||
if s:settings.use_css
|
||||
1;/<style\>/+1
|
||||
if !s:settings.no_modeline
|
||||
call append(line('$'), "<!-- vim: set foldmethod=manual : -->")
|
||||
endif
|
||||
|
||||
" Normal/global attributes
|
||||
if s:settings.use_css
|
||||
" Now, when we finally know which, we define the colors and styles
|
||||
if s:settings.use_css && !s:settings.no_doc
|
||||
1;/<style\>/+1
|
||||
|
||||
" Normal/global attributes
|
||||
if s:settings.no_pre
|
||||
call append('.', "body { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: ". s:htmlfont ."; }")
|
||||
+
|
||||
@ -1874,7 +1879,9 @@ if s:settings.use_css
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
else
|
||||
endif
|
||||
|
||||
if !s:settings.use_css && !s:settings_no_doc
|
||||
" For Netscape 4, set <body> attributes too, though, strictly speaking, it's
|
||||
" incorrect.
|
||||
execute '%s:<body\([^>]*\):<body bgcolor="' . s:bgc . '" text="' . s:fgc . '"\1>\r<font face="'. s:htmlfont .'"'
|
||||
@ -1882,7 +1889,7 @@ endif
|
||||
|
||||
" Gather attributes for all other classes. Do diff first so that normal
|
||||
" highlight groups are inserted before it.
|
||||
if s:settings.use_css
|
||||
if s:settings.use_css && !s:settings.no_doc
|
||||
if s:diff_mode
|
||||
call append('.', filter(map(keys(s:diffstylelist), "s:diffstylelist[v:val]"), 'v:val != ""'))
|
||||
endif
|
||||
@ -1892,20 +1899,22 @@ if s:settings.use_css
|
||||
endif
|
||||
|
||||
" Add hyperlinks
|
||||
" TODO: add option to not do this? Maybe just make the color the same as the
|
||||
" text highlight group normally is?
|
||||
%s+\(https\=://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|>\|<\|"\)+<a href="\1">\1</a>\2+ge
|
||||
|
||||
" The DTD
|
||||
if s:settings.use_xhtml
|
||||
exe "normal! gg$a\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
|
||||
elseif s:html5
|
||||
exe "normal! gg0i<!DOCTYPE html>\n"
|
||||
else
|
||||
exe "normal! gg0i<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
|
||||
if !s:settings.no_links
|
||||
%s+\(https\=://\S\{-}\)\(\([.,;:}]\=\(\s\|$\)\)\|[\\"'<>]\|>\|<\|"\)+<a href="\1">\1</a>\2+ge
|
||||
endif
|
||||
|
||||
if s:settings.use_xhtml
|
||||
" The DTD
|
||||
if !s:settings.no_doc
|
||||
if s:settings.use_xhtml
|
||||
exe "normal! gg$a\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
|
||||
elseif s:html5
|
||||
exe "normal! gg0i<!DOCTYPE html>\n"
|
||||
else
|
||||
exe "normal! gg0i<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
|
||||
endif
|
||||
endif
|
||||
|
||||
if s:settings.use_xhtml && !s:settings.no_doc
|
||||
exe "normal! gg/<html/e\na xmlns=\"http://www.w3.org/1999/xhtml\"\e"
|
||||
endif
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim help file
|
||||
" Maintainer: Bram Moolenaar (Bram@vim.org)
|
||||
" Last Change: 2022 Sep 26
|
||||
" Last Change: 2022 Oct 17
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@ -11,7 +11,7 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn match helpHeadline "^[-A-Z .][-A-Z0-9 .()_]*\ze\(\s\+\*\|$\)"
|
||||
syn match helpHeadline "^ *[-A-Z.][-A-Z0-9 .()_]*?\=\ze\(\s\+\*\|$\)"
|
||||
syn match helpSectionDelim "^===.*===$"
|
||||
syn match helpSectionDelim "^---.*--$"
|
||||
if has("conceal")
|
||||
|
72
runtime/syntax/openvpn.vim
Normal file
72
runtime/syntax/openvpn.vim
Normal file
@ -0,0 +1,72 @@
|
||||
" Vim syntax file
|
||||
" Language: OpenVPN
|
||||
" Maintainer: ObserverOfTime <chronobserver@disroot.org>
|
||||
" Filenames: *.ovpn
|
||||
" Last Change: 2022 Oct 16
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
" Options
|
||||
syntax match openvpnOption /^[a-z-]\+/
|
||||
\ skipwhite nextgroup=openvpnArgList
|
||||
syntax match openvpnArgList /.*$/ transparent contained
|
||||
\ contains=openvpnArgument,openvpnNumber,
|
||||
\ openvpnIPv4Address,openvpnIPv6Address,
|
||||
\ openvpnSignal,openvpnComment
|
||||
|
||||
" Arguments
|
||||
syntax match openvpnArgument /[^\\"' \t]\+/
|
||||
\ contained contains=openvpnEscape
|
||||
syntax region openvpnArgument matchgroup=openvpnQuote
|
||||
\ start=/"/ skip=/\\"/ end=/"/
|
||||
\ oneline contained contains=openvpnEscape
|
||||
syntax region openvpnArgument matchgroup=openvpnQuote
|
||||
\ start=/'/ skip=/\\'/ end=/'/
|
||||
\ oneline contained
|
||||
syntax match openvpnEscape /\\[\\" \t]/ contained
|
||||
|
||||
" Numbers
|
||||
syntax match openvpnNumber /\<[1-9][0-9]*\(\.[0-9]\+\)\?\>/ contained
|
||||
|
||||
" Signals
|
||||
syntax match openvpnSignal /SIG\(HUP\|INT\|TERM\|USER[12]\)/ contained
|
||||
|
||||
" IP addresses
|
||||
syntax match openvpnIPv4Address /\(\d\{1,3}\.\)\{3}\d\{1,3}/
|
||||
\ contained nextgroup=openvpnSlash
|
||||
syntax match openvpnIPv6Address /\([A-F0-9]\{1,4}:\)\{7}\[A-F0-9]\{1,4}/
|
||||
\ contained nextgroup=openvpnSlash
|
||||
syntax match openvpnSlash "/" contained
|
||||
\ nextgroup=openvpnIPv4Address,openvpnIPv6Address,openvpnNumber
|
||||
|
||||
" Inline files
|
||||
syntax region openvpnInline matchgroup=openvpnTag
|
||||
\ start=+^<\z([a-z-]\+\)>+ end=+^</\z1>+
|
||||
|
||||
" Comments
|
||||
syntax keyword openvpnTodo contained TODO FIXME NOTE XXX
|
||||
syntax match openvpnComment /^[;#].*$/ contains=openvpnTodo
|
||||
syntax match openvpnComment /\s\+\zs[;#].*$/ contains=openvpnTodo
|
||||
|
||||
hi def link openvpnArgument String
|
||||
hi def link openvpnComment Comment
|
||||
hi def link openvpnEscape SpecialChar
|
||||
hi def link openvpnIPv4Address Constant
|
||||
hi def link openvpnIPv6Address Constant
|
||||
hi def link openvpnNumber Number
|
||||
hi def link openvpnOption Keyword
|
||||
hi def link openvpnQuote Quote
|
||||
hi def link openvpnSignal Special
|
||||
hi def link openvpnSlash Delimiter
|
||||
hi def link openvpnTag Tag
|
||||
hi def link openvpnTodo Todo
|
||||
|
||||
let b:current_syntax = 'openvpn'
|
||||
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
@ -619,7 +619,7 @@ syn match vimCtrlChar "[--]"
|
||||
|
||||
" Beginners - Patterns that involve ^ {{{2
|
||||
" =========
|
||||
syn match vimLineComment +^[ \t:]*"\("[^"]*"\|[^"]\)*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
|
||||
syn match vimLineComment +^[ \t:]*".*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
|
||||
syn match vim9LineComment +^[ \t:]\+#.*$+ contains=@vimCommentGroup,vimCommentString,vimCommentTitle
|
||||
syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
|
||||
syn match vimContinue "^\s*\\"
|
||||
|
@ -2099,7 +2099,7 @@ static void augment_terminfo(TUIData *data, const char *term, long vte_version,
|
||||
// Dickey ncurses terminfo does not include the setrgbf and setrgbb
|
||||
// capabilities, proposed by Rüdiger Sonderfeld on 2013-10-15. Adding
|
||||
// them here when terminfo lacks them is an augmentation, not a fixup.
|
||||
// https://gist.github.com/XVilka/8346728
|
||||
// https://github.com/termstandard/colors
|
||||
|
||||
// At this time (2017-07-12) it seems like all terminals that support rgb
|
||||
// color codes can use semicolons in the terminal code and be fine.
|
||||
|
Loading…
Reference in New Issue
Block a user