Commit 2c7ed420 authored by Justin M. Keyes's avatar Justin M. Keyes

vim-patch:fc65cabb15d0

Update runtime files.
https://github.com/vim/vim/commit/fc65cabb15d0236bce001ad78e12a40511caf941

---

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)
parent f5406dfe
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -155,7 +155,7 @@ fun! tar#Browse(tarfile)
let curlast= line("$")
if tarfile =~# '\.\(gz\|tgz\)$'
" 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'
" 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." - "
......@@ -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
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))
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$'
" 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
......
......@@ -921,6 +921,13 @@ These three can be repeated and mixed. Examples:
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*
*subscript*
......
......@@ -573,11 +573,31 @@ By default the following options are set, in accordance with PEP8: >
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
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*
Since the text for this plugin is rather long it has been put in a separate
......
......@@ -974,6 +974,11 @@ Below is an example of indentation with and without this option enabled:
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*
......
......@@ -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
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
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:
-1 If no completion can be done, the completion will be cancelled with an
error message.
-2 To cancel silently and stay in completion mode.
-3 To cancel silently and leave completion mode.
Negative return values:
-2 To cancel silently and stay in completion mode.
-3 To cancel silently and leave completion mode.
Another negative value: completion starts at the cursor column
On the second invocation the arguments are:
a:findstart 0
......
......@@ -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
is invalid or not found, nothing is shown. The screen will be updated
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
still need to finish the search command with <Enter> to move the
cursor to the match.
......
......@@ -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
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.
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.
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*
The readline library is primarily used by the BASH shell, which adds quite a
......
......@@ -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
'shortmess' option. But it's very unusual that you need this.
For programatic access to the swap file, see |swapinfo()|.
==============================================================================
*11.4* Further reading
......
" Vim filetype plugin file
" Language: Haskell
" Maintainer: Daniel Campoverde <alx@sillybytes.net>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
" Latest Revision: 2018-08-27
if exists("b:did_ftplugin")
finish
......@@ -15,6 +16,7 @@ let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=s1fl:{-,mb:-,ex:-},:-- commentstring=--\ %s
setlocal formatoptions-=t formatoptions+=croql
setlocal omnifunc=haskellcomplete#Complete
let &cpo = s:cpo_save
unlet s:cpo_save
......@@ -2,7 +2,7 @@
" Language: R Markdown file
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" 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)
" Only do this when not yet done for this buffer
......@@ -10,19 +10,12 @@ if exists("b:did_ftplugin")
finish
endif
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
if exists('g:rmd_include_html') && g:rmd_include_html
runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
endif
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
setlocal comments=fb:*,fb:-,fb:+,n:>
setlocal commentstring=#\ %s
setlocal formatoptions+=tcqln
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
setlocal iskeyword=@,48-57,_,.
......@@ -30,6 +23,22 @@ setlocal iskeyword=@,48-57,_,.
let s:cpo_save = &cpo
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
unlet! b:did_ftplugin
runtime ftplugin/pandoc.vim
......
......@@ -2,7 +2,7 @@
" Language: reStructuredText documentation format with R code
" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
" 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
" Only do this when not yet done for this buffer
......@@ -16,11 +16,27 @@ let b:did_ftplugin = 1
let s:cpo_save = &cpo
set cpo&vim
setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
setlocal comments=fb:*,fb:-,fb:+,n:>
setlocal commentstring=#\ %s
setlocal formatoptions+=tcqln
setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
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")
let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
\ "All Files (*.*)\t*.*\n"
......
......@@ -3,9 +3,6 @@
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2011-07-08
let s:cpo_save = &cpo
set cpo&vim
setlocal indentexpr=GetDTDIndent()
setlocal indentkeys=!^F,o,O,>
setlocal nosmartindent
......@@ -14,6 +11,9 @@ if exists("*GetDTDIndent")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" TODO: Needs to be adjusted to stop at [, <, and ].
let s:token_pattern = '^[^[:space:]]\+'
......
......@@ -663,7 +663,7 @@ func! s:CSSIndent()
else
let cur_hasfield = curtext =~ '^\s*[a-zA-Z0-9-]\+:'
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.
let extra = shiftwidth()
......@@ -716,9 +716,13 @@ func! s:CSSIndent()
endfunc "}}}
" Inside <style>: Whether a line is unfinished.
" tag:
" tag: blah
" tag: blah &&
" tag: blah ||
func! s:CssUnfinished(text)
"{{{
return a:text =~ '\s\(||\|&&\|:\)\s*$'
return a:text =~ '\(||\|&&\|:\|\k\)\s*$'
endfunc "}}}
" Search back for the first unfinished line above "lnum".
......
......@@ -2,7 +2,7 @@
" Language: R
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" 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.
......@@ -19,22 +19,16 @@ if exists("*GetRIndent")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" Options to make the indentation more similar to Emacs/ESS:
if !exists("g:r_indent_align_args")
let g:r_indent_align_args = 1
endif
if !exists("g:r_indent_ess_comments")
let g:r_indent_ess_comments = 0
endif
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
let g:r_indent_align_args = get(g:, 'r_indent_align_args', 1)
let g:r_indent_ess_comments = get(g:, 'r_indent_ess_comments', 0)
let g:r_indent_comment_column = get(g:, 'r_indent_comment_column', 40)
let g:r_indent_ess_compatible = get(g:, 'r_indent_ess_compatible', 0)
let g:r_indent_op_pattern = get(g:, 'r_indent_op_pattern',
\ '\(&\||\|+\|-\|\*\|/\|=\|\~\|%\|->\)\s*$')
function s:RDelete_quotes(line)
let i = 0
......@@ -231,7 +225,7 @@ function GetRIndent()
let cline = SanitizeRLine(cline)
if cline =~ '^\s*}' || cline =~ '^\s*}\s*)$'
if cline =~ '^\s*}'
let indline = s:Get_matching_brace(clnum, '{', '}', 1)
if indline > 0 && indline != clnum
let iline = SanitizeRLine(getline(indline))
......@@ -244,6 +238,11 @@ function GetRIndent()
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
let lnum = s:Get_prev_line(clnum)
" Hit the start of the file, use zero indent.
......@@ -515,7 +514,9 @@ function GetRIndent()
endwhile
return ind
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2
......@@ -2,7 +2,7 @@
" Language: Rmd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" 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.
......@@ -20,7 +20,10 @@ if exists("*GetRmdIndent")
finish
endif
function GetMdIndent()
let s:cpo_save = &cpo
set cpo&vim
function s:GetMdIndent()
let pline = getline(v:lnum - 1)
let cline = getline(v:lnum)
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))
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()
if getline(".") =~ '^[ \t]*```{r .*}$' || getline(".") =~ '^[ \t]*```$'
return 0
endif
if search('^[ \t]*```{r', "bncW") > search('^[ \t]*```$', "bncW")
return s:RIndent()
elseif v:lnum > 1 && search('^---$', "bnW") == 1 &&
\ (search('^---$', "nW") > v:lnum || search('^...$', "nW") > v:lnum)
return s:GetYamlIndent()
else
return GetMdIndent()
return s:GetMdIndent()
endif
endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: sw=2
......@@ -21,7 +21,7 @@ else
let s:TeXIndent = function(substitute(&indentexpr, "()", "", ""))
endif
unlet b:did_indent
unlet! b:did_indent
runtime indent/r.vim
let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
let b:did_indent = 1
......
......@@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus.
"
" 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
" 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, '\.[^.]*', "", "")
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'
" 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".
......@@ -159,7 +166,7 @@ nnoremenu 20.370 &Edit.Put\ &Before<Tab>[p [p
inoremenu &Edit.Put\ &Before<Tab>[p <C-O>[p
nnoremenu 20.380 &Edit.Put\ &After<Tab>]p ]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
endif
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>
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>
vunmenu &Edit.&Find\.\.\.
vnoremenu <silent> &Edit.&Find\.\.\. y:promptfind <C-R>=<SID>FixFText()<CR><CR>
......@@ -194,6 +201,8 @@ fun! s:EditVimrc()
else
let fname = $VIM . "/_vimrc"
endif
elseif has("amiga")
let fname = "s:.vimrc"
else
let fname = $HOME . "/.vimrc"
endif
......@@ -337,57 +346,77 @@ fun! s:FileFormat()
endif
endfun
let s:did_setup_color_schemes = 0
" Setup the Edit.Color Scheme submenu
" get NL separated string with file names
let s:n = globpath(&runtimepath, "colors/*.vim")
" split at NL, ignore case for Windows, sort on name
let s:names = sort(map(split(s:n, "\n"), 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1)
" define all the submenu entries
let s:idx = 100
for s:name in s:names
exe "an 20.450." . s:idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "<CR>"
let s:idx = s:idx + 10
endfor
unlet s:name s:names s:n s:idx
func! s:SetupColorSchemes() abort
if s:did_setup_color_schemes
return
endif
let s:did_setup_color_schemes = 1
let n = globpath(&runtimepath, "colors/*.vim", 1, 1)
let n += globpath(&runtimepath, "pack/*/start/*/colors/*.vim", 1, 1)
let n += globpath(&runtimepath, "pack/*/opt/*/colors/*.vim", 1, 1)
" Ignore case for VMS and windows, sort on name
let names = sort(map(n, 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1)
" define all the submenu entries
let idx = 100
for name in names
exe "an 20.450." . idx . ' &Edit.C&olor\ Scheme.' . name . " :colors " . name . "<CR>"
let idx = idx + 10
endfor
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
if has("keymap")
let s:n = globpath(&runtimepath, "keymap/*.vim")
if s:n != ""
let s:idx = 100
an 20.460.90 &Edit.&Keymap.None :set keymap=<CR>
while strlen(s:n) > 0
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
" Ignore case for Windows
let s:name = substitute(s:name, '\c.*[/\\:\]]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
exe "an 20.460." . s:idx . ' &Edit.&Keymap.' . s:name . " :set keymap=" . s:name . "<CR>"
unlet s:name
unlet s:i
let s:idx = s:idx + 10
endwhile
unlet s:idx
let s:did_setup_keymaps = 0
func! s:SetupKeymaps() abort
if s:did_setup_keymaps
return
endif
let s:did_setup_keymaps = 1
let n = globpath(&runtimepath, "keymap/*.vim", 1, 1)
if !empty(n)
let idx = 100
an 20.460.90 &Edit.&Keymap.None :set keymap=<CR>
for name in n
" Ignore case for VMS and windows
let name = substitute(name, '\c.*[/\\:\]]\([^/\\:_]*\)\(_[0-9a-zA-Z-]*\)\=\.vim', '\1', '')
exe "an 20.460." . idx . ' &Edit.&Keymap.' . name . " :set keymap=" . name . "<CR>"
let idx = idx + 10
endfor
endif
silent! aunmenu &Edit.Show\ &Keymaps\ in\ Menu
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
unlet s:n
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>
endif
" Programming menu
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
an 40.300 &Tools.&Jump\ to\ This\ Tag<Tab>g^] g<C-]>
......@@ -435,10 +464,10 @@ if has("spell")
endif
let found = 0
let s = globpath(&rtp, "spell/*." . enc . ".spl")
if s != ""
let s = globpath(&runtimepath, "spell/*." . enc . ".spl", 1, 1)
if !empty(s)
let n = 300
for f in split(s, "\n")
for f in s
let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "")
if nm != "en" && nm !~ '/'
let _nm = nm
......@@ -532,8 +561,12 @@ an <silent> 40.540 &Tools.Conve&rt\ Back<Tab>:%!xxd\ -r
" set.
func! s:XxdConv()
let mod = &mod
call s:XxdFind()
exe '%!"' . g:xxdprogram . '"'
if has("vms")
%!mc vim:xxd
else
call s:XxdFind()
exe '%!"' . g:xxdprogram . '"'
endif
if getline(1) =~ "^0000000:" " only if it worked
set ft=xxd
endif
......@@ -542,8 +575,12 @@ endfun
func! s:XxdBack()
let mod = &mod
call s:XxdFind()
exe '%!"' . g:xxdprogram . '" -r'
if has("vms")
%!mc vim:xxd -r
else
call s:XxdFind()
exe '%!"' . g:xxdprogram . '" -r'
endif
set ft=
doautocmd filetypedetect BufReadPost
let &mod = mod
......@@ -560,27 +597,46 @@ func! s:XxdFind()
endif
endfun
let s:did_setup_compilers = 0
" Setup the Tools.Compiler submenu
let s:n = globpath(&runtimepath, "compiler/*.vim")
let s:idx = 100
while strlen(s:n) > 0
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)
func! s:SetupCompilers() abort
if s:did_setup_compilers
return
endif
" Ignore case for Windows
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>"
unlet s:name
unlet s:i
let s:idx = s:idx + 10
endwhile
unlet s:n
unlet s:idx
let s:did_setup_compilers = 1
let n = globpath(&runtimepath, "compiler/*.vim", 1, 1)
let idx = 100
for name in n
" Ignore case for VMS and windows
let name = substitute(name, '\c.*[/\\:\]]\([^/\\:]*\)\.vim', '\1', '')
exe "an 30.440." . idx . ' &Tools.Se&t\ Compiler.' . name . " :compiler " . name . "<CR>"
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")
......@@ -683,13 +739,21 @@ endfunc
func! s:BMHash(name)
" Make name all upper case, so that chars are between 32 and 96
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")