vim-patch:fc65cabb15d0

Update runtime files.
fc65cabb15

---

vim-patch:8.0.1279: initializing menus can be slow
Problem:    Initializing menus can be slow, especially when there are many
            keymaps, color schemes, etc.
Solution:   Do the globbing for runtime files lazlily. (Ken Takata)
This commit is contained in:
Justin M. Keyes
2018-10-29 23:38:41 +01:00
parent f5406dfe77
commit 2c7ed420d9
23 changed files with 3855 additions and 242 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -155,7 +155,7 @@ fun! tar#Browse(tarfile)
let curlast= line("$") let curlast= line("$")
if tarfile =~# '\.\(gz\|tgz\)$' if tarfile =~# '\.\(gz\|tgz\)$'
" call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") " call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - "
elseif tarfile =~# '\.lrp' elseif tarfile =~# '\.lrp'
" call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") " call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ")
exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - "
@@ -292,7 +292,7 @@ fun! tar#Read(fname,mode)
exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
elseif tarfile =~# '\.\(gz\|tgz\)$' elseif tarfile =~# '\.\(gz\|tgz\)$'
" call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1)) " call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1))
exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp
elseif tarfile =~# '\.lrp$' elseif tarfile =~# '\.lrp$'
" call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) " call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp)
exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp

View File

@@ -921,6 +921,13 @@ These three can be repeated and mixed. Examples:
expr8 *expr8* expr8 *expr8*
----- -----
This expression is either |expr9| or a sequence of the alternatives below,
in any order. E.g., these are all possible:
expr9[expr1].name
expr9.name[expr1]
expr9(expr1, ...)[expr1].name
expr8[expr1] item of String or |List| *expr-[]* *E111* expr8[expr1] item of String or |List| *expr-[]* *E111*
*subscript* *subscript*

View File

@@ -573,11 +573,31 @@ By default the following options are set, in accordance with PEP8: >
setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8
To disable this behaviour, set the following variable in your vimrc: > To disable this behavior, set the following variable in your vimrc: >
let g:python_recommended_style = 0 let g:python_recommended_style = 0
R MARKDOWN *ft-rmd-plugin*
By default ftplugin/html.vim is not sourced. If you want it sourced, add to
your |vimrc|: >
let rmd_include_html = 1
The 'formatexpr' option is set dynamically with different values for R code
and for Markdown code. If you prefer that 'formatexpr' is not set, add to your
|vimrc|: >
let rmd_dynamic_comments = 0
R RESTRUCTURED TEXT *ft-rrst-plugin*
The 'formatexpr' option is set dynamically with different values for R code
and for ReStructured text. If you prefer that 'formatexpr' is not set, add to
your |vimrc|: >
let rrst_dynamic_comments = 0
RPM SPEC *ft-spec-plugin* RPM SPEC *ft-spec-plugin*
Since the text for this plugin is rather long it has been put in a separate Since the text for this plugin is rather long it has been put in a separate

View File

@@ -974,6 +974,11 @@ Below is an example of indentation with and without this option enabled:
paste(x) paste(x) paste(x) paste(x)
} } } }
< <
The code will be indented after lines that match the pattern
`'\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$'`. If you want indentation after
lines that match a different pattern, you should set the appropriate value of
`r_indent_op_pattern` in your |vimrc|.
SHELL *ft-sh-indent* SHELL *ft-sh-indent*

View File

@@ -1026,13 +1026,13 @@ The function must return the column where the completion starts. It must be a
number between zero and the cursor column "col('.')". This involves looking number between zero and the cursor column "col('.')". This involves looking
at the characters just before the cursor and including those characters that at the characters just before the cursor and including those characters that
could be part of the completed item. The text between this column and the could be part of the completed item. The text between this column and the
cursor column will be replaced with the matches. cursor column will be replaced with the matches. If the returned value is
larger than the cursor column, the cursor column is used.
Special return values: Negative return values:
-1 If no completion can be done, the completion will be cancelled with an -2 To cancel silently and stay in completion mode.
error message. -3 To cancel silently and leave completion mode.
-2 To cancel silently and stay in completion mode. Another negative value: completion starts at the cursor column
-3 To cancel silently and leave completion mode.
On the second invocation the arguments are: On the second invocation the arguments are:
a:findstart 0 a:findstart 0

View File

@@ -3201,8 +3201,7 @@ A jump table for the options with a short description can be found at |Q_op|.
so far, matches. The matched string is highlighted. If the pattern so far, matches. The matched string is highlighted. If the pattern
is invalid or not found, nothing is shown. The screen will be updated is invalid or not found, nothing is shown. The screen will be updated
often, this is only useful on fast terminals. often, this is only useful on fast terminals.
Also applies to the `:s`, `:g` and `:v` commands. < Note that the match will be shown, but the cursor will return to its
Note that the match will be shown, but the cursor will return to its
original position when no match is found and when pressing <Esc>. You original position when no match is found and when pressing <Esc>. You
still need to finish the search command with <Enter> to move the still need to finish the search command with <Enter> to move the
cursor to the match. cursor to the match.

View File

@@ -1243,7 +1243,7 @@ doxygen_javadoc_autobrief 1 Set to 0 to disable javadoc autobrief
doxygen_end_punctuation '[.]' Set to regexp match for the ending doxygen_end_punctuation '[.]' Set to regexp match for the ending
punctuation of brief punctuation of brief
There are also some hilight groups worth mentioning as they can be useful in There are also some highlight groups worth mentioning as they can be useful in
configuration. configuration.
Highlight Effect ~ Highlight Effect ~
@@ -2610,6 +2610,48 @@ Any combination of these three variables is legal, but might highlight more
commands than are actually available to you by the game. commands than are actually available to you by the game.
R *r.vim* *ft-r-syntax*
The parsing of R code for syntax highlight starts 40 lines backwards, but you
can set a different value in your |vimrc|. Example: >
let r_syntax_minlines = 60
You can also turn off syntax highlighting of ROxygen: >
let r_syntax_hl_roxygen = 0
enable folding of code delimited by parentheses, square brackets and curly
braces: >
let r_syntax_folding = 1
and highlight as functions all keywords followed by an opening parenthesis: >
let r_syntax_fun_pattern = 1
R MARKDOWN *rmd.vim* *ft-rmd-syntax*
To disable syntax highlight of YAML header, add to your |vimrc|: >
let rmd_syn_hl_yaml = 0
To disable syntax highlighting of citation keys: >
let rmd_syn_hl_citations = 0
To highlight R code in knitr chunk headers: >
let rmd_syn_hl_chunk = 1
By default, chunks of R code will be highlighted following the rules of R
language. If you want proper syntax highlighting of chunks of other languages,
you should add them to either `markdown_fenced_languages` or
`rmd_fenced_languages`. For example to properly highlight both R and Python,
you may add this to your |vimrc|: >
let rmd_fenced_languages = ['r', 'python']
R RESTRUCTURED TEXT *rrst.vim* *ft-rrst-syntax*
To highlight R code in knitr chunk headers, add to your |vimrc|: >
let rrst_syn_hl_chunk = 1
READLINE *readline.vim* *ft-readline-syntax* READLINE *readline.vim* *ft-readline-syntax*
The readline library is primarily used by the BASH shell, which adds quite a The readline library is primarily used by the BASH shell, which adds quite a

