0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

Updated runtime files.

This commit is contained in:
Bram Moolenaar 2014-04-06 14:09:13 +02:00
parent 7e38ea2fb6
commit 75b8156a44
5 changed files with 184 additions and 47 deletions

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2014 Apr 05
*eval.txt* For Vim version 7.4. Last change: 2014 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@ -1144,7 +1144,7 @@ specified by what is prepended:
|local-variable| l: Local to a function.
|script-variable| s: Local to a |:source|'ed Vim script.
|function-argument| a: Function argument (only inside a function).
|vim-variable| v: Global, predefined by Vim.
|vim-variable| v: Global, predefined by Vim.
The scope name by itself can be used as a |Dictionary|. For example, to
delete all script-local variables: >

View File

@ -70,7 +70,13 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
Using autoconf 2.69 gives a lot of warnings.
Crash in setqflist(). (Benoit Mortgat, 2010 Nov 18)
MS-Windows: Crash opening very long file name starting with "\\".
(Christian Brock, 2012 Jun 29)
Crash in autocmd that unloads buffers in a BufUnload event. (Andrew Pimlott,
2012 Aug 11) Disallow :new when BufUnload is being handled?
Spell files use a latin single quote. Unicode also has another single quote.
Adjust spell file scripts to duplicate words to support both quotes.
@ -354,9 +360,6 @@ In the ATTENTION message about an existing swap file, mention the name of the
process that is running. It might actually be some other program, e.g. after
a reboot.
MS-Windows: Crash opening very long file name starting with "\\".
(Christian Brock, 2012 Jun 29)
Patch to have text objects defined by arbitrary single characters. (Daniel
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
Ben Fritz: problem with 'selection' set to "exclusive".
@ -427,9 +430,6 @@ Should be possible to enable/disable matchparen per window or buffer.
Add a check for b:no_match_paren in Highlight_matching_Pair() (Marcin
Szamotulski, 2012 Nov 8)
Crash in autocmd that unloads buffers in a BufUnload event. (Andrew Pimlott,
2012 Aug 11) Disallow :new when BufUnload is being handled?
Issue 72: 'autochdir' causes problems for :vimgrep.
Session file creation: 'autochdir' causes trouble. Keep it off until after
@ -841,8 +841,6 @@ Patch: Let rare word highlighting overrule good word highlighting.
When 'lines' is 25 and 'scrolloff' is 12, "j" scrolls zero or two lines
instead of one. (Constantin Pan, 2010 Sep 10)
Crash in setqflist(). (Benoit Mortgat, 2010 Nov 18)
Gui menu edit/paste in block mode insert only inserts in one line (Bjorn
Winckler, 2011 May 11)
Requires a map mode for Insert mode started from blockwise Visual mode.

View File

@ -2,14 +2,17 @@
" Language: J
" Maintainer: David Bürgin <676c7473@gmail.com>
" URL: https://github.com/glts/vim-j
" Last Change: 2014-03-17
" Last Change: 2014-04-05
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal iskeyword=48-57,65-90,_,97-122
let s:save_cpo = &cpo
set cpo&vim
setlocal iskeyword=48-57,A-Z,_,a-z
setlocal comments=:NB.
setlocal commentstring=NB.\ %s
setlocal formatoptions-=t
@ -17,3 +20,56 @@ setlocal shiftwidth=2 softtabstop=2 expandtab
setlocal matchpairs=(:)
let b:undo_ftplugin = 'setlocal matchpairs< expandtab< softtabstop< shiftwidth< formatoptions< commentstring< comments< iskeyword<'
" Section movement with ]] ][ [[ []. The start/end patterns below are amended
" inside the function in order to avoid matching on the current cursor line.
let s:sectionstart = '.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>.*'
let s:sectionend = '\s*)\s*'
function! s:SearchSection(end, backwards, visualmode) abort
if a:visualmode !=# ''
normal! gv
endif
let flags = a:backwards ? 'bsW' : 'sW'
if a:end
call search('^' . s:sectionend . (a:backwards ? '\n\_.\{-}\%#' : '$'), flags)
else
call search('^' . s:sectionstart . (a:backwards ? '\n\_.\{-}\%#' : '$'), flags)
endif
endfunction
noremap <script> <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, '')<CR>
xnoremap <script> <buffer> <silent> ]] :<C-U>call <SID>SearchSection(0, 0, visualmode())<CR>
sunmap <buffer> ]]
noremap <script> <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, '')<CR>
xnoremap <script> <buffer> <silent> ][ :<C-U>call <SID>SearchSection(1, 0, visualmode())<CR>
sunmap <buffer> ][
noremap <script> <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, '')<CR>
xnoremap <script> <buffer> <silent> [[ :<C-U>call <SID>SearchSection(0, 1, visualmode())<CR>
sunmap <buffer> [[
noremap <script> <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, '')<CR>
xnoremap <script> <buffer> <silent> [] :<C-U>call <SID>SearchSection(1, 1, visualmode())<CR>
sunmap <buffer> []
let b:undo_ftplugin .= ' | silent! execute "unmap <buffer> ]]"'
\ . ' | silent! execute "unmap <buffer> ]["'
\ . ' | silent! execute "unmap <buffer> [["'
\ . ' | silent! execute "unmap <buffer> []"'
" Browse dialog filter on Windows (see ":help browsefilter")
if has('gui_win32') && !exists('b:browsefilter')
let b:browsefilter = "J Script Files (*.ijs)\t*.ijs\n"
\ . "All Files (*.*)\t*.*\n"
let b:undo_ftplugin .= ' | unlet! b:browsefilter'
endif
" Enhanced "%" matching (see ":help matchit")
if exists('loaded_matchit') && !exists('b:match_words')
let b:match_ignorecase = 0
let b:match_words = '^.\{-}\<\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>:^\s*\:\s*$:^\s*)\s*$'
\ . ',\<\%(for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.:\<\%(case\|catch[dt]\=\|else\%(if\)\=\|fcase\)\.:\<end\.'
let b:undo_ftplugin .= ' | unlet! b:match_ignorecase b:match_words'
endif
let &cpo = s:save_cpo
unlet s:save_cpo

View File

@ -2,7 +2,7 @@
" Language: J
" Maintainer: David Bürgin <676c7473@gmail.com>
" URL: https://github.com/glts/vim-j
" Last Change: 2014-03-17
" Last Change: 2014-04-05
if exists('b:did_indent')
finish
@ -10,8 +10,8 @@ endif
let b:did_indent = 1
setlocal indentexpr=GetJIndent()
setlocal indentkeys-=0{,0},\:,0#
setlocal indentkeys+=0),=case.,=catch.,=catchd.,=catcht.,=do.,=else.,=elseif.,=end.,=fcase.
setlocal indentkeys-=0{,0},:,0#
setlocal indentkeys+=0),0<:>,=case.,=catch.,=catchd.,=catcht.,=do.,=else.,=elseif.,=end.,=fcase.
let b:undo_indent = 'setlocal indentkeys< indentexpr<'
@ -19,19 +19,31 @@ if exists('*GetJIndent')
finish
endif
function GetJIndent()
" If g:j_indent_definitions is true, the bodies of explicit definitions of
" adverbs, conjunctions, and verbs will be indented. Default is false (0).
if !exists('g:j_indent_definitions')
let g:j_indent_definitions = 0
endif
function GetJIndent() abort
let prevlnum = prevnonblank(v:lnum-1)
if prevlnum == 0
return 0
endif
let indent = indent(prevlnum)
if getline(prevlnum) =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|fcase\|for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.'
if getline(prevlnum) !~# '\<end\.'
let indent += shiftwidth()
endif
let prevline = getline(prevlnum)
if prevline =~# '^\s*\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|fcase\|for\%(_\a\k*\)\=\|if\|select\|try\|whil\%(e\|st\)\)\.\%(\%(\<end\.\)\@!.\)*$'
" Increase indentation after an initial control word that starts or
" continues a block and is not terminated by "end."
let indent += shiftwidth()
elseif g:j_indent_definitions && (prevline =~# '\<\%([1-4]\|13\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>' || prevline =~# '^\s*:\s*$')
" Increase indentation in explicit definitions of adverbs, conjunctions,
" and verbs
let indent += shiftwidth()
endif
if getline(v:lnum) =~# '^\s*\%(\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|end\|fcase\)\.\)\|)'
" Decrease indentation in lines that start with either control words that
" continue or end a block, or the special items ")" and ":"
if getline(v:lnum) =~# '^\s*\%()\|:\|\%(case\|catch[dt]\=\|do\|else\%(if\)\=\|end\|fcase\)\.\)'
let indent -= shiftwidth()
endif
return indent

View File

@ -2,31 +2,36 @@
" Language: J
" Maintainer: David Bürgin <676c7473@gmail.com>
" URL: https://github.com/glts/vim-j
" Last Change: 2014-03-17
" Last Change: 2014-04-05
if exists('b:current_syntax')
finish
endif
let s:save_cpo = &cpo
set cpo&vim
syntax case match
syntax sync minlines=50
syntax cluster jStdlibItems contains=jStdlibNoun,jStdlibAdverb,jStdlibConjunction,jStdlibVerb
syntax cluster jPrimitiveItems contains=jNoun,jAdverb,jConjunction,jVerb,jCopula
syntax match jControl /\<\%(assert\|break\|case\|catch[dt]\=\|continue\|do\|else\%(if\)\=\|end\|fcase\|for\|if\|return\|select\|throw\|try\|whil\%(e\|st\)\)\./
syntax match jControl /\<\%(for\|goto\|label\)_\a\k*\./
" Standard library names defined in the z locale. A few verbs need to be
" defined with ":syntax match" because they would otherwise take precedence
" over the corresponding jControl items.
syntax keyword jNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB adverb andurl conjunction dbhelp dyad libjqt monad noun verb
syntax keyword jAdverb define each every fapplylines inv inverse items leaf rows table
syntax keyword jConjunction bind cuts def on
syntax keyword jVerb AND Endian IFDEF Note OR XOR alpha17 alpha27 anddf android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpathsep jsystemdefs list ljust load loadd mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc script scriptd setbreak show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep
syntax match jVerb /\<\%(assert\|break\|do\)\>\.\@!/
" Standard library names. A few names need to be defined with ":syntax match"
" because they would otherwise take precedence over the corresponding jControl
" and jDefineExpression items.
syntax keyword jStdlibNoun ARGV BINPATH CR CRLF DEL Debug EAV EMPTY FF FHS IF64 IFIOS IFJCDROID IFJHS IFQT IFRASPI IFUNIX IFWIN IFWINCE IFWINE IFWOW64 JB01 JBOXED JCHAR JCMPX JFL JINT JPTR JSIZES JSTR JTYPES JVERSION LF LF2 TAB UNAME UNXLIB andurl dbhelp libjqt
syntax keyword jStdlibAdverb define each every fapplylines inv inverse items leaf rows table
syntax keyword jStdlibConjunction bind cuts def on
syntax keyword jStdlibVerb AND Endian IFDEF Note OR XOR alpha17 alpha27 anddf android_exec_host andunzip apply boxopen boxxopen bx calendar cd cdcb cder cderx cdf charsub chopstring clear coclass cocreate cocurrent codestroy coerase cofind cofindv cofullname coinfo coinsert coname conames conew conl conouns conounsx copath copathnl copathnlx coreset costate cut cutLF cutopen cutpara datatype dbctx dberm dberr dbg dbjmp dblocals dblxq dblxs dbnxt dbq dbr dbret dbrr dbrrx dbrun dbs dbsig dbsq dbss dbst dbstack dbstk dbstop dbstopme dbstopnext dbstops dbtrace dbview deb debc delstring detab dfh dir dircompare dircompares dirfind dirpath dirss dirssrplc dirtree dirused dlb dltb dltbs dquote drop dropafter dropto dtb dtbs echo empty endian erase evtloop exit expand f2utf8 fappend fappends fboxname fc fcopynew fdir ferase fetch fexist fexists fgets file2url fixdotdot fliprgb fmakex foldpara foldtext fpathcreate fpathname fputs fread freadblock freadr freads frename freplace fsize fss fssrplc fstamp fstringreplace ftype fview fwrite fwritenew fwrites getargs getdate getenv getqtbin hfd hostpathsep ic install iospath isatty isotimestamp isutf8 jcwdpath joinstring jpathsep jsystemdefs list ljust load loadd mema memf memr memw nameclass namelist names nc nl pick quote require rjust rplc script scriptd setbreak show sign sminfo smoutput sort split splitnostring splitstring ss startupandroid startupconsole startupide stderr stdin stdout stringreplace symdat symget symset take takeafter taketo timespacex timestamp timex tmoutput toCRLF toHOST toJ todate todayno tolower topara toupper tsdiff tsrep tstamp type ucp ucpcount unxlib usleep utf8 uucp valdate wcsize weekday weeknumber weeksinyear winpathsep
syntax match jStdlibNoun /\<\%(adverb\|conjunction\|dyad\|monad\|noun\|verb\)\>/
syntax match jStdlibVerb /\<\%(assert\|break\|do\)\>\.\@!/
syntax region jString oneline start=/'/ skip=/''/ end=/'/
" Number patterns. Matching J numbers is difficult. The regular expression
" used for the general case roughly embodies this grammar sketch:
" Numbers. Matching J numbers is difficult. The regular expression used for
" the general case roughly embodies this grammar sketch:
"
" BASE := /_?\d+(\.\d*)?([eE]_?\d+)?/
" RATIONAL := BASE | BASE r BASE
@ -43,21 +48,87 @@ syntax region jString oneline start=/'/ skip=/''/ end=/'/
syntax match jNumber /\<_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(r_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\=\)\|\%([px]_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\%(\%(j\|a[dr]\|r\)_\=\d\+\%(\.\d*\)\=\%([eE]_\=\d\+\)\=\)\=\)\)\=/
syntax match jNumber /\<_\=\d\+\%([eE]\d\+\)\=b_\=[0-9a-z]\+/
syntax match jNumber /\<__\=\>/
syntax match jNumber /\<_\./
syntax match jNumber /\<_\=\d\+x\>/
syntax keyword jTodo TODO FIXME XXX contained
syntax region jString oneline start=/'/ skip=/''/ end=/'/
syntax keyword jArgument contained x y u v m n
" Primitives. Order is significant both within the patterns and among
" ":syntax match" statements. Refer to "Parts of speech" in the J dictionary.
syntax match jNoun /\<a[.:]/
syntax match jAdverb /[}~]\|[/\\]\.\=\|\<\%([Mbft]\.\|t:\)/
syntax match jConjunction /"\|`:\=\|[.:@&][.:]\=\|&\.:\|\<\%([dDHT]\.\|[DLS]:\)/
syntax match jVerb /[=!\]]\|[\^?]\.\=\|[;[]:\=\|{\.\|[_/\\]:\|[<>+*\-%$|,#][.:]\=\|[~}"][.:]\|{\%[::]\|\<\%([ACeEiIjLor]\.\|p\.\.\=\|[ipqsux]:\|0:\|_\=[1-9]:\)/
syntax match jCopula /=[.:]/
syntax match jConjunction /;\.\|\^:\|![.:]/
" Explicit noun definition. The difficulty is that the define expression
" "0 : 0" can occur in the middle of a line but the jNounDefine region must
" only start on the next line. The trick is to split the problem into two
" regions and link them with "nextgroup=".
syntax region jNounDefineStart
\ matchgroup=jDefineExpression start=/\<\%(0\|noun\)\s\+\%(\:\s*0\|def\s\+0\|define\)\>/
\ keepend matchgroup=NONE end=/$/
\ contains=@jStdlibItems,@jPrimitiveItems,jNumber,jString,jParenGroup,jParen,jComment
\ oneline skipempty nextgroup=jDefineEnd,jNounDefine
" These two items must have "contained", which allows them to match only after
" jNounDefineStart thanks to the "nextgroup=" above.
syntax region jNounDefine
\ matchgroup=NONE start=/^/
\ matchgroup=jDefineEnd end=/^\s*)\s*$/
\ contained
" This match is necessary in case of an empty noun definition
syntax match jDefineEnd contained /^\s*)\s*$/
" Explicit verb, adverb, and conjunction definition
syntax region jDefine
\ matchgroup=jDefineExpression start=/\<\%([1-4]\|13\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>/
\ matchgroup=jDefineEnd end=/^\s*)\s*$/
\ contains=jControl,@jStdlibItems,@jPrimitiveItems,jNumber,jString,jArgument,jParenGroup,jParen,jComment,jDefineMonadDyad
syntax match jDefineMonadDyad contained /^\s*:\s*$/
" Paired parentheses. When a jDefineExpression such as "3 : 0" is
" parenthesised it will erroneously extend jParenGroup to span over the whole
" definition body. This situation receives a special treatment here.
syntax match jParen /(\%(\s*\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\s*)\)\@=/
syntax match jParen contained /\%((\s*\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\s*\)\@<=)/
syntax region jParenGroup
\ matchgroup=jParen start=/(\%(\s*\%([0-4]\|13\|noun\|adverb\|conjunction\|verb\|monad\|dyad\)\s\+\%(:\s*0\|def\s\+0\|define\)\>\)\@!/
\ matchgroup=jParen end=/)/
\ oneline transparent
syntax keyword jTodo contained TODO FIXME XXX
syntax match jComment /NB\..*$/ contains=jTodo,@Spell
syntax match jSharpBang /\%^#!.*$/
highlight default link jControl Statement
highlight default link jNoun Identifier
highlight default link jAdverb Identifier
highlight default link jConjunction Identifier
highlight default link jVerb Function
highlight default link jString String
highlight default link jNumber Number
highlight default link jTodo Todo
highlight default link jComment Comment
highlight default link jSharpBang PreProc
highlight default link jControl Statement
highlight default link jStdlibNoun Identifier
highlight default link jStdlibAdverb Function
highlight default link jStdlibConjunction Function
highlight default link jStdlibVerb Function
highlight default link jString String
highlight default link jNumber Number
highlight default link jNoun Constant
highlight default link jAdverb Normal
highlight default link jConjunction Normal
highlight default link jVerb Normal
highlight default link jCopula Normal
highlight default link jArgument Identifier
highlight default link jParen Delimiter
highlight default link jDefineExpression Define
highlight default link jDefineMonadDyad Delimiter
highlight default link jDefineEnd Delimiter
highlight default link jNounDefine Normal
highlight default link jTodo Todo
highlight default link jComment Comment
highlight default link jSharpBang PreProc
let b:current_syntax = 'j'
let &cpo = s:save_cpo
unlet s:save_cpo