View File

@@ -283,6 +283,8 @@ machines. Therefore, don't rely on Vim always warning you.
If you really don't want to see this message, you can add the 'A' flag to the If you really don't want to see this message, you can add the 'A' flag to the
'shortmess' option. But it's very unusual that you need this. 'shortmess' option. But it's very unusual that you need this.
For programatic access to the swap file, see |swapinfo()|.
============================================================================== ==============================================================================
*11.4* Further reading *11.4* Further reading

View File

@@ -1,7 +1,8 @@
" Vim filetype plugin file " Vim filetype plugin file
" Language: Haskell " Language: Haskell
" Maintainer: Daniel Campoverde <alx@sillybytes.net>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09 " Latest Revision: 2018-08-27
if exists("b:did_ftplugin") if exists("b:did_ftplugin")
finish finish
@@ -15,6 +16,7 @@ let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=s1fl:{-,mb:-,ex:-},:-- commentstring=--\ %s setlocal comments=s1fl:{-,mb:-,ex:-},:-- commentstring=--\ %s
setlocal formatoptions-=t formatoptions+=croql setlocal formatoptions-=t formatoptions+=croql
setlocal omnifunc=haskellcomplete#Complete
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save

View File

@@ -2,7 +2,7 @@
" Language: R Markdown file " Language: R Markdown file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Mon Jun 06, 2016 09:41PM " Last Change: Sun Jul 22, 2018 06:51PM
" Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann) " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
" Only do this when not yet done for this buffer " Only do this when not yet done for this buffer
@@ -10,19 +10,12 @@ if exists("b:did_ftplugin")
finish finish
endif endif
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim if exists('g:rmd_include_html') && g:rmd_include_html
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
" Nvim-R plugin needs this
if exists("*CompleteR")
if &omnifunc == "CompleteR"
let b:rplugin_nonr_omnifunc = ""
else
let b:rplugin_nonr_omnifunc = &omnifunc
endif
set omnifunc=CompleteR
endif endif
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s setlocal comments=fb:*,fb:-,fb:+,n:>
setlocal commentstring=#\ %s
setlocal formatoptions+=tcqln setlocal formatoptions+=tcqln
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+ setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
setlocal iskeyword=@,48-57,_,. setlocal iskeyword=@,48-57,_,.
@@ -30,6 +23,22 @@ setlocal iskeyword=@,48-57,_,.
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
function! FormatRmd()
if search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")
setlocal comments=:#',:###,:##,:#
else
setlocal comments=fb:*,fb:-,fb:+,n:>
endif
return 1
endfunction
" If you do not want 'comments' dynamically defined, put in your vimrc:
" let g:rmd_dynamic_comments = 0
if !exists("g:rmd_dynamic_comments") || (exists("g:rmd_dynamic_comments") && g:rmd_dynamic_comments == 1)
setlocal formatexpr=FormatRmd()
endif
" Enables pandoc if it is installed " Enables pandoc if it is installed
unlet! b:did_ftplugin unlet! b:did_ftplugin
runtime ftplugin/pandoc.vim runtime ftplugin/pandoc.vim

View File

@@ -2,7 +2,7 @@
" Language: reStructuredText documentation format with R code " Language: reStructuredText documentation format with R code
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Tue Apr 07, 2015 04:38PM " Last Change: Wed Nov 01, 2017 10:47PM
" Original work by Alex Zvoleff " Original work by Alex Zvoleff
" Only do this when not yet done for this buffer " Only do this when not yet done for this buffer
@@ -16,11 +16,27 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo let s:cpo_save = &cpo
set cpo&vim set cpo&vim
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s setlocal comments=fb:*,fb:-,fb:+,n:>
setlocal commentstring=#\ %s
setlocal formatoptions+=tcqln setlocal formatoptions+=tcqln
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+ setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
setlocal iskeyword=@,48-57,_,. setlocal iskeyword=@,48-57,_,.
function! FormatRrst()
if search('^\.\. {r', "bncW") > search('^\.\. \.\.$', "bncW")
setlocal comments=:#',:###,:##,:#
else
setlocal comments=fb:*,fb:-,fb:+,n:>
endif
return 1
endfunction
" If you do not want 'comments' dynamically defined, put in your vimrc:
" let g:rrst_dynamic_comments = 0
if !exists("g:rrst_dynamic_comments") || (exists("g:rrst_dynamic_comments") && g:rrst_dynamic_comments == 1)
setlocal formatexpr=FormatRrst()
endif
if has("gui_win32") && !exists("b:browsefilter") if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" . let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
\ "All Files (*.*)\t*.*\n" \ "All Files (*.*)\t*.*\n"

View File

@@ -3,9 +3,6 @@
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2011-07-08 " Latest Revision: 2011-07-08
let s:cpo_save = &cpo
set cpo&vim
setlocal indentexpr=GetDTDIndent() setlocal indentexpr=GetDTDIndent()
setlocal indentkeys=!^F,o,O,> setlocal indentkeys=!^F,o,O,>
setlocal nosmartindent setlocal nosmartindent
@@ -14,6 +11,9 @@ if exists("*GetDTDIndent")
finish finish
endif endif
let s:cpo_save = &cpo
set cpo&vim
" TODO: Needs to be adjusted to stop at [, <, and ]. " TODO: Needs to be adjusted to stop at [, <, and ].
let s:token_pattern = '^[^[:space:]]\+' let s:token_pattern = '^[^[:space:]]\+'

View File

@@ -663,7 +663,7 @@ func! s:CSSIndent()
else else
let cur_hasfield = curtext =~ '^\s*[a-zA-Z0-9-]\+:' let cur_hasfield = curtext =~ '^\s*[a-zA-Z0-9-]\+:'
let prev_unfinished = s:CssUnfinished(prev_text) let prev_unfinished = s:CssUnfinished(prev_text)
if !cur_hasfield && (prev_hasfield || prev_unfinished) if prev_unfinished
" Continuation line has extra indent if the previous line was not a " Continuation line has extra indent if the previous line was not a
" continuation line. " continuation line.
let extra = shiftwidth() let extra = shiftwidth()
@@ -716,9 +716,13 @@ func! s:CSSIndent()
endfunc "}}} endfunc "}}}
" Inside <style>: Whether a line is unfinished. " Inside <style>: Whether a line is unfinished.
" tag:
" tag: blah
" tag: blah &&
" tag: blah ||
func! s:CssUnfinished(text) func! s:CssUnfinished(text)
"{{{ "{{{
return a:text =~ '\s\(||\|&&\|:\)\s*$' return a:text =~ '\(||\|&&\|:\|\k\)\s*$'
endfunc "}}} endfunc "}}}
" Search back for the first unfinished line above "lnum". " Search back for the first unfinished line above "lnum".

View File

@@ -2,7 +2,7 @@
" Language: R " Language: R
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com> " Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Thu Feb 18, 2016 06:32AM " Last Change: Sun Aug 19, 2018 09:13PM
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
@@ -19,22 +19,16 @@ if exists("*GetRIndent")
finish finish
endif endif
let s:cpo_save = &cpo
set cpo&vim
" Options to make the indentation more similar to Emacs/ESS: " Options to make the indentation more similar to Emacs/ESS:
if !exists("g:r_indent_align_args") let g:r_indent_align_args = get(g:, 'r_indent_align_args', 1)
let g:r_indent_align_args = 1 let g:r_indent_ess_comments = get(g:, 'r_indent_ess_comments', 0)
endif let g:r_indent_comment_column = get(g:, 'r_indent_comment_column', 40)
if !exists("g:r_indent_ess_comments") let g:r_indent_ess_compatible = get(g:, 'r_indent_ess_compatible', 0)
let g:r_indent_ess_comments = 0 let g:r_indent_op_pattern = get(g:, 'r_indent_op_pattern',
endif \ '\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$')
if !exists("g:r_indent_comment_column")
let g:r_indent_comment_column = 40
endif
if ! exists("g:r_indent_ess_compatible")
let g:r_indent_ess_compatible = 0
endif
if ! exists("g:r_indent_op_pattern")
let g:r_indent_op_pattern = '\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$'
endif
function s:RDelete_quotes(line) function s:RDelete_quotes(line)
let i = 0 let i = 0
@@ -231,7 +225,7 @@ function GetRIndent()
let cline = SanitizeRLine(cline) let cline = SanitizeRLine(cline)
if cline =~ '^\s*}' || cline =~ '^\s*}\s*)$' if cline =~ '^\s*}'
let indline = s:Get_matching_brace(clnum, '{', '}', 1) let indline = s:Get_matching_brace(clnum, '{', '}', 1)
if indline > 0 && indline != clnum if indline > 0 && indline != clnum
let iline = SanitizeRLine(getline(indline)) let iline = SanitizeRLine(getline(indline))
@@ -244,6 +238,11 @@ function GetRIndent()
endif endif
endif endif
if cline =~ '^\s*)$'
let indline = s:Get_matching_brace(clnum, '(', ')', 1)
return indent(indline)
endif
" Find the first non blank line above the current line " Find the first non blank line above the current line
let lnum = s:Get_prev_line(clnum) let lnum = s:Get_prev_line(clnum)
" Hit the start of the file, use zero indent. " Hit the start of the file, use zero indent.
@@ -515,7 +514,9 @@ function GetRIndent()
endwhile endwhile
return ind return ind
endfunction endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2 " vim: sw=2

View File

@@ -2,7 +2,7 @@
" Language: Rmd " Language: Rmd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com> " Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Tue Apr 07, 2015 04:38PM " Last Change: Sun Aug 19, 2018 09:14PM
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
@@ -20,7 +20,10 @@ if exists("*GetRmdIndent")
finish finish
endif endif
function GetMdIndent() let s:cpo_save = &cpo
set cpo&vim
function s:GetMdIndent()
let pline = getline(v:lnum - 1) let pline = getline(v:lnum - 1)
let cline = getline(v:lnum) let cline = getline(v:lnum)
if prevnonblank(v:lnum - 1) < v:lnum - 1 || cline =~ '^\s*[-\+\*]\s' || cline =~ '^\s*\d\+\.\s\+' if prevnonblank(v:lnum - 1) < v:lnum - 1 || cline =~ '^\s*[-\+\*]\s' || cline =~ '^\s*\d\+\.\s\+'
@@ -33,15 +36,31 @@ function GetMdIndent()
return indent(prevnonblank(v:lnum - 1)) return indent(prevnonblank(v:lnum - 1))
endfunction endfunction
function s:GetYamlIndent()
let pline = getline(v:lnum - 1)
if pline =~ ':\s*$'
return indent(v:lnum) + &sw
elseif pline =~ '^\s*- '
return indent(v:lnum) + 2
endif
return indent(prevnonblank(v:lnum - 1))
endfunction
function GetRmdIndent() function GetRmdIndent()
if getline(".") =~ '^[ \t]*```{r .*}$' || getline(".") =~ '^[ \t]*```$' if getline(".") =~ '^[ \t]*```{r .*}$' || getline(".") =~ '^[ \t]*```$'
return 0 return 0
endif endif
if search('^[ \t]*```{r', "bncW") > search('^[ \t]*```$', "bncW") if search('^[ \t]*```{r', "bncW") > search('^[ \t]*```$', "bncW")
return s:RIndent() return s:RIndent()
elseif v:lnum > 1 && search('^---$', "bnW") == 1 &&
\ (search('^---$', "nW") > v:lnum || search('^...$', "nW") > v:lnum)
return s:GetYamlIndent()
else else
return GetMdIndent() return s:GetMdIndent()
endif endif
endfunction endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2 " vim: sw=2

View File

@@ -21,7 +21,7 @@ else
let s:TeXIndent = function(substitute(&indentexpr, "()", "", "")) let s:TeXIndent = function(substitute(&indentexpr, "()", "", ""))
endif endif
unlet b:did_indent unlet! b:did_indent
runtime indent/r.vim runtime indent/r.vim
let s:RIndent = function(substitute(&indentexpr, "()", "", "")) let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
let b:did_indent = 1 let b:did_indent = 1

View File

@@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus. " You can also use this as a start for your own set of menus.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Mar 04 " Last Change: 2018 May 17
" Note that ":an" (short for ":anoremenu") is often used to make a menu work " Note that ":an" (short for ":anoremenu") is often used to make a menu work
" in all modes and avoid side effects from mappings defined by the user. " in all modes and avoid side effects from mappings defined by the user.
@@ -56,6 +56,13 @@ if exists("v:lang") || &langmenu != ""
let s:lang = substitute(s:lang, '\.[^.]*', "", "") let s:lang = substitute(s:lang, '\.[^.]*', "", "")
exe "runtime! lang/menu_" . s:lang . "[^a-z]*vim" exe "runtime! lang/menu_" . s:lang . "[^a-z]*vim"
if !exists("did_menu_trans") && s:lang =~ '_'
" If the language includes a region try matching without that region.
" (e.g. find menu_de.vim if s:lang == de_DE).
let langonly = substitute(s:lang, '_.*', "", "")
exe "runtime! lang/menu_" . langonly . "[^a-z]*vim"
endif
if !exists("did_menu_trans") && strlen($LANG) > 1 && s:lang !~ '^en_us' if !exists("did_menu_trans") && strlen($LANG) > 1 && s:lang !~ '^en_us'
" On windows locale names are complicated, try using $LANG, it might " On windows locale names are complicated, try using $LANG, it might
" have been set by set_init_1(). But don't do this for "en" or "en_us". " have been set by set_init_1(). But don't do this for "en" or "en_us".
@@ -159,7 +166,7 @@ nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p [p
inoremenu &Edit.Put\ &Before<Tab>[p <C-O>[p inoremenu &Edit.Put\ &Before<Tab>[p <C-O>[p
nnoremenu 20.380 &Edit.Put\ &After<Tab>]p ]p nnoremenu 20.380 &Edit.Put\ &After<Tab>]p ]p
inoremenu &Edit.Put\ &After<Tab>]p <C-O>]p inoremenu &Edit.Put\ &After<Tab>]p <C-O>]p
if has("win32") || has("win16") if has("win32")
vnoremenu 20.390 &Edit.&Delete<Tab>x x vnoremenu 20.390 &Edit.&Delete<Tab>x x
endif endif
noremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG :<C-U>call <SID>SelectAll()<CR> noremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG :<C-U>call <SID>SelectAll()<CR>
@@ -167,7 +174,7 @@ inoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-O>:call <SID>S
cnoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-U>call <SID>SelectAll()<CR> cnoremenu <script> <silent> 20.400 &Edit.&Select\ All<Tab>ggVG <C-U>call <SID>SelectAll()<CR>
an 20.405 &Edit.-SEP2- <Nop> an 20.405 &Edit.-SEP2- <Nop>
if has("win32") || has("win16") || has("gui_gtk") || has("gui_kde") || has("gui_motif") if has("win32") || has("gui_gtk") || has("gui_kde") || has("gui_motif")
an 20.410 &Edit.&Find\.\.\. :promptfind<CR> an 20.410 &Edit.&Find\.\.\. :promptfind<CR>
vunmenu &Edit.&Find\.\.\. vunmenu &Edit.&Find\.\.\.
vnoremenu <silent> &Edit.&Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR> vnoremenu <silent> &Edit.&Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
@@ -194,6 +201,8 @@ fun! s:EditVimrc()
else else
let fname = $VIM . "/_vimrc" let fname = $VIM . "/_vimrc"
endif endif
elseif has("amiga")
let fname = "s:.vimrc"
else else
let fname = $HOME . "/.vimrc" let fname = $HOME . "/.vimrc"
endif endif
@@ -337,57 +346,77 @@ fun! s:FileFormat()
endif endif
endfun endfun
let s:did_setup_color_schemes = 0
" Setup the Edit.Color Scheme submenu " Setup the Edit.Color Scheme submenu
func! s:SetupColorSchemes() abort
if s:did_setup_color_schemes
return
endif
let s:did_setup_color_schemes = 1
" get NL separated string with file names let n = globpath(&runtimepath, "colors/*.vim", 1, 1)
let s:n = globpath(&runtimepath, "colors/*.vim") let n += globpath(&runtimepath, "pack/*/start/*/colors/*.vim", 1, 1)
let n += globpath(&runtimepath, "pack/*/opt/*/colors/*.vim", 1, 1)
" split at NL, ignore case for Windows, sort on name " Ignore case for VMS and windows, sort on name
let s:names = sort(map(split(s:n, "\n"), 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1) let names = sort(map(n, 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1)
" define all the submenu entries " define all the submenu entries
let s:idx = 100 let idx = 100
for s:name in s:names for name in names
exe "an 20.450." . s:idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "<CR>" exe "an 20.450." . idx . ' &Edit.C&olor\ Scheme.' . name . " :colors " . name . "<CR>"
let s:idx = s:idx + 10 let idx = idx + 10
endfor endfor
unlet s:name s:names s:n s:idx silent! aunmenu &Edit.Show\ C&olor\ Schemes\ in\ Menu
endfun
if exists("do_no_lazyload_menus")
call s:SetupColorSchemes()
else
an <silent> 20.450 &Edit.Show\ C&olor\ Schemes\ in\ Menu :call <SID>SetupColorSchemes()<CR>
endif
" Setup the Edit.Keymap submenu " Setup the Edit.Keymap submenu
if has("keymap") if has("keymap")
let s:n = globpath(&runtimepath, "keymap/*.vim") let s:did_setup_keymaps = 0
if s:n != ""
let s:idx = 100 func! s:SetupKeymaps() abort
an 20.460.90 &Edit.&Keymap.None :set keymap=<CR> if s:did_setup_keymaps
while strlen(s:n) > 0 return
let s:i = stridx(s:n, "\n") endif
if s:i < 0 let s:did_setup_keymaps = 1
let s:name = s:n
let s:n = "" let n = globpath(&runtimepath, "keymap/*.vim", 1, 1)
else if !empty(n)
let s:name = strpart(s:n, 0, s:i) let idx = 100
let s:n = strpart(s:n, s:i + 1, 19999) an 20.460.90 &Edit.&Keymap.None :set keymap=<CR>
endif for name in n
" Ignore case for Windows " Ignore case for VMS and windows
let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '') let name = substitute(name, '\c.*[/\\:\]]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
exe "an 20.460." . s:idx . ' &Edit.&Keymap.' . s:name . " :set keymap=" . s:name . "<CR>" exe "an 20.460." . idx . ' &Edit.&Keymap.' . name . " :set keymap=" . name . "<CR>"
unlet s:name let idx = idx + 10
unlet s:i endfor
let s:idx = s:idx + 10 endif
endwhile silent! aunmenu &Edit.Show\ &Keymaps\ in\ Menu
unlet s:idx endfun
if exists("do_no_lazyload_menus")
call s:SetupKeymaps()
else
an <silent> 20.460 &Edit.Show\ &Keymaps\ in\ Menu :call <SID>SetupKeymaps()<CR>
endif endif
unlet s:n
endif endif
if has("win32") || has("win16") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_mac") if has("win32") || has("gui_motif") || has("gui_gtk") || has("gui_kde") || has("gui_photon") || has("gui_mac")
an 20.470 &Edit.Select\ Fo&nt\.\.\. :set guifont=*<CR> an 20.470 &Edit.Select\ Fo&nt\.\.\. :set guifont=*<CR>
endif endif
" Programming menu " Programming menu
if !exists("g:ctags_command") if !exists("g:ctags_command")
let g:ctags_command = "ctags -R ." if has("vms")
let g:ctags_command = "mc vim:ctags *.*"
else
let g:ctags_command = "ctags -R ."
endif
endif endif
an 40.300 &Tools.&Jump\ to\ This\ Tag<Tab>g^] g<C-]> an 40.300 &Tools.&Jump\ to\ This\ Tag<Tab>g^] g<C-]>
@@ -435,10 +464,10 @@ if has("spell")
endif endif
let found = 0 let found = 0
let s = globpath(&rtp, "spell/*." . enc . ".spl") let s = globpath(&runtimepath, "spell/*." . enc . ".spl", 1, 1)
if s != "" if !empty(s)
let n = 300 let n = 300
for f in split(s, "\n") for f in s
let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "") let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "")
if nm != "en" && nm !~ '/' if nm != "en" && nm !~ '/'
let _nm = nm let _nm = nm
@@ -532,8 +561,12 @@ an <silent> 40.540 &Tools.Conve&rt\ Back<Tab>:%!xxd\ -r
" set. " set.
func! s:XxdConv() func! s:XxdConv()
let mod = &mod let mod = &mod
call s:XxdFind() if has("vms")
exe '%!"' . g:xxdprogram . '"' %!mc vim:xxd
else
call s:XxdFind()
exe '%!"' . g:xxdprogram . '"'
endif
if getline(1) =~ "^0000000:" " only if it worked if getline(1) =~ "^0000000:" " only if it worked
set ft=xxd set ft=xxd
endif endif
@@ -542,8 +575,12 @@ endfun
func! s:XxdBack() func! s:XxdBack()
let mod = &mod let mod = &mod
call s:XxdFind() if has("vms")
exe '%!"' . g:xxdprogram . '" -r' %!mc vim:xxd -r
else
call s:XxdFind()
exe '%!"' . g:xxdprogram . '" -r'
endif
set ft= set ft=
doautocmd filetypedetect BufReadPost doautocmd filetypedetect BufReadPost
let &mod = mod let &mod = mod
@@ -560,27 +597,46 @@ func! s:XxdFind()
endif endif
endfun endfun
let s:did_setup_compilers = 0
" Setup the Tools.Compiler submenu " Setup the Tools.Compiler submenu
let s:n = globpath(&runtimepath, "compiler/*.vim") func! s:SetupCompilers() abort
let s:idx = 100 if s:did_setup_compilers
while strlen(s:n) > 0 return
let s:i = stridx(s:n, "\n")
if s:i < 0
let s:name = s:n
let s:n = ""
else
let s:name = strpart(s:n, 0, s:i)
let s:n = strpart(s:n, s:i + 1, 19999)
endif endif
" Ignore case for Windows let s:did_setup_compilers = 1
let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '')
exe "an 30.440." . s:idx . ' &Tools.Se&t\ Compiler.' . s:name . " :compiler " . s:name . "<CR>" let n = globpath(&runtimepath, "compiler/*.vim", 1, 1)
unlet s:name let idx = 100
unlet s:i for name in n
let s:idx = s:idx + 10 " Ignore case for VMS and windows
endwhile let name = substitute(name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '')
unlet s:n exe "an 30.440." . idx . ' &Tools.Se&t\ Compiler.' . name . " :compiler " . name . "<CR>"
unlet s:idx let idx = idx + 10
endfor
silent! aunmenu &Tools.Show\ Compiler\ Se&ttings\ in\ Menu
endfun
if exists("do_no_lazyload_menus")
call s:SetupCompilers()
else
an <silent> 30.440 &Tools.Show\ Compiler\ Se&ttings\ in\ Menu :call <SID>SetupCompilers()<CR>
endif
" Load ColorScheme, Compiler Setting and Keymap menus when idle.
if !exists("do_no_lazyload_menus")
func! s:SetupLazyloadMenus()
call s:SetupColorSchemes()
call s:SetupCompilers()
if has("keymap")
call s:SetupKeymaps()
endif
endfunc
augroup SetupLazyloadMenus
au!
au CursorHold,CursorHoldI * call <SID>SetupLazyloadMenus() | au! SetupLazyloadMenus
augroup END
endif
if !exists("no_buffers_menu") if !exists("no_buffers_menu")
@@ -683,13 +739,21 @@ endfunc
func! s:BMHash(name) func! s:BMHash(name)
" Make name all upper case, so that chars are between 32 and 96 " Make name all upper case, so that chars are between 32 and 96
let nm = substitute(a:name, ".*", '\U\0', "") let nm = substitute(a:name, ".*", '\U\0', "")
let sp = char2nr(' ') if has("ebcdic")
" HACK: Replace all non alphabetics with 'Z'
" Just to make it work for now.
let nm = substitute(nm, "[^A-Z]", 'Z', "g")
let sp = char2nr('A') - 1
else
let sp = char2nr(' ')
endif
" convert first six chars into a number for sorting: " convert first six chars into a number for sorting:
return (char2nr(nm[0]) - sp) * 0x800000 + (char2nr(nm[1]) - sp) * 0x20000 + (char2nr(nm[2]) - sp) * 0x1000 + (char2nr(nm[3]) - sp) * 0x80 + (char2nr(nm[4]) - sp) * 0x20 + (char2nr(nm[5]) - sp) return (char2nr(nm[0]) - sp) * 0x800000 + (char2nr(nm[1]) - sp) * 0x20000 + (char2nr(nm[2]) - sp) * 0x1000 + (char2nr(nm[3]) - sp) * 0x80 + (char2nr(nm[4]) - sp) * 0x20 + (char2nr(nm[5]) - sp)
endfunc endfunc
func! s:BMHash2(name) func! s:BMHash2(name)
let nm = substitute(a:name, ".", '\L\0', "") let nm = substitute(a:name, ".", '\L\0', "")
" Not exactly right for EBCDIC...
if nm[0] < 'a' || nm[0] > 'z' if nm[0] < 'a' || nm[0] > 'z'
return '&others.' return '&others.'
elseif nm[0] <= 'd' elseif nm[0] <= 'd'
@@ -1082,7 +1146,7 @@ if (exists("did_load_filetypes") || exists("syntax_on"))
if exists("do_syntax_sel_menu") if exists("do_syntax_sel_menu")
runtime! synmenu.vim runtime! synmenu.vim
else else
an 50.10 &Syntax.&Show\ File\ Types\ in\ Menu :let do_syntax_sel_menu = 1<Bar>runtime! synmenu.vim<Bar>aunmenu &Syntax.&Show\ File\ Types\ in\ Menu<CR> an <silent> 50.10 &Syntax.&Show\ File\ Types\ in\ Menu :let do_syntax_sel_menu = 1<Bar>runtime! synmenu.vim<Bar>aunmenu &Syntax.&Show\ File\ Types\ in\ Menu<CR>
an 50.195 &Syntax.-SEP1- <Nop> an 50.195 &Syntax.-SEP1- <Nop>
endif endif

View File

@@ -5,7 +5,7 @@
" Tom Payne <tom@tompayne.org> " Tom Payne <tom@tompayne.org>
" Contributor: Johannes Ranke <jranke@uni-bremen.de> " Contributor: Johannes Ranke <jranke@uni-bremen.de>
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sat Apr 08, 2017 07:01PM " Last Change: Wed Aug 01, 2018 10:10PM
" Filenames: *.R *.r *.Rhistory *.Rt " Filenames: *.R *.r *.Rhistory *.Rt
" "
" NOTE: The highlighting of R functions might be defined in " NOTE: The highlighting of R functions might be defined in
@@ -43,15 +43,17 @@ endif
if exists("g:r_syntax_folding") && g:r_syntax_folding if exists("g:r_syntax_folding") && g:r_syntax_folding
setlocal foldmethod=syntax setlocal foldmethod=syntax
endif endif
if !exists("g:r_syntax_hl_roxygen")
let g:r_syntax_hl_roxygen = 1 let g:r_syntax_hl_roxygen = get(g:, 'r_syntax_hl_roxygen', 1)
endif
syn case match syn case match
" Comment " Comment
syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):" syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):"
syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*" syn match rTodoParen contained "\(BUG\|FIXME\|NOTE\|TODO\)\s*(.\{-})\s*:" contains=rTodoKeyw,rTodoInfo transparent
syn keyword rTodoKeyw BUG FIXME NOTE TODO contained
syn match rTodoInfo "(\zs.\{-}\ze)" contained
syn match rComment contains=@Spell,rCommentTodo,rTodoParen,rOBlock "#.*"
" Roxygen " Roxygen
if g:r_syntax_hl_roxygen if g:r_syntax_hl_roxygen
@@ -65,7 +67,7 @@ if g:r_syntax_hl_roxygen
" First we match all roxygen blocks as containing only a title. In case an " First we match all roxygen blocks as containing only a title. In case an
" empty roxygen line ending the title or a tag is found, this will be " empty roxygen line ending the title or a tag is found, this will be
" overriden later by the definitions of rOBlock. " overridden later by the definitions of rOBlock.
syn match rOTitleBlock "\%^\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag syn match rOTitleBlock "\%^\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
syn match rOTitleBlock "^\s*\n\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag syn match rOTitleBlock "^\s*\n\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
@@ -91,7 +93,7 @@ if g:r_syntax_hl_roxygen
syn match rOTitle "^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag syn match rOTitle "^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
syn match rOTitleTag contained "@title" syn match rOTitleTag contained "@title"
syn match rOCommentKey "#\{1,2}'" contained syn match rOCommentKey "^\s*#\{1,2}'" contained
syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOTag fold syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOTag fold
" rOTag list generated from the lists in " rOTag list generated from the lists in
@@ -256,6 +258,7 @@ if exists("g:r_syntax_folding")
syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError fold syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError fold
syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError fold syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError fold
syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError fold syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError fold
syn region rSection matchgroup=Title start=/^#.*[-=#]\{4,}/ end=/^#.*[-=#]\{4,}/ms=s-2,me=s-1 transparent contains=ALL fold
else else
syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError
syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError
@@ -282,13 +285,8 @@ endif
if g:r_syntax_fun_pattern == 1 if g:r_syntax_fun_pattern == 1
syn match rFunction '[0-9a-zA-Z_\.]\+\s*\ze(' syn match rFunction '[0-9a-zA-Z_\.]\+\s*\ze('
else else
if !exists("g:R_hi_fun") " Nvim-R:
let g:R_hi_fun = 1 runtime R/functions.vim
endif
if g:R_hi_fun
" Nvim-R:
runtime R/functions.vim
endif
endif endif
syn match rDollar display contained "\$" syn match rDollar display contained "\$"
@@ -311,7 +309,7 @@ syn keyword rType array category character complex double function integer list
" Name of object with spaces " Name of object with spaces
if &filetype != "rmd" && &filetype != "rrst" if &filetype != "rmd" && &filetype != "rrst"
syn region rNameWSpace start="`" end="`" syn region rNameWSpace start="`" end="`" contains=rSpaceFun
endif endif
if &filetype == "rhelp" if &filetype == "rhelp"
@@ -331,7 +329,10 @@ hi def link rAssign Statement
hi def link rBoolean Boolean hi def link rBoolean Boolean
hi def link rBraceError Error hi def link rBraceError Error
hi def link rComment Comment hi def link rComment Comment
hi def link rTodoParen Comment
hi def link rTodoInfo SpecialComment
hi def link rCommentTodo Todo hi def link rCommentTodo Todo
hi def link rTodoKeyw Todo
hi def link rComplex Number hi def link rComplex Number
hi def link rConditional Conditional hi def link rConditional Conditional
hi def link rConstant Constant hi def link rConstant Constant
@@ -341,6 +342,7 @@ hi def link rDollar SpecialChar
hi def link rError Error hi def link rError Error
hi def link rFloat Float hi def link rFloat Float
hi def link rFunction Function hi def link rFunction Function
hi def link rSpaceFun Function
hi def link rHelpIdent Identifier hi def link rHelpIdent Identifier
hi def link rhPreProc PreProc hi def link rhPreProc PreProc
hi def link rhSection PreCondit hi def link rhSection PreCondit

View File

@@ -1,123 +1,118 @@
" markdown Text with R statements " markdown Text with R statements
" Language: markdown with R code chunks " Language: markdown with R code chunks
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Sat Jan 28, 2017 10:06PM " Last Change: Sat Aug 25, 2018 03:44PM
"
" CONFIGURATION:
" To highlight chunk headers as R code, put in your vimrc (e.g. .config/nvim/init.vim):
" let rmd_syn_hl_chunk = 1
" "
" For highlighting pandoc extensions to markdown like citations and TeX and " For highlighting pandoc extensions to markdown like citations and TeX and
" many other advanced features like folding of markdown sections, it is " many other advanced features like folding of markdown sections, it is
" recommended to install the vim-pandoc filetype plugin as well as the " recommended to install the vim-pandoc filetype plugin as well as the
" vim-pandoc-syntax filetype plugin from https://github.com/vim-pandoc. " vim-pandoc-syntax filetype plugin from https://github.com/vim-pandoc.
"
" TODO:
" - Provide highlighting for rmarkdown parameters in yaml header
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
endif endif
" load all of pandoc info, e.g. from " Configuration if not using pandoc syntax:
" Add syntax highlighting of YAML header
let g:rmd_syn_hl_yaml = get(g:, 'rmd_syn_hl_yaml', 1)
" Add syntax highlighting of citation keys
let g:rmd_syn_hl_citations = get(g:, 'rmd_syn_hl_citations', 1)
" Highlight the header of the chunk of R code
let g:rmd_syn_hl_chunk = get(g:, 'g:rmd_syn_hl_chunk', 0)
" Pandoc-syntax has more features, but it is slower.
" https://github.com/vim-pandoc/vim-pandoc-syntax " https://github.com/vim-pandoc/vim-pandoc-syntax
let g:pandoc#syntax#codeblocks#embeds#langs = get(g:, 'pandoc#syntax#codeblocks#embeds#langs', ['r'])
runtime syntax/pandoc.vim runtime syntax/pandoc.vim
if exists("b:current_syntax") if exists("b:current_syntax")
let rmdIsPandoc = 1 " Fix recognition of R code
unlet b:current_syntax syn region pandocDelimitedCodeBlock_r start=/^```{r\>.*}$/ end=/^```$/ contained containedin=pandocDelimitedCodeBlock contains=@R
else syn region rmdrInline matchgroup=rmdInlineDelim start="`r " end="`" contains=@R containedin=pandocLaTeXRegion,yamlFlowString keepend
let rmdIsPandoc = 0 hi def link rmdInlineDelim Delimiter
runtime syntax/markdown.vim let b:current_syntax = "rmd"
if exists("b:current_syntax") finish
unlet b:current_syntax
endif
" load all of the yaml syntax highlighting rules into @yaml
syntax include @yaml syntax/yaml.vim
if exists("b:current_syntax")
unlet b:current_syntax
endif
" highlight yaml block commonly used for front matter
syntax region rmdYamlBlock matchgroup=rmdYamlBlockDelim start="^---" matchgroup=rmdYamlBlockDelim end="^---" contains=@yaml keepend fold
endif endif
if !exists("g:rmd_syn_langs") let s:cpo_save = &cpo
let g:rmd_syn_langs = ["r"] set cpo&vim
else
let s:hasr = 0 " R chunks will not be highlighted by syntax/markdown because their headers
for s:lng in g:rmd_syn_langs " follow a non standard pattern: "```{lang" instead of "^```lang".
if s:lng == "r" " Make a copy of g:markdown_fenced_languages to highlight the chunks later:
let s:hasr = 1 if exists('g:markdown_fenced_languages')
endif if !exists('g:rmd_fenced_languages')
endfor let g:rmd_fenced_languages = deepcopy(g:markdown_fenced_languages)
if s:hasr == 0 let g:markdown_fenced_languages = []
let g:rmd_syn_langs += ["r"]
endif endif
else
let g:rmd_fenced_languages = ['r']
endif endif
for s:lng in g:rmd_syn_langs runtime syntax/markdown.vim
exe 'syntax include @' . toupper(s:lng) . ' syntax/'. s:lng . '.vim'
if exists("b:current_syntax")
unlet b:current_syntax
endif
exe 'syntax region rmd' . toupper(s:lng) . 'Chunk start="^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" end="^[ \t]*```$" contains=@' . toupper(s:lng) . ',rmd' . toupper(s:lng) . 'ChunkDelim keepend fold'
if exists("g:rmd_syn_hl_chunk") && s:lng == "r" " Now highlight chunks:
" highlight R code inside chunk header for s:type in g:rmd_fenced_languages
syntax match rmdRChunkDelim "^[ \t]*```{r" contained if s:type =~ '='
syntax match rmdRChunkDelim "}$" contained let s:lng = substitute(s:type, '=.*', '')
let s:nm = substitute(s:type, '.*=', '')
else else
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" contained' let s:lng = s:type
let s:nm = s:type
endif endif
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```$" contained' unlet! b:current_syntax
exe 'syn include @Rmd'.s:nm.' syntax/'.s:lng.'.vim'
if g:rmd_syn_hl_chunk
exe 'syn region rmd'.s:nm.'ChunkDelim matchgroup=rmdCodeDelim start="^\s*```\s*{\s*'.s:nm.'\>" matchgroup=rmdCodeDelim end="}$" keepend containedin=rmd'.s:nm.'Chunk contains=@Rmd'.s:nm
exe 'syn region rmd'.s:nm.'Chunk start="^\s*```\s*{\s*'.s:nm.'\>.*$" matchgroup=rmdCodeDelim end="^\s*```\ze\s*$" keepend contains=rmd'.s:nm.'ChunkDelim,@Rmd'.s:nm
else
exe 'syn region rmd'.s:nm.'Chunk matchgroup=rmdCodeDelim start="^\s*```\s*{\s*'.s:nm.'\>.*$" matchgroup=rmdCodeDelim end="^\s*```\ze\s*$" keepend contains=@Rmd'.s:nm
endif
exe 'syn region rmd'.s:nm.'Inline matchgroup=rmdInlineDelim start="`'.s:nm.' " end="`" contains=@Rmd'.s:nm.' keepend'
endfor endfor
unlet! s:type
hi def link rmdInlineDelim Delimiter
hi def link rmdCodeDelim Delimiter
" also match and syntax highlight in-line R code " You don't need this if either your markdown/syntax.vim already highlights
syntax region rmdrInline matchgroup=rmdInlineDelim start="`r " end="`" contains=@R containedin=pandocLaTeXRegion,yamlFlowString keepend " the YAML header or you are writing standard markdown
" I was not able to highlight rmdrInline inside a pandocLaTeXCommand, although if g:rmd_syn_hl_yaml
" highlighting works within pandocLaTeXRegion and yamlFlowString. " Minimum highlighting of yaml header
syntax cluster texMathZoneGroup add=rmdrInline syn match rmdYamlFieldTtl /^\s*\zs\w*\ze:/ contained
syn match rmdYamlFieldTtl /^\s*-\s*\zs\w*\ze:/ contained
" match slidify special marker syn region yamlFlowString matchgroup=yamlFlowStringDelimiter start='"' skip='\\"' end='"' contains=yamlEscape,rmdrInline contained
syntax match rmdSlidifySpecial "\*\*\*" syn region yamlFlowString matchgroup=yamlFlowStringDelimiter start="'" skip="''" end="'" contains=yamlSingleEscape,rmdrInline contained
syn match yamlEscape contained '\\\%([\\"abefnrtv\^0_ NLP\n]\|x\x\x\|u\x\{4}\|U\x\{8}\)'
syn match yamlSingleEscape contained "''"
if rmdIsPandoc == 0 syn region pandocYAMLHeader matchgroup=rmdYamlBlockDelim start=/\%(\%^\|\_^\s*\n\)\@<=\_^-\{3}\ze\n.\+/ end=/^\([-.]\)\1\{2}$/ keepend contains=rmdYamlFieldTtl,yamlFlowString
syn match rmdBlockQuote /^\s*>.*\n\(.*\n\@<!\n\)*/ skipnl hi def link rmdYamlBlockDelim Delimiter
" LaTeX hi def link rmdYamlFieldTtl Identifier
syntax include @LaTeX syntax/tex.vim hi def link yamlFlowString String
if exists("b:current_syntax")
unlet b:current_syntax
endif
" Inline
syntax match rmdLaTeXInlDelim "\$"
syntax match rmdLaTeXInlDelim "\\\$"
syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup
" Region
syntax match rmdLaTeXRegDelim "\$\$" contained
syntax match rmdLaTeXRegDelim "\$\$latex$" contained
syntax match rmdLaTeXSt "\\[a-zA-Z]\+"
syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXRegDelim keepend
syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXRegDelim keepend
hi def link rmdBlockQuote Comment
hi def link rmdLaTeXSt Statement
hi def link rmdLaTeXInlDelim Special
hi def link rmdLaTeXRegDelim Special
endif endif
for s:lng in g:rmd_syn_langs " You don't need this if either your markdown/syntax.vim already highlights
exe 'syn sync match rmd' . toupper(s:lng) . 'SyncChunk grouphere rmd' . toupper(s:lng) . 'Chunk /^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\)/' " citations or you are writing standard markdown
endfor if g:rmd_syn_hl_citations
" From vim-pandoc-syntax
hi def link rmdYamlBlockDelim Delim " parenthetical citations
for s:lng in g:rmd_syn_langs syn match pandocPCite /\^\@<!\[[^\[\]]\{-}-\{0,1}@[[:alnum:]_][[:alnum:]à-öø-ÿÀ-ÖØ-ß_:.#$%&\-+?<>~\/]*.\{-}\]/ contains=pandocEmphasis,pandocStrong,pandocLatex,pandocCiteKey,@Spell,pandocAmpersandEscape display
exe 'hi def link rmd' . toupper(s:lng) . 'ChunkDelim Special' " in-text citations with location
endfor syn match pandocICite /@[[:alnum:]_][[:alnum:]à-öø-ÿÀ-ÖØ-ß_:.#$%&\-+?<>~\/]*\s\[.\{-1,}\]/ contains=pandocCiteKey,@Spell display
hi def link rmdInlineDelim Special " cite keys
hi def link rmdSlidifySpecial Special syn match pandocCiteKey /\(-\=@[[:alnum:]_][[:alnum:]à-öø-ÿÀ-ÖØ-ß_:.#$%&\-+?<>~\/]*\)/ containedin=pandocPCite,pandocICite contains=@NoSpell display
syn match pandocCiteAnchor /[-@]/ contained containedin=pandocCiteKey display
syn match pandocCiteLocator /[\[\]]/ contained containedin=pandocPCite,pandocICite
hi def link pandocPCite Operator
hi def link pandocICite Operator
hi def link pandocCiteKey Label
hi def link pandocCiteAnchor Operator
hi def link pandocCiteLocator Operator
endif
let b:current_syntax = "rmd" let b:current_syntax = "rmd"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8 sw=2 " vim: ts=8 sw=2

View File

@@ -1,7 +1,7 @@
" Vim syntax file " Vim syntax file
" Language: R noweb Files " Language: R noweb Files
" Maintainer: Johannes Ranke <jranke@uni-bremen.de> " Maintainer: Johannes Ranke <jranke@uni-bremen.de>
" Last Change: Sat Feb 06, 2016 06:47AM " Last Change: Thu Apr 05, 2018 11:06PM
" Version: 0.9.1 " Version: 0.9.1
" Remarks: - This file is inspired by the proposal of " Remarks: - This file is inspired by the proposal of
" Fernando Henrique Ferraz Pereira da Rosa <feferraz@ime.usp.br> " Fernando Henrique Ferraz Pereira da Rosa <feferraz@ime.usp.br>
@@ -16,7 +16,7 @@ syn case match
" Extension of Tex clusters {{{1 " Extension of Tex clusters {{{1
runtime syntax/tex.vim runtime syntax/tex.vim
unlet b:current_syntax unlet! b:current_syntax
syn cluster texMatchGroup add=@rnoweb syn cluster texMatchGroup add=@rnoweb
syn cluster texMathMatchGroup add=rnowebSexpr syn cluster texMathMatchGroup add=rnowebSexpr

View File

@@ -2,7 +2,7 @@
" Language: reST with R code chunks " Language: reST with R code chunks
" Maintainer: Alex Zvoleff, azvoleff@mail.sdsu.edu " Maintainer: Alex Zvoleff, azvoleff@mail.sdsu.edu
" Homepage: https://github.com/jalvesaq/R-Vim-runtime " Homepage: https://github.com/jalvesaq/R-Vim-runtime
" Last Change: Tue Jun 28, 2016 08:53AM " Last Change: Thu Apr 05, 2018 11:06PM
" "
" CONFIGURATION: " CONFIGURATION:
" To highlight chunk headers as R code, put in your vimrc: " To highlight chunk headers as R code, put in your vimrc:
@@ -14,7 +14,7 @@ endif
" load all of the rst info " load all of the rst info
runtime syntax/rst.vim runtime syntax/rst.vim
unlet b:current_syntax unlet! b:current_syntax
" load all of the r syntax highlighting rules into @R " load all of the r syntax highlighting rules into @R
syntax include @R syntax/r.vim syntax include @R syntax/r.vim

View File

@@ -1,8 +1,9 @@
" Vim syntax file " Vim syntax file
" Language: sudoers(5) configuration files " Language: sudoers(5) configuration files
" Previous Maintainer: Nikolai Weibull <now@bitwi.se> " Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2018-07-19 " Latest Revision: 2018-08-18
" Recent Changes: Support for #include and #includedir. " Recent Changes: Support for #include and #includedir.
" Added many new options (Samuel D. Leslie)
if exists("b:current_syntax") if exists("b:current_syntax")
finish finish
@@ -152,77 +153,120 @@ syn match sudoersDefaultTypeGreaterThan contained '>' nextgroup=@sudoersUser s
" TODO: could also deal with special characters here " TODO: could also deal with special characters here
syn match sudoersBooleanParameter contained '!' nextgroup=sudoersBooleanParameter skipwhite skipnl syn match sudoersBooleanParameter contained '!' nextgroup=sudoersBooleanParameter skipwhite skipnl
syn keyword sudoersBooleanParameter contained skipwhite skipnl syn keyword sudoersBooleanParameter contained skipwhite skipnl
\ always_query_group_plugin
\ always_set_home \ always_set_home
\ authenticate \ authenticate
\ closefrom_override \ closefrom_override
\ compress_io
\ env_editor \ env_editor
\ env_reset \ env_reset
\ exec_background
\ fast_glob
\ fqdn \ fqdn
\ ignore_audit_errors
\ ignore_dot \ ignore_dot
\ ignore_iolog_errors
\ ignore_local_sudoers \ ignore_local_sudoers
\ ignore_logfile_errors
\ ignore_unknown_defaults
\ insults \ insults
\ log_host \ log_host
\ log_input
\ log_output
\ log_year \ log_year
\ long_otp_prompt \ long_otp_prompt
\ mail_all_cmnds
\ mail_always \ mail_always
\ mail_badpass \ mail_badpass
\ mail_no_host \ mail_no_host
\ mail_no_perms \ mail_no_perms
\ mail_no_user \ mail_no_user
\ match_group_by_gid
\ netgroup_tuple
\ noexec \ noexec
\ path_info \ pam_session
\ pam_setcred
\ passprompt_override \ passprompt_override
\ path_info
\ preserve_groups \ preserve_groups
\ pwfeedback
\ requiretty \ requiretty
\ root_sudo \ root_sudo
\ rootpw \ rootpw
\ runaspw \ runaspw
\ set_home \ set_home
\ set_logname \ set_logname
\ set_utmp
\ setenv \ setenv
\ shell_noargs \ shell_noargs
\ stay_setuid \ stay_setuid
\ sudoedit_checkdir
\ sudoedit_fellow
\ syslog_pid
\ targetpw \ targetpw
\ tty_tickets \ tty_tickets
\ umask_override
\ use_netgroups
\ use_pty
\ user_command_timeouts
\ utmp_runas
\ visiblepw \ visiblepw
syn keyword sudoersIntegerParameter contained syn keyword sudoersIntegerParameter contained
\ nextgroup=sudoersIntegerParameterEquals \ nextgroup=sudoersIntegerParameterEquals
\ skipwhite skipnl \ skipwhite skipnl
\ closefrom \ closefrom
\ passwd_tries \ command_timeout
\ loglinelen \ loglinelen
\ maxseq
\ passwd_timeout \ passwd_timeout
\ passwd_tries
\ syslog_maxlen
\ timestamp_timeout \ timestamp_timeout
\ umask \ umask
syn keyword sudoersStringParameter contained syn keyword sudoersStringParameter contained
\ nextgroup=sudoersStringParameterEquals \ nextgroup=sudoersStringParameterEquals
\ skipwhite skipnl \ skipwhite skipnl
\ askpass
\ badpass_message \ badpass_message
\ editor \ editor
\ mailsub
\ noexec_file
\ passprompt
\ runas_default
\ syslog_badpri
\ syslog_goodpri
\ sudoers_locale
\ timestampdir
\ timestampowner
\ askpass
\ env_file \ env_file
\ exempt_group \ exempt_group
\ fdexec
\ group_plugin
\ iolog_dir
\ iolog_file
\ iolog_flush
\ iolog_group
\ iolog_mode
\ iolog_user
\ lecture \ lecture
\ lecture_file \ lecture_file
\ lecture_status_dir
\ listpw \ listpw
\ logfile \ logfile
\ mailerflags \ mailerflags
\ mailerpath \ mailerpath
\ mailfrom \ mailfrom
\ mailsub
\ mailto \ mailto
\ noexec_file
\ pam_login_service
\ pam_service
\ passprompt
\ restricted_env_file
\ role
\ runas_default
\ secure_path \ secure_path
\ sudoers_locale
\ syslog \ syslog
\ syslog_badpri
\ syslog_goodpri
\ timestamp_type
\ timestampdir
\ timestampowner
\ type
\ verifypw \ verifypw
syn keyword sudoersListParameter contained syn keyword sudoersListParameter contained