mirror of
https://github.com/zoriya/vim.git
synced 2025-12-09 00:36:15 +00:00
Compare commits
148 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5e2b040b4 | ||
|
|
8ad80dea08 | ||
|
|
b463e8d999 | ||
|
|
6aa8cea46d | ||
|
|
9472eec83c | ||
|
|
bb7943b792 | ||
|
|
763209c57b | ||
|
|
1615b36b91 | ||
|
|
bf15b8d78b | ||
|
|
863e80b445 | ||
|
|
3e54569b17 | ||
|
|
ce876aaa9a | ||
|
|
976787d1f3 | ||
|
|
4b974d5443 | ||
|
|
28a8193e31 | ||
|
|
a3921f48c6 | ||
|
|
45e5fd135d | ||
|
|
6e62da3e14 | ||
|
|
6dd4a53502 | ||
|
|
b4d6c3ea4a | ||
|
|
712598f210 | ||
|
|
d7aca7a71c | ||
|
|
2a79ed293c | ||
|
|
545cb79da5 | ||
|
|
2a0b06def4 | ||
|
|
79a213d6a4 | ||
|
|
9e0f6ec076 | ||
|
|
253f912877 | ||
|
|
4475b62396 | ||
|
|
beb9cb19c6 | ||
|
|
66c0e70b80 | ||
|
|
45cf6e910c | ||
|
|
29ae377ea7 | ||
|
|
45d2cca1ea | ||
|
|
8f77c5a4ec | ||
|
|
a21ccb7a97 | ||
|
|
1a9020d4cb | ||
|
|
0635ee6824 | ||
|
|
696cbd224b | ||
|
|
b7637c44c2 | ||
|
|
86e5792906 | ||
|
|
94237495c0 | ||
|
|
d788f6fe89 | ||
|
|
b11c826ddc | ||
|
|
5b276aa80e | ||
|
|
94be619e30 | ||
|
|
f1d21c8cc8 | ||
|
|
9b77016545 | ||
|
|
7a85b0f028 | ||
|
|
97db5541a6 | ||
|
|
1d4be82c7d | ||
|
|
a701b3b6f0 | ||
|
|
99895eac1c | ||
|
|
91b6e4591a | ||
|
|
6de5e12601 | ||
|
|
a364cdb648 | ||
|
|
c03944151f | ||
|
|
62cf09b5dc | ||
|
|
60402d68da | ||
|
|
fc8f1118e7 | ||
|
|
43d1ac6e81 | ||
|
|
31bdd13c33 | ||
|
|
39170e2d97 | ||
|
|
9f92886277 | ||
|
|
ea588154d0 | ||
|
|
478af67dd6 | ||
|
|
451a4a1cb7 | ||
|
|
f803a76978 | ||
|
|
cd5c8f8250 | ||
|
|
f8ec998613 | ||
|
|
59053e1d9f | ||
|
|
7860bac57b | ||
|
|
d2381a2cad | ||
|
|
1cc482069a | ||
|
|
9f4de1f543 | ||
|
|
3317d5ebbe | ||
|
|
d34f9b1155 | ||
|
|
9585a1655b | ||
|
|
395b6bab33 | ||
|
|
d4863aa99e | ||
|
|
52604f2454 | ||
|
|
3bab93998d | ||
|
|
15ecbd6f3d | ||
|
|
866c688610 | ||
|
|
ba6ec18297 | ||
|
|
a1d5fa65bc | ||
|
|
04000560ca | ||
|
|
a604429529 | ||
|
|
08f88b139d | ||
|
|
85045a73db | ||
|
|
fa0ad0bb0b | ||
|
|
69f40be645 | ||
|
|
6914c64ee5 | ||
|
|
33ccb24cf7 | ||
|
|
878c263a48 | ||
|
|
c77d675747 | ||
|
|
9b81079ddd | ||
|
|
658a3a2caf | ||
|
|
13489b9c41 | ||
|
|
ef8eb08978 | ||
|
|
ce5c274201 | ||
|
|
85325f839a | ||
|
|
a33ddbbd04 | ||
|
|
8da1e6cedf | ||
|
|
bf3d58073f | ||
|
|
3fcfa35f82 | ||
|
|
99a6e8dd82 | ||
|
|
ace95989ed | ||
|
|
0c078fc7db | ||
|
|
c6cd8409c2 | ||
|
|
b6fa30ccc3 | ||
|
|
e0720cbf63 | ||
|
|
b1e04fca37 | ||
|
|
d5d37537d1 | ||
|
|
980128c369 | ||
|
|
c96272e30e | ||
|
|
1572e30607 | ||
|
|
a683ec44c3 | ||
|
|
8a0141d4e7 | ||
|
|
dd00851e07 | ||
|
|
d722fd74d8 | ||
|
|
a2845b8f5a | ||
|
|
6c0c1e8052 | ||
|
|
ba6ad17378 | ||
|
|
e5e0fbcd42 | ||
|
|
9d20ce6970 | ||
|
|
a37ffaa5e0 | ||
|
|
b2964f2570 | ||
|
|
3c2881dc11 | ||
|
|
4889ad7c6c | ||
|
|
c6aafbaf3e | ||
|
|
e94260f358 | ||
|
|
3ff2f09525 | ||
|
|
518c9b133b | ||
|
|
f5610da7a8 | ||
|
|
1662ce104e | ||
|
|
15618fa643 | ||
|
|
81b9d0bd5c | ||
|
|
bfd830d3e2 | ||
|
|
38e3483637 | ||
|
|
7dd4850698 | ||
|
|
b4c5572e74 | ||
|
|
651e4056ac | ||
|
|
8c752bd6c4 | ||
|
|
4520d440c5 | ||
|
|
ee85df3763 | ||
|
|
f79225ed4f | ||
|
|
2c90d51123 |
@@ -99,5 +99,6 @@ script:
|
||||
|
||||
after_success:
|
||||
- if [ "$COVERAGE" = "yes" ]; then ~/.local/bin/coveralls -b $SRCDIR -x .xs -e ${SRCDIR}/xxd -e ${SRCDIR}/if_perl.c --encodings utf-8 latin-1 EUC-KR; fi
|
||||
- if [ "$COVERAGE" = "yes" ]; then cd $SRCDIR && bash <(curl -s https://codecov.io/bash) ; fi
|
||||
|
||||
# vim:set sts=2 sw=2 tw=0 et:
|
||||
|
||||
5
Filelist
5
Filelist
@@ -24,6 +24,7 @@ SRC_ALL = \
|
||||
src/edit.c \
|
||||
src/eval.c \
|
||||
src/evalfunc.c \
|
||||
src/ex_cmdidxs.h \
|
||||
src/ex_cmds.c \
|
||||
src/ex_cmds.h \
|
||||
src/ex_cmds2.c \
|
||||
@@ -215,6 +216,7 @@ SRC_UNIX = \
|
||||
src/config.mk.in \
|
||||
src/configure \
|
||||
src/configure.ac \
|
||||
src/create_cmdidxs.vim \
|
||||
src/gui_at_fs.c \
|
||||
src/gui_at_sb.c \
|
||||
src/gui_at_sb.h \
|
||||
@@ -238,7 +240,7 @@ SRC_UNIX = \
|
||||
src/link.sh \
|
||||
src/installman.sh \
|
||||
src/installml.sh \
|
||||
src/mkinstalldirs \
|
||||
src/install-sh \
|
||||
src/os_unix.c \
|
||||
src/os_unix.h \
|
||||
src/os_unixx.h \
|
||||
@@ -724,7 +726,6 @@ EXTRA = \
|
||||
farsi/README.txt \
|
||||
farsi/fonts/*/far-* \
|
||||
runtime/vimlogo.xpm \
|
||||
src/swis.s \
|
||||
src/tee/Makefile \
|
||||
src/tee/Make_mvc.mak \
|
||||
src/tee/tee.c \
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
`README.md` for version 8.0 of Vim: Vi IMproved.
|
||||
[](https://travis-ci.org/vim/vim)
|
||||
[](https://codecov.io/gh/vim/vim?branch=master)
|
||||
[](https://coveralls.io/github/vim/vim?branch=master)
|
||||
[](https://ci.appveyor.com/project/chrisbra/vim)
|
||||
[](https://scan.coverity.com/projects/vim)
|
||||
|
||||
415
runtime/autoload/rust.vim
Normal file
415
runtime/autoload/rust.vim
Normal file
@@ -0,0 +1,415 @@
|
||||
" Author: Kevin Ballard
|
||||
" Description: Helper functions for Rust commands/mappings
|
||||
" Last Modified: May 27, 2014
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
" Jump {{{1
|
||||
|
||||
function! rust#Jump(mode, function) range
|
||||
let cnt = v:count1
|
||||
normal! m'
|
||||
if a:mode ==# 'v'
|
||||
norm! gv
|
||||
endif
|
||||
let foldenable = &foldenable
|
||||
set nofoldenable
|
||||
while cnt > 0
|
||||
execute "call <SID>Jump_" . a:function . "()"
|
||||
let cnt = cnt - 1
|
||||
endwhile
|
||||
let &foldenable = foldenable
|
||||
endfunction
|
||||
|
||||
function! s:Jump_Back()
|
||||
call search('{', 'b')
|
||||
keepjumps normal! w99[{
|
||||
endfunction
|
||||
|
||||
function! s:Jump_Forward()
|
||||
normal! j0
|
||||
call search('{', 'b')
|
||||
keepjumps normal! w99[{%
|
||||
call search('{')
|
||||
endfunction
|
||||
|
||||
" Run {{{1
|
||||
|
||||
function! rust#Run(bang, args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
if a:bang
|
||||
let idx = index(l:args, '--')
|
||||
if idx != -1
|
||||
let rustc_args = idx == 0 ? [] : l:args[:idx-1]
|
||||
let args = l:args[idx+1:]
|
||||
else
|
||||
let rustc_args = l:args
|
||||
let args = []
|
||||
endif
|
||||
else
|
||||
let rustc_args = []
|
||||
endif
|
||||
|
||||
let b:rust_last_rustc_args = l:rustc_args
|
||||
let b:rust_last_args = l:args
|
||||
|
||||
call s:WithPath(function("s:Run"), rustc_args, args)
|
||||
endfunction
|
||||
|
||||
function! s:Run(dict, rustc_args, args)
|
||||
let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r')
|
||||
if has('win32')
|
||||
let exepath .= '.exe'
|
||||
endif
|
||||
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let rustc_args = [relpath, '-o', exepath] + a:rustc_args
|
||||
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)')))
|
||||
if output != ''
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
endif
|
||||
if !v:shell_error
|
||||
exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)'))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Expand {{{1
|
||||
|
||||
function! rust#Expand(bang, args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
if a:bang && !empty(l:args)
|
||||
let pretty = remove(l:args, 0)
|
||||
else
|
||||
let pretty = "expanded"
|
||||
endif
|
||||
call s:WithPath(function("s:Expand"), pretty, args)
|
||||
endfunction
|
||||
|
||||
function! s:Expand(dict, pretty, args)
|
||||
try
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
|
||||
if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)'
|
||||
let flag = '--xpretty'
|
||||
else
|
||||
let flag = '--pretty'
|
||||
endif
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||
if v:shell_error
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
else
|
||||
new
|
||||
silent put =output
|
||||
1
|
||||
d
|
||||
setl filetype=rust
|
||||
setl buftype=nofile
|
||||
setl bufhidden=hide
|
||||
setl noswapfile
|
||||
" give the buffer a nice name
|
||||
let suffix = 1
|
||||
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||
while 1
|
||||
let bufname = basename
|
||||
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||
let bufname .= '.pretty.rs'
|
||||
if bufexists(bufname)
|
||||
let suffix += 1
|
||||
continue
|
||||
endif
|
||||
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||
break
|
||||
endwhile
|
||||
endif
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! rust#CompleteExpand(lead, line, pos)
|
||||
if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$'
|
||||
" first argument and it has a !
|
||||
let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"]
|
||||
if !empty(a:lead)
|
||||
call filter(list, "v:val[:len(a:lead)-1] == a:lead")
|
||||
endif
|
||||
return list
|
||||
endif
|
||||
|
||||
return glob(escape(a:lead, "*?[") . '*', 0, 1)
|
||||
endfunction
|
||||
|
||||
" Emit {{{1
|
||||
|
||||
function! rust#Emit(type, args)
|
||||
let args = s:ShellTokenize(a:args)
|
||||
call s:WithPath(function("s:Emit"), a:type, args)
|
||||
endfunction
|
||||
|
||||
function! s:Emit(dict, type, args)
|
||||
try
|
||||
let output_path = a:dict.tmpdir.'/output'
|
||||
|
||||
let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc"
|
||||
|
||||
let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path)
|
||||
let args = [relpath, '--emit', a:type, '-o', output_path] + a:args
|
||||
let pwd = a:dict.istemp ? a:dict.tmpdir : ''
|
||||
let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)')))
|
||||
if output != ''
|
||||
echohl WarningMsg
|
||||
echo output
|
||||
echohl None
|
||||
endif
|
||||
if !v:shell_error
|
||||
new
|
||||
exe 'silent keepalt read' fnameescape(output_path)
|
||||
1
|
||||
d
|
||||
if a:type == "llvm-ir"
|
||||
setl filetype=llvm
|
||||
let extension = 'll'
|
||||
elseif a:type == "asm"
|
||||
setl filetype=asm
|
||||
let extension = 's'
|
||||
endif
|
||||
setl buftype=nofile
|
||||
setl bufhidden=hide
|
||||
setl noswapfile
|
||||
if exists('l:extension')
|
||||
" give the buffer a nice name
|
||||
let suffix = 1
|
||||
let basename = fnamemodify(a:dict.path, ':t:r')
|
||||
while 1
|
||||
let bufname = basename
|
||||
if suffix > 1 | let bufname .= ' ('.suffix.')' | endif
|
||||
let bufname .= '.'.extension
|
||||
if bufexists(bufname)
|
||||
let suffix += 1
|
||||
continue
|
||||
endif
|
||||
exe 'silent noautocmd keepalt file' fnameescape(bufname)
|
||||
break
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
" Utility functions {{{1
|
||||
|
||||
" Invokes func(dict, ...)
|
||||
" Where {dict} is a dictionary with the following keys:
|
||||
" 'path' - The path to the file
|
||||
" 'tmpdir' - The path to a temporary directory that will be deleted when the
|
||||
" function returns.
|
||||
" 'istemp' - 1 if the path is a file inside of {dict.tmpdir} or 0 otherwise.
|
||||
" If {istemp} is 1 then an additional key is provided:
|
||||
" 'tmpdir_relpath' - The {path} relative to the {tmpdir}.
|
||||
"
|
||||
" {dict.path} may be a path to a file inside of {dict.tmpdir} or it may be the
|
||||
" existing path of the current buffer. If the path is inside of {dict.tmpdir}
|
||||
" then it is guaranteed to have a '.rs' extension.
|
||||
function! s:WithPath(func, ...)
|
||||
let buf = bufnr('')
|
||||
let saved = {}
|
||||
let dict = {}
|
||||
try
|
||||
let saved.write = &write
|
||||
set write
|
||||
let dict.path = expand('%')
|
||||
let pathisempty = empty(dict.path)
|
||||
|
||||
" Always create a tmpdir in case the wrapped command wants it
|
||||
let dict.tmpdir = tempname()
|
||||
call mkdir(dict.tmpdir)
|
||||
|
||||
if pathisempty || !saved.write
|
||||
let dict.istemp = 1
|
||||
" if we're doing this because of nowrite, preserve the filename
|
||||
if !pathisempty
|
||||
let filename = expand('%:t:r').".rs"
|
||||
else
|
||||
let filename = 'unnamed.rs'
|
||||
endif
|
||||
let dict.tmpdir_relpath = filename
|
||||
let dict.path = dict.tmpdir.'/'.filename
|
||||
|
||||
let saved.mod = &mod
|
||||
set nomod
|
||||
|
||||
silent exe 'keepalt write! ' . fnameescape(dict.path)
|
||||
if pathisempty
|
||||
silent keepalt 0file
|
||||
endif
|
||||
else
|
||||
let dict.istemp = 0
|
||||
update
|
||||
endif
|
||||
|
||||
call call(a:func, [dict] + a:000)
|
||||
finally
|
||||
if bufexists(buf)
|
||||
for [opt, value] in items(saved)
|
||||
silent call setbufvar(buf, '&'.opt, value)
|
||||
unlet value " avoid variable type mismatches
|
||||
endfor
|
||||
endif
|
||||
if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
function! rust#AppendCmdLine(text)
|
||||
call setcmdpos(getcmdpos())
|
||||
let cmd = getcmdline() . a:text
|
||||
return cmd
|
||||
endfunction
|
||||
|
||||
" Tokenize the string according to sh parsing rules
|
||||
function! s:ShellTokenize(text)
|
||||
" states:
|
||||
" 0: start of word
|
||||
" 1: unquoted
|
||||
" 2: unquoted backslash
|
||||
" 3: double-quote
|
||||
" 4: double-quoted backslash
|
||||
" 5: single-quote
|
||||
let l:state = 0
|
||||
let l:current = ''
|
||||
let l:args = []
|
||||
for c in split(a:text, '\zs')
|
||||
if l:state == 0 || l:state == 1 " unquoted
|
||||
if l:c ==# ' '
|
||||
if l:state == 0 | continue | endif
|
||||
call add(l:args, l:current)
|
||||
let l:current = ''
|
||||
let l:state = 0
|
||||
elseif l:c ==# '\'
|
||||
let l:state = 2
|
||||
elseif l:c ==# '"'
|
||||
let l:state = 3
|
||||
elseif l:c ==# "'"
|
||||
let l:state = 5
|
||||
else
|
||||
let l:current .= l:c
|
||||
let l:state = 1
|
||||
endif
|
||||
elseif l:state == 2 " unquoted backslash
|
||||
if l:c !=# "\n" " can it even be \n?
|
||||
let l:current .= l:c
|
||||
endif
|
||||
let l:state = 1
|
||||
elseif l:state == 3 " double-quote
|
||||
if l:c ==# '\'
|
||||
let l:state = 4
|
||||
elseif l:c ==# '"'
|
||||
let l:state = 1
|
||||
else
|
||||
let l:current .= l:c
|
||||
endif
|
||||
elseif l:state == 4 " double-quoted backslash
|
||||
if stridx('$`"\', l:c) >= 0
|
||||
let l:current .= l:c
|
||||
elseif l:c ==# "\n" " is this even possible?
|
||||
" skip it
|
||||
else
|
||||
let l:current .= '\'.l:c
|
||||
endif
|
||||
let l:state = 3
|
||||
elseif l:state == 5 " single-quoted
|
||||
if l:c == "'"
|
||||
let l:state = 1
|
||||
else
|
||||
let l:current .= l:c
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
if l:state != 0
|
||||
call add(l:args, l:current)
|
||||
endif
|
||||
return l:args
|
||||
endfunction
|
||||
|
||||
function! s:RmDir(path)
|
||||
" sanity check; make sure it's not empty, /, or $HOME
|
||||
if empty(a:path)
|
||||
echoerr 'Attempted to delete empty path'
|
||||
return 0
|
||||
elseif a:path == '/' || a:path == $HOME
|
||||
echoerr 'Attempted to delete protected path: ' . a:path
|
||||
return 0
|
||||
endif
|
||||
return system("rm -rf " . shellescape(a:path))
|
||||
endfunction
|
||||
|
||||
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
|
||||
" If {pwd} is the empty string then it doesn't change the cwd.
|
||||
function! s:system(pwd, cmd)
|
||||
let cmd = a:cmd
|
||||
if !empty(a:pwd)
|
||||
let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd
|
||||
endif
|
||||
return system(cmd)
|
||||
endfunction
|
||||
|
||||
" Playpen Support {{{1
|
||||
" Parts of gist.vim by Yasuhiro Matsumoto <mattn.jp@gmail.com> reused
|
||||
" gist.vim available under the BSD license, available at
|
||||
" http://github.com/mattn/gist-vim
|
||||
function! s:has_webapi()
|
||||
if !exists("*webapi#http#post")
|
||||
try
|
||||
call webapi#http#post()
|
||||
catch
|
||||
endtry
|
||||
endif
|
||||
return exists("*webapi#http#post")
|
||||
endfunction
|
||||
|
||||
function! rust#Play(count, line1, line2, ...) abort
|
||||
redraw
|
||||
|
||||
let l:rust_playpen_url = get(g:, 'rust_playpen_url', 'https://play.rust-lang.org/')
|
||||
let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/')
|
||||
|
||||
if !s:has_webapi()
|
||||
echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let bufname = bufname('%')
|
||||
if a:count < 1
|
||||
let content = join(getline(a:line1, a:line2), "\n")
|
||||
else
|
||||
let save_regcont = @"
|
||||
let save_regtype = getregtype('"')
|
||||
silent! normal! gvy
|
||||
let content = @"
|
||||
call setreg('"', save_regcont, save_regtype)
|
||||
endif
|
||||
|
||||
let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content)
|
||||
|
||||
if strlen(body) > 5000
|
||||
echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
let payload = "format=simple&url=".webapi#http#encodeURI(body)
|
||||
let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {})
|
||||
let url = res.content
|
||||
|
||||
redraw | echomsg 'Done: '.url
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
|
||||
" vim: set noet sw=8 ts=8:
|
||||
107
runtime/autoload/rustfmt.vim
Normal file
107
runtime/autoload/rustfmt.vim
Normal file
@@ -0,0 +1,107 @@
|
||||
" Author: Stephen Sugden <stephen@stephensugden.com>
|
||||
"
|
||||
" Adapted from https://github.com/fatih/vim-go
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if !exists("g:rustfmt_autosave")
|
||||
let g:rustfmt_autosave = 0
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_command")
|
||||
let g:rustfmt_command = "rustfmt"
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_options")
|
||||
let g:rustfmt_options = ""
|
||||
endif
|
||||
|
||||
if !exists("g:rustfmt_fail_silently")
|
||||
let g:rustfmt_fail_silently = 0
|
||||
endif
|
||||
|
||||
let s:got_fmt_error = 0
|
||||
|
||||
function! s:RustfmtCommandRange(filename, line1, line2)
|
||||
let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]}
|
||||
return printf("%s %s --write-mode=overwrite --file-lines '[%s]'", g:rustfmt_command, g:rustfmt_options, json_encode(l:arg))
|
||||
endfunction
|
||||
|
||||
function! s:RustfmtCommand(filename)
|
||||
return g:rustfmt_command . " --write-mode=overwrite " . g:rustfmt_options . " " . shellescape(a:filename)
|
||||
endfunction
|
||||
|
||||
function! s:RunRustfmt(command, curw, tmpname)
|
||||
if exists("*systemlist")
|
||||
let out = systemlist(a:command)
|
||||
else
|
||||
let out = split(system(a:command), '\r\?\n')
|
||||
endif
|
||||
|
||||
if v:shell_error == 0 || v:shell_error == 3
|
||||
" remove undo point caused via BufWritePre
|
||||
try | silent undojoin | catch | endtry
|
||||
|
||||
" Replace current file with temp file, then reload buffer
|
||||
call rename(a:tmpname, expand('%'))
|
||||
silent edit!
|
||||
let &syntax = &syntax
|
||||
|
||||
" only clear location list if it was previously filled to prevent
|
||||
" clobbering other additions
|
||||
if s:got_fmt_error
|
||||
let s:got_fmt_error = 0
|
||||
call setloclist(0, [])
|
||||
lwindow
|
||||
endif
|
||||
elseif g:rustfmt_fail_silently == 0
|
||||
" otherwise get the errors and put them in the location list
|
||||
let errors = []
|
||||
|
||||
for line in out
|
||||
" src/lib.rs:13:5: 13:10 error: expected `,`, or `}`, found `value`
|
||||
let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\):\s*\(\d\+:\d\+\s*\)\?\s*error: \(.*\)')
|
||||
if !empty(tokens)
|
||||
call add(errors, {"filename": @%,
|
||||
\"lnum": tokens[2],
|
||||
\"col": tokens[3],
|
||||
\"text": tokens[5]})
|
||||
endif
|
||||
endfor
|
||||
|
||||
if empty(errors)
|
||||
% | " Couldn't detect rustfmt error format, output errors
|
||||
endif
|
||||
|
||||
if !empty(errors)
|
||||
call setloclist(0, errors, 'r')
|
||||
echohl Error | echomsg "rustfmt returned error" | echohl None
|
||||
endif
|
||||
|
||||
let s:got_fmt_error = 1
|
||||
lwindow
|
||||
" We didn't use the temp file, so clean up
|
||||
call delete(a:tmpname)
|
||||
endif
|
||||
|
||||
call winrestview(a:curw)
|
||||
endfunction
|
||||
|
||||
function! rustfmt#FormatRange(line1, line2)
|
||||
let l:curw = winsaveview()
|
||||
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
|
||||
call writefile(getline(1, '$'), l:tmpname)
|
||||
|
||||
let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2)
|
||||
|
||||
call s:RunRustfmt(command, l:curw, l:tmpname)
|
||||
endfunction
|
||||
|
||||
function! rustfmt#Format()
|
||||
let l:curw = winsaveview()
|
||||
let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt"
|
||||
call writefile(getline(1, '$'), l:tmpname)
|
||||
|
||||
let command = s:RustfmtCommand(l:tmpname)
|
||||
|
||||
call s:RunRustfmt(command, l:curw, l:tmpname)
|
||||
endfunction
|
||||
35
runtime/compiler/cargo.vim
Normal file
35
runtime/compiler/cargo.vim
Normal file
@@ -0,0 +1,35 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Cargo Compiler
|
||||
" Maintainer: Damien Radtke <damienradtke@gmail.com>
|
||||
" Latest Revision: 2014 Sep 24
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if exists('current_compiler')
|
||||
finish
|
||||
endif
|
||||
runtime compiler/rustc.vim
|
||||
let current_compiler = "cargo"
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists(':CompilerSet') != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if exists('g:cargo_makeprg_params')
|
||||
execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*'
|
||||
else
|
||||
CompilerSet makeprg=cargo\ $*
|
||||
endif
|
||||
|
||||
" Ignore general cargo progress messages
|
||||
CompilerSet errorformat+=
|
||||
\%-G%\\s%#Downloading%.%#,
|
||||
\%-G%\\s%#Compiling%.%#,
|
||||
\%-G%\\s%#Finished%.%#,
|
||||
\%-G%\\s%#error:\ Could\ not\ compile\ %.%#,
|
||||
\%-G%\\s%#To\ learn\ more\\,%.%#
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim compiler file
|
||||
" Compiler: reStructuredText Documentation Format
|
||||
" Compiler: sphinx >= 1.0.8, http://www.sphinx-doc.org
|
||||
" Description: reStructuredText Documentation Format
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-04-19
|
||||
" Latest Revision: 2017-03-31
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -11,12 +12,18 @@ let current_compiler = "rst"
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal errorformat=
|
||||
\%f:%l:\ (%tEBUG/0)\ %m,
|
||||
\%f:%l:\ (%tNFO/1)\ %m,
|
||||
\%f:%l:\ (%tARNING/2)\ %m,
|
||||
\%f:%l:\ (%tRROR/3)\ %m,
|
||||
\%f:%l:\ (%tEVERE/3)\ %m,
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%f\\:%l:\ %tEBUG:\ %m,
|
||||
\%f\\:%l:\ %tNFO:\ %m,
|
||||
\%f\\:%l:\ %tARNING:\ %m,
|
||||
\%f\\:%l:\ %tRROR:\ %m,
|
||||
\%f\\:%l:\ %tEVERE:\ %m,
|
||||
\%f\\:%s:\ %tARNING:\ %m,
|
||||
\%f\\:%s:\ %tRROR:\ %m,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||
\%DMaking\ %*\\a\ in\ %f
|
||||
|
||||
46
runtime/compiler/rustc.vim
Normal file
46
runtime/compiler/rustc.vim
Normal file
@@ -0,0 +1,46 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Rust Compiler
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Latest Revision: 2013 Jul 12
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "rustc"
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0
|
||||
CompilerSet makeprg=rustc
|
||||
else
|
||||
CompilerSet makeprg=rustc\ \%
|
||||
endif
|
||||
|
||||
" Old errorformat (before nightly 2016/08/10)
|
||||
CompilerSet errorformat=
|
||||
\%f:%l:%c:\ %t%*[^:]:\ %m,
|
||||
\%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m,
|
||||
\%-G%f:%l\ %s,
|
||||
\%-G%*[\ ]^,
|
||||
\%-G%*[\ ]^%*[~],
|
||||
\%-G%*[\ ]...
|
||||
|
||||
" New errorformat (after nightly 2016/08/10)
|
||||
CompilerSet errorformat+=
|
||||
\%-G,
|
||||
\%-Gerror:\ aborting\ %.%#,
|
||||
\%-Gerror:\ Could\ not\ compile\ %.%#,
|
||||
\%Eerror:\ %m,
|
||||
\%Eerror[E%n]:\ %m,
|
||||
\%Wwarning:\ %m,
|
||||
\%Inote:\ %m,
|
||||
\%C\ %#-->\ %f:%l:%c
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,7 +1,7 @@
|
||||
" The default vimrc file.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2017 Mar 08
|
||||
" Last change: 2017 Apr 12
|
||||
"
|
||||
" This is loaded if no vimrc file was found.
|
||||
" Except when Vim is run with "-u NONE" or "-C".
|
||||
@@ -26,6 +26,12 @@ if &compatible
|
||||
set nocompatible
|
||||
endif
|
||||
|
||||
" When the +eval feature is missing, the set command above will be skipped.
|
||||
" Use a trick to reset compatible only when the +eval feature is missing.
|
||||
silent! while 0
|
||||
set nocompatible
|
||||
silent! endwhile
|
||||
|
||||
" Allow backspacing over everything in insert mode.
|
||||
set backspace=indent,eol,start
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ DOCS = \
|
||||
filetype.txt \
|
||||
fold.txt \
|
||||
ft_ada.txt \
|
||||
ft_rust.txt \
|
||||
ft_sql.txt \
|
||||
gui.txt \
|
||||
gui_w32.txt \
|
||||
@@ -165,6 +166,7 @@ HTMLS = \
|
||||
filetype.html \
|
||||
fold.html \
|
||||
ft_ada.html \
|
||||
ft_rust.html \
|
||||
ft_sql.html \
|
||||
gui.html \
|
||||
gui_w32.html \
|
||||
|
||||
@@ -10,11 +10,11 @@ Arabic Language support (options & mappings) for Vim *Arabic*
|
||||
|
||||
*E800*
|
||||
In order to use right-to-left and Arabic mapping support, it is
|
||||
necessary to compile VIM with the |+arabic| feature.
|
||||
necessary to compile Vim with the |+arabic| feature.
|
||||
|
||||
These functions have been created by Nadim Shaikli <nadim-at-arabeyes.org>
|
||||
|
||||
It is best to view this file with these settings within VIM's GUI: >
|
||||
It is best to view this file with these settings within Vim's GUI: >
|
||||
|
||||
:set encoding=utf-8
|
||||
:set arabicshape
|
||||
@@ -42,7 +42,7 @@ the user interface remains the standard Vi interface.
|
||||
|
||||
Highlights
|
||||
----------
|
||||
o Editing left-to-right files as in the original VIM hasn't changed.
|
||||
o Editing left-to-right files as in the original Vim hasn't changed.
|
||||
|
||||
o Viewing and editing files in right-to-left windows. File
|
||||
orientation is per window, so it is possible to view the same
|
||||
@@ -52,7 +52,7 @@ o No special terminal with right-to-left capabilities is required.
|
||||
The right-to-left changes are completely hardware independent.
|
||||
Only Arabic fonts are necessary.
|
||||
|
||||
o Compatible with the original VIM. Almost all features work in
|
||||
o Compatible with the original Vim. Almost all features work in
|
||||
right-to-left mode (there are liable to be bugs).
|
||||
|
||||
o Changing keyboard mapping and reverse insert modes using a single
|
||||
@@ -66,14 +66,14 @@ o While in Arabic mode, numbers are entered from left to right. Upon
|
||||
|
||||
o Arabic keymapping on the command line in reverse insert mode.
|
||||
|
||||
o Proper Bidirectional functionality is possible given VIM is
|
||||
o Proper Bidirectional functionality is possible given Vim is
|
||||
started within a Bidi capable terminal emulator.
|
||||
|
||||
|
||||
Arabic Fonts *arabicfonts*
|
||||
------------
|
||||
|
||||
VIM requires monospaced fonts of which there are many out there.
|
||||
Vim requires monospaced fonts of which there are many out there.
|
||||
Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
|
||||
(without Form-B, Arabic will _NOT_ be usable). It is highly
|
||||
recommended that users search for so-called 'ISO-10646-1' fonts.
|
||||
@@ -96,13 +96,13 @@ o Installation of fonts for X Window systems (Unix/Linux)
|
||||
|
||||
Usage
|
||||
-----
|
||||
Prior to the actual usage of Arabic within VIM, a number of settings
|
||||
Prior to the actual usage of Arabic within Vim, a number of settings
|
||||
need to be accounted for and invoked.
|
||||
|
||||
o Setting the Arabic fonts
|
||||
|
||||
+ For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done
|
||||
by entering the following command in the VIM window.
|
||||
+ For Vim GUI set the 'guifont' to your_ARABIC_FONT. This is done
|
||||
by entering the following command in the Vim window.
|
||||
>
|
||||
:set guifont=your_ARABIC_FONT
|
||||
<
|
||||
@@ -115,7 +115,7 @@ o Setting the Arabic fonts
|
||||
you can include ':set guifont=your_ARABIC_FONT' to your .vimrc
|
||||
file.
|
||||
|
||||
+ Under the X Window environment, you can also start VIM with
|
||||
+ Under the X Window environment, you can also start Vim with
|
||||
'-fn your_ARABIC_FONT' option.
|
||||
|
||||
o Setting the appropriate character Encoding
|
||||
@@ -124,7 +124,7 @@ o Setting the appropriate character Encoding
|
||||
>
|
||||
:set encoding=utf-8
|
||||
<
|
||||
to your .vimrc file (entering the command manually into you VIM
|
||||
to your .vimrc file (entering the command manually into you Vim
|
||||
window is highly discouraged). In short, include ':set
|
||||
encoding=utf-8' to your .vimrc file.
|
||||
|
||||
@@ -137,11 +137,11 @@ o Setting the appropriate character Encoding
|
||||
o Enable Arabic settings [short-cut]
|
||||
|
||||
In order to simplify and streamline things, you can either invoke
|
||||
VIM with the command-line option,
|
||||
Vim with the command-line option,
|
||||
|
||||
% vim -A my_utf8_arabic_file ...
|
||||
|
||||
or enable 'arabic' via the following command within VIM
|
||||
or enable 'arabic' via the following command within Vim
|
||||
>
|
||||
:set arabic
|
||||
<
|
||||
@@ -189,7 +189,7 @@ o Enable Arabic settings [short-cut]
|
||||
>
|
||||
:set keymap=arabic
|
||||
<
|
||||
in your VIM window. You can also append the 'keymap' set command to
|
||||
in your Vim window. You can also append the 'keymap' set command to
|
||||
your .vimrc file. In other words, you can include ':set keymap=arabic'
|
||||
to your .vimrc file.
|
||||
|
||||
@@ -202,7 +202,7 @@ o Enable Arabic settings [short-cut]
|
||||
|
||||
+ Arabic deletion of a combined pair character
|
||||
|
||||
By default VIM has the 'delcombine' option disabled. This option
|
||||
By default Vim has the 'delcombine' option disabled. This option
|
||||
allows the deletion of ALEF in a LAM_ALEF (LAA) combined character
|
||||
and still retain the LAM (i.e. it reverts to treating the combined
|
||||
character as its natural two characters form -- this also pertains
|
||||
@@ -211,13 +211,13 @@ o Enable Arabic settings [short-cut]
|
||||
>
|
||||
:set delcombine
|
||||
<
|
||||
in our VIM window. You can also append the 'delcombine' set command
|
||||
in our Vim window. You can also append the 'delcombine' set command
|
||||
to your .vimrc file. In other words, you can include ':set delcombine'
|
||||
to your .vimrc file.
|
||||
|
||||
+ Arabic right-to-left Mode
|
||||
|
||||
By default VIM starts in Left-to-right mode. 'rightleft' is the
|
||||
By default Vim starts in Left-to-right mode. 'rightleft' is the
|
||||
command that allows one to alter a window's orientation - that can
|
||||
be accomplished via,
|
||||
|
||||
@@ -253,7 +253,7 @@ o Enable Arabic settings [short-cut]
|
||||
>
|
||||
:set arabicshape
|
||||
<
|
||||
in our VIM window. You can also append the 'arabicshape' set
|
||||
in our Vim window. You can also append the 'arabicshape' set
|
||||
command to your .vimrc file. In other words, you can include
|
||||
':set arabicshape' to your .vimrc file.
|
||||
|
||||
@@ -261,7 +261,7 @@ o Enable Arabic settings [short-cut]
|
||||
Keymap/Keyboard *arabickeymap*
|
||||
---------------
|
||||
|
||||
The character/letter encoding used in VIM is the standard UTF-8.
|
||||
The character/letter encoding used in Vim is the standard UTF-8.
|
||||
It is widely discouraged that any other encoding be used or even
|
||||
attempted.
|
||||
|
||||
@@ -294,7 +294,7 @@ o Keyboard
|
||||
Restrictions
|
||||
------------
|
||||
|
||||
o VIM in its GUI form does not currently support Bi-directionality
|
||||
o Vim in its GUI form does not currently support Bi-directionality
|
||||
(i.e. the ability to see both Arabic and Latin intermixed within
|
||||
the same line).
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2017 Jan 14
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2017 Apr 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -610,7 +610,7 @@ FileChangedShell When Vim notices that the modification time of
|
||||
|timestamp|
|
||||
Mostly triggered after executing a shell
|
||||
command, but also with a |:checktime| command
|
||||
or when Gvim regains input focus.
|
||||
or when gvim regains input focus.
|
||||
This autocommand is triggered for each changed
|
||||
file. It is not used when 'autoread' is set
|
||||
and the buffer was not changed. If a
|
||||
@@ -621,7 +621,7 @@ FileChangedShell When Vim notices that the modification time of
|
||||
to tell Vim what to do next.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer that was changed "<afile>".
|
||||
buffer that was changed, which is in "<afile>".
|
||||
NOTE: The commands must not change the current
|
||||
buffer, jump to another buffer or delete a
|
||||
buffer. *E246* *E811*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.0. Last change: 2016 Nov 24
|
||||
*editing.txt* For Vim version 8.0. Last change: 2017 Apr 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1558,6 +1558,13 @@ If you want to automatically reload a file when it has been changed outside of
|
||||
Vim, set the 'autoread' option. This doesn't work at the moment you write the
|
||||
file though, only when the file wasn't changed inside of Vim.
|
||||
|
||||
If you do not want to be asked or automatically reload the file, you can use
|
||||
this: >
|
||||
set buftype=nofile
|
||||
|
||||
Or, when starting gvim from a shell: >
|
||||
gvim file.log -c "set buftype=nofile"
|
||||
|
||||
Note that if a FileChangedShell autocommand is defined you will not get a
|
||||
warning message or prompt. The autocommand is expected to handle this.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Mar 18
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jun 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2261,12 +2261,13 @@ readfile({fname} [, {binary} [, {max}]])
|
||||
reltime([{start} [, {end}]]) List get time value
|
||||
reltimefloat({time}) Float turn the time value into a Float
|
||||
reltimestr({time}) String turn time value into a String
|
||||
remote_expr({server}, {string} [, {idvar}])
|
||||
remote_expr({server}, {string} [, {idvar} [, {timeout}]])
|
||||
String send expression
|
||||
remote_foreground({server}) Number bring Vim server to the foreground
|
||||
remote_peek({serverid} [, {retvar}])
|
||||
Number check for reply string
|
||||
remote_read({serverid}) String read reply string
|
||||
remote_read({serverid} [, {timeout}])
|
||||
String read reply string
|
||||
remote_send({server}, {string} [, {idvar}])
|
||||
String send key sequence
|
||||
remote_startserver({name}) none become server {name}
|
||||
@@ -2363,7 +2364,7 @@ systemlist({expr} [, {input}]) List output of shell command/filter {expr}
|
||||
tabpagebuflist([{arg}]) List list of buffer numbers in tab page
|
||||
tabpagenr([{arg}]) Number number of current or last tab page
|
||||
tabpagewinnr({tabarg}[, {arg}]) Number number of current window in tab page
|
||||
taglist({expr}) List list of tags matching {expr}
|
||||
taglist({expr}[, {filename}]) List list of tags matching {expr}
|
||||
tagfiles() List tags files used
|
||||
tan({expr}) Float tangent of {expr}
|
||||
tanh({expr}) Float hyperbolic tangent of {expr}
|
||||
@@ -3372,6 +3373,7 @@ did_filetype() Returns |TRUE| when autocommands are being executed and the
|
||||
FileType event has been triggered at least once. Can be used
|
||||
to avoid triggering the FileType event again in the scripts
|
||||
that detect the file type. |FileType|
|
||||
Returns |FALSE| when `:setf FALLBACK` was used.
|
||||
When editing another file, the counter is reset, thus this
|
||||
really checks if the FileType event has been triggered for the
|
||||
current buffer. This allows an autocommand that starts
|
||||
@@ -4378,12 +4380,14 @@ getcurpos() Get the position of the cursor. This is like getpos('.'), but
|
||||
includes an extra item in the list:
|
||||
[bufnum, lnum, col, off, curswant] ~
|
||||
The "curswant" number is the preferred column when moving the
|
||||
cursor vertically.
|
||||
cursor vertically. Also see |getpos()|.
|
||||
|
||||
This can be used to save and restore the cursor position: >
|
||||
let save_cursor = getcurpos()
|
||||
MoveTheCursorAround
|
||||
call setpos('.', save_cursor)
|
||||
<
|
||||
< Note that this only works within the window. See
|
||||
|winrestview()| for restoring more state.
|
||||
*getcwd()*
|
||||
getcwd([{winnr} [, {tabnr}]])
|
||||
The result is a String, which is the name of the current
|
||||
@@ -4581,6 +4585,7 @@ getqflist([{what}]) *getqflist()*
|
||||
If the optional {what} dictionary argument is supplied, then
|
||||
returns only the items listed in {what} as a dictionary. The
|
||||
following string items are supported in {what}:
|
||||
context get the context stored with |setqflist()|
|
||||
nr get information for this quickfix list; zero
|
||||
means the current quickfix list
|
||||
title get the list title
|
||||
@@ -4592,6 +4597,7 @@ getqflist([{what}]) *getqflist()*
|
||||
returned.
|
||||
|
||||
The returned dictionary contains the following entries:
|
||||
context context information stored with |setqflist()|
|
||||
nr quickfix list number
|
||||
title quickfix list title text
|
||||
winid quickfix |window-ID| (if opened)
|
||||
@@ -4681,13 +4687,16 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
|
||||
<
|
||||
*getwinposx()*
|
||||
getwinposx() The result is a Number, which is the X coordinate in pixels of
|
||||
the left hand side of the GUI Vim window. The result will be
|
||||
-1 if the information is not available.
|
||||
the left hand side of the GUI Vim window. Also works for an
|
||||
xterm.
|
||||
The result will be -1 if the information is not available.
|
||||
The value can be used with `:winpos`.
|
||||
|
||||
*getwinposy()*
|
||||
getwinposy() The result is a Number, which is the Y coordinate in pixels of
|
||||
the top of the GUI Vim window. The result will be -1 if the
|
||||
information is not available.
|
||||
the top of the GUI Vim window. Also works for an xterm.
|
||||
The result will be -1 if the information is not available.
|
||||
The value can be used with `:winpos`.
|
||||
|
||||
getwininfo([{winid}]) *getwininfo()*
|
||||
Returns information about windows as a List with Dictionaries.
|
||||
@@ -5259,9 +5268,14 @@ job_stop({job} [, {how}]) *job_stop()*
|
||||
0 if "how" is not supported on the system.
|
||||
Note that even when the operation was executed, whether the
|
||||
job was actually stopped needs to be checked with
|
||||
job_status().
|
||||
The status of the job isn't checked, the operation will even
|
||||
be done when Vim thinks the job isn't running.
|
||||
|job_status()|.
|
||||
|
||||
If the status of the job is "dead", the signal will not be
|
||||
sent. This is to avoid to stop the wrong job (esp. on Unix,
|
||||
where process numbers are recycled).
|
||||
|
||||
When using "kill" Vim will assume the job will die and close
|
||||
the channel.
|
||||
|
||||
{only available when compiled with the |+job| feature}
|
||||
|
||||
@@ -5303,13 +5317,29 @@ json_decode({string}) *json_decode()*
|
||||
in Vim values. See |json_encode()| for the relation between
|
||||
JSON and Vim values.
|
||||
The decoding is permissive:
|
||||
- A trailing comma in an array and object is ignored.
|
||||
- A trailing comma in an array and object is ignored, e.g.
|
||||
"[1, 2, ]" is the same as "[1, 2]".
|
||||
- More floating point numbers are recognized, e.g. "1." for
|
||||
"1.0".
|
||||
However, a duplicate key in an object is not allowed. *E938*
|
||||
The result must be a valid Vim type:
|
||||
- An empty object member name is not allowed.
|
||||
- Duplicate object member names are not allowed.
|
||||
"1.0", or "001.2" for "1.2". Special floating point values
|
||||
"Infinity" and "NaN" (capitalization ignored) are accepted.
|
||||
- Leading zeroes in integer numbers are ignored, e.g. "012"
|
||||
for "12" or "-012" for "-12".
|
||||
- Capitalization is ignored in literal names null, true or
|
||||
false, e.g. "NULL" for "null", "True" for "true".
|
||||
- Control characters U+0000 through U+001F which are not
|
||||
escaped in strings are accepted, e.g. " " (tab
|
||||
character in string) for "\t".
|
||||
- Backslash in an invalid 2-character sequence escape is
|
||||
ignored, e.g. "\a" is decoded as "a".
|
||||
- A correct surrogate pair in JSON strings should normally be
|
||||
a 12 character sequence such as "\uD834\uDD1E", but
|
||||
json_decode() silently accepts truncated surrogate pairs
|
||||
such as "\uD834" or "\uD834\u"
|
||||
*E938*
|
||||
A duplicate key in an object, valid in rfc7159, is not
|
||||
accepted by json_decode() as the result must be a valid Vim
|
||||
type, e.g. this fails: {"a":"b", "a":"c"}
|
||||
|
||||
|
||||
json_encode({expr}) *json_encode()*
|
||||
Encode {expr} as JSON and return this as a string.
|
||||
@@ -5412,8 +5442,10 @@ line({expr}) The result is a Number, which is the line number of the file
|
||||
$ the last line in the current buffer
|
||||
'x position of mark x (if the mark is not set, 0 is
|
||||
returned)
|
||||
w0 first line visible in current window
|
||||
w$ last line visible in current window
|
||||
w0 first line visible in current window (one if the
|
||||
display isn't updated, e.g. in silent Ex mode)
|
||||
w$ last line visible in current window (this is one
|
||||
less than "w0" if no lines are visible)
|
||||
v In Visual mode: the start of the Visual area (the
|
||||
cursor is the end). When not in Visual mode
|
||||
returns the cursor position. Differs from |'<| in
|
||||
@@ -6320,15 +6352,17 @@ reltimestr({time}) *reltimestr()*
|
||||
{only available when compiled with the |+reltime| feature}
|
||||
|
||||
*remote_expr()* *E449*
|
||||
remote_expr({server}, {string} [, {idvar}])
|
||||
remote_expr({server}, {string} [, {idvar} [, {timeout}]])
|
||||
Send the {string} to {server}. The string is sent as an
|
||||
expression and the result is returned after evaluation.
|
||||
The result must be a String or a |List|. A |List| is turned
|
||||
into a String by joining the items with a line break in
|
||||
between (not at the end), like with join(expr, "\n").
|
||||
If {idvar} is present, it is taken as the name of a
|
||||
variable and a {serverid} for later use with
|
||||
If {idvar} is present and not empty, it is taken as the name
|
||||
of a variable and a {serverid} for later use with
|
||||
remote_read() is stored there.
|
||||
If {timeout} is given the read times out after this many
|
||||
seconds. Otherwise a timeout of 600 seconds is used.
|
||||
See also |clientserver| |RemoteReply|.
|
||||
This function is not available in the |sandbox|.
|
||||
{only available when compiled with the |+clientserver| feature}
|
||||
@@ -6367,9 +6401,10 @@ remote_peek({serverid} [, {retvar}]) *remote_peek()*
|
||||
:let repl = ""
|
||||
:echo "PEEK: ".remote_peek(id, "repl").": ".repl
|
||||
|
||||
remote_read({serverid}) *remote_read()*
|
||||
remote_read({serverid}, [{timeout}]) *remote_read()*
|
||||
Return the oldest available reply from {serverid} and consume
|
||||
it. It blocks until a reply is available.
|
||||
it. Unless a {timeout} in seconds is given, it blocks until a
|
||||
reply is available.
|
||||
See also |clientserver|.
|
||||
This function is not available in the |sandbox|.
|
||||
{only available when compiled with the |+clientserver| feature}
|
||||
@@ -6918,6 +6953,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
nr error number
|
||||
text description of the error
|
||||
type single-character error type, 'E', 'W', etc.
|
||||
valid recognized error message
|
||||
|
||||
The "col", "vcol", "nr", "type" and "text" entries are
|
||||
optional. Either "lnum" or "pattern" entry can be used to
|
||||
@@ -6927,21 +6963,26 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
item will not be handled as an error line.
|
||||
If both "pattern" and "lnum" are present then "pattern" will
|
||||
be used.
|
||||
If the "valid" entry is not supplied, then the valid flag is
|
||||
set when "bufnr" is a valid buffer or "filename" exists.
|
||||
If you supply an empty {list}, the quickfix list will be
|
||||
cleared.
|
||||
Note that the list is not exactly the same as what
|
||||
|getqflist()| returns.
|
||||
|
||||
*E927*
|
||||
If {action} is set to 'a', then the items from {list} are
|
||||
added to the existing quickfix list. If there is no existing
|
||||
list, then a new list is created.
|
||||
{action} values: *E927*
|
||||
'a' The items from {list} are added to the existing
|
||||
quickfix list. If there is no existing list, then a
|
||||
new list is created.
|
||||
|
||||
If {action} is set to 'r', then the items from the current
|
||||
quickfix list are replaced with the items from {list}. This
|
||||
can also be used to clear the list: >
|
||||
:call setqflist([], 'r')
|
||||
'r' The items from the current quickfix list are replaced
|
||||
with the items from {list}. This can also be used to
|
||||
clear the list: >
|
||||
:call setqflist([], 'r')
|
||||
<
|
||||
'f' All the quickfix lists in the quickfix stack are
|
||||
freed.
|
||||
|
||||
If {action} is not present or is set to ' ', then a new list
|
||||
is created.
|
||||
|
||||
@@ -6949,6 +6990,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
only the items listed in {what} are set. The first {list}
|
||||
argument is ignored. The following items can be specified in
|
||||
{what}:
|
||||
context any Vim type can be stored as a context
|
||||
nr list number in the quickfix stack
|
||||
title quickfix list title text
|
||||
Unsupported keys in {what} are ignored.
|
||||
@@ -6963,7 +7005,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
|
||||
This function can be used to create a quickfix list
|
||||
independent of the 'errorformat' setting. Use a command like
|
||||
":cc 1" to jump to the first position.
|
||||
`:cc 1` to jump to the first position.
|
||||
|
||||
|
||||
*setreg()*
|
||||
@@ -7738,8 +7780,13 @@ tagfiles() Returns a |List| with the file names used to search for tags
|
||||
for the current buffer. This is the 'tags' option expanded.
|
||||
|
||||
|
||||
taglist({expr}) *taglist()*
|
||||
taglist({expr}[, {filename}]) *taglist()*
|
||||
Returns a list of tags matching the regular expression {expr}.
|
||||
|
||||
If {filename} is passed it is used to prioritize the results
|
||||
in the same way that |:tselect| does. See |tag-priority|.
|
||||
{filename} should be the full path of the file.
|
||||
|
||||
Each list item is a dictionary with at least the following
|
||||
entries:
|
||||
name Name of the tag.
|
||||
@@ -8458,9 +8505,9 @@ listcmds Compiled with commands for the buffer list |:files|
|
||||
and the argument list |arglist|.
|
||||
localmap Compiled with local mappings and abbr. |:map-local|
|
||||
lua Compiled with Lua interface |Lua|.
|
||||
mac Any Macintosh version of Vim.
|
||||
macunix Compiled for OS X, with darwin
|
||||
osx Compiled for OS X, with or without darwin
|
||||
mac Any Macintosh version of Vim, but not all OS X.
|
||||
macunix Compiled for OS X, with |mac-darwin-feature|
|
||||
osx Compiled for OS X, with or w/o |mac-darwin-feature|
|
||||
menu Compiled with support for |:menu|.
|
||||
mksession Compiled with support for |:mksession|.
|
||||
modify_fname Compiled with file name modifiers. |filename-modifiers|
|
||||
@@ -10635,6 +10682,17 @@ missing: >
|
||||
: echo "You will _never_ see this message"
|
||||
:endif
|
||||
|
||||
To execute a command only when the |+eval| feature is disabled requires a trick,
|
||||
as this example shows: >
|
||||
|
||||
silent! while 0
|
||||
set history=111
|
||||
silent! endwhile
|
||||
|
||||
When the |+eval| feature is available the command is skipped because of the
|
||||
"while 0". Without the |+eval| feature the "while 0" is an error, which is
|
||||
silently ignored, and the command is executed.
|
||||
|
||||
==============================================================================
|
||||
11. The sandbox *eval-sandbox* *sandbox* *E48*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 8.0. Last change: 2017 Jan 04
|
||||
*filetype.txt* For Vim version 8.0. Last change: 2017 Mar 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -353,12 +353,12 @@ define yourself. There are a few ways to avoid this:
|
||||
You need to define your own mapping before the plugin is loaded (before
|
||||
editing a file of that type). The plugin will then skip installing the
|
||||
default mapping.
|
||||
|
||||
*no_mail_maps*
|
||||
3. Disable defining mappings for a specific filetype by setting a variable,
|
||||
which contains the name of the filetype. For the "mail" filetype this
|
||||
would be: >
|
||||
:let no_mail_maps = 1
|
||||
|
||||
< *no_plugin_maps*
|
||||
4. Disable defining mappings for all filetypes by setting a variable: >
|
||||
:let no_plugin_maps = 1
|
||||
<
|
||||
@@ -663,6 +663,12 @@ Since the text for this plugin is rather long it has been put in a separate
|
||||
file: |pi_spec.txt|.
|
||||
|
||||
|
||||
RUST *ft-rust*
|
||||
|
||||
Since the text for this plugin is rather long it has been put in a separate
|
||||
file: |ft_rust.txt|.
|
||||
|
||||
|
||||
SQL *ft-sql*
|
||||
|
||||
Since the text for this plugin is rather long it has been put in a separate
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 8.0. Last change: 2016 Jan 02
|
||||
*fold.txt* For Vim version 8.0. Last change: 2017 Mar 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -79,7 +79,7 @@ This will call a function to compute the fold level: >
|
||||
:set foldexpr=MyFoldLevel(v:lnum)
|
||||
This will make a fold out of paragraphs separated by blank lines: >
|
||||
:set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
|
||||
this does the same: >
|
||||
This does the same: >
|
||||
:set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1
|
||||
|
||||
Note that backslashes must be used to escape characters that ":set" handles
|
||||
@@ -203,7 +203,7 @@ and the level given by the marker:
|
||||
1. If a marker with the same fold level is encountered, the previous fold
|
||||
ends and another fold with the same level starts.
|
||||
2. If a marker with a higher fold level is found, a nested fold is started.
|
||||
3. if a marker with a lower fold level is found, all folds up to and including
|
||||
3. If a marker with a lower fold level is found, all folds up to and including
|
||||
this level end and a fold with the specified level starts.
|
||||
|
||||
The number indicates the fold level. A zero cannot be used (a marker with
|
||||
|
||||
@@ -116,7 +116,7 @@ NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic
|
||||
then "gnat xref -v *.ad?"
|
||||
4) Project manager support is completely broken - don't even try "gnat xref
|
||||
-Padacl.gpr".
|
||||
5) VIM is faster when the tags file is sorted - use "sort --unique
|
||||
5) Vim is faster when the tags file is sorted - use "sort --unique
|
||||
--ignore-case --output=tags tags" .
|
||||
6) Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark
|
||||
the file assorted.
|
||||
|
||||
237
runtime/doc/ft_rust.txt
Normal file
237
runtime/doc/ft_rust.txt
Normal file
@@ -0,0 +1,237 @@
|
||||
*ft_rust.txt* Filetype plugin for Rust
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *rust*
|
||||
|
||||
1. Introduction |rust-intro|
|
||||
2. Settings |rust-settings|
|
||||
3. Commands |rust-commands|
|
||||
4. Mappings |rust-mappings|
|
||||
|
||||
==============================================================================
|
||||
INTRODUCTION *rust-intro*
|
||||
|
||||
This plugin provides syntax and supporting functionality for the Rust
|
||||
filetype.
|
||||
|
||||
==============================================================================
|
||||
SETTINGS *rust-settings*
|
||||
|
||||
This plugin has a few variables you can define in your vimrc that change the
|
||||
behavior of the plugin.
|
||||
|
||||
*g:rustc_path*
|
||||
g:rustc_path~
|
||||
Set this option to the path to rustc for use in the |:RustRun| and
|
||||
|:RustExpand| commands. If unset, "rustc" will be located in $PATH: >
|
||||
let g:rustc_path = $HOME."/bin/rustc"
|
||||
<
|
||||
|
||||
*g:rustc_makeprg_no_percent*
|
||||
g:rustc_makeprg_no_percent~
|
||||
Set this option to 1 to have 'makeprg' default to "rustc" instead of
|
||||
"rustc %": >
|
||||
let g:rustc_makeprg_no_percent = 1
|
||||
<
|
||||
|
||||
*g:rust_conceal*
|
||||
g:rust_conceal~
|
||||
Set this option to turn on the basic |conceal| support: >
|
||||
let g:rust_conceal = 1
|
||||
<
|
||||
|
||||
*g:rust_conceal_mod_path*
|
||||
g:rust_conceal_mod_path~
|
||||
Set this option to turn on |conceal| for the path connecting token
|
||||
"::": >
|
||||
let g:rust_conceal_mod_path = 1
|
||||
<
|
||||
|
||||
*g:rust_conceal_pub*
|
||||
g:rust_conceal_pub~
|
||||
Set this option to turn on |conceal| for the "pub" token: >
|
||||
let g:rust_conceal_pub = 1
|
||||
<
|
||||
|
||||
*g:rust_recommended_style*
|
||||
g:rust_recommended_style~
|
||||
Set this option to enable vim indentation and textwidth settings to
|
||||
conform to style conventions of the rust standard library (i.e. use 4
|
||||
spaces for indents and sets 'textwidth' to 99). This option is enabled
|
||||
by default. To disable it: >
|
||||
let g:rust_recommended_style = 0
|
||||
<
|
||||
|
||||
*g:rust_fold*
|
||||
g:rust_fold~
|
||||
Set this option to turn on |folding|: >
|
||||
let g:rust_fold = 1
|
||||
<
|
||||
Value Effect ~
|
||||
0 No folding
|
||||
1 Braced blocks are folded. All folds are open by
|
||||
default.
|
||||
2 Braced blocks are folded. 'foldlevel' is left at the
|
||||
global value (all folds are closed by default).
|
||||
|
||||
*g:rust_bang_comment_leader*
|
||||
g:rust_bang_comment_leader~
|
||||
Set this option to 1 to preserve the leader on multi-line doc comments
|
||||
using the /*! syntax: >
|
||||
let g:rust_bang_comment_leader = 1
|
||||
<
|
||||
|
||||
*g:ftplugin_rust_source_path*
|
||||
g:ftplugin_rust_source_path~
|
||||
Set this option to a path that should be prepended to 'path' for Rust
|
||||
source files: >
|
||||
let g:ftplugin_rust_source_path = $HOME.'/dev/rust'
|
||||
<
|
||||
|
||||
*g:rustfmt_command*
|
||||
g:rustfmt_command~
|
||||
Set this option to the name of the 'rustfmt' executable in your $PATH. If
|
||||
not specified it defaults to 'rustfmt' : >
|
||||
let g:rustfmt_command = 'rustfmt'
|
||||
<
|
||||
*g:rustfmt_autosave*
|
||||
g:rustfmt_autosave~
|
||||
Set this option to 1 to run |:RustFmt| automatically when saving a
|
||||
buffer. If not specified it defaults to 0 : >
|
||||
let g:rustfmt_autosave = 0
|
||||
<
|
||||
*g:rustfmt_fail_silently*
|
||||
g:rustfmt_fail_silently~
|
||||
Set this option to 1 to prevent 'rustfmt' from populating the
|
||||
|location-list| with errors. If not specified it defaults to 0: >
|
||||
let g:rustfmt_fail_silently = 0
|
||||
<
|
||||
*g:rustfmt_options*
|
||||
g:rustfmt_options~
|
||||
Set this option to a string of options to pass to 'rustfmt'. The
|
||||
write-mode is already set to 'overwrite'. If not specified it
|
||||
defaults to '' : >
|
||||
let g:rustfmt_options = ''
|
||||
<
|
||||
|
||||
*g:rust_playpen_url*
|
||||
g:rust_playpen_url~
|
||||
Set this option to override the url for the playpen to use: >
|
||||
let g:rust_playpen_url = 'https://play.rust-lang.org/'
|
||||
<
|
||||
|
||||
*g:rust_shortener_url*
|
||||
g:rust_shortener_url~
|
||||
Set this option to override the url for the url shortener: >
|
||||
let g:rust_shortener_url = 'https://is.gd/'
|
||||
<
|
||||
|
||||
|
||||
==============================================================================
|
||||
COMMANDS *rust-commands*
|
||||
|
||||
:RustRun [args] *:RustRun*
|
||||
:RustRun! [rustc-args] [--] [args]
|
||||
Compiles and runs the current file. If it has unsaved changes,
|
||||
it will be saved first using |:update|. If the current file is
|
||||
an unnamed buffer, it will be written to a temporary file
|
||||
first. The compiled binary is always placed in a temporary
|
||||
directory, but is run from the current directory.
|
||||
|
||||
The arguments given to |:RustRun| will be passed to the
|
||||
compiled binary.
|
||||
|
||||
If ! is specified, the arguments are passed to rustc instead.
|
||||
A "--" argument will separate the rustc arguments from the
|
||||
arguments passed to the binary.
|
||||
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustExpand [args] *:RustExpand*
|
||||
:RustExpand! [TYPE] [args]
|
||||
Expands the current file using --pretty and displays the
|
||||
results in a new split. If the current file has unsaved
|
||||
changes, it will be saved first using |:update|. If the
|
||||
current file is an unnamed buffer, it will be written to a
|
||||
temporary file first.
|
||||
|
||||
The arguments given to |:RustExpand| will be passed to rustc.
|
||||
This is largely intended for specifying various --cfg
|
||||
configurations.
|
||||
|
||||
If ! is specified, the first argument is the expansion type to
|
||||
pass to rustc --pretty. Otherwise it will default to
|
||||
"expanded".
|
||||
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustEmitIr [args] *:RustEmitIr*
|
||||
Compiles the current file to LLVM IR and displays the results
|
||||
in a new split. If the current file has unsaved changes, it
|
||||
will be saved first using |:update|. If the current file is an
|
||||
unnamed buffer, it will be written to a temporary file first.
|
||||
|
||||
The arguments given to |:RustEmitIr| will be passed to rustc.
|
||||
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustEmitAsm [args] *:RustEmitAsm*
|
||||
Compiles the current file to assembly and displays the results
|
||||
in a new split. If the current file has unsaved changes, it
|
||||
will be saved first using |:update|. If the current file is an
|
||||
unnamed buffer, it will be written to a temporary file first.
|
||||
|
||||
The arguments given to |:RustEmitAsm| will be passed to rustc.
|
||||
|
||||
If |g:rustc_path| is defined, it is used as the path to rustc.
|
||||
Otherwise it is assumed rustc can be found in $PATH.
|
||||
|
||||
:RustPlay *:RustPlay*
|
||||
This command will only work if you have web-api.vim installed
|
||||
(available at https://github.com/mattn/webapi-vim). It sends the
|
||||
current selection, or if nothing is selected, the entirety of the
|
||||
current buffer to the Rust playpen, and emits a message with the
|
||||
shortened URL to the playpen.
|
||||
|
||||
|g:rust_playpen_url| is the base URL to the playpen, by default
|
||||
"https://play.rust-lang.org/".
|
||||
|
||||
|g:rust_shortener_url| is the base url for the shorterner, by
|
||||
default "https://is.gd/"
|
||||
|
||||
:RustFmt *:RustFmt*
|
||||
Runs |g:rustfmt_command| on the current buffer. If
|
||||
|g:rustfmt_options| is set then those will be passed to the
|
||||
executable.
|
||||
|
||||
If |g:rustfmt_fail_silently| is 0 (the default) then it
|
||||
will populate the |location-list| with the errors from
|
||||
|g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1
|
||||
then it will not populate the |location-list|.
|
||||
|
||||
:RustFmtRange *:RustFmtRange*
|
||||
Runs |g:rustfmt_command| with selected range. See
|
||||
|:RustFmt| for any other information.
|
||||
|
||||
==============================================================================
|
||||
MAPPINGS *rust-mappings*
|
||||
|
||||
This plugin defines mappings for |[[| and |]]| to support hanging indents.
|
||||
|
||||
It also has a few other mappings:
|
||||
|
||||
*rust_<D-r>*
|
||||
<D-r> Executes |:RustRun| with no arguments.
|
||||
Note: This binding is only available in MacVim.
|
||||
|
||||
*rust_<D-R>*
|
||||
<D-R> Populates the command line with |:RustRun|! using the
|
||||
arguments given to the last invocation, but does not
|
||||
execute it.
|
||||
Note: This binding is only available in MacVim.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:sw=4:noet:ts=8:ft=help:norl:
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Introduction *hangul*
|
||||
------------
|
||||
It is to input hangul, the Korean language, with VIM GUI version.
|
||||
It is to input hangul, the Korean language, with Vim GUI version.
|
||||
If you have a XIM program, you can use another |+xim| feature.
|
||||
Basically, it is for anybody who has no XIM program.
|
||||
|
||||
@@ -31,7 +31,7 @@ You should set LANG variable to Korean locale such as ko, ko_KR.eucKR
|
||||
or ko_KR.UTF-8.
|
||||
If you set LC_ALL variable, it should be set to Korean locale also.
|
||||
|
||||
VIM resource
|
||||
Vim resource
|
||||
------------
|
||||
You may want to set 'encoding' and 'fileencodings'.
|
||||
Next are examples: >
|
||||
@@ -53,12 +53,12 @@ If both are set, VIM_KEYBOARD has higher priority.
|
||||
|
||||
Hangul Fonts
|
||||
------------
|
||||
If you use GTK version of GVIM, you should set 'guifont' and 'guifontwide'.
|
||||
If you use GTK version of gvim, you should set 'guifont' and 'guifontwide'.
|
||||
For example: >
|
||||
set guifont=Courier\ 12
|
||||
set guifontwide=NanumGothicCoding\ 12
|
||||
|
||||
If you use Motif or Athena version of GVIM, you should set 'guifontset' in
|
||||
If you use Motif or Athena version of gvim, you should set 'guifontset' in
|
||||
your vimrc. You can set fontset in the .Xdefaults file.
|
||||
|
||||
$HOME/.gvimrc: >
|
||||
@@ -77,11 +77,11 @@ $HOME/.Xdefaults: >
|
||||
|
||||
attention! the , (comma) or ; (semicolon)
|
||||
|
||||
And there should be no ':set guifont'. If it exists, then Gvim ignores
|
||||
':set guifontset'. It means VIM runs without fontset supporting.
|
||||
And there should be no ':set guifont'. If it exists, then gvim ignores
|
||||
':set guifontset'. It means Vim runs without fontset supporting.
|
||||
So, you can see only English. Hangul does not be correctly displayed.
|
||||
|
||||
After "fontset" feature is enabled, VIM does not allow using english
|
||||
After "fontset" feature is enabled, Vim does not allow using english
|
||||
font only in "font" setting for syntax.
|
||||
For example, if you use >
|
||||
:set guifontset=eng_font,your_font
|
||||
@@ -99,7 +99,7 @@ We don't support Johab font.
|
||||
We don't support Hanja input.
|
||||
And We don't have any plan to support them.
|
||||
|
||||
If you really need such features, you can use console version of VIM with a
|
||||
If you really need such features, you can use console version of Vim with a
|
||||
capable terminal emulator.
|
||||
|
||||
Bug or Comment
|
||||
|
||||
@@ -31,7 +31,7 @@ Get specific help: It is possible to go directly to whatever you want help
|
||||
help entries for "word".
|
||||
Or use ":helpgrep word". |:helpgrep|
|
||||
|
||||
VIM stands for Vi IMproved. Most of VIM was made by Bram Moolenaar, but only
|
||||
Vim stands for Vi IMproved. Most of Vim was made by Bram Moolenaar, but only
|
||||
through the help of many others. See |credits|.
|
||||
------------------------------------------------------------------------------
|
||||
*doc-file-list* *Q_ct*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*helphelp.txt* For Vim version 8.0. Last change: 2017 Feb 09
|
||||
*helphelp.txt* For Vim version 8.0. Last change: 2017 Mar 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -142,7 +142,8 @@ Help on help files *helphelp*
|
||||
already opened, then the location list for that window
|
||||
is used. Otherwise, a new help window is opened and
|
||||
the location list for that window is set. The
|
||||
location list for the current window is not changed.
|
||||
location list for the current window is not changed
|
||||
then.
|
||||
|
||||
*:exu* *:exusage*
|
||||
:exu[sage] Show help on Ex commands. Added to simulate the Nvi
|
||||
|
||||
@@ -41,9 +41,9 @@ instance), code similar to the following should be used:
|
||||
$vim = new Win32::OLE 'Vim.Application';
|
||||
|
||||
[C#] >
|
||||
// Add a reference to VIM in your project.
|
||||
// Add a reference to Vim in your project.
|
||||
// Choose the COM tab.
|
||||
// Select "VIM Ole Interface 1.1 Type Library"
|
||||
// Select "Vim Ole Interface 1.1 Type Library"
|
||||
Vim.Vim vimobj = new Vim.Vim();
|
||||
|
||||
Vim does not support acting as a "hidden" OLE server, like some other OLE
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
Perl and Vim *perl* *Perl*
|
||||
|
||||
1. Editing Perl files |perl-editing|
|
||||
2. Compiling VIM with Perl interface |perl-compiling|
|
||||
2. Compiling Vim with Perl interface |perl-compiling|
|
||||
3. Using the Perl interface |perl-using|
|
||||
4. Dynamic loading |perl-dynamic|
|
||||
|
||||
@@ -33,7 +33,7 @@ Vim in the $VIMRUNTIME/tools directory. This script has currently more
|
||||
features than Exuberant ctags' Perl support.
|
||||
|
||||
==============================================================================
|
||||
2. Compiling VIM with Perl interface *perl-compiling*
|
||||
2. Compiling Vim with Perl interface *perl-compiling*
|
||||
|
||||
To compile Vim with Perl interface, you need Perl 5.004 (or later). Perl must
|
||||
be installed before you compile Vim. Vim's Perl interface does NOT work with
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.0. Last change: 2017 Feb 23
|
||||
*index.txt* For Vim version 8.0. Last change: 2017 Apr 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -309,10 +309,10 @@ tag char note action in Normal mode ~
|
||||
|B| B 1 cursor N WORDS backward
|
||||
|C| ["x]C 2 change from the cursor position to the end
|
||||
of the line, and N-1 more lines [into
|
||||
buffer x]; synonym for "c$"
|
||||
register x]; synonym for "c$"
|
||||
|D| ["x]D 2 delete the characters under the cursor
|
||||
until the end of the line and N-1 more
|
||||
lines [into buffer x]; synonym for "d$"
|
||||
lines [into register x]; synonym for "d$"
|
||||
|E| E 1 cursor forward to the end of WORD N
|
||||
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
||||
the left
|
||||
@@ -329,13 +329,13 @@ tag char note action in Normal mode ~
|
||||
opposite direction
|
||||
|O| O 2 begin a new line above the cursor and
|
||||
insert text, repeat N times
|
||||
|P| ["x]P 2 put the text [from buffer x] before the
|
||||
|P| ["x]P 2 put the text [from register x] before the
|
||||
cursor N times
|
||||
|Q| Q switch to "Ex" mode
|
||||
|R| R 2 enter replace mode: overtype existing
|
||||
characters, repeat the entered text N-1
|
||||
times
|
||||
|S| ["x]S 2 delete N lines [into buffer x] and start
|
||||
|S| ["x]S 2 delete N lines [into register x] and start
|
||||
insert; synonym for "cc".
|
||||
|T| T{char} 1 cursor till after Nth occurrence of {char}
|
||||
to the left
|
||||
@@ -343,8 +343,8 @@ tag char note action in Normal mode ~
|
||||
|V| V start linewise Visual mode
|
||||
|W| W 1 cursor N WORDS forward
|
||||
|X| ["x]X 2 delete N characters before the cursor [into
|
||||
buffer x]
|
||||
|Y| ["x]Y yank N lines [into buffer x]; synonym for
|
||||
register x]
|
||||
|Y| ["x]Y yank N lines [into register x]; synonym for
|
||||
"yy"
|
||||
|ZZ| ZZ store current file if modified, and exit
|
||||
|ZQ| ZQ exit current file always
|
||||
@@ -367,12 +367,12 @@ tag char note action in Normal mode ~
|
||||
|`}| `} 1 cursor to the end of the current paragraph
|
||||
|a| a 2 append text after the cursor N times
|
||||
|b| b 1 cursor N words backward
|
||||
|c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start
|
||||
|c| ["x]c{motion} 2 delete Nmove text [into register x] and
|
||||
start insert
|
||||
|cc| ["x]cc 2 delete N lines [into register x] and start
|
||||
insert
|
||||
|cc| ["x]cc 2 delete N lines [into buffer x] and start
|
||||
insert
|
||||
|d| ["x]d{motion} 2 delete Nmove text [into buffer x]
|
||||
|dd| ["x]dd 2 delete N lines [into buffer x]
|
||||
|d| ["x]d{motion} 2 delete Nmove text [into register x]
|
||||
|dd| ["x]dd 2 delete N lines [into register x]
|
||||
|do| do 2 same as ":diffget"
|
||||
|dp| dp 2 same as ":diffput"
|
||||
|e| e 1 cursor forward to the end of word N
|
||||
@@ -398,16 +398,16 @@ tag char note action in Normal mode ~
|
||||
|q?| q? edit ? command-line in command-line window
|
||||
|r| r{char} 2 replace N chars with {char}
|
||||
|s| ["x]s 2 (substitute) delete N characters [into
|
||||
buffer x] and start insert
|
||||
register x] and start insert
|
||||
|t| t{char} 1 cursor till before Nth occurrence of {char}
|
||||
to the right
|
||||
|u| u 2 undo changes
|
||||
|v| v start characterwise Visual mode
|
||||
|w| w 1 cursor N words forward
|
||||
|x| ["x]x 2 delete N characters under and after the
|
||||
cursor [into buffer x]
|
||||
|y| ["x]y{motion} yank Nmove text [into buffer x]
|
||||
|yy| ["x]yy yank N lines [into buffer x]
|
||||
cursor [into register x]
|
||||
|y| ["x]y{motion} yank Nmove text [into register x]
|
||||
|yy| ["x]yy yank N lines [into register x]
|
||||
|z| z{char} commands starting with 'z', see |z| below
|
||||
|{| { 1 cursor N paragraphs backward
|
||||
|bar| | 1 cursor to column N
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 8.0. Last change: 2016 Jan 31
|
||||
*insert.txt* For Vim version 8.0. Last change: 2017 May 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -159,7 +159,8 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
|
||||
CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
|
||||
Insert the contents of a register literally and don't
|
||||
auto-indent. Does the same as pasting with the mouse
|
||||
|<MiddleMouse>|.
|
||||
|<MiddleMouse>|. When the register is linewise this will
|
||||
insert the text above the current line, like with `P`.
|
||||
Does not replace characters!
|
||||
The '.' register (last inserted text) is still inserted as
|
||||
typed. {not in Vi}
|
||||
@@ -633,13 +634,13 @@ Completion can be done for:
|
||||
10. User defined completion |i_CTRL-X_CTRL-U|
|
||||
11. omni completion |i_CTRL-X_CTRL-O|
|
||||
12. Spelling suggestions |i_CTRL-X_s|
|
||||
13. keywords in 'complete' |i_CTRL-N|
|
||||
13. keywords in 'complete' |i_CTRL-N| |i_CTRL-P|
|
||||
|
||||
All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert
|
||||
and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the
|
||||
CTRL-X commands. You exit CTRL-X mode by typing a key that is not a valid
|
||||
CTRL-X mode command. Valid keys are the CTRL-X command itself, CTRL-N (next),
|
||||
and CTRL-P (previous).
|
||||
All these, except CTRL-N and CTRL-P, are done in CTRL-X mode. This is a
|
||||
sub-mode of Insert and Replace modes. You enter CTRL-X mode by typing CTRL-X
|
||||
and one of the CTRL-X commands. You exit CTRL-X mode by typing a key that is
|
||||
not a valid CTRL-X mode command. Valid keys are the CTRL-X command itself,
|
||||
CTRL-N (next), and CTRL-P (previous).
|
||||
|
||||
Also see the 'infercase' option if you want to adjust the case of the match.
|
||||
|
||||
|
||||
@@ -84,8 +84,8 @@ The Vim pages contain the most recent information about Vim. They also
|
||||
contain links to the most recent version of Vim. The FAQ is a list of
|
||||
Frequently Asked Questions. Read this if you have problems.
|
||||
|
||||
VIM home page: http://www.vim.org/
|
||||
VIM FAQ: http://vimdoc.sf.net/
|
||||
Vim home page: http://www.vim.org/
|
||||
Vim FAQ: http://vimdoc.sf.net/
|
||||
Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.0. Last change: 2017 Mar 10
|
||||
*map.txt* For Vim version 8.0. Last change: 2017 May 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -185,7 +185,7 @@ that starts with ",". Then you need to type another character for Vim to know
|
||||
whether to use the "," mapping or the longer one. To avoid this add the
|
||||
<nowait> argument. Then the mapping will be used when it matches, Vim does
|
||||
not wait for more characters to be typed. However, if the characters were
|
||||
already type they are used.
|
||||
already typed they are used.
|
||||
|
||||
*:map-<silent>* *:map-silent*
|
||||
To define a mapping which will not be echoed on the command line, add
|
||||
@@ -798,7 +798,7 @@ Bear in mind that convert-meta has been reported to have troubles when used in
|
||||
UTF-8 locales. On terminals like xterm, the "metaSendsEscape" resource can be
|
||||
toggled on the fly through the "Main Options" menu, by pressing Ctrl-LeftClick
|
||||
on the terminal; that's a good last resource in case you want to send ESC when
|
||||
using other applications but not when inside VIM.
|
||||
using other applications but not when inside Vim.
|
||||
|
||||
|
||||
1.11 MAPPING AN OPERATOR *:map-operator*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 8.0. Last change: 2017 Jan 02
|
||||
*message.txt* For Vim version 8.0. Last change: 2017 Mar 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -768,6 +768,13 @@ Example: >
|
||||
You tried to execute a command that is neither an Ex command nor
|
||||
a user-defined command.
|
||||
|
||||
*E943* >
|
||||
Command table needs to be updated, run 'make cmdidxs'
|
||||
|
||||
This can only happen when changing the source code, when adding a command in
|
||||
src/ex_cmds.h. The lookup table then needs to be updated, by running: >
|
||||
make cmdidxs
|
||||
|
||||
==============================================================================
|
||||
3. Messages *messages*
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ In case you do not want the NetBeans interface you can disable it by
|
||||
uncommenting a line with "--disable-netbeans" in the Makefile.
|
||||
|
||||
Currently the NetBeans interface is supported by Vim running in a terminal and
|
||||
by GVim when it is run with one of the following GUIs: GTK, GNOME, Windows,
|
||||
by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows,
|
||||
Athena and Motif.
|
||||
|
||||
If Motif support is required the user must supply XPM libraries. See
|
||||
@@ -996,7 +996,7 @@ to "Vim". In the Expert tab make sure the "Vim Command" is correct.
|
||||
You should be careful if you change the "Vim Command". There are command
|
||||
line options there which must be there for the connection to be properly
|
||||
set up. You can change the command name but that's about it. If your gvim
|
||||
can be found by your $PATH then the VIM Command can start with "gvim". If
|
||||
can be found by your $PATH then the Vim Command can start with "gvim". If
|
||||
you don't want gvim searched from your $PATH then hard code in the full
|
||||
Unix path name. At this point you should get a gvim for any source file
|
||||
you open in NetBeans.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Mar 09
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jun 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -370,7 +370,7 @@ Note: In the future more global options can be made global-local. Using
|
||||
|
||||
Setting the filetype
|
||||
|
||||
:setf[iletype] {filetype} *:setf* *:setfiletype*
|
||||
:setf[iletype] [FALLBACK] {filetype} *:setf* *:setfiletype*
|
||||
Set the 'filetype' option to {filetype}, but only if
|
||||
not done yet in a sequence of (nested) autocommands.
|
||||
This is short for: >
|
||||
@@ -380,6 +380,13 @@ Setting the filetype
|
||||
< This command is used in a filetype.vim file to avoid
|
||||
setting the 'filetype' option twice, causing different
|
||||
settings and syntax files to be loaded.
|
||||
|
||||
When the optional FALLBACK argument is present, a
|
||||
later :setfiletype command will override the
|
||||
'filetype'. This is to used for filetype detections
|
||||
that are just a guess. |did_filetype()| will return
|
||||
false after this command.
|
||||
|
||||
{not in Vi}
|
||||
|
||||
*option-window* *optwin*
|
||||
@@ -862,6 +869,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
< Vim will guess the value. In the GUI this should work correctly,
|
||||
in other cases Vim might not be able to guess the right value.
|
||||
|
||||
When the t_BG option is set, Vim will use it to request the background
|
||||
color from the terminal. If the returned RGB value is dark/light and
|
||||
'background' is not dark/light, 'background' will be set and the
|
||||
screen is redrawn. This may have side effects, make t_BG empty in
|
||||
your .vimrc if you suspect this problem.
|
||||
|
||||
When starting the GUI, the default value for 'background' will be
|
||||
"light". When the value is not set in the .gvimrc, and Vim detects
|
||||
that the background is actually quite dark, 'background' is set to
|
||||
@@ -2700,7 +2713,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Makes the 'g' and 'c' flags of the ":substitute" command to be
|
||||
toggled each time the flag is given. See |complex-change|. See
|
||||
also 'gdefault' option.
|
||||
Switching this option on is discouraged!
|
||||
Switching this option on may break plugins!
|
||||
|
||||
*'emoji'* *'emo'* *'noemoji'* *'noemo'*
|
||||
'emoji' 'emo' boolean (default: on)
|
||||
@@ -6489,8 +6502,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
|
||||
"bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like
|
||||
systems, the default is set according to the value of 'shell', to
|
||||
reduce the need to set this option by the user. It's not used for
|
||||
OS/2 (EMX figures this out itself).
|
||||
reduce the need to set this option by the user.
|
||||
On Unix it can have more than one flag. Each white space separated
|
||||
part is passed as an argument to the shell command.
|
||||
See |option-backslash| about including spaces and backslashes.
|
||||
@@ -7730,6 +7742,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
compatible terminal.
|
||||
If setting this option does not work (produces a colorless UI)
|
||||
reading |xterm-true-color| might help.
|
||||
Note that the "cterm" attributes are still used, not the "gui" ones.
|
||||
NOTE: This option is reset when 'compatible' is set.
|
||||
|
||||
*'terse'* *'noterse'*
|
||||
@@ -7806,7 +7819,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'timeout' 'to' boolean (default on)
|
||||
global
|
||||
*'ttimeout'* *'nottimeout'*
|
||||
'ttimeout' boolean (default off, set in |defaults.vim|))
|
||||
'ttimeout' boolean (default off, set in |defaults.vim|)
|
||||
global
|
||||
{not in Vi}
|
||||
These two options together determine the behavior when part of a
|
||||
@@ -7841,7 +7854,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{not in all versions of Vi}
|
||||
*'ttimeoutlen'* *'ttm'*
|
||||
'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|))
|
||||
'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|)
|
||||
global
|
||||
{not in Vi}
|
||||
The time in milliseconds that is waited for a key code or mapped key
|
||||
|
||||
@@ -144,7 +144,7 @@ The default value for $VIM is set at compile time and can be determined with >
|
||||
:version
|
||||
|
||||
The normal value is /boot/home/config/share/vim. If you don't like it you can
|
||||
set the VIM environment variable to override this, or set 'helpfile' in your
|
||||
set the Vim environment variable to override this, or set 'helpfile' in your
|
||||
.vimrc: >
|
||||
|
||||
:if version >= 500
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_mac.txt* For Vim version 8.0. Last change: 2006 Apr 30
|
||||
*os_mac.txt* For Vim version 8.0. Last change: 2017 Apr 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar et al.
|
||||
@@ -12,11 +12,13 @@ NOTE: This file is a bit outdated. You might find more useful info here:
|
||||
http://macvim.org/
|
||||
|
||||
1. Filename Convention |mac-filename|
|
||||
2. .vimrc an .vim files |mac-vimfile|
|
||||
3. FAQ |mac-faq|
|
||||
4. Known Lack |mac-lack|
|
||||
5. Mac Bug Report |mac-bug|
|
||||
6. Compiling Vim |mac-compile|
|
||||
2. .vimrc and .vim files |mac-vimfile|
|
||||
3. Standard mappings |mac-standard-mappings|
|
||||
4. FAQ |mac-faq|
|
||||
5. Known Lack |mac-lack|
|
||||
6. Mac Bug Report |mac-bug|
|
||||
7. Compiling Vim |mac-compile|
|
||||
8. The darwin feature |mac-darwin-feature|
|
||||
|
||||
There was a Mac port for version 3.0 of Vim. Here are the first few lines
|
||||
from the old file:
|
||||
@@ -72,7 +74,18 @@ the |'nocompatible'| option is set, otherwise it will only handle mac format
|
||||
files.
|
||||
|
||||
==============================================================================
|
||||
3. Mac FAQ *mac-faq*
|
||||
3. Standard mappings *mac-standard-mappings*
|
||||
|
||||
The following mappings are available for cut/copy/paste from/to clipboard.
|
||||
|
||||
key Normal Visual Insert Description ~
|
||||
Command-v "*P "-d"*P <C-R>* paste text *<D-v>*
|
||||
Command-c "*y copy Visual text *<D-c>*
|
||||
Command-x "*d cut Visual text *<D-x>*
|
||||
Backspace "*d cut Visual text
|
||||
|
||||
==============================================================================
|
||||
4. Mac FAQ *mac-faq*
|
||||
|
||||
On the internet: http://macvim.org/OSX/index.php#FAQ
|
||||
|
||||
@@ -95,13 +108,13 @@ A: The following trick works with most shells. Put it in your vimrc file.
|
||||
let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n')
|
||||
|
||||
==============================================================================
|
||||
4. Mac Lack *mac-lack*
|
||||
5. Mac Lack *mac-lack*
|
||||
|
||||
In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as
|
||||
Shift-Control-2.
|
||||
|
||||
==============================================================================
|
||||
5. Mac Bug Report *mac-bug*
|
||||
6. Mac Bug Report *mac-bug*
|
||||
|
||||
When reporting any Mac specific bug or feature change, please use the vim-mac
|
||||
maillist |vim-mac|. However, you need to be subscribed. An alternative is to
|
||||
@@ -110,9 +123,59 @@ send a message to the current MacVim maintainers:
|
||||
mac@vim.org
|
||||
|
||||
==============================================================================
|
||||
6. Compiling Vim *mac-compile*
|
||||
7. Compiling Vim *mac-compile*
|
||||
|
||||
See the file "src/INSTALLmac.txt" that comes with the source files.
|
||||
|
||||
==============================================================================
|
||||
8. The Darwin Feature *mac-darwin-feature*
|
||||
|
||||
If you have a Mac that isn't very old, you will be running OS X, also called
|
||||
Darwin. The last pre-Darwin OS was Mac OS 9. The darwin feature makes Vim
|
||||
use Darwin-specific properties.
|
||||
|
||||
What is accomplished with this feature is two-fold:
|
||||
|
||||
- Make Vim interoperable with the system clipboard.
|
||||
- Incorporate into Vim a converter module that bridges the gap between some
|
||||
character encodings specific to the platform and those known to Vim.
|
||||
|
||||
Needless to say, both are not to be missed for any decent text editor to work
|
||||
nicely with other applications running on the same desktop environment.
|
||||
|
||||
As Vim is not an application dedicated only to macOS, we need an extra feature
|
||||
to add in order for it to offer the same user experience that our users on
|
||||
other platforms enjoy to people on macOS.
|
||||
|
||||
For brevity, the feature is referred to as "darwin" to signify it one of the
|
||||
Vim features that are specific to that particular platform.
|
||||
|
||||
The feature is a configuration option. Accordingly, whether it is enabled or
|
||||
not is determined at build time; once it is selected to be enabled, it is
|
||||
compiled in and hence cannot be disabled at runtime.
|
||||
|
||||
The feature is enabled by default. For most macOS users, that should be
|
||||
sufficient unless they have specific needs mentioned briefly below.
|
||||
|
||||
If you want to disable it, pass `--disable-darwin` to the configure script: >
|
||||
|
||||
./configure --disable-darwin <other options>
|
||||
|
||||
and then run `make` to build Vim. The order of the options doesn't matter.
|
||||
|
||||
To make sure at runtime whether or not the darwin feature is compiled in, you
|
||||
can use `has('macunix')` which returns 1 if the feature is compiled in; 0
|
||||
otherwise.
|
||||
|
||||
Notable use cases where `--disable-darwin` is turned out to be useful are:
|
||||
|
||||
- When you want to use |x11-selection| instead of the system clipboard.
|
||||
- When you want to use |x11-clientserver|.
|
||||
|
||||
Since both have to make use of X11 inter-client communication for them to work
|
||||
properly, and since the communication mechanism can come into conflict with
|
||||
the system clipboard, the darwin feature should be disabled to prevent Vim
|
||||
from hanging at runtime.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -539,7 +539,7 @@ More info under :help hardcopy
|
||||
|
||||
8.10 Setting up the symbols
|
||||
|
||||
When I use GVIM this way and press CTRL-Y in the parent terminal, gvim exits.
|
||||
When I use gvim this way and press CTRL-Y in the parent terminal, gvim exits.
|
||||
I now use a different symbol that seems to work OK and fixes the problem.
|
||||
I suggest this instead: >
|
||||
|
||||
@@ -547,7 +547,7 @@ I suggest this instead: >
|
||||
|
||||
The /INPUT=NLA0: separates the standard input of the gvim process from the
|
||||
parent terminal, to block signals from the parent window.
|
||||
Without the -GEOMETRY, the GVIM window size will be minimal and the menu
|
||||
Without the -GEOMETRY, the gvim window size will be minimal and the menu
|
||||
will be confused after a window-resize.
|
||||
|
||||
(Carlo Mekenkamp, Coen Engelbarts, Vim 6.0ac)
|
||||
@@ -764,14 +764,14 @@ GNU_TOOLS.ZIP package downloadable from http://www.polarhome.com/vim/
|
||||
|
||||
9. VMS related changes *vms-changes*
|
||||
|
||||
Version 7.4
|
||||
- Undo: VMS can not handle more than one dot in the filenames use "dir/name" -> "dir/_un_name"
|
||||
Version 7.4
|
||||
- Undo: VMS can not handle more than one dot in the filenames use "dir/name" -> "dir/_un_name"
|
||||
add _un_ at the beginning to keep the extension
|
||||
- correct swap file name wildcard handling
|
||||
- handle iconv usage correctly
|
||||
- do not optimize on vax - otherwise it hangs compiling crypto files
|
||||
- fileio.c fix the comment
|
||||
- correct RealWaitForChar
|
||||
- correct RealWaitForChar
|
||||
- after 7.4-119 use different functions lib$cvtf_to_internal_time because Alpha and VAX have
|
||||
G_FLOAT but IA64 uses IEEE float otherwise Vim crashes
|
||||
- guard against crashes that are caused by mixed filenames
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_win32.txt* For Vim version 8.0. Last change: 2016 Oct 12
|
||||
*os_win32.txt* For Vim version 8.0. Last change: 2017 Mar 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by George Reilly
|
||||
@@ -135,7 +135,7 @@ you will need to get a version older than that.
|
||||
6. Running under Windows 3.1 *win32-win3.1*
|
||||
|
||||
*win32s* *windows-3.1* *gui-w32s*
|
||||
There was a special version of Gvim that runs under Windows 3.1 and 3.11.
|
||||
There was a special version of gvim that runs under Windows 3.1 and 3.11.
|
||||
Support was removed in patch 7.4.1363.
|
||||
|
||||
==============================================================================
|
||||
@@ -212,10 +212,19 @@ A. You can't! This is a limitation of the NT console. NT 5.0 is reported to
|
||||
be able to set the blink rate for all console windows at the same time.
|
||||
|
||||
*:!start*
|
||||
Q. How can I run an external command or program asynchronously?
|
||||
A. When using :! to run an external command, you can run it with "start": >
|
||||
:!start winfile.exe<CR>
|
||||
< Using "start" stops Vim switching to another screen, opening a new console,
|
||||
Q. How can I asynchronously run an external command or program, or open a
|
||||
document or URL with its default program?
|
||||
A. When using :! to run an external command, you can run it with "start". For
|
||||
example, to run notepad: >
|
||||
:!start notepad
|
||||
< To open "image.jpg" with the default image viewer: >
|
||||
:!start image.jpg
|
||||
< To open the folder of the current file in Windows Explorer: >
|
||||
:!start %:h
|
||||
< To open the Vim home page with the default browser: >
|
||||
:!start http://www.vim.org/
|
||||
<
|
||||
Using "start" stops Vim switching to another screen, opening a new console,
|
||||
or waiting for the program to complete; it indicates that you are running a
|
||||
program that does not affect the files you are editing. Programs begun
|
||||
with :!start do not get passed Vim's open file handles, which means they do
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 8.0. Last change: 2017 Mar 05
|
||||
*pattern.txt* For Vim version 8.0. Last change: 2017 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1085,25 +1085,27 @@ x A single character, with no special meaning, matches itself
|
||||
- A character class expression is evaluated to the set of characters
|
||||
belonging to that character class. The following character classes
|
||||
are supported:
|
||||
Name Contents ~
|
||||
*[:alnum:]* [:alnum:] ASCII letters and digits
|
||||
*[:alpha:]* [:alpha:] ASCII letters
|
||||
*[:blank:]* [:blank:] space and tab characters
|
||||
*[:cntrl:]* [:cntrl:] control characters
|
||||
*[:digit:]* [:digit:] decimal digits
|
||||
*[:graph:]* [:graph:] printable characters excluding space
|
||||
*[:lower:]* [:lower:] lowercase letters (all letters when
|
||||
Name Func Contents ~
|
||||
*[:alnum:]* [:alnum:] isalnum ASCII letters and digits
|
||||
*[:alpha:]* [:alpha:] isalpha ASCII letters
|
||||
*[:blank:]* [:blank:] space and tab
|
||||
*[:cntrl:]* [:cntrl:] iscntrl ASCII control characters
|
||||
*[:digit:]* [:digit:] decimal digits '0' to '9'
|
||||
*[:graph:]* [:graph:] isgraph ASCII printable characters excluding
|
||||
space
|
||||
*[:lower:]* [:lower:] (1) lowercase letters (all letters when
|
||||
'ignorecase' is used)
|
||||
*[:print:]* [:print:] printable characters including space
|
||||
*[:punct:]* [:punct:] ASCII punctuation characters
|
||||
*[:space:]* [:space:] whitespace characters
|
||||
*[:upper:]* [:upper:] uppercase letters (all letters when
|
||||
*[:print:]* [:print:] (2) printable characters including space
|
||||
*[:punct:]* [:punct:] ispunct ASCII punctuation characters
|
||||
*[:space:]* [:space:] whitespace characters: space, tab, CR,
|
||||
NL, vertical tab, form feed
|
||||
*[:upper:]* [:upper:] (3) uppercase letters (all letters when
|
||||
'ignorecase' is used)
|
||||
*[:xdigit:]* [:xdigit:] hexadecimal digits
|
||||
*[:return:]* [:return:] the <CR> character
|
||||
*[:tab:]* [:tab:] the <Tab> character
|
||||
*[:escape:]* [:escape:] the <Esc> character
|
||||
*[:backspace:]* [:backspace:] the <BS> character
|
||||
*[:xdigit:]* [:xdigit:] hexadecimal digits: 0-9, a-f, A-F
|
||||
*[:return:]* [:return:] the <CR> character
|
||||
*[:tab:]* [:tab:] the <Tab> character
|
||||
*[:escape:]* [:escape:] the <Esc> character
|
||||
*[:backspace:]* [:backspace:] the <BS> character
|
||||
The brackets in character class expressions are additional to the
|
||||
brackets delimiting a collection. For example, the following is a
|
||||
plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is,
|
||||
@@ -1114,6 +1116,13 @@ x A single character, with no special meaning, matches itself
|
||||
regexp engine. See |two-engines|. In the future these items may
|
||||
work for multi-byte characters. For now, to get all "alpha"
|
||||
characters you can use: [[:lower:][:upper:]].
|
||||
|
||||
The "Func" column shows what library function is used. The
|
||||
implementation depends on the system. Otherwise:
|
||||
(1) Uses islower() for ASCII and Vim builtin rules for other
|
||||
characters when built with the |+multi_byte| feature.
|
||||
(2) Uses Vim builtin rules
|
||||
(3) As with (1) but using isupper()
|
||||
*/[[=* *[==]*
|
||||
- An equivalence class. This means that characters are matched that
|
||||
have almost the same meaning, e.g., when ignoring accents. This
|
||||
|
||||
@@ -9,7 +9,7 @@ Copyright: (c) 2004-2012 by Charles E. Campbell *glvs-copyright*
|
||||
The VIM LICENSE (see |copyright|) applies to the files in this
|
||||
package, including getscriptPlugin.vim, getscript.vim,
|
||||
GetLatestVimScripts.dist, and pi_getscript.txt, except use "getscript"
|
||||
instead of "VIM". Like anything else that's free, getscript and its
|
||||
instead of "Vim". Like anything else that's free, getscript and its
|
||||
associated files are provided *as is* and comes with no warranty of
|
||||
any kind, either expressed or implied. No guarantees of
|
||||
merchantability. No guarantees of suitability for any purpose. By
|
||||
@@ -68,7 +68,7 @@ Your computer needs to have wget or curl for GetLatestVimScripts to do its work.
|
||||
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
|
||||
(edit GetLatestVimScripts.dat to install your own personal
|
||||
list of desired plugins -- see |GetLatestVimScripts_dat|)
|
||||
|
||||
|
||||
3. Windows:
|
||||
vim getscript.vba
|
||||
:so %
|
||||
|
||||
@@ -99,25 +99,25 @@ If the option is empty, then vim will use the system default printer for
|
||||
HPUX: hp-roman8,
|
||||
EBCDIC: ebcdic-uk)
|
||||
global
|
||||
Sets the character encoding used when printing. This option tells VIM which
|
||||
Sets the character encoding used when printing. This option tells Vim which
|
||||
print character encoding file from the "print" directory in 'runtimepath' to
|
||||
use.
|
||||
|
||||
This option will accept any value from |encoding-names|. Any recognized names
|
||||
are converted to VIM standard names - see 'encoding' for more details. Names
|
||||
not recognized by VIM will just be converted to lower case and underscores
|
||||
are converted to Vim standard names - see 'encoding' for more details. Names
|
||||
not recognized by Vim will just be converted to lower case and underscores
|
||||
replaced with '-' signs.
|
||||
|
||||
If 'printencoding' is empty or VIM cannot find the file then it will use
|
||||
'encoding' (if VIM is compiled with |+multi_byte| and it is set an 8-bit
|
||||
encoding) to find the print character encoding file. If VIM is unable to find
|
||||
If 'printencoding' is empty or Vim cannot find the file then it will use
|
||||
'encoding' (if Vim is compiled with |+multi_byte| and it is set an 8-bit
|
||||
encoding) to find the print character encoding file. If Vim is unable to find
|
||||
a character encoding file then it will use the "latin1" print character
|
||||
encoding file.
|
||||
|
||||
When 'encoding' is set to a multi-byte encoding, VIM will try to convert
|
||||
When 'encoding' is set to a multi-byte encoding, Vim will try to convert
|
||||
characters to the printing encoding for printing (if 'printencoding' is empty
|
||||
then the conversion will be to latin1). Conversion to a printing encoding
|
||||
other than latin1 will require VIM to be compiled with the |+iconv| feature.
|
||||
other than latin1 will require Vim to be compiled with the |+iconv| feature.
|
||||
If no conversion is possible then printing will fail. Any characters that
|
||||
cannot be converted will be replaced with upside down question marks.
|
||||
|
||||
@@ -203,7 +203,7 @@ header is used when this option is empty.
|
||||
'printmbcharset' 'pmbcs' string (default "")
|
||||
global
|
||||
Sets the CJK character set to be used when generating CJK output from
|
||||
|:hardcopy|. The following predefined values are currently recognised by VIM:
|
||||
|:hardcopy|. The following predefined values are currently recognised by Vim:
|
||||
|
||||
Value Description ~
|
||||
Chinese GB_2312-80
|
||||
@@ -270,7 +270,7 @@ Japanese text you would do the following; >
|
||||
|
||||
If 'printmbcharset' is not one of the above values then it is assumed to
|
||||
specify a custom multi-byte character set and no check will be made that it is
|
||||
compatible with the value for 'printencoding'. VIM will look for a file
|
||||
compatible with the value for 'printencoding'. Vim will look for a file
|
||||
defining the character set in the "print" directory in 'runtimepath'.
|
||||
|
||||
*pmbfn-option*
|
||||
@@ -420,10 +420,10 @@ There are currently a number of limitations with PostScript printing:
|
||||
possible to get all the characters in an encoding to print by installing a
|
||||
new version of the Courier font family.
|
||||
|
||||
- Multi-byte support - Currently VIM will try to convert multi-byte characters
|
||||
- Multi-byte support - Currently Vim will try to convert multi-byte characters
|
||||
to the 8-bit encoding specified by 'printencoding' (or latin1 if it is
|
||||
empty). Any characters that are not successfully converted are shown as
|
||||
unknown characters. Printing will fail if VIM cannot convert the multi-byte
|
||||
unknown characters. Printing will fail if Vim cannot convert the multi-byte
|
||||
to the 8-bit encoding.
|
||||
|
||||
==============================================================================
|
||||
@@ -434,11 +434,11 @@ you need to define your own PostScript font encoding vector. Details on how
|
||||
to define a font encoding vector is beyond the scope of this help file, but
|
||||
you can find details in the PostScript Language Reference Manual, 3rd Edition,
|
||||
published by Addison-Wesley and available in PDF form at
|
||||
http://www.adobe.com/. The following describes what you need to do for VIM to
|
||||
http://www.adobe.com/. The following describes what you need to do for Vim to
|
||||
locate and use your print character encoding.
|
||||
|
||||
i. Decide on a unique name for your encoding vector, one that does not clash
|
||||
with any of the recognized or standard encoding names that VIM uses (see
|
||||
with any of the recognized or standard encoding names that Vim uses (see
|
||||
|encoding-names| for a list), and that no one else is likely to use.
|
||||
ii. Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your
|
||||
'runtimepath' and rename it with your unique name.
|
||||
@@ -446,23 +446,23 @@ iii. Edit your renamed copy of latin1.ps, replacing all occurrences of latin1
|
||||
with your unique name (don't forget the line starting %%Title:), and
|
||||
modify the array of glyph names to define your new encoding vector. The
|
||||
array must have exactly 256 entries or you will not be able to print!
|
||||
iv. Within VIM, set 'printencoding' to your unique encoding name and then
|
||||
print your file. VIM will now use your custom print character encoding.
|
||||
iv. Within Vim, set 'printencoding' to your unique encoding name and then
|
||||
print your file. Vim will now use your custom print character encoding.
|
||||
|
||||
VIM will report an error with the resource file if you change the order or
|
||||
Vim will report an error with the resource file if you change the order or
|
||||
content of the first 3 lines, other than the name of the encoding on the line
|
||||
starting %%Title: or the version number on the line starting %%Version:.
|
||||
|
||||
[Technical explanation for those that know PostScript - VIM looks for a file
|
||||
[Technical explanation for those that know PostScript - Vim looks for a file
|
||||
with the same name as the encoding it will use when printing. The file
|
||||
defines a new PostScript Encoding resource called /VIM-name, where name is the
|
||||
print character encoding VIM will use.]
|
||||
print character encoding Vim will use.]
|
||||
|
||||
==============================================================================
|
||||
5. PostScript CJK Printing *postscript-cjk-printing*
|
||||
*E673* *E674* *E675*
|
||||
|
||||
VIM supports printing of Chinese, Japanese, and Korean files. Setting up VIM
|
||||
Vim supports printing of Chinese, Japanese, and Korean files. Setting up Vim
|
||||
to correctly print CJK files requires setting up a few more options.
|
||||
|
||||
Each of these countries has many standard character sets and encodings which
|
||||
@@ -483,7 +483,7 @@ option allows you to specify different fonts to use when printing characters
|
||||
which are syntax highlighted with the font styles normal, italic, bold and
|
||||
bold-italic.
|
||||
|
||||
No CJK fonts are supplied with VIM. There are some free Korean, Japanese, and
|
||||
No CJK fonts are supplied with Vim. There are some free Korean, Japanese, and
|
||||
Traditional Chinese fonts available at:
|
||||
|
||||
http://examples.oreilly.com/cjkvinfo/adobe/samples/
|
||||
@@ -498,7 +498,7 @@ CJK fonts can be large containing several thousand glyphs, and it is not
|
||||
uncommon to find that they only contain a subset of a national standard. It
|
||||
is not unusual to find the fonts to not include characters for codes in the
|
||||
ASCII code range. If you find half-width Roman characters are not appearing
|
||||
in your printout then you should configure VIM to use the Courier font the
|
||||
in your printout then you should configure Vim to use the Courier font the
|
||||
half-width ASCII characters with 'printmbfont'. If your font does not include
|
||||
other characters then you will need to find another font that does.
|
||||
|
||||
@@ -506,7 +506,7 @@ Another issue with ASCII characters, is that the various national character
|
||||
sets specify a couple of different glyphs in the ASCII code range. If you
|
||||
print ASCII text using the national character set you may see some unexpected
|
||||
characters. If you want true ASCII code printing then you need to configure
|
||||
VIM to output ASCII characters for the ASCII code range with 'printmbfont'.
|
||||
Vim to output ASCII characters for the ASCII code range with 'printmbfont'.
|
||||
|
||||
It is possible to define your own multi-byte character set although this
|
||||
should not be attempted lightly. A discussion on the process if beyond the
|
||||
@@ -525,13 +525,13 @@ print job completing.
|
||||
There are a number of possible causes as to why the printing may have failed:
|
||||
|
||||
- Wrong version of the prolog resource file. The prolog resource file
|
||||
contains some PostScript that VIM needs to be able to print. Each version
|
||||
of VIM needs one particular version. Make sure you have correctly installed
|
||||
contains some PostScript that Vim needs to be able to print. Each version
|
||||
of Vim needs one particular version. Make sure you have correctly installed
|
||||
the runtime files, and don't have any old versions of a file called prolog
|
||||
in the print directory in your 'runtimepath' directory.
|
||||
|
||||
- Paper size. Some PostScript printers will abort printing a file if they do
|
||||
not support the requested paper size. By default VIM uses A4 paper. Find
|
||||
not support the requested paper size. By default Vim uses A4 paper. Find
|
||||
out what size paper your printer normally uses and set the appropriate paper
|
||||
size with 'printoptions'. If you cannot find the name of the paper used,
|
||||
measure a sheet and compare it with the table of supported paper sizes listed
|
||||
@@ -668,7 +668,7 @@ complex print document creation.
|
||||
|
||||
N-UP PRINTING
|
||||
|
||||
The psnup utility takes an existing PostScript file generated from VIM and
|
||||
The psnup utility takes an existing PostScript file generated from Vim and
|
||||
convert it to an n-up version. The simplest way to create a 2-up printout is
|
||||
to first create a PostScript file with: >
|
||||
|
||||
@@ -724,16 +724,16 @@ There are a couple of points to bear in mind:
|
||||
==============================================================================
|
||||
8. Formfeed Characters *printing-formfeed*
|
||||
|
||||
By default VIM does not do any special processing of |formfeed| control
|
||||
characters. Setting the 'printoptions' formfeed item will make VIM recognize
|
||||
By default Vim does not do any special processing of |formfeed| control
|
||||
characters. Setting the 'printoptions' formfeed item will make Vim recognize
|
||||
formfeed characters and continue printing the current line at the beginning
|
||||
of the first line on a new page. The use of formfeed characters provides
|
||||
rudimentary print control but there are certain things to be aware of.
|
||||
|
||||
VIM will always start printing a line (including a line number if enabled)
|
||||
Vim will always start printing a line (including a line number if enabled)
|
||||
containing a formfeed character, even if it is the first character on the
|
||||
line. This means if a line starting with a formfeed character is the first
|
||||
line of a page then VIM will print a blank page.
|
||||
line of a page then Vim will print a blank page.
|
||||
|
||||
Since the line number is printed at the start of printing the line containing
|
||||
the formfeed character, the remainder of the line printed on the new page
|
||||
@@ -742,7 +742,7 @@ lines of a long line when wrap in 'printoptions' is enabled).
|
||||
|
||||
If the formfeed character is the last character on a line, then printing will
|
||||
continue on the second line of the new page, not the first. This is due to
|
||||
VIM processing the end of the line after the formfeed character and moving
|
||||
Vim processing the end of the line after the formfeed character and moving
|
||||
down a line to continue printing.
|
||||
|
||||
Due to the points made above it is recommended that when formfeed character
|
||||
|
||||
@@ -63,53 +63,53 @@ versions of 'emacs' in the late 1970's and was relieved by finding 'vi' in the
|
||||
first UNIX I came across in 1983). In my opinion, it's about time 'VIM'
|
||||
replace 'emacs' as the standard for top editors. (Bo Thide', Sweden)
|
||||
|
||||
I love and use VIM heavily too. (Larry Wall)
|
||||
I love and use Vim heavily too. (Larry Wall)
|
||||
|
||||
Vi is like a Ferrari, if you're a beginner, it handles like a bitch, but once
|
||||
you get the hang of it, it's small, powerful and FAST! (Unknown)
|
||||
VIM is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!"
|
||||
Vim is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!"
|
||||
(Stephen Riehm, Germany)
|
||||
|
||||
Schon bei Nutzung eines Bruchteils der VIM-Funktionen wird der Benutzer recht
|
||||
Schon bei Nutzung eines Bruchteils der Vim-Funktionen wird der Benutzer recht
|
||||
schnell die Vorzuege dieses Editors kennen- und schaetzenlernen.
|
||||
Translated: Even when only using a fraction of VIM-functions, the user will
|
||||
Translated: Even when only using a fraction of Vim-functions, the user will
|
||||
quickly get used to and appreciate the advantages of this editor. (Garry
|
||||
Glendown, conclusion of an article on VIM in iX magazine 9/1998)
|
||||
Glendown, conclusion of an article on Vim in iX magazine 9/1998)
|
||||
|
||||
I've recently acquired the O'Reilly book on VI (it also discusses VIM
|
||||
I've recently acquired the O'Reilly book on Vi (it also discusses Vim
|
||||
in-depth), and I'm amazed at just how powerful this application is. (Jeffrey
|
||||
Rankin)
|
||||
|
||||
This guide was written using the Windows 9.x distribution of GVIM, which is
|
||||
This guide was written using the Windows 9.x distribution of gvim, which is
|
||||
quite possibly the greatest thing to come along since God created the naked
|
||||
girl. (Michael DiBernardo)
|
||||
|
||||
Boy, I thought I knew almost everything about VIM, but every time I browse the
|
||||
online documentation, I hit upon a minor but cool aspect of a VIM feature that
|
||||
Boy, I thought I knew almost everything about Vim, but every time I browse the
|
||||
online documentation, I hit upon a minor but cool aspect of a Vim feature that
|
||||
I didn't know before! I must say the documentation is one the finest I've
|
||||
ever seen in a product -- even better than most commercial products.
|
||||
(Gautam Mudunuri)
|
||||
|
||||
VIM 4.5 is really a fantastic editor. It has sooooo many features and more
|
||||
Vim 4.5 is really a fantastic editor. It has sooooo many features and more
|
||||
importantly, the defaults are so well thought out that you really don't have
|
||||
to change anything!! Words cannot express my amazement and gratitude to the
|
||||
creators of VIM. Keep it up. (Vikas, USA)
|
||||
creators of Vim. Keep it up. (Vikas, USA)
|
||||
|
||||
I wonder how long it will be before people will refer to other Vi editors as
|
||||
VIM clones? (Darren Hiebert)
|
||||
Vim clones? (Darren Hiebert)
|
||||
|
||||
I read about [auto-positioning-in-file-based-on-the-errors-from-make] in one
|
||||
of those "Perfect Programmer's Editor" threads and was delighted to discover
|
||||
that VIM already supports it. (Brendan Macmillan, Australia)
|
||||
that Vim already supports it. (Brendan Macmillan, Australia)
|
||||
|
||||
I just discovered VIM (5.0) and I'm telling everyone I know about it!
|
||||
I tell them VIM stands for VI for the new (M)illenium. Thanks so much!
|
||||
I just discovered Vim (5.0) and I'm telling everyone I know about it!
|
||||
I tell them Vim stands for Vi for the new (M)illenium. Thanks so much!
|
||||
(Matt F. Valentine)
|
||||
|
||||
I think from now on "vi" should be called "Vim Imitation", not the other way
|
||||
around. (Rungun Ramanathan)
|
||||
|
||||
The Law of VIM:
|
||||
The Law of Vim:
|
||||
For each member b of the possible behaviour space B of program P, there exists
|
||||
a finite time t before which at least one user u in the total user space U of
|
||||
program P will request b becomes a member of the allowed behaviour space B'
|
||||
@@ -118,42 +118,42 @@ In other words: Sooner or later everyone wants everything as an option.
|
||||
(Negri)
|
||||
|
||||
Whenever I move to a new computing platform, the first thing I do is to port
|
||||
VIM. Lately, I am simply stunned by its ease of compilation using the
|
||||
Vim. Lately, I am simply stunned by its ease of compilation using the
|
||||
configure facility. (A.M. Sabuncu, Turkey)
|
||||
|
||||
The options are really excellent and very powerful. (Anish Maharaj)
|
||||
|
||||
The Spring user-interface designs are in, and word from the boutiques is that
|
||||
80x24 text-only mode is back with a *vengeance! Vi editor clone VIM burst onto
|
||||
80x24 text-only mode is back with a *vengeance! Vi editor clone Vim burst onto
|
||||
March desk-tops with a dazzling show of pastel syntax highlights for its 5.0
|
||||
look. Strident and customizable, VIM raises eyebrows with its interpretation
|
||||
look. Strident and customizable, Vim raises eyebrows with its interpretation
|
||||
of the classic Vi single-key macro collection.
|
||||
http://www.ntk.net/index.cgi?back=archive98/now0327.txt&line=179#l
|
||||
|
||||
I just wanted to take this opportunity to let you know that VIM 5 ROCKS!
|
||||
I just wanted to take this opportunity to let you know that Vim 5 ROCKS!
|
||||
Syntax highlighting: how did I survive without it?! Thank you for creating
|
||||
mankind's best editor! (Mun Johl, USA)
|
||||
|
||||
Thanks again for VIM. I use it every day on Linux. (Eric Foster-Johnson,
|
||||
Thanks again for Vim. I use it every day on Linux. (Eric Foster-Johnson,
|
||||
author of the book "UNIX Programming Tools")
|
||||
|
||||
The BEST EDITOR EVER (Stuart Woolford)
|
||||
|
||||
I have used most of VIM's fancy features at least once, many frequently, and I
|
||||
I have used most of Vim's fancy features at least once, many frequently, and I
|
||||
can honestly say that I couldn't live with anything less anymore. My
|
||||
productivity has easily doubled compared to what it was when I used vi.
|
||||
(Sitaram Chamarty)
|
||||
|
||||
I luv VIM. It is incredible. I'm naming my first-born Vimberly. (Jose
|
||||
I luv Vim. It is incredible. I'm naming my first-born Vimberly. (Jose
|
||||
Unpingco, USA)
|
||||
|
||||
Hint: "VIM" is "vi improved" - much better! (Sven Guckes, Germany)
|
||||
Hint: "Vim" is "vi improved" - much better! (Sven Guckes, Germany)
|
||||
|
||||
I use VIM every day. I spend more time in VIM than in any other program...
|
||||
I use Vim every day. I spend more time in Vim than in any other program...
|
||||
It's the best vi clone there is. I think it's great. (Craig Sanders,
|
||||
Australia)
|
||||
|
||||
I strongly advise using VIM--its infinite undo/redo saved me much grief.
|
||||
I strongly advise using Vim--its infinite undo/redo saved me much grief.
|
||||
(Terry Brown)
|
||||
|
||||
Thanks very much for writing what in my opinion is the finest text editor on
|
||||
@@ -163,98 +163,98 @@ the planet. If I were to get another cat, I would name it "Vim".
|
||||
I typed :set all and the screen FILLED up with options. A whole screen of
|
||||
things to be set and unset. I saw some of my old friends like wrapmargin,
|
||||
modelines and showmode, but the screen was FILLED with new friends! I love
|
||||
them all! I love VIM! I'm so happy that I've found this editor! I feel
|
||||
them all! I love Vim! I'm so happy that I've found this editor! I feel
|
||||
like how I once felt when I started using vi after a couple of years of using
|
||||
ed. I never thought I'd forsake my beloved ed, but vi ... oh god, vi was
|
||||
great. And now, VIM. (Peter Jay Salzman, USA)
|
||||
great. And now, Vim. (Peter Jay Salzman, USA)
|
||||
|
||||
I am really happy with such a wonderful software package. Much better than
|
||||
almost any expensive, off the shelf program. (Jeff Walker)
|
||||
|
||||
Whenever I reread the VIM documentation I'm overcome with excitement at the
|
||||
Whenever I reread the Vim documentation I'm overcome with excitement at the
|
||||
power of the editor. (William Edward Webber, Australia)
|
||||
|
||||
Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions
|
||||
Hurrah for Vim!! It is "at your fingertips" like vi, and has the extensions
|
||||
that vi sorely needs: highlighting for executing commands on blocks, an easily
|
||||
navigable and digestible help screen, and more. (Paul Pax)
|
||||
|
||||
The reason WHY I don't have this amazingly useful macro anymore, is that I
|
||||
now use VIM - and this is built in!! (Stephen Riehm, Germany)
|
||||
now use Vim - and this is built in!! (Stephen Riehm, Germany)
|
||||
|
||||
I am a user of VIM and I love it. I use it to do all my programming, C,
|
||||
I am a user of Vim and I love it. I use it to do all my programming, C,
|
||||
C++, HTML what ever. (Tim Allwine)
|
||||
|
||||
I discovered VIM after years of struggling with the original vi, and I just
|
||||
I discovered Vim after years of struggling with the original vi, and I just
|
||||
can't live without it anymore. (Emmanuel Mogenet, USA)
|
||||
|
||||
Emacs has not a bit of chance to survive so long as VIM is around. Besides,
|
||||
Emacs has not a bit of chance to survive so long as Vim is around. Besides,
|
||||
it also has the most detailed software documentation I have ever seen---much
|
||||
better than most commercial software! (Leiming Qian)
|
||||
|
||||
This version of VIM will just blow people apart when they discover just how
|
||||
This version of Vim will just blow people apart when they discover just how
|
||||
fantastic it is! (Tony Nugent, Australia)
|
||||
|
||||
I took your advice & finally got VIM & I'm really impressed. Instant convert.
|
||||
I took your advice & finally got Vim & I'm really impressed. Instant convert.
|
||||
(Patrick Killelea, USA)
|
||||
|
||||
VIM is by far my favorite piece of shareware and I have been particularly
|
||||
Vim is by far my favorite piece of shareware and I have been particularly
|
||||
pleased with version 3.0. This is really a solid piece of work. (Robert
|
||||
Colon, USA)
|
||||
|
||||
VIM is a joy to use, it is so well thought and practical that I wonder why
|
||||
anybody would use visual development tools. VIM is powerful and elegant, it
|
||||
Vim is a joy to use, it is so well thought and practical that I wonder why
|
||||
anybody would use visual development tools. Vim is powerful and elegant, it
|
||||
looks deceptively simple but is almost as complex as a 747 (especially when I
|
||||
look at my growing .vimrc), keep up that wonderful job, VIM is a centerpiece
|
||||
look at my growing .vimrc), keep up that wonderful job, Vim is a centerpiece
|
||||
of the free software world. (Louis-David Mitterand, USA)
|
||||
|
||||
I cannot believe how great it is to use VIM. I think the guys at work are
|
||||
I cannot believe how great it is to use Vim. I think the guys at work are
|
||||
getting tired of hearing me bragging about it. Others eyes are lighting up.
|
||||
(Rick Croote)
|
||||
|
||||
Emacs takes way too much time to start up and run, it is too big and bulky for
|
||||
effective use and the interface is more confusing than it is of any help. VIM
|
||||
effective use and the interface is more confusing than it is of any help. Vim
|
||||
however is short, it is fast, it is powerful, it has a good interface and it
|
||||
is all purpose. (Paal Ditlefsen Ekran)
|
||||
|
||||
From the first time I got VIM3.0, I was very enthusiastic. It has almost no
|
||||
From the first time I got Vim3.0, I was very enthusiastic. It has almost no
|
||||
problems. The swapfile handling and the backup possibilities are robust, also
|
||||
the protection against editing one file twice. It is very compatible to the
|
||||
real VI (and that is a MUST, because my brain is trained over years in using
|
||||
it). (Gert van Antwerpen, Holland)
|
||||
|
||||
Visual mode in VIM is a very powerful thing! (Tony Nugent, Australia)
|
||||
Visual mode in Vim is a very powerful thing! (Tony Nugent, Australia)
|
||||
|
||||
I have to say that VIM is =THE= single greatest piece of source code to ever
|
||||
I have to say that Vim is =THE= single greatest piece of source code to ever
|
||||
come across the net (Jim Battle, USA).
|
||||
|
||||
In fact, if you do want to get a new vi I'd suggest VIM-3.0. This is, by
|
||||
In fact, if you do want to get a new vi I'd suggest Vim-3.0. This is, by
|
||||
far, the best version of vi I've ever seen (Albert W. Schueller).
|
||||
|
||||
I should mention that VIM is a very good editor and can compete with anything
|
||||
I should mention that Vim is a very good editor and can compete with anything
|
||||
(Ilya Beloozerov).
|
||||
|
||||
To tell the truth sometimes I used elvis, vile, xvi, calvin, etc. And this is
|
||||
the reason that I can state that VIM is the best! (Ferenc Deak, Hungary)
|
||||
the reason that I can state that Vim is the best! (Ferenc Deak, Hungary)
|
||||
|
||||
VIM is by far the best editor that I have used in a long time, and I have
|
||||
Vim is by far the best editor that I have used in a long time, and I have
|
||||
looked at just about every thing that is available for every platform that I
|
||||
use. VIM is the best on all of them. (Guy L. Oliver)
|
||||
use. Vim is the best on all of them. (Guy L. Oliver)
|
||||
|
||||
VIM is the greatest editor since the stone chisel. (Jose Unpingco, USA)
|
||||
Vim is the greatest editor since the stone chisel. (Jose Unpingco, USA)
|
||||
|
||||
I would like to say that with VIM I am finally making the 'emacs to vi'
|
||||
I would like to say that with Vim I am finally making the 'emacs to vi'
|
||||
transition - as an Editor it is so much better in many ways: keyboard layout,
|
||||
memory usage, text alteration to name 3. (Mark Adam)
|
||||
|
||||
In fact, now if I want to know what a particular setting does in vi, I fire up
|
||||
VIM and check out its help! (Nikhil Patel, USA)
|
||||
Vim and check out its help! (Nikhil Patel, USA)
|
||||
|
||||
As a vi user, VIM has made working with text a far more pleasant task than
|
||||
As a vi user, Vim has made working with text a far more pleasant task than
|
||||
before I encountered this program. (Steinar Knutsen, Norway)
|
||||
|
||||
I use VIM since version 3.0. Since that time, it is the ONLY editor I use,
|
||||
with Solaris, Linux and OS/2 Warp. I suggest all my friends to use VIM, they
|
||||
try, and they continue using it. VIM is really the best software I have ever
|
||||
I use Vim since version 3.0. Since that time, it is the ONLY editor I use,
|
||||
with Solaris, Linux and OS/2 Warp. I suggest all my friends to use Vim, they
|
||||
try, and they continue using it. Vim is really the best software I have ever
|
||||
downloaded from the Internet, and the best editor I know of. (Marco
|
||||
Eccettuato, Italy)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*remote.txt* For Vim version 8.0. Last change: 2015 Mar 01
|
||||
*remote.txt* For Vim version 8.0. Last change: 2017 Mar 18
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -149,6 +149,7 @@ the description in |eval.txt| or use CTRL-] on the function name to jump to
|
||||
the full explanation.
|
||||
|
||||
synopsis explanation ~
|
||||
remote_startserver( name) run a server
|
||||
remote_expr( server, string, idvar) send expression
|
||||
remote_send( server, string, idvar) send key sequence
|
||||
serverlist() get a list of available servers
|
||||
|
||||
@@ -478,7 +478,7 @@ Vim uses a binary file format for spelling. This greatly speeds up loading
|
||||
the word list and keeps it small.
|
||||
*.aff* *.dic* *Myspell*
|
||||
You can create a Vim spell file from the .aff and .dic files that Myspell
|
||||
uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt
|
||||
uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt
|
||||
files are zip files which contain the .aff and .dic files. You should be able
|
||||
to find them here:
|
||||
http://extensions.services.openoffice.org/dictionary
|
||||
@@ -1614,7 +1614,7 @@ COMPOUNDSYLLABLE (Hunspell) *spell-COMPOUNDSYLLABLE*
|
||||
KEY (Hunspell) *spell-KEY*
|
||||
Define characters that are close together on the keyboard.
|
||||
Used to give better suggestions. Not supported.
|
||||
|
||||
|
||||
LANG (Hunspell) *spell-LANG*
|
||||
This specifies language-specific behavior. This actually
|
||||
moves part of the language knowledge into the program,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2017 Feb 06
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2017 Jun 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -4812,10 +4812,11 @@ ctermbg={color-nr} *highlight-ctermbg*
|
||||
Example: >
|
||||
:highlight Normal ctermfg=grey ctermbg=darkblue
|
||||
< When setting the "ctermbg" color for the Normal group, the
|
||||
'background' option will be adjusted automatically. This causes the
|
||||
highlight groups that depend on 'background' to change! This means
|
||||
you should set the colors for Normal first, before setting other
|
||||
colors.
|
||||
'background' option will be adjusted automatically, under the
|
||||
condition that the color is recognized and 'background' was not set
|
||||
explicitly. This causes the highlight groups that depend on
|
||||
'background' to change! This means you should set the colors for
|
||||
Normal first, before setting other colors.
|
||||
When a colorscheme is being used, changing 'background' causes it to
|
||||
be reloaded, which may reset all colors (including Normal). First
|
||||
delete the "g:colors_name" variable when you don't want this.
|
||||
|
||||
@@ -945,6 +945,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_F7' term.txt /*'t_F7'*
|
||||
't_F8' term.txt /*'t_F8'*
|
||||
't_F9' term.txt /*'t_F9'*
|
||||
't_GP' term.txt /*'t_GP'*
|
||||
't_IE' term.txt /*'t_IE'*
|
||||
't_IS' term.txt /*'t_IS'*
|
||||
't_K1' term.txt /*'t_K1'*
|
||||
@@ -1927,6 +1928,13 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:Print various.txt /*:Print*
|
||||
:Rexplore pi_netrw.txt /*:Rexplore*
|
||||
:RmVimball pi_vimball.txt /*:RmVimball*
|
||||
:RustEmitAsm ft_rust.txt /*:RustEmitAsm*
|
||||
:RustEmitIr ft_rust.txt /*:RustEmitIr*
|
||||
:RustExpand ft_rust.txt /*:RustExpand*
|
||||
:RustFmt ft_rust.txt /*:RustFmt*
|
||||
:RustFmtRange ft_rust.txt /*:RustFmtRange*
|
||||
:RustPlay ft_rust.txt /*:RustPlay*
|
||||
:RustRun ft_rust.txt /*:RustRun*
|
||||
:Sexplore pi_netrw.txt /*:Sexplore*
|
||||
:TOhtml syntax.txt /*:TOhtml*
|
||||
:TarDiff pi_tar.txt /*:TarDiff*
|
||||
@@ -3270,6 +3278,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
<Char> map.txt /*<Char>*
|
||||
<CursorHold> autocmd.txt /*<CursorHold>*
|
||||
<D- intro.txt /*<D-*
|
||||
<D-c> os_mac.txt /*<D-c>*
|
||||
<D-v> os_mac.txt /*<D-v>*
|
||||
<D-x> os_mac.txt /*<D-x>*
|
||||
<Del> change.txt /*<Del>*
|
||||
<Down> motion.txt /*<Down>*
|
||||
<Drop> change.txt /*<Drop>*
|
||||
@@ -4505,6 +4516,9 @@ E938 eval.txt /*E938*
|
||||
E939 change.txt /*E939*
|
||||
E94 windows.txt /*E94*
|
||||
E940 eval.txt /*E940*
|
||||
E941 eval.txt /*E941*
|
||||
E942 eval.txt /*E942*
|
||||
E943 message.txt /*E943*
|
||||
E95 message.txt /*E95*
|
||||
E96 diff.txt /*E96*
|
||||
E97 diff.txt /*E97*
|
||||
@@ -5013,6 +5027,7 @@ assert_inrange() eval.txt /*assert_inrange()*
|
||||
assert_match() eval.txt /*assert_match()*
|
||||
assert_notequal() eval.txt /*assert_notequal()*
|
||||
assert_notmatch() eval.txt /*assert_notmatch()*
|
||||
assert_report() eval.txt /*assert_report()*
|
||||
assert_true() eval.txt /*assert_true()*
|
||||
at motion.txt /*at*
|
||||
atan() eval.txt /*atan()*
|
||||
@@ -6128,6 +6143,7 @@ ft-rexx-syntax syntax.txt /*ft-rexx-syntax*
|
||||
ft-rst-syntax syntax.txt /*ft-rst-syntax*
|
||||
ft-ruby-omni insert.txt /*ft-ruby-omni*
|
||||
ft-ruby-syntax syntax.txt /*ft-ruby-syntax*
|
||||
ft-rust filetype.txt /*ft-rust*
|
||||
ft-scheme-syntax syntax.txt /*ft-scheme-syntax*
|
||||
ft-sdl-syntax syntax.txt /*ft-sdl-syntax*
|
||||
ft-sed-syntax syntax.txt /*ft-sed-syntax*
|
||||
@@ -6160,6 +6176,7 @@ ft-xpm-syntax syntax.txt /*ft-xpm-syntax*
|
||||
ft-yaml-syntax syntax.txt /*ft-yaml-syntax*
|
||||
ft-zsh-syntax syntax.txt /*ft-zsh-syntax*
|
||||
ft_ada.txt ft_ada.txt /*ft_ada.txt*
|
||||
ft_rust.txt ft_rust.txt /*ft_rust.txt*
|
||||
ft_sql.txt ft_sql.txt /*ft_sql.txt*
|
||||
ftdetect filetype.txt /*ftdetect*
|
||||
ftp pi_netrw.txt /*ftp*
|
||||
@@ -6237,6 +6254,7 @@ g:decada.Make_Command ft_ada.txt /*g:decada.Make_Command*
|
||||
g:decada.Unit_Name() ft_ada.txt /*g:decada.Unit_Name()*
|
||||
g:filetype_csh syntax.txt /*g:filetype_csh*
|
||||
g:filetype_r syntax.txt /*g:filetype_r*
|
||||
g:ftplugin_rust_source_path ft_rust.txt /*g:ftplugin_rust_source_path*
|
||||
g:gnat ft_ada.txt /*g:gnat*
|
||||
g:gnat.Error_Format ft_ada.txt /*g:gnat.Error_Format*
|
||||
g:gnat.Find() ft_ada.txt /*g:gnat.Find()*
|
||||
@@ -6366,6 +6384,20 @@ g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp*
|
||||
g:netrw_winsize pi_netrw.txt /*g:netrw_winsize*
|
||||
g:netrw_wiw pi_netrw.txt /*g:netrw_wiw*
|
||||
g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen*
|
||||
g:rust_bang_comment_leader ft_rust.txt /*g:rust_bang_comment_leader*
|
||||
g:rust_conceal ft_rust.txt /*g:rust_conceal*
|
||||
g:rust_conceal_mod_path ft_rust.txt /*g:rust_conceal_mod_path*
|
||||
g:rust_conceal_pub ft_rust.txt /*g:rust_conceal_pub*
|
||||
g:rust_fold ft_rust.txt /*g:rust_fold*
|
||||
g:rust_playpen_url ft_rust.txt /*g:rust_playpen_url*
|
||||
g:rust_recommended_style ft_rust.txt /*g:rust_recommended_style*
|
||||
g:rust_shortener_url ft_rust.txt /*g:rust_shortener_url*
|
||||
g:rustc_makeprg_no_percent ft_rust.txt /*g:rustc_makeprg_no_percent*
|
||||
g:rustc_path ft_rust.txt /*g:rustc_path*
|
||||
g:rustfmt_autosave ft_rust.txt /*g:rustfmt_autosave*
|
||||
g:rustfmt_command ft_rust.txt /*g:rustfmt_command*
|
||||
g:rustfmt_fail_silently ft_rust.txt /*g:rustfmt_fail_silently*
|
||||
g:rustfmt_options ft_rust.txt /*g:rustfmt_options*
|
||||
g:syntax_on syntax.txt /*g:syntax_on*
|
||||
g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions*
|
||||
g:tar_cmd pi_tar.txt /*g:tar_cmd*
|
||||
@@ -7148,9 +7180,11 @@ m` motion.txt /*m`*
|
||||
mac os_mac.txt /*mac*
|
||||
mac-bug os_mac.txt /*mac-bug*
|
||||
mac-compile os_mac.txt /*mac-compile*
|
||||
mac-darwin-feature os_mac.txt /*mac-darwin-feature*
|
||||
mac-faq os_mac.txt /*mac-faq*
|
||||
mac-filename os_mac.txt /*mac-filename*
|
||||
mac-lack os_mac.txt /*mac-lack*
|
||||
mac-standard-mappings os_mac.txt /*mac-standard-mappings*
|
||||
mac-vimfile os_mac.txt /*mac-vimfile*
|
||||
macintosh os_mac.txt /*macintosh*
|
||||
macro map.txt /*macro*
|
||||
@@ -7661,6 +7695,8 @@ nice todo.txt /*nice*
|
||||
no-eval-feature eval.txt /*no-eval-feature*
|
||||
no-type-checking eval.txt /*no-type-checking*
|
||||
no_buffers_menu gui.txt /*no_buffers_menu*
|
||||
no_mail_maps filetype.txt /*no_mail_maps*
|
||||
no_plugin_maps filetype.txt /*no_plugin_maps*
|
||||
non-greedy pattern.txt /*non-greedy*
|
||||
non-zero-arg eval.txt /*non-zero-arg*
|
||||
none-variable eval.txt /*none-variable*
|
||||
@@ -8019,6 +8055,7 @@ remote_foreground() eval.txt /*remote_foreground()*
|
||||
remote_peek() eval.txt /*remote_peek()*
|
||||
remote_read() eval.txt /*remote_read()*
|
||||
remote_send() eval.txt /*remote_send()*
|
||||
remote_startserver() eval.txt /*remote_startserver()*
|
||||
remove() eval.txt /*remove()*
|
||||
remove-filetype filetype.txt /*remove-filetype*
|
||||
remove-option-flags options.txt /*remove-option-flags*
|
||||
@@ -8074,6 +8111,13 @@ russian-issues russian.txt /*russian-issues*
|
||||
russian-keymap russian.txt /*russian-keymap*
|
||||
russian-l18n russian.txt /*russian-l18n*
|
||||
russian.txt russian.txt /*russian.txt*
|
||||
rust ft_rust.txt /*rust*
|
||||
rust-commands ft_rust.txt /*rust-commands*
|
||||
rust-intro ft_rust.txt /*rust-intro*
|
||||
rust-mappings ft_rust.txt /*rust-mappings*
|
||||
rust-settings ft_rust.txt /*rust-settings*
|
||||
rust_<D-R> ft_rust.txt /*rust_<D-R>*
|
||||
rust_<D-r> ft_rust.txt /*rust_<D-r>*
|
||||
rview starting.txt /*rview*
|
||||
rvim starting.txt /*rvim*
|
||||
rxvt syntax.txt /*rxvt*
|
||||
@@ -8485,6 +8529,7 @@ t_F6 term.txt /*t_F6*
|
||||
t_F7 term.txt /*t_F7*
|
||||
t_F8 term.txt /*t_F8*
|
||||
t_F9 term.txt /*t_F9*
|
||||
t_GP term.txt /*t_GP*
|
||||
t_IE term.txt /*t_IE*
|
||||
t_IS term.txt /*t_IS*
|
||||
t_K1 term.txt /*t_K1*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 8.0. Last change: 2017 Feb 02
|
||||
*term.txt* For Vim version 8.0. Last change: 2017 Apr 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -314,6 +314,7 @@ Added by Vim (there are no standard codes for these):
|
||||
t_IS set icon text start *t_IS* *'t_IS'*
|
||||
t_IE set icon text end *t_IE* *'t_IE'*
|
||||
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
|
||||
t_GP get window position (Y, X) in pixels *t_GP* *'t_GP'*
|
||||
t_WS set window size (height, width) in characters *t_WS* *'t_WS'*
|
||||
t_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'*
|
||||
t_SR start replace mode (underline cursor shape) *t_SR* *'t_SR'*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Mar 16
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jun 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,13 +35,9 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Using "g<" after ":for x in [1,2,3]|echom x|endfor" looks wrong. (Marcin
|
||||
Szamotulski, 2017 Mar 12)
|
||||
Also, using Ctrl-C clears the last part.
|
||||
|
||||
Test 45 fails on MS-Windows only before resetting 'sw'. Why?
|
||||
|
||||
+channel:
|
||||
- When redrawing for the channel buffer, command line completion is cleared.
|
||||
(Ramel Eshed, 2017 May 4)
|
||||
- Try out background make plugin:
|
||||
https://github.com/AndrewVos/vim-make-background
|
||||
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
|
||||
@@ -110,22 +106,128 @@ Regexp problems:
|
||||
had_endbrace[] is set but not initialized or used.
|
||||
- Difference between two engines: ".*\zs\/\@>\/" on text "///"
|
||||
(Chris Paul, 2016 Nov 13) New engine not greedy enough?
|
||||
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
|
||||
(2017 May 15, #1252)
|
||||
|
||||
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
|
||||
(Marcin Szewczyk, 2017 Apr 26)
|
||||
|
||||
ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
|
||||
|
||||
ml_get errors with buggy script. (Dominique, 2017 Apr 30)
|
||||
|
||||
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
|
||||
|
||||
Add options_default() / options_restore() to set several options to Vim
|
||||
defaults for a plugin. Comments from Zyx, 2017 May 10.
|
||||
Perhaps use a vimcontext / endvimcontext command block.
|
||||
|
||||
Using freed memory with "qf" FileType autocommand that does :cclose.
|
||||
(Lemonboy, 2017 May 28, #1730, fix in 1734, with test that doesn't fail, but
|
||||
it fails when run manually) Add "starting" to test_override()?
|
||||
|
||||
Problem with three-piece comment. (Michael Lee, 2017 May 11, #1696)
|
||||
|
||||
When checking if a bufref is valid, also check the buffer number, to catch the
|
||||
case of :bwipe followed by :new.
|
||||
|
||||
Files for Latvian language. (Vitolins, 2017 May 3, #1675)
|
||||
|
||||
Setting 'clipboard' to "unnamed" makes a global command very slow (Daniel
|
||||
Drucker, 2017 May 8).
|
||||
This was supposed to be fixed, did it break again somehow?
|
||||
Christian cannot reproduce it.
|
||||
|
||||
Better TeX indent file. (Christian Brabandt, 2017 May 3)
|
||||
|
||||
Openhab syntax file (mueller, #1678)
|
||||
|
||||
Use gvimext.dll from the nightly build? (Issue #249)
|
||||
|
||||
Patch to remove HAVE_GTK_MULTIHEAD-relevant code. (Kazunobu Kuriyama, 2017 May
|
||||
5) Update May 11
|
||||
|
||||
'synmaxcol' works with bytes instead of screen cells. (Llandon, 2017 May 31,
|
||||
#1736)
|
||||
|
||||
Patch to pass quickfix list index to functions. (Yegappan Lakshmanan, 2017 May
|
||||
31)
|
||||
|
||||
Problem with using :cd when remotely editing a file. (Gerd Wachsmuth, 2017 May
|
||||
8, #1690)
|
||||
|
||||
'equalalways' only works for one column. (Glacambre, 2017 May 15, #1707)
|
||||
|
||||
Include solarized color scheme?
|
||||
|
||||
Updates to GTK help. (Kazunobu Kuriyama, 2017 May 4)
|
||||
|
||||
Running test_gui and test_gui_init with Motif sometimes kills the window
|
||||
manager. Problem with Motif?
|
||||
|
||||
Bogus characters inserted when triggering indent while changing text.
|
||||
(Vitor Antunes, 2016 Nov 22, #1269)
|
||||
|
||||
Patch to have ":stag" respect 'switchbuf'. (Ingo Karkat, 2017 May 5, #1681)
|
||||
|
||||
Patch to improve building with MSVC. (Leonardo Manera, #1747)
|
||||
|
||||
Wrong selection of quoted text (Guraga, #1687)
|
||||
Patch to fix selection of quoted text. (Christian Brabandt, 2017 May 7, #1687)
|
||||
|
||||
Patch to use separate error message for regex range. (Itchyny, Ken Hamada,
|
||||
2017 May 16)
|
||||
|
||||
Segmentation fault with complete(). (Lifepillar, 2017 Apr 29, #1668)
|
||||
Check for "pat" to be NULL in search_for_exact_line()?
|
||||
How did it get NULL? Comment by Christian, Apr 30.
|
||||
|
||||
Is it possible to keep the complete menu open when calling complete()?
|
||||
(Prabir Shrestha, 2017 May 19, #1713)
|
||||
|
||||
Calling may_req_ambiguous_char_width() and may_req_bg_color() only after
|
||||
executing command line commands may not work properly.
|
||||
(Rastislav Barlink, 2017 May 18)
|
||||
Set "starting" to 0 earlier, and move the may_req calls above exe_commands()?
|
||||
No, that's a problem with using "-c quit", not running Vim interactive.
|
||||
|
||||
Memory leak in test97? The string is actually freed. Weird.
|
||||
|
||||
Include rust files. Got all permissions?
|
||||
Patch for shellescape(). (Christian Brabandt, 2017 Apr 20, #1590)
|
||||
|
||||
dict_add_list and dict_add_dict may free item when failing. (2017 Mar 12,
|
||||
Nikolai Pavlov, #1555)
|
||||
Patch for flickering redraw. (Hirohito Higashi, 2017 Apr 23, #1637)
|
||||
|
||||
Patch to add buffer name argument to taglist().
|
||||
Ordering of tags in result of taglist call. (Duncan McDougall, #1194)
|
||||
New value "uselast" for 'switchbuf'. (Lemonboy, 2017 Apr 23, #1652)
|
||||
|
||||
Add a toolbar in the terminal. Can be global, above all windows, or specific
|
||||
for one window.
|
||||
|
||||
Make maparg() also return the raw rhs, so that it doesn't depend on 'cpo'.
|
||||
(Brett Stahlman, 2017 May 23)
|
||||
Even better: add a way to disable a mapping temporarily and re-enable it
|
||||
later. This is for a sub-mode that is active for a short while (one buffer).
|
||||
Still need maplist() to find the mappings. What can we use to identify a
|
||||
mapping? Something unique would be better than the LHS.
|
||||
Perhaps simpler: actually delete the mappings. Use maplist() to list matching
|
||||
mappings (with a lhs prefix, like maparg()), mapdelete() to delete,
|
||||
maprestore() to restore (using the output of maplist().
|
||||
|
||||
Patch to support chinese wordcount in utf-8. (Rain, 2017 May 24, #1722)
|
||||
Or not?
|
||||
|
||||
"gn" selects one character instead of the searched text. (keyboardfire, #1683)
|
||||
Patch by Christian, 2017 May 7.
|
||||
|
||||
Wrong memory access using p_fdm, found in patch to add tests for diff mode
|
||||
(#1658) (Dominique Pelle, 2017 May 6)
|
||||
|
||||
Patch to improve test coverage for diff mode. (Dominique Pelle, 2017 May 11,
|
||||
#1685)
|
||||
|
||||
Add an argument to :mkvimrc (or add aother command) to skip mappings from
|
||||
plugins (source is a Vim script). No need to put these in a .vimrc, they will
|
||||
be defined when the plugin is loaded.
|
||||
|
||||
Use tb_set(winid, [{'text': 'stop', 'cb': callback, 'hi': 'Green'}])
|
||||
tb_highlight(winid, 'ToolBar')
|
||||
tb_get(winid)
|
||||
@@ -135,12 +237,6 @@ What if there is an invalid character?
|
||||
|
||||
Json string with trailing \u should be an error. (Lcd)
|
||||
|
||||
On MS-Windows with 'clipboard' set to "unnamed" this doesn't work to double
|
||||
lines: :g/^/normal yyp On Unix it works OK. (Bryce Orgill, 2016 Nov 5)
|
||||
Another example 2017 Mar 10.
|
||||
|
||||
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
|
||||
|
||||
When session file has name in argument list but the buffer was deleted, the
|
||||
buffer is not deleted when using the session file. (#1393)
|
||||
Should add the buffer in hidden state.
|
||||
@@ -148,10 +244,6 @@ Should add the buffer in hidden state.
|
||||
When an item in the quickfix list has a file name that does not exist, behave
|
||||
like the item was not a match for :cnext.
|
||||
|
||||
Patch to test regexp classes. (Dominique, 2017 Mar 13, #1560)
|
||||
Do we need to adjust the implementation?
|
||||
Make different classes that depend on the system and that don't.
|
||||
|
||||
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
||||
Also get E749 on exit.
|
||||
Another example in #1309
|
||||
@@ -159,9 +251,6 @@ Another example in #1309
|
||||
Patch to change all use of &sw to shiftwidth(). (Tyru, 2017 Feb 19)
|
||||
Wait until maintainers integrate it.
|
||||
|
||||
Completion for user-defined commands does not work if a few characters were
|
||||
already typed. (Dominique, 2017 Jan 26)
|
||||
|
||||
When deleting a mark or register, leave a tombstone, so that it's also deleted
|
||||
when writing viminfo (and the delete was the most recent action). #1339
|
||||
|
||||
@@ -172,6 +261,10 @@ Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
|
||||
|
||||
Completion for :!cmd shows each match twice. #1435
|
||||
|
||||
Patch to change GUI behavior: instead of changing the window size change the
|
||||
lines/columns when menu/toolbar/etc. is added/removed. (Ychin, 2016 Mar 20,
|
||||
#703)
|
||||
|
||||
GTK: When adding a timer from 'balloonexpr' it won't fire, because
|
||||
g_main_context_iteration() doesn't return. Need to trigger an event when the
|
||||
timer expires.
|
||||
@@ -206,6 +299,10 @@ writefile() does not abort as soon as an error is found. (Nikolai Pavlov,
|
||||
Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
|
||||
Feb 14).
|
||||
|
||||
Change the Farsi code to work with UTF-8. Possibly combined with the Arabic
|
||||
support, or similar.
|
||||
Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2)
|
||||
|
||||
Add a command to take a range of lines, filter them and put the output
|
||||
somewhere else. :{range}copy {dest} !cmd
|
||||
|
||||
@@ -218,6 +315,9 @@ Patch for restoring wide characters in the console buffer.
|
||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
|
||||
|
||||
Characters deleted on completion. (Adrià Farrés, 2017 Apr 20, #1645)
|
||||
Remarks from Christian Brabandt (Apr 21)
|
||||
|
||||
The TermResponse event is not triggered when a plugin has set 'eventignore' to
|
||||
"all". Netrw does this. (Gary Johnson, 2017 Jan 24)
|
||||
Postpone the event until 'eventignore' is reset.
|
||||
@@ -225,6 +325,8 @@ Postpone the event until 'eventignore' is reset.
|
||||
Patch to make urxvt mouse work better, recognize Esc[*M termcap code.
|
||||
(Maurice Bos, 2017 Feb 17, #1486)
|
||||
|
||||
Expanding /**/ is slow. Idea by Luc Hermitte, 2017 Apr 14.
|
||||
|
||||
Once .exe with updated installer is available: Add remark to download page
|
||||
about /S and /D options (Ken Takata, 2016 Apr 13)
|
||||
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||
@@ -258,6 +360,9 @@ Does this also fix #1408 ?
|
||||
|
||||
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
|
||||
|
||||
When 'completeopt' has "noselect" does not insert a newline. (Lifepillar, 2017
|
||||
Apr 23, #1653)
|
||||
|
||||
Window resizing with 'winfixheight': With a vertical split the height changes
|
||||
anyway. (Tommy allen, 2017 Feb 21, #1502)
|
||||
|
||||
@@ -302,11 +407,21 @@ Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
|
||||
Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4,
|
||||
#1350)
|
||||
|
||||
Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
|
||||
3. Doesn't work properly according to Yukihiro Nakadaira.
|
||||
Also see #1635.
|
||||
|
||||
Patch for systemlist(), add empty item. (thinca, Sep 30, #1135)
|
||||
Add an argument to choose binary or non-binary (like readfile()), when omitted
|
||||
use the current behavior.
|
||||
Include the test.
|
||||
|
||||
Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22.
|
||||
New update 2017 Apr 10, #1628
|
||||
|
||||
Unnamed register only contains the last deleted text when appending deleted
|
||||
text to a register. (Wolfgang Jeltsch, reproduced by Ben Fritz, 2017 Apr 10)
|
||||
|
||||
When 'keywordprg' starts with ":" the argument is still escaped as a shell
|
||||
command argument. (Romain Lafourcade, 2016 Oct 16, #1175)
|
||||
|
||||
@@ -352,30 +467,20 @@ Jul 25, #948)
|
||||
Patch to fix wrong encoding of error message on Cygwin/MSYS terminal.
|
||||
(Ken Takata, 2016 Oct 4)
|
||||
|
||||
Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
|
||||
Better help Aug 19.
|
||||
Problem: applies to too many commands, such as :cbuffer.
|
||||
Updated patch with three options, 2016 Sep 8.
|
||||
Win32: When running ":make" and 'encoding' differs from the system locale,
|
||||
the output should be converted. Esp. when 'encoding' is "utf-8". (Yongwei
|
||||
Wu) Should we use 'termencoding' for this?
|
||||
|
||||
Patch to add 'systemencoding', convert between 'encoding' and this for file
|
||||
names, shell commands and the like. (Kikuchan, 2010 Oct 14)
|
||||
Assume the system converts between the actual encoding of the filesystem to
|
||||
the system encoding (usually utf-8).
|
||||
|
||||
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
|
||||
Using ":tab drop file" does not trigger BufEnter or TabEnter events.
|
||||
(Andy Stewart, 2017 Apr 27, #1660)
|
||||
Autocommands blocked in do_arg_all(). Supposed to happen later?
|
||||
|
||||
Patch to add context information to quickfix/location list. (Yegappan
|
||||
Lakshmanan, 2016 Aug 25, #1012)
|
||||
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
|
||||
|
||||
MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c?
|
||||
Otherwise task flickers in taskbar.
|
||||
|
||||
Bogus characters inserted when triggering indent while changing test.
|
||||
(Vitor Antunes, 2016 Nov 22, #1269)
|
||||
|
||||
Should make ":@r" handle line continuation. (Cesar Romani, 2016 Jun 26)
|
||||
Also for ":@.".
|
||||
|
||||
@@ -432,7 +537,7 @@ When doing "vi buf.md" a BufNew autocommand for *.md is not triggered.
|
||||
Because of using the initial buffer? (Dun Peal, 2016 May 12)
|
||||
|
||||
Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
|
||||
Updated 2016 Jun 10, #858
|
||||
Updated 2016 Jun 10, #858 Update 2017 Mar 28: use <buffer>
|
||||
|
||||
Add redrawtabline command. (Naruhiko Nishino, 2016 Jun 11)
|
||||
|
||||
@@ -442,6 +547,8 @@ No test, needs some work to include.
|
||||
Patch to improve indenting for C++ constructor with initializer list.
|
||||
(Hirohito Higashi, 2016 Mar 31)
|
||||
|
||||
Zero-out krypt key information when no longer in use. (Ben Fritz, 2017 May 15)
|
||||
|
||||
Add stronger encryption. Could use libsodium (NaCl).
|
||||
https://github.com/jedisct1/libsodium/
|
||||
Possibly include the needed code so that it can be build everywhere.
|
||||
@@ -491,10 +598,6 @@ When command names are very long :command output is difficult to read. Use a
|
||||
maximum for the column width? (#871)
|
||||
Patcy by varmanishant, 2016 Jun 18, #876
|
||||
|
||||
Patch to change GUI behavior: instead of changing the window size change the
|
||||
lines/columns when menu/toolbar/etc. is added/removed. (Ychin, 2016 Mar 20,
|
||||
#703)
|
||||
|
||||
Installation of .desktop files does not work everywhere.
|
||||
It's now fixed, but the target directory probably isn't right.
|
||||
Add configure check?
|
||||
@@ -613,7 +716,8 @@ Value of virtcol() for '[ and '] depend on multi-byte character.
|
||||
(Luchr, #277)
|
||||
|
||||
Can we cache the syntax attributes, so that updates for 'relativenumber' and
|
||||
'cursorline'/'cursorcolumn' are a lot faster?
|
||||
'cursorline'/'cursorcolumn' are a lot faster? Thus store the attributes
|
||||
before combining them.
|
||||
|
||||
C highlighting: modern C allows: /* comment */ #ifdef
|
||||
and also line continuation after #include.
|
||||
@@ -928,9 +1032,6 @@ Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12)
|
||||
Patch to add "ntab" item in 'listchars' to repeat first character. (Nathaniel
|
||||
Braun, pragm, 2013 Oct 13) A better solution 2014 Mar 5.
|
||||
|
||||
Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
|
||||
3. Doesn't work properly according to Yukihiro Nakadaira.
|
||||
|
||||
/[b-a] gives error E16, should probably be E769.
|
||||
|
||||
7 Windows XP: When using "ClearType" for text smoothing, a column of yellow
|
||||
@@ -1095,8 +1196,6 @@ MS-Windows resizing problems:
|
||||
Patch to append regexp to tag commands to make it possible to select one out
|
||||
of many matches. (Cody Cutler, 2013 Mar 28)
|
||||
|
||||
Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22.
|
||||
|
||||
The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O.
|
||||
Suggestion for another map. (Philip Mat, 2012 Jun 18)
|
||||
But use "gi" instead of "a". Or use CTRL-\ CTRL-O.
|
||||
@@ -1522,8 +1621,6 @@ When a:base in 'completefunc' starts with a number it's passed as a number,
|
||||
not a string. (Sean Ma) Need to add flag to call_func_retlist() to force a
|
||||
string value.
|
||||
|
||||
Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2)
|
||||
|
||||
For running gvim on a USB stick: avoid the OLE registration. Use a command
|
||||
line argument -noregister.
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ mouse button. The selected text will be inserted.
|
||||
The "current selection" will only remain valid until some other text is
|
||||
selected. After doing the paste in the other gVim, now select some characters
|
||||
in that window. You will notice that the words that were previously selected
|
||||
in the other gVim window are displayed differently. This means that it no
|
||||
in the other gvim window are displayed differently. This means that it no
|
||||
longer is the current selection.
|
||||
|
||||
You don't need to select text with the mouse, using the keyboard commands for
|
||||
@@ -215,7 +215,7 @@ USING BOTH
|
||||
|
||||
This use of both the "current selection" and the "real clipboard" might sound
|
||||
a bit confusing. But it is very useful. Let's show this with an example.
|
||||
Use one gVim with a text file and perform these actions:
|
||||
Use one gvim with a text file and perform these actions:
|
||||
|
||||
- Select two words in Visual mode.
|
||||
- Use the Edit/Copy menu to get these words onto the clipboard.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2017 Mar 09
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2017 Mar 28
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -889,6 +889,7 @@ GUI: *gui-functions*
|
||||
|
||||
Vim server: *server-functions*
|
||||
serverlist() return the list of server names
|
||||
remote_startserve() run a server
|
||||
remote_send() send command characters to a Vim server
|
||||
remote_expr() evaluate an expression in a Vim server
|
||||
server2client() send a reply to a client of a Vim server
|
||||
@@ -920,6 +921,7 @@ Testing: *test-functions*
|
||||
assert_true() assert that an expression is true
|
||||
assert_exception() assert that a command throws an exception
|
||||
assert_fails() assert that a function call fails
|
||||
assert_report() report a test failure
|
||||
test_alloc_fail() make memory allocation fail
|
||||
test_autochdir() enable 'autochdir' during startup
|
||||
test_override() test with Vim internal overrides
|
||||
@@ -2275,8 +2277,8 @@ plugin for the mail filetype: >
|
||||
endif
|
||||
|
||||
Two global variables are used:
|
||||
no_plugin_maps disables mappings for all filetype plugins
|
||||
no_mail_maps disables mappings for a specific filetype
|
||||
|no_plugin_maps| disables mappings for all filetype plugins
|
||||
|no_mail_maps| disables mappings for the "mail" filetype
|
||||
|
||||
|
||||
USER COMMANDS
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_44.txt* For Vim version 8.0. Last change: 2008 Dec 28
|
||||
*usr_44.txt* For Vim version 8.0. Last change: 2017 May 06
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -686,7 +686,7 @@ that included files do this too, you might have to reset "b:current_syntax" if
|
||||
you include two files.
|
||||
|
||||
If you want your syntax file to work with Vim 5.x, add a check for v:version.
|
||||
See yacc.vim for an example.
|
||||
Find an syntax file in the Vim 7.2 distribution for an example.
|
||||
|
||||
Do not include anything that is a user preference. Don't set 'tabstop',
|
||||
'expandtab', etc. These belong in a filetype plugin.
|
||||
|
||||
@@ -9250,7 +9250,7 @@ Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c,
|
||||
src/proto/quickfix.pro, src/quickfix.c
|
||||
|
||||
Patch 6.1.424 (extra)
|
||||
Problem: Win32: Gvim compiled with VC++ 7.0 run on Windows 95 does not show
|
||||
Problem: Win32: gvim compiled with VC++ 7.0 run on Windows 95 does not show
|
||||
menu items.
|
||||
Solution: Define $WINVER to avoid an extra item is added to MENUITEMINFO.
|
||||
(Muraoka Taro)
|
||||
@@ -12319,7 +12319,7 @@ Solution: Don't ignore the WM_SYSKEYUP event when the menu is disabled.
|
||||
Files: src/gui_w32.c
|
||||
|
||||
Patch 6.2.362 (extra, after 6.2.347)
|
||||
Problem: Win32: The manifest causes Gvim not to work. (Dave Roberts)
|
||||
Problem: Win32: The manifest causes gvim not to work. (Dave Roberts)
|
||||
Solution: Change "x86" to "X86". (Serge Pirotte)
|
||||
Files: src/gvim.exe.mnf
|
||||
|
||||
|
||||
@@ -4151,7 +4151,7 @@ Patch 7.0.173
|
||||
Problem: ":call f().TT()" doesn't work. (Richard Emberson)
|
||||
Solution: When a function returns a Dictionary or another composite continue
|
||||
evaluating what follows.
|
||||
Files: src/eval.c
|
||||
Files: src/eval.c
|
||||
|
||||
Patch 7.0.174
|
||||
Problem: ":mksession" doesn't restore window layout correctly in tab pages
|
||||
@@ -4265,7 +4265,7 @@ Problem: When 'swapfile' is switched off in an empty file it is possible
|
||||
that not all blocks are loaded into memory, causing ml_get errors
|
||||
later.
|
||||
Solution: Rename "dont_release" to "mf_dont_release" and also use it to
|
||||
avoid using the cached line and locked block.
|
||||
avoid using the cached line and locked block.
|
||||
Files: src/globals.h, src/memfile.c, src/memline.c
|
||||
|
||||
Patch 7.0.193
|
||||
@@ -6031,7 +6031,7 @@ Solution: Add type casts. (Ben Schmidt)
|
||||
Files: src/version.c
|
||||
|
||||
Patch 7.1.207
|
||||
Problem: Netbeans: "remove" cannot delete one line.
|
||||
Problem: Netbeans: "remove" cannot delete one line.
|
||||
Solution: Remove partial lines and whole lines properly. Avoid a memory
|
||||
leak. (Xavier de Gaye)
|
||||
Files: src/netbeans.c
|
||||
@@ -7991,7 +7991,7 @@ Files: src/ex_cmds.c
|
||||
|
||||
Patch 7.2.097
|
||||
Problem: "!xterm&" doesn't work when 'shell' is "bash".
|
||||
Solution: Ignore SIGHUP after calling setsid(). (Simon Schubert)
|
||||
Solution: Ignore SIGHUP after calling setsid(). (Simon Schubert)
|
||||
Files: src/os_unix.c
|
||||
|
||||
Patch 7.2.098
|
||||
@@ -8740,7 +8740,7 @@ Files: src/gui_gtk_x11.c, src/message.c, src/ops.c, src/proto/ui.pro,
|
||||
src/ui.c
|
||||
|
||||
Patch 7.2.222
|
||||
Problem: ":mksession" doesn't work properly with 'acd' set.
|
||||
Problem: ":mksession" doesn't work properly with 'acd' set.
|
||||
Solution: Make it work. (Yakov Lerner)
|
||||
Files: src/ex_docmd.c
|
||||
|
||||
@@ -9150,7 +9150,7 @@ Solution: Add the missing "else". (Lech Lorens)
|
||||
Files: src/ops.c
|
||||
|
||||
Patch 7.2.293
|
||||
Problem: When setting 'comments' option it may be used in a wrong way.
|
||||
Problem: When setting 'comments' option it may be used in a wrong way.
|
||||
Solution: Don't increment after skipping over digits. (Yukihiro Nakadaira)
|
||||
Files: src/misc1.c
|
||||
|
||||
@@ -10191,32 +10191,32 @@ More information here: |two-engines|
|
||||
Better Python interface *better-python-interface*
|
||||
-----------------------
|
||||
|
||||
Added |python-bindeval| function. Unlike |python-eval| this one returns
|
||||
|python-Dictionary|, |python-List| and |python-Function| objects for
|
||||
dictionaries lists and functions respectively in place of their Python
|
||||
Added |python-bindeval| function. Unlike |python-eval| this one returns
|
||||
|python-Dictionary|, |python-List| and |python-Function| objects for
|
||||
dictionaries lists and functions respectively in place of their Python
|
||||
built-in equivalents (or None if we are talking about function references).
|
||||
For simple types this function returns Python built-in types and not only
|
||||
Python `str()` like |python-eval| does. On Python 3 it will return `bytes()`
|
||||
For simple types this function returns Python built-in types and not only
|
||||
Python `str()` like |python-eval| does. On Python 3 it will return `bytes()`
|
||||
objects in place of `str()` ones avoiding possibility of UnicodeDecodeError.
|
||||
Interface of new objects mimics standard Python `dict()` and `list()`
|
||||
interfaces to some extent. Extent will be improved in the future.
|
||||
|
||||
Added special |python-vars| objects also available for |python-buffer| and
|
||||
Added special |python-vars| objects also available for |python-buffer| and
|
||||
|python-window|. They ease access to Vim script variables from Python.
|
||||
|
||||
Now you no longer need to alter `sys.path` to import your module: special
|
||||
hooks are responsible for importing from {rtp}/python2, {rtp}/python3 and
|
||||
{rtp}/pythonx directories (for Python 2, Python 3 and both respectively).
|
||||
Now you no longer need to alter `sys.path` to import your module: special
|
||||
hooks are responsible for importing from {rtp}/python2, {rtp}/python3 and
|
||||
{rtp}/pythonx directories (for Python 2, Python 3 and both respectively).
|
||||
See |python-special-path|.
|
||||
|
||||
Added possibility to work with |tabpage|s through |python-tabpage| object.
|
||||
|
||||
Added automatic conversion of Vim errors and exceptions to Python
|
||||
Added automatic conversion of Vim errors and exceptions to Python
|
||||
exceptions.
|
||||
|
||||
Changed the behavior of the |python-buffers| object: it now uses buffer numbers
|
||||
as keys in place of the index of the buffer in the internal buffer list.
|
||||
This should not break anything as the only way to get this index was
|
||||
Changed the behavior of the |python-buffers| object: it now uses buffer numbers
|
||||
as keys in place of the index of the buffer in the internal buffer list.
|
||||
This should not break anything as the only way to get this index was
|
||||
iterating over |python-buffers|.
|
||||
|
||||
Added |:pydo| and |:py3do| commands.
|
||||
@@ -10226,7 +10226,7 @@ Added the |pyeval()| and |py3eval()| functions.
|
||||
Now in all places which previously accepted `str()` objects, `str()` and
|
||||
`unicode()` (Python 2) or `bytes()` and `str()` (Python 3) are accepted.
|
||||
|
||||
|python-window| has gained `.col` and `.row` attributes that are currently
|
||||
|python-window| has gained `.col` and `.row` attributes that are currently
|
||||
the only way to get internal window positions.
|
||||
|
||||
Added or fixed support for `dir()` in Vim Python objects.
|
||||
@@ -10235,12 +10235,12 @@ Added or fixed support for `dir()` in Vim Python objects.
|
||||
Changed *changed-7.4*
|
||||
-------
|
||||
|
||||
Old Python versions (≤2.2) are no longer supported. Building with them did
|
||||
Old Python versions (≤2.2) are no longer supported. Building with them did
|
||||
not work anyway.
|
||||
|
||||
Options:
|
||||
Added ability to automatically save the selection into the system
|
||||
clipboard when using non-GUI version of Vim (autoselectplus in
|
||||
Added ability to automatically save the selection into the system
|
||||
clipboard when using non-GUI version of Vim (autoselectplus in
|
||||
'clipboard'). Also added ability to use the system clipboard as
|
||||
default register (previously only primary selection could be used).
|
||||
(Ivan Krasilnikov, Christian Brabandt, Bram Moolenaar)
|
||||
@@ -10255,12 +10255,12 @@ Options:
|
||||
'relativenumber'. (Christian Brabandt)
|
||||
|
||||
Commands:
|
||||
|:diffoff| now saves the local values of some settings and restores
|
||||
them in place of blindly resetting them to the defaults. (Christian
|
||||
|:diffoff| now saves the local values of some settings and restores
|
||||
them in place of blindly resetting them to the defaults. (Christian
|
||||
Brabandt)
|
||||
|
||||
Other:
|
||||
Lua interface now also uses userdata binded to Vim structures. (Taro
|
||||
Lua interface now also uses userdata binded to Vim structures. (Taro
|
||||
Muraoka, Luis Carvalho)
|
||||
|
||||
glob() and autocommand patterns used to work with the undocumented
|
||||
@@ -10285,74 +10285,74 @@ Functions:
|
||||
|
||||
Added |wildmenumode()| function. (Christian Brabandt)
|
||||
|
||||
Debugging functions: |screenattr()|, |screenchar()|, |screencol()|,
|
||||
Debugging functions: |screenattr()|, |screenchar()|, |screencol()|,
|
||||
|screenrow()|. (Simon Ruderich, Bram Moolenaar)
|
||||
|
||||
Added ability to use |Dictionary-function|s for |sort()|ing, via
|
||||
Added ability to use |Dictionary-function|s for |sort()|ing, via
|
||||
optional third argument. (Nikolay Pavlov)
|
||||
|
||||
Added special |expand()| argument that expands to the current line
|
||||
Added special |expand()| argument that expands to the current line
|
||||
number.
|
||||
|
||||
Made it possible to force |char2nr()| to always give unicode codepoints
|
||||
Made it possible to force |char2nr()| to always give unicode codepoints
|
||||
regardless of current encoding. (Yasuhiro Matsumoto)
|
||||
|
||||
Made it possible for functions generating file list generate |List|
|
||||
and not NL-separated string. (e.g. |glob()|, |expand()|) (Christian
|
||||
Made it possible for functions generating file list generate |List|
|
||||
and not NL-separated string. (e.g. |glob()|, |expand()|) (Christian
|
||||
Brabandt)
|
||||
|
||||
Functions that obtain variables from the specific window, tabpage or
|
||||
buffer scope dictionary can now return specified default value in
|
||||
place of empty string in case variable is not found. (|gettabvar()|,
|
||||
Functions that obtain variables from the specific window, tabpage or
|
||||
buffer scope dictionary can now return specified default value in
|
||||
place of empty string in case variable is not found. (|gettabvar()|,
|
||||
|getwinvar()|, |getbufvar()|) (Shougo Matsushita, Hirohito Higashi)
|
||||
|
||||
Autocommands:
|
||||
Added |InsertCharPre| event launched before inserting character.
|
||||
Added |InsertCharPre| event launched before inserting character.
|
||||
(Jakson A. Aquino)
|
||||
|
||||
Added |CompleteDone| event launched after finishing completion in
|
||||
Added |CompleteDone| event launched after finishing completion in
|
||||
insert mode. (idea by Florian Klein)
|
||||
|
||||
Added |QuitPre| event launched when commands that can either close Vim
|
||||
Added |QuitPre| event launched when commands that can either close Vim
|
||||
or only some window(s) are launched.
|
||||
|
||||
Added |TextChanged| and |TextChangedI| events launched when text is
|
||||
Added |TextChanged| and |TextChangedI| events launched when text is
|
||||
changed.
|
||||
|
||||
Commands:
|
||||
|:syntime| command useful for debugging.
|
||||
|
||||
Made it possible to remove all signs from the current buffer using
|
||||
Made it possible to remove all signs from the current buffer using
|
||||
|:sign-unplace|. (Christian Brabandt)
|
||||
|
||||
Added |:language| autocompletion. (Dominique Pelle)
|
||||
|
||||
Added more |:command-complete| completion types: |:behave| suboptions,
|
||||
color schemes, compilers, |:cscope| suboptions, files from 'path',
|
||||
|:history| suboptions, locale names, |:syntime| suboptions, user
|
||||
Added more |:command-complete| completion types: |:behave| suboptions,
|
||||
color schemes, compilers, |:cscope| suboptions, files from 'path',
|
||||
|:history| suboptions, locale names, |:syntime| suboptions, user
|
||||
names. (Dominique Pelle)
|
||||
|
||||
Added |:map-nowait| creating mapping which when having lhs that is the
|
||||
prefix of another mapping’s lhs will not allow Vim to wait for user to
|
||||
type more characters to resolve ambiguity, forcing Vim to take the
|
||||
Added |:map-nowait| creating mapping which when having lhs that is the
|
||||
prefix of another mapping’s lhs will not allow Vim to wait for user to
|
||||
type more characters to resolve ambiguity, forcing Vim to take the
|
||||
shorter alternative: one with <nowait>.
|
||||
|
||||
Options:
|
||||
Made it possible to ignore case when completing: 'wildignorecase'.
|
||||
|
||||
Added ability to delete comment leader when using |J| by `j` flag in
|
||||
Added ability to delete comment leader when using |J| by `j` flag in
|
||||
'formatoptions' (|fo-table|). (Lech Lorens)
|
||||
|
||||
Added ability to control indentation inside namespaces: |cino-N|.
|
||||
Added ability to control indentation inside namespaces: |cino-N|.
|
||||
(Konstantin Lepa)
|
||||
|
||||
Added ability to control alignment inside `if` condition separately
|
||||
Added ability to control alignment inside `if` condition separately
|
||||
from alignment inside function arguments: |cino-k|. (Lech Lorens)
|
||||
|
||||
Other:
|
||||
Improved support for cmd.exe. (Ben Fritz, Bram Moolenaar)
|
||||
|
||||
Added |v:windowid| variable containing current window number in GUI
|
||||
Added |v:windowid| variable containing current window number in GUI
|
||||
Vim. (Christian J. Robinson, Lech Lorens)
|
||||
|
||||
Added rxvt-unicode and SGR mouse support. (Yiding Jia, Hayaki Saito)
|
||||
@@ -11923,7 +11923,7 @@ Solution: Pass the separator character to in_history(). (Taro Muraoka)
|
||||
Files: src/ex_getln.c
|
||||
|
||||
Patch 7.3.266
|
||||
Problem: In Gvim with iBus typing space in Insert mode doesn't work.
|
||||
Problem: In gvim with iBus typing space in Insert mode doesn't work.
|
||||
Solution: Clear xim_expected_char after checking it.
|
||||
Files: src/mbyte.c
|
||||
|
||||
@@ -11938,7 +11938,7 @@ Solution: Use O_NOCTTY both in the master and slave. (Bjorn Winckler)
|
||||
Files: src/os_unix.c
|
||||
|
||||
Patch 7.3.269
|
||||
Problem: 'shellcmdflag' only works with one flag.
|
||||
Problem: 'shellcmdflag' only works with one flag.
|
||||
Solution: Split into multiple arguments. (Gary Johnson)
|
||||
Files: src/os_unix.c
|
||||
|
||||
@@ -13118,7 +13118,7 @@ Files: src/ops.c
|
||||
Patch 7.3.477
|
||||
Problem: Using ":echo" to output enough lines to scroll, then using "j" and
|
||||
"k" at the more prompt, displays the command on top of the output.
|
||||
(Marcin Szamotulski)
|
||||
(Marcin Szamotulski)
|
||||
Solution: Put the output below the command. (Christian Brabandt)
|
||||
Files: src/eval.c
|
||||
|
||||
@@ -13371,7 +13371,7 @@ Solution: Recognize completefunction returning -3. (Matsushita Shougo)
|
||||
Files: src/edit.c
|
||||
|
||||
Patch 7.3.520
|
||||
Problem: Gvim starts up slow on Ubuntu 12.04.
|
||||
Problem: gvim starts up slow on Ubuntu 12.04.
|
||||
Solution: Move the call to gui_mch_init_check() to after fork(). (Yasuhiro
|
||||
Matsumoto) Do check $DISPLAY being set.
|
||||
Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro
|
||||
@@ -13424,7 +13424,7 @@ Solution: Make the count select that many characters or lines. (Christian
|
||||
Files: src/normal.c
|
||||
|
||||
Patch 7.3.530 (after 7.3.520)
|
||||
Problem: Gvim does not work when 'guioptions' includes "f". (Davido)
|
||||
Problem: gvim does not work when 'guioptions' includes "f". (Davido)
|
||||
Solution: Call gui_mch_init_check() when running GUI in the foreground.
|
||||
(Yasuhiro Matsumoto)
|
||||
Files: src/gui.c
|
||||
@@ -14287,7 +14287,7 @@ Files: Filelist
|
||||
Patch 7.3.682 (after 7.3.677)
|
||||
Problem: Compiler complains about incompatible types.
|
||||
Solution: Remove type casts. (hint by Danek Duvall)
|
||||
Files: src/edit.c
|
||||
Files: src/edit.c
|
||||
|
||||
Patch 7.3.683
|
||||
Problem: ":python" may crash when vimbindeval() returns None.
|
||||
@@ -16340,7 +16340,7 @@ Solution: Avoid negative argument to vim_strncpy(). (Narendran
|
||||
Files: src/if_cscope.c
|
||||
|
||||
Patch 7.3.1039
|
||||
Problem: New regexp engine does not support \%23c, \%<23c and the like.
|
||||
Problem: New regexp engine does not support \%23c, \%<23c and the like.
|
||||
Solution: Implement them. (partly by Yasuhiro Matsumoto)
|
||||
Files: src/regexp.h, src/regexp_nfa.c, src/testdir/test64.in,
|
||||
src/testdir/test64.ok
|
||||
@@ -17552,9 +17552,9 @@ Solution: Specify a separate viminfo file.
|
||||
Files: src/testdir/test61.in
|
||||
|
||||
Patch 7.3.1252
|
||||
Problem: Gvim does not find the toolbar bitmap files in ~/vimfiles/bitmaps
|
||||
Problem: gvim does not find the toolbar bitmap files in ~/vimfiles/bitmaps
|
||||
if the corresponding menu command contains additional characters
|
||||
like the shortcut marker '&' or if you use a non-english locale.
|
||||
like the shortcut marker '&' or if you use a non-english locale.
|
||||
Solution: Use menu->en_dname or menu->dname. (Martin Gieseking)
|
||||
Files: src/gui_w32.c
|
||||
|
||||
@@ -18175,7 +18175,7 @@ Files: src/window.c
|
||||
|
||||
Patch 7.4a.045
|
||||
Problem: Configure does not always find the right library for Lua. Missing
|
||||
support for LuaJit.
|
||||
support for LuaJit.
|
||||
Solution: Improve the configure detection of Lua. (Hiroshi Shirosaki)
|
||||
Files: src/Makefile, src/configure.in, src/auto/configure
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2017 Mar 13
|
||||
" Last Change: 2017 Jun 04
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -288,7 +288,8 @@ au BufNewFile,BufRead *.bib setf bib
|
||||
au BufNewFile,BufRead *.bst setf bst
|
||||
|
||||
" BIND configuration
|
||||
au BufNewFile,BufRead named.conf,rndc.conf setf named
|
||||
" sudoedit uses namedXXXX.conf
|
||||
au BufNewFile,BufRead named*.conf,rndc*.conf setf named
|
||||
|
||||
" BIND zone
|
||||
au BufNewFile,BufRead named.root setf bindzone
|
||||
@@ -309,9 +310,10 @@ au BufNewFile,BufRead *.bl setf blank
|
||||
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
|
||||
|
||||
" Bazel (http://bazel.io)
|
||||
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setfiletype bzl
|
||||
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setf bzl
|
||||
if has("fname_case")
|
||||
autocmd BufRead,BufNewFile BUILD setfiletype bzl
|
||||
" There is another check for BUILD further below.
|
||||
autocmd BufRead,BufNewFile BUILD setf bzl
|
||||
endif
|
||||
|
||||
" C or lpc
|
||||
@@ -979,7 +981,7 @@ au BufNewFile,BufRead */etc/initng/*/*.i,*.ii setf initng
|
||||
|
||||
" Innovation Data Processing
|
||||
au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat
|
||||
au BufRead,BufNewFile upstream.log\c,upstream.*.log\c,*.upstream.log\c setf upstreamlog
|
||||
au BufRead,BufNewFile fdrupstream.log,upstream.log\c,upstream.*.log\c,*.upstream.log\c,UPSTREAM-*.log\c setf upstreamlog
|
||||
au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog
|
||||
au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog
|
||||
au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog
|
||||
@@ -1179,14 +1181,21 @@ au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown
|
||||
" Mason
|
||||
au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason
|
||||
|
||||
" Matlab or Objective C
|
||||
" Mathematica, Matlab, Murphi or Objective C
|
||||
au BufNewFile,BufRead *.m call s:FTm()
|
||||
|
||||
func! s:FTm()
|
||||
let n = 1
|
||||
while n < 10
|
||||
let saw_comment = 0 " Whether we've seen a multiline comment leader.
|
||||
while n < 100
|
||||
let line = getline(n)
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)'
|
||||
if line =~ '^\s*/\*'
|
||||
" /* ... */ is a comment in Objective C and Murphi, so we can't conclude
|
||||
" it's either of them yet, but track this as a hint in case we don't see
|
||||
" anything more definitive.
|
||||
let saw_comment = 1
|
||||
endif
|
||||
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)'
|
||||
setf objc
|
||||
return
|
||||
endif
|
||||
@@ -1198,11 +1207,23 @@ func! s:FTm()
|
||||
setf mma
|
||||
return
|
||||
endif
|
||||
if line =~ '^\c\s*\(\(type\|var\)\>\|--\)'
|
||||
setf murphi
|
||||
return
|
||||
endif
|
||||
let n = n + 1
|
||||
endwhile
|
||||
if exists("g:filetype_m")
|
||||
|
||||
if saw_comment
|
||||
" We didn't see anything definitive, but this looks like either Objective C
|
||||
" or Murphi based on the comment leader. Assume the former as it is more
|
||||
" common.
|
||||
setf objc
|
||||
elseif exists("g:filetype_m")
|
||||
" Use user specified default filetype for .m
|
||||
exe "setf " . g:filetype_m
|
||||
else
|
||||
" Default is matlab
|
||||
setf matlab
|
||||
endif
|
||||
endfunc
|
||||
@@ -1417,7 +1438,7 @@ if has("fname_case")
|
||||
else
|
||||
au BufNewFile,BufRead *.pl call s:FTpl()
|
||||
endif
|
||||
au BufNewFile,BufRead *.plx,*.al setf perl
|
||||
au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl
|
||||
au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6
|
||||
|
||||
func! s:FTpl()
|
||||
@@ -1805,6 +1826,9 @@ au BufNewFile,BufRead *.sa setf sather
|
||||
" Scala
|
||||
au BufNewFile,BufRead *.scala setf scala
|
||||
|
||||
" SBT - Scala Build Tool
|
||||
au BufNewFile,BufRead *.sbt setf sbt
|
||||
|
||||
" Scilab
|
||||
au BufNewFile,BufRead *.sci,*.sce setf scilab
|
||||
|
||||
@@ -2131,7 +2155,10 @@ au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
|
||||
au BufNewFile,BufRead sshd_config setf sshdconfig
|
||||
|
||||
" Stata
|
||||
au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata
|
||||
au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata setf stata
|
||||
" Also *.class, but not when it's a Java bytecode file
|
||||
au BufNewFile,BufRead *.class
|
||||
\ if getline(1) !~ "^\xca\xfe\xba\xbe" | setf stata | endif
|
||||
|
||||
" SMCL
|
||||
au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl
|
||||
@@ -2601,6 +2628,11 @@ au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
|
||||
" Bazaar version control
|
||||
au BufNewFile,BufRead bzr_log.* setf bzr
|
||||
|
||||
" Bazel build file
|
||||
if !has("fname_case")
|
||||
au BufNewFile,BufRead BUILD setf bzl
|
||||
endif
|
||||
|
||||
" BIND zone
|
||||
au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
|
||||
|
||||
@@ -2764,12 +2796,12 @@ runtime! ftdetect/*.vim
|
||||
" state.
|
||||
augroup END
|
||||
|
||||
" Generic configuration file (check this last, it's just guessing!)
|
||||
" Generic configuration file. Use FALLBACK, it's just guessing!
|
||||
au filetypedetect BufNewFile,BufRead,StdinReadPost *
|
||||
\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
|
||||
\ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
|
||||
\ || getline(4) =~ '^#' || getline(5) =~ '^#') |
|
||||
\ setf conf |
|
||||
\ setf FALLBACK conf |
|
||||
\ endif
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Hamster Script
|
||||
" Version: 2.0.6.0
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Last Change: 2017 Mar 07
|
||||
" Last Change: 2017 Mar 18
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -14,7 +14,6 @@ let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
set cpo-=C
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< tw< commentstring<"
|
||||
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
|
||||
|
||||
197
runtime/ftplugin/rust.vim
Normal file
197
runtime/ftplugin/rust.vim
Normal file
@@ -0,0 +1,197 @@
|
||||
" Language: Rust
|
||||
" Description: Vim ftplugin for Rust
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Maintainer: Kevin Ballard <kevin@sb.org>
|
||||
" Last Change: June 08, 2016
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
augroup rust.vim
|
||||
autocmd!
|
||||
|
||||
" Variables {{{1
|
||||
|
||||
" The rust source code at present seems to typically omit a leader on /*!
|
||||
" comments, so we'll use that as our default, but make it easy to switch.
|
||||
" This does not affect indentation at all (I tested it with and without
|
||||
" leader), merely whether a leader is inserted by default or not.
|
||||
if exists("g:rust_bang_comment_leader") && g:rust_bang_comment_leader != 0
|
||||
" Why is the `,s0:/*,mb:\ ,ex:*/` there, you ask? I don't understand why,
|
||||
" but without it, */ gets indented one space even if there were no
|
||||
" leaders. I'm fairly sure that's a Vim bug.
|
||||
setlocal comments=s1:/*,mb:*,ex:*/,s0:/*,mb:\ ,ex:*/,:///,://!,://
|
||||
else
|
||||
setlocal comments=s0:/*!,m:\ ,ex:*/,s1:/*,mb:*,ex:*/,:///,://!,://
|
||||
endif
|
||||
setlocal commentstring=//%s
|
||||
setlocal formatoptions-=t formatoptions+=croqnl
|
||||
" j was only added in 7.3.541, so stop complaints about its nonexistence
|
||||
silent! setlocal formatoptions+=j
|
||||
|
||||
" smartindent will be overridden by indentexpr if filetype indent is on, but
|
||||
" otherwise it's better than nothing.
|
||||
setlocal smartindent nocindent
|
||||
|
||||
if !exists("g:rust_recommended_style") || g:rust_recommended_style != 0
|
||||
setlocal tabstop=4 shiftwidth=4 softtabstop=4 expandtab
|
||||
setlocal textwidth=99
|
||||
endif
|
||||
|
||||
" This includeexpr isn't perfect, but it's a good start
|
||||
setlocal includeexpr=substitute(v:fname,'::','/','g')
|
||||
|
||||
setlocal suffixesadd=.rs
|
||||
|
||||
if exists("g:ftplugin_rust_source_path")
|
||||
let &l:path=g:ftplugin_rust_source_path . ',' . &l:path
|
||||
endif
|
||||
|
||||
if exists("g:loaded_delimitMate")
|
||||
if exists("b:delimitMate_excluded_regions")
|
||||
let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
|
||||
endif
|
||||
|
||||
let s:delimitMate_extra_excluded_regions = ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
|
||||
|
||||
" For this buffer, when delimitMate issues the `User delimitMate_map`
|
||||
" event in the autocommand system, add the above-defined extra excluded
|
||||
" regions to delimitMate's state, if they have not already been added.
|
||||
autocmd User <buffer>
|
||||
\ if expand('<afile>') ==# 'delimitMate_map' && match(
|
||||
\ delimitMate#Get("excluded_regions"),
|
||||
\ s:delimitMate_extra_excluded_regions) == -1
|
||||
\| let b:delimitMate_excluded_regions =
|
||||
\ delimitMate#Get("excluded_regions")
|
||||
\ . s:delimitMate_extra_excluded_regions
|
||||
\|endif
|
||||
|
||||
" For this buffer, when delimitMate issues the `User delimitMate_unmap`
|
||||
" event in the autocommand system, delete the above-defined extra excluded
|
||||
" regions from delimitMate's state (the deletion being idempotent and
|
||||
" having no effect if the extra excluded regions are not present in the
|
||||
" targeted part of delimitMate's state).
|
||||
autocmd User <buffer>
|
||||
\ if expand('<afile>') ==# 'delimitMate_unmap'
|
||||
\| let b:delimitMate_excluded_regions = substitute(
|
||||
\ delimitMate#Get("excluded_regions"),
|
||||
\ '\C\V' . s:delimitMate_extra_excluded_regions,
|
||||
\ '', 'g')
|
||||
\|endif
|
||||
endif
|
||||
|
||||
if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
|
||||
let b:rust_set_foldmethod=1
|
||||
setlocal foldmethod=syntax
|
||||
if g:rust_fold == 2
|
||||
setlocal foldlevel<
|
||||
else
|
||||
setlocal foldlevel=99
|
||||
endif
|
||||
endif
|
||||
|
||||
if has('conceal') && exists('g:rust_conceal') && g:rust_conceal != 0
|
||||
let b:rust_set_conceallevel=1
|
||||
setlocal conceallevel=2
|
||||
endif
|
||||
|
||||
" Motion Commands {{{1
|
||||
|
||||
" Bind motion commands to support hanging indents
|
||||
nnoremap <silent> <buffer> [[ :call rust#Jump('n', 'Back')<CR>
|
||||
nnoremap <silent> <buffer> ]] :call rust#Jump('n', 'Forward')<CR>
|
||||
xnoremap <silent> <buffer> [[ :call rust#Jump('v', 'Back')<CR>
|
||||
xnoremap <silent> <buffer> ]] :call rust#Jump('v', 'Forward')<CR>
|
||||
onoremap <silent> <buffer> [[ :call rust#Jump('o', 'Back')<CR>
|
||||
onoremap <silent> <buffer> ]] :call rust#Jump('o', 'Forward')<CR>
|
||||
|
||||
" Commands {{{1
|
||||
|
||||
" See |:RustRun| for docs
|
||||
command! -nargs=* -complete=file -bang -buffer RustRun call rust#Run(<bang>0, <q-args>)
|
||||
|
||||
" See |:RustExpand| for docs
|
||||
command! -nargs=* -complete=customlist,rust#CompleteExpand -bang -buffer RustExpand call rust#Expand(<bang>0, <q-args>)
|
||||
|
||||
" See |:RustEmitIr| for docs
|
||||
command! -nargs=* -buffer RustEmitIr call rust#Emit("llvm-ir", <q-args>)
|
||||
|
||||
" See |:RustEmitAsm| for docs
|
||||
command! -nargs=* -buffer RustEmitAsm call rust#Emit("asm", <q-args>)
|
||||
|
||||
" See |:RustPlay| for docs
|
||||
command! -range=% RustPlay :call rust#Play(<count>, <line1>, <line2>, <f-args>)
|
||||
|
||||
" See |:RustFmt| for docs
|
||||
command! -buffer RustFmt call rustfmt#Format()
|
||||
|
||||
" See |:RustFmtRange| for docs
|
||||
command! -range -buffer RustFmtRange call rustfmt#FormatRange(<line1>, <line2>)
|
||||
|
||||
" Mappings {{{1
|
||||
|
||||
" Bind ⌘R in MacVim to :RustRun
|
||||
nnoremap <silent> <buffer> <D-r> :RustRun<CR>
|
||||
" Bind ⌘⇧R in MacVim to :RustRun! pre-filled with the last args
|
||||
nnoremap <buffer> <D-R> :RustRun! <C-r>=join(b:rust_last_rustc_args)<CR><C-\>erust#AppendCmdLine(' -- ' . join(b:rust_last_args))<CR>
|
||||
|
||||
if !exists("b:rust_last_rustc_args") || !exists("b:rust_last_args")
|
||||
let b:rust_last_rustc_args = []
|
||||
let b:rust_last_args = []
|
||||
endif
|
||||
|
||||
" Cleanup {{{1
|
||||
|
||||
let b:undo_ftplugin = "
|
||||
\ setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<
|
||||
\|setlocal tabstop< shiftwidth< softtabstop< expandtab< textwidth<
|
||||
\|if exists('b:rust_original_delimitMate_excluded_regions')
|
||||
\|let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions
|
||||
\|unlet b:rust_original_delimitMate_excluded_regions
|
||||
\|else
|
||||
\|unlet! b:delimitMate_excluded_regions
|
||||
\|endif
|
||||
\|if exists('b:rust_set_foldmethod')
|
||||
\|setlocal foldmethod< foldlevel<
|
||||
\|unlet b:rust_set_foldmethod
|
||||
\|endif
|
||||
\|if exists('b:rust_set_conceallevel')
|
||||
\|setlocal conceallevel<
|
||||
\|unlet b:rust_set_conceallevel
|
||||
\|endif
|
||||
\|unlet! b:rust_last_rustc_args b:rust_last_args
|
||||
\|delcommand RustRun
|
||||
\|delcommand RustExpand
|
||||
\|delcommand RustEmitIr
|
||||
\|delcommand RustEmitAsm
|
||||
\|delcommand RustPlay
|
||||
\|nunmap <buffer> <D-r>
|
||||
\|nunmap <buffer> <D-R>
|
||||
\|nunmap <buffer> [[
|
||||
\|nunmap <buffer> ]]
|
||||
\|xunmap <buffer> [[
|
||||
\|xunmap <buffer> ]]
|
||||
\|ounmap <buffer> [[
|
||||
\|ounmap <buffer> ]]
|
||||
\|set matchpairs-=<:>
|
||||
\"
|
||||
|
||||
" }}}1
|
||||
|
||||
" Code formatting on save
|
||||
if get(g:, "rustfmt_autosave", 0)
|
||||
autocmd BufWritePre *.rs silent! call rustfmt#Format()
|
||||
endif
|
||||
|
||||
augroup END
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: set noet sw=8 ts=8:
|
||||
15
runtime/ftplugin/sbt.vim
Normal file
15
runtime/ftplugin/sbt.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: sbt
|
||||
" Maintainer: Steven Dobay <stevendobay at protonmail.com>
|
||||
" License: Same as Vim
|
||||
" Last Change: 2017.04.30
|
||||
" ----------------------------------------------------------------------------
|
||||
|
||||
if exists('b:did_ftplugin') || &cp
|
||||
finish
|
||||
endif
|
||||
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
runtime! ftplugin/scala.vim
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Javascript
|
||||
" Maintainer: Chris Paul ( https://github.com/bounceme )
|
||||
" URL: https://github.com/pangloss/vim-javascript
|
||||
" Last Change: December 31, 2016
|
||||
" Last Change: March 21, 2017
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@@ -14,6 +14,10 @@ let b:did_indent = 1
|
||||
setlocal indentexpr=GetJavascriptIndent()
|
||||
setlocal autoindent nolisp nosmartindent
|
||||
setlocal indentkeys+=0],0)
|
||||
" Testable with something like:
|
||||
" vim -eNs "+filetype plugin indent on" "+syntax on" "+set ft=javascript" \
|
||||
" "+norm! gg=G" '+%print' '+:q!' testfile.js \
|
||||
" | diff -uBZ testfile.js -
|
||||
|
||||
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
|
||||
|
||||
@@ -32,10 +36,14 @@ if exists('*shiftwidth')
|
||||
endfunction
|
||||
else
|
||||
function s:sw()
|
||||
return &sw
|
||||
return &l:shiftwidth == 0 ? &l:tabstop : &l:shiftwidth
|
||||
endfunction
|
||||
endif
|
||||
|
||||
" Performance for forwards search(): start search at pos rather than masking
|
||||
" matches before pos.
|
||||
let s:z = has('patch-7.4.984') ? 'z' : ''
|
||||
|
||||
" searchpair() wrapper
|
||||
if has('reltime')
|
||||
function s:GetPair(start,end,flags,skip,time,...)
|
||||
@@ -48,34 +56,41 @@ else
|
||||
endif
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template'
|
||||
let s:syng_str = 'string\|template'
|
||||
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
|
||||
let s:syng_str = 'string\|template\|special'
|
||||
let s:syng_com = 'comment\|doc'
|
||||
" Expression used to check whether we should skip a match with searchpair().
|
||||
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
|
||||
|
||||
function s:parse_cino(f) abort
|
||||
return float2nr(eval(substitute(substitute(join(split(
|
||||
\ matchstr(&cino,'.*'.a:f.'\zs[^,]*'), 's',1), '*'.s:W)
|
||||
\ , '^-\=\zs\*','',''), '^-\=\zs\.','0.','')))
|
||||
endfunction
|
||||
|
||||
function s:skip_func()
|
||||
if !s:free || search('\m`\|\*\/','nW',s:looksyn)
|
||||
let s:free = !eval(s:skip_expr)
|
||||
let s:looksyn = s:free ? line('.') : s:looksyn
|
||||
return !s:free
|
||||
if getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
|
||||
return eval(s:skip_expr)
|
||||
elseif s:checkIn || search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn)
|
||||
let s:checkIn = eval(s:skip_expr)
|
||||
endif
|
||||
let s:looksyn = line('.')
|
||||
return (search('\m\/','nbW',s:looksyn) || search('\m[''"]\|\\$','nW',s:looksyn)) && eval(s:skip_expr)
|
||||
return s:checkIn
|
||||
endfunction
|
||||
|
||||
function s:alternatePair(stop)
|
||||
let pos = getpos('.')[1:2]
|
||||
while search('\m[][(){}]','bW',a:stop)
|
||||
if !s:skip_func()
|
||||
let idx = stridx('])}',s:looking_at())
|
||||
if idx + 1
|
||||
if !s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop)
|
||||
break
|
||||
endif
|
||||
else
|
||||
return
|
||||
let pat = '[][(){};]'
|
||||
while search('\m'.pat,'bW',a:stop)
|
||||
if s:skip_func() | continue | endif
|
||||
let idx = stridx('])};',s:looking_at())
|
||||
if idx is 3 | let pat = '[{}()]' | continue | endif
|
||||
if idx + 1
|
||||
if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
|
||||
break
|
||||
endif
|
||||
else
|
||||
return
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',pos)
|
||||
@@ -100,93 +115,91 @@ function s:token()
|
||||
return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
|
||||
endfunction
|
||||
|
||||
function s:b_token()
|
||||
if s:looking_at() =~ '\k'
|
||||
call search('\m\<','cbW')
|
||||
endif
|
||||
return search('\m\S','bW')
|
||||
endfunction
|
||||
|
||||
function s:previous_token()
|
||||
let l:n = line('.')
|
||||
while s:b_token()
|
||||
if (s:looking_at() == '/' || line('.') != l:n && search('\m\/\/','nbW',
|
||||
\ line('.'))) && s:syn_at(line('.'),col('.')) =~? s:syng_com
|
||||
call search('\m\_[^/]\zs\/[/*]','bW')
|
||||
let l:pos = getpos('.')[1:2]
|
||||
if search('\m\k\{1,}\zs\k\|\S','bW')
|
||||
if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:pos[0] &&
|
||||
\ getline('.') =~ '\%<'.col('.').'c\/\/') && s:syn_at(line('.'),col('.')) =~? s:syng_com
|
||||
while search('\m\S\ze\_s*\/[/*]','bW')
|
||||
if s:syn_at(line('.'),col('.')) !~? s:syng_com
|
||||
return s:token()
|
||||
endif
|
||||
endwhile
|
||||
else
|
||||
return s:token()
|
||||
endif
|
||||
endwhile
|
||||
endif
|
||||
call call('cursor',l:pos)
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function s:others(p)
|
||||
return "((line2byte(line('.')) + col('.')) <= ".(line2byte(a:p[0]) + a:p[1]).") || ".s:skip_expr
|
||||
endfunction
|
||||
|
||||
function s:tern_skip(p)
|
||||
return s:GetPair('{','}','nbW',s:others(a:p),200,a:p[0]) > 0
|
||||
endfunction
|
||||
|
||||
function s:tern_col(p)
|
||||
return s:GetPair('?',':\@<!::\@!','nbW',s:others(a:p)
|
||||
\ .' || s:tern_skip('.string(a:p).')',200,a:p[0]) > 0
|
||||
endfunction
|
||||
|
||||
function s:label_col()
|
||||
let pos = getpos('.')[1:2]
|
||||
let [s:looksyn,s:free] = pos
|
||||
call s:alternatePair(0)
|
||||
if s:save_pos('s:IsBlock')
|
||||
let poss = getpos('.')[1:2]
|
||||
return call('cursor',pos) || !s:tern_col(poss)
|
||||
elseif s:looking_at() == ':'
|
||||
return !s:tern_col([0,0])
|
||||
function s:expr_col()
|
||||
if getline('.')[col('.')-2] == ':'
|
||||
return 1
|
||||
endif
|
||||
let bal = 0
|
||||
while search('\m[{}?:;]','bW')
|
||||
if eval(s:skip_expr) | continue | endif
|
||||
" switch (looking_at())
|
||||
exe { '}': "if s:GetPair('{','}','bW',s:skip_expr,200) <= 0 | return | endif",
|
||||
\ ';': "return",
|
||||
\ '{': "return getpos('.')[1:2] != b:js_cache[1:] && !s:IsBlock()",
|
||||
\ ':': "let bal -= getline('.')[max([col('.')-2,0]):col('.')] !~ '::'",
|
||||
\ '?': "let bal += 1 | if bal > 0 | return 1 | endif" }[s:looking_at()]
|
||||
endwhile
|
||||
endfunction
|
||||
|
||||
" configurable regexes that define continuation lines, not including (, {, or [.
|
||||
let s:opfirst = '^' . get(g:,'javascript_opfirst',
|
||||
\ '\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
|
||||
\ '\C\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
|
||||
let s:continuation = get(g:,'javascript_continuation',
|
||||
\ '\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|delete\|void\|in\|instanceof\)\)') . '$'
|
||||
\ '\C\%([-+<>=,.~!?/*^%|&:]\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
|
||||
|
||||
function s:continues(ln,con)
|
||||
return !cursor(a:ln, match(' '.a:con,s:continuation)) &&
|
||||
\ eval((['s:syn_at(line("."),col(".")) !~? "regex"'] +
|
||||
\ repeat(['s:previous_token() != "."'],5) + [1])[
|
||||
\ index(split('/ typeof in instanceof void delete'),s:token())])
|
||||
if !cursor(a:ln, match(' '.a:con,s:continuation))
|
||||
let teol = s:looking_at()
|
||||
if teol == '/'
|
||||
return s:syn_at(line('.'),col('.')) !~? 'regex'
|
||||
elseif teol =~ '[-+>]'
|
||||
return getline('.')[col('.')-2] != tr(teol,'>','=')
|
||||
elseif teol =~ '\l'
|
||||
return s:previous_token() != '.'
|
||||
elseif teol == ':'
|
||||
return s:expr_col()
|
||||
endif
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" get the line of code stripped of comments and move cursor to the last
|
||||
" non-comment char.
|
||||
function s:Trim(ln)
|
||||
let pline = substitute(getline(a:ln),'\s*$','','')
|
||||
let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0])
|
||||
while l:max && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
|
||||
let pline = substitute(strpart(pline, 0, l:max),'\s*$','','')
|
||||
let l:max = max([match(pline,'.*[^/]\zs\/[/*]'),0])
|
||||
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
|
||||
while l:max != -1 && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
|
||||
let pline = pline[: l:max]
|
||||
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
|
||||
let pline = substitute(pline[:-2],'\s*$','','')
|
||||
endwhile
|
||||
return cursor(a:ln,strlen(pline)) ? pline : pline
|
||||
return pline is '' || cursor(a:ln,strlen(pline)) ? pline : pline
|
||||
endfunction
|
||||
|
||||
" Find line above 'lnum' that isn't empty or in a comment
|
||||
function s:PrevCodeLine(lnum)
|
||||
let l:n = prevnonblank(a:lnum)
|
||||
let [l:pos, l:n] = [getpos('.')[1:2], prevnonblank(a:lnum)]
|
||||
while l:n
|
||||
if getline(l:n) =~ '^\s*\/[/*]'
|
||||
if (stridx(getline(l:n),'`') > 0 || getline(l:n-1)[-1:] == '\') &&
|
||||
\ s:syn_at(l:n,1) =~? s:syng_str
|
||||
return l:n
|
||||
endif
|
||||
let l:n = prevnonblank(l:n-1)
|
||||
elseif s:syn_at(l:n,1) =~? s:syng_com
|
||||
let l:n = s:save_pos('eval',
|
||||
\ 'cursor('.l:n.',1) + search(''\m\/\*'',"bW")')
|
||||
elseif stridx(getline(l:n), '*/') + 1 && s:syn_at(l:n,1) =~? s:syng_com
|
||||
call cursor(l:n,1)
|
||||
keepjumps norm! [*
|
||||
let l:n = search('\m\S','nbW')
|
||||
else
|
||||
return l:n
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',l:pos)
|
||||
return l:n
|
||||
endfunction
|
||||
|
||||
" Check if line 'lnum' has a balanced amount of parentheses.
|
||||
@@ -201,7 +214,9 @@ function s:Balanced(lnum)
|
||||
return
|
||||
endif
|
||||
endif
|
||||
let pos = match(l:line, '[][(){}]', pos + 1)
|
||||
let pos = match(l:line, (l:open ?
|
||||
\ '['.escape(tr(l:line[pos],'({[]})',')}][{(').l:line[pos],']').']' :
|
||||
\ '[][(){}]'), pos + 1)
|
||||
endwhile
|
||||
return !l:open
|
||||
endfunction
|
||||
@@ -210,11 +225,11 @@ function s:OneScope(lnum)
|
||||
let pline = s:Trim(a:lnum)
|
||||
let kw = 'else do'
|
||||
if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
|
||||
call s:previous_token()
|
||||
let kw = 'for if let while with'
|
||||
if index(split('await each'),s:token()) + 1
|
||||
if s:previous_token() =~# '^\%(await\|each\)$'
|
||||
call s:previous_token()
|
||||
let kw = 'for'
|
||||
else
|
||||
let kw = 'for if let while with'
|
||||
endif
|
||||
endif
|
||||
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
|
||||
@@ -246,18 +261,23 @@ function s:IsBlock()
|
||||
if s:looking_at() == '{'
|
||||
let l:n = line('.')
|
||||
let char = s:previous_token()
|
||||
let syn = char =~ '[{>/]' ? s:syn_at(line('.'),col('.')-(char == '{')) : ''
|
||||
if syn =~? 'xml\|jsx'
|
||||
if match(s:stack,'\cxml\|jsx') + 1 && s:syn_at(line('.'),col('.')-1) =~? 'xml\|jsx'
|
||||
return char != '{'
|
||||
elseif char =~ '\k'
|
||||
return index(split('return const let import export yield default delete var await void typeof throw case new in instanceof')
|
||||
\ ,char) < (line('.') != l:n) || s:previous_token() == '.'
|
||||
if char ==# 'type'
|
||||
return s:previous_token() !~# '^\%(im\|ex\)port$'
|
||||
endif
|
||||
return index(split('return const let import export extends yield default delete var await void typeof throw case new of in instanceof')
|
||||
\ ,char) < (line('.') != l:n) || s:save_pos('s:previous_token') == '.'
|
||||
elseif char == '>'
|
||||
return getline('.')[col('.')-2] == '=' || syn =~? '^jsflow'
|
||||
return getline('.')[col('.')-2] == '=' || s:syn_at(line('.'),col('.')) =~? '^jsflow'
|
||||
elseif char == ':'
|
||||
return getline('.')[col('.')-2] != ':' && s:label_col()
|
||||
return !s:save_pos('s:expr_col')
|
||||
elseif char == '/'
|
||||
return s:syn_at(line('.'),col('.')) =~? 'regex'
|
||||
endif
|
||||
return syn =~? 'regex' || char !~ '[-=~!<*+,/?^%|&([]'
|
||||
return char !~ '[=~!<*,?^%|&([]' &&
|
||||
\ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
@@ -266,7 +286,9 @@ function GetJavascriptIndent()
|
||||
" Get the current line.
|
||||
call cursor(v:lnum,1)
|
||||
let l:line = getline('.')
|
||||
let syns = s:syn_at(v:lnum, 1)
|
||||
" use synstack as it validates syn state and works in an empty line
|
||||
let s:stack = map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
|
||||
let syns = get(s:stack,-1,'')
|
||||
|
||||
" start with strings,comments,etc.
|
||||
if syns =~? s:syng_com
|
||||
@@ -275,7 +297,7 @@ function GetJavascriptIndent()
|
||||
elseif l:line !~ '^\s*\/[/*]'
|
||||
return -1
|
||||
endif
|
||||
elseif syns =~? s:syng_str && l:line !~ '^[''"]'
|
||||
elseif syns =~? s:syng_str
|
||||
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
|
||||
let b:js_cache[0] = v:lnum
|
||||
endif
|
||||
@@ -295,69 +317,60 @@ function GetJavascriptIndent()
|
||||
endif
|
||||
|
||||
" the containing paren, bracket, or curly. Many hacks for performance
|
||||
let idx = strlen(l:line) ? stridx('])}',l:line[0]) : -1
|
||||
let idx = index([']',')','}'],l:line[0])
|
||||
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
|
||||
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
|
||||
call call('cursor',b:js_cache[1:])
|
||||
else
|
||||
let [s:looksyn, s:free, top] = [v:lnum - 1, 1, (!indent(l:lnum) &&
|
||||
let [s:looksyn, s:checkIn, top] = [v:lnum - 1, 0, (!indent(l:lnum) &&
|
||||
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
|
||||
if idx + 1
|
||||
call s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,top)
|
||||
elseif indent(v:lnum) && syns =~? 'block'
|
||||
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:skip_func()',2000,top)
|
||||
elseif getline(v:lnum) !~ '^\S' && syns =~? 'block'
|
||||
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
|
||||
else
|
||||
call s:alternatePair(top)
|
||||
endif
|
||||
endif
|
||||
|
||||
if idx + 1 || l:line[:1] == '|}'
|
||||
if idx == 2 && search('\m\S','bW',line('.')) && s:looking_at() == ')'
|
||||
call s:GetPair('(',')','bW',s:skip_expr,200)
|
||||
endif
|
||||
return indent('.')
|
||||
endif
|
||||
|
||||
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
|
||||
let num = b:js_cache[1]
|
||||
|
||||
let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
|
||||
if !num || s:IsBlock()
|
||||
let ilnum = line('.')
|
||||
let pline = s:save_pos('s:Trim',l:lnum)
|
||||
if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
|
||||
let num = line('.')
|
||||
if s:previous_token() ==# 'switch' && s:previous_token() != '.'
|
||||
if &cino !~ ':' || !has('float')
|
||||
let num = ilnum == num ? line('.') : num
|
||||
if idx < 0 && s:previous_token() ==# 'switch' && s:previous_token() != '.'
|
||||
if &cino !~ ':'
|
||||
let switch_offset = s:W
|
||||
else
|
||||
let cinc = matchlist(&cino,'.*:\(-\)\=\([0-9.]*\)\(s\)\=\C')
|
||||
let switch_offset = float2nr(str2float(cinc[1].(strlen(cinc[2]) ? cinc[2] : strlen(cinc[3])))
|
||||
\ * (strlen(cinc[3]) ? s:W : 1))
|
||||
let switch_offset = max([-indent(num),s:parse_cino(':')])
|
||||
endif
|
||||
if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
|
||||
return indent(num) + switch_offset
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
if pline[-1:] !~ '[{;]'
|
||||
if pline =~# ':\@<!:$'
|
||||
call cursor(l:lnum,strlen(pline))
|
||||
let isOp = s:tern_col(b:js_cache[1:2])
|
||||
else
|
||||
let isOp = l:line =~# s:opfirst || s:continues(l:lnum,pline)
|
||||
endif
|
||||
let bL = s:iscontOne(l:lnum,num,isOp)
|
||||
if idx < 0 && pline[-1:] !~ '[{;]'
|
||||
let isOp = (l:line =~# s:opfirst || s:continues(l:lnum,pline)) * s:W
|
||||
let bL = s:iscontOne(l:lnum,b:js_cache[1],isOp)
|
||||
let bL -= (bL && l:line[0] == '{') * s:W
|
||||
endif
|
||||
elseif idx < 0 && getline(b:js_cache[1])[b:js_cache[2]-1] == '(' && &cino =~ '('
|
||||
let pval = s:parse_cino('(')
|
||||
return !pval ? (s:parse_cino('w') ? 0 : -(!!search('\m\S','W'.s:z,num))) + virtcol('.') :
|
||||
\ max([indent('.') + pval + (s:GetPair('(',')','nbrmW',s:skip_expr,100,num) * s:W),0])
|
||||
endif
|
||||
|
||||
" main return
|
||||
if isOp
|
||||
return (num ? indent(num) : -s:W) + (s:W * 2) + switch_offset + bL
|
||||
if l:line =~ '^\%([])}]\||}\)'
|
||||
return max([indent(num),0])
|
||||
elseif num
|
||||
return indent(num) + s:W + switch_offset + bL
|
||||
return indent(num) + s:W + switch_offset + bL + isOp
|
||||
endif
|
||||
return bL
|
||||
return bL + isOp
|
||||
endfunction
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
|
||||
" URL: http://www.2072productions.com/vim/indent/php.vim
|
||||
" Home: https://github.com/2072/PHP-Indenting-for-VIm
|
||||
" Last Change: 2015 September 8th
|
||||
" Version: 1.60
|
||||
" Last Change: 2017 March 12th
|
||||
" Version: 1.62
|
||||
"
|
||||
"
|
||||
" Type :help php-indent for available options
|
||||
@@ -141,11 +141,13 @@ let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
|
||||
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
|
||||
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
|
||||
let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
|
||||
let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
|
||||
let s:endline = '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
|
||||
let s:unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.s:endline
|
||||
|
||||
|
||||
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
|
||||
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)'
|
||||
let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
|
||||
let s:structureHead = '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline . '\|\<new\s\+class\>'
|
||||
|
||||
|
||||
|
||||
@@ -214,10 +216,28 @@ function! GetLastRealCodeLNum(startline) " {{{
|
||||
let lnum = lnum - 1
|
||||
endwhile
|
||||
elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline
|
||||
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$', '')
|
||||
while getline(lnum) !~? tofind && lnum > 1
|
||||
let lnum = lnum - 1
|
||||
|
||||
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$\\|^[^\1]\\+[=([]\\s*[\1]', '')
|
||||
let trylnum = lnum
|
||||
while getline(trylnum) !~? tofind && trylnum > 1
|
||||
let trylnum = trylnum - 1
|
||||
endwhile
|
||||
|
||||
if trylnum == 1
|
||||
break
|
||||
else
|
||||
if lastline =~ ';'.s:endline
|
||||
while getline(trylnum) !~? s:terminated && getline(trylnum) !~? '{'.s:endline && trylnum > 1
|
||||
let trylnum = prevnonblank(trylnum - 1)
|
||||
endwhile
|
||||
|
||||
|
||||
if trylnum == 1
|
||||
break
|
||||
end
|
||||
end
|
||||
let lnum = trylnum
|
||||
end
|
||||
else
|
||||
break
|
||||
endif
|
||||
@@ -262,7 +282,7 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
|
||||
while line > 1
|
||||
let linec = getline(line)
|
||||
|
||||
if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
|
||||
if linec =~ s:terminated || linec =~ s:structureHead
|
||||
break
|
||||
endif
|
||||
|
||||
@@ -273,6 +293,20 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
|
||||
return line
|
||||
endfun " }}}
|
||||
|
||||
let s:blockChars = {'{':1, '[': 1, '(': 1, ')':-1, ']':-1, '}':-1}
|
||||
function! BalanceDirection (str)
|
||||
|
||||
let balance = 0
|
||||
|
||||
for c in split(a:str, '\zs')
|
||||
if has_key(s:blockChars, c)
|
||||
let balance += s:blockChars[c]
|
||||
endif
|
||||
endfor
|
||||
|
||||
return balance
|
||||
endfun
|
||||
|
||||
function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{
|
||||
|
||||
if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>'
|
||||
@@ -457,7 +491,7 @@ function! GetPhpIndent()
|
||||
|
||||
if synname!=""
|
||||
if synname == "SpecStringEntrails"
|
||||
let b:InPHPcode = -1
|
||||
let b:InPHPcode = -1 " thumb down
|
||||
let b:InPHPcode_tofind = ""
|
||||
elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
|
||||
let b:InPHPcode = 1
|
||||
@@ -540,7 +574,7 @@ function! GetPhpIndent()
|
||||
let b:InPHPcode_and_script = 1
|
||||
endif
|
||||
|
||||
elseif last_line =~ '^[^''"`]\+[''"`]$'
|
||||
elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
|
||||
let b:InPHPcode = -1
|
||||
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
|
||||
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
|
||||
@@ -660,7 +694,8 @@ function! GetPhpIndent()
|
||||
|
||||
let terminated = s:terminated
|
||||
|
||||
let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline
|
||||
let unstated = s:unstated
|
||||
|
||||
|
||||
if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>'
|
||||
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
|
||||
@@ -673,7 +708,7 @@ function! GetPhpIndent()
|
||||
|
||||
while last_line_num > 1
|
||||
|
||||
if previous_line =~ terminated || previous_line =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . endline
|
||||
if previous_line =~ terminated || previous_line =~ s:structureHead
|
||||
|
||||
let ind = indent(last_line_num)
|
||||
|
||||
@@ -689,7 +724,7 @@ function! GetPhpIndent()
|
||||
endwhile
|
||||
|
||||
elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
|
||||
let ind = ind + s:sw()
|
||||
let ind = ind + s:sw() " we indent one level further when the preceding line is not stated
|
||||
return ind + addSpecial
|
||||
|
||||
elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
|
||||
@@ -699,7 +734,7 @@ function! GetPhpIndent()
|
||||
|
||||
let isSingleLineBlock = 0
|
||||
while 1
|
||||
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline
|
||||
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX
|
||||
|
||||
call cursor(last_line_num, 1)
|
||||
if previous_line !~ '^}'
|
||||
@@ -780,10 +815,10 @@ function! GetPhpIndent()
|
||||
if !LastLineClosed
|
||||
|
||||
|
||||
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline
|
||||
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline && BalanceDirection(last_line) > 0
|
||||
|
||||
let dontIndent = 0
|
||||
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
|
||||
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*[)\]]\+\s*{'.endline && last_line !~ s:structureHead
|
||||
let dontIndent = 1
|
||||
endif
|
||||
|
||||
@@ -797,9 +832,9 @@ function! GetPhpIndent()
|
||||
return ind + addSpecial
|
||||
endif
|
||||
|
||||
elseif last_line =~ '\S\+\s*),'.endline
|
||||
elseif last_line =~ '\S\+\s*),'.endline && BalanceDirection(last_line) < 0
|
||||
call cursor(lnum, 1)
|
||||
call search('),'.endline, 'W')
|
||||
call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag
|
||||
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
|
||||
if openedparent != lnum
|
||||
let ind = indent(openedparent)
|
||||
@@ -809,7 +844,7 @@ function! GetPhpIndent()
|
||||
let ind = ind + s:sw()
|
||||
|
||||
|
||||
elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
|
||||
elseif AntepenultimateLine =~ '{'.endline && AntepenultimateLine !~? '^\s*use\>' || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
|
||||
let ind = ind + s:sw()
|
||||
endif
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ function GetRIndent()
|
||||
let nlnum = s:Get_prev_line(nlnum)
|
||||
let nline = SanitizeRLine(getline(nlnum)) . nline
|
||||
endwhile
|
||||
if nline =~ '^\s*function\s*(' && indent(nlnum) == &sw
|
||||
if nline =~ '^\s*function\s*(' && indent(nlnum) == shiftwidth()
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
@@ -285,7 +285,7 @@ function GetRIndent()
|
||||
|
||||
" line is an incomplete command:
|
||||
if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\<else$' || line =~ '<-$' || line =~ '->$'
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
|
||||
" Deal with () and []
|
||||
@@ -293,14 +293,14 @@ function GetRIndent()
|
||||
let pb = s:Get_paren_balance(line, '(', ')')
|
||||
|
||||
if line =~ '^\s*{$' || line =~ '(\s*{' || (pb == 0 && (line =~ '{$' || line =~ '(\s*{$'))
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
|
||||
let s:curtabstop = repeat(' ', &tabstop)
|
||||
|
||||
if g:r_indent_align_args == 1
|
||||
if pb > 0 && line =~ '{$'
|
||||
return s:Get_last_paren_idx(line, '(', ')', pb) + &sw
|
||||
return s:Get_last_paren_idx(line, '(', ')', pb) + shiftwidth()
|
||||
endif
|
||||
|
||||
let bb = s:Get_paren_balance(line, '[', ']')
|
||||
@@ -364,11 +364,11 @@ function GetRIndent()
|
||||
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
|
||||
return indent(lnum)
|
||||
else
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
else
|
||||
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
|
||||
return indent(lnum) - &sw
|
||||
return indent(lnum) - shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -383,7 +383,7 @@ function GetRIndent()
|
||||
let line = linepiece . line
|
||||
endwhile
|
||||
if line =~ '{$' && post_block == 0
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
|
||||
" Now we can do some tests again
|
||||
@@ -393,19 +393,19 @@ function GetRIndent()
|
||||
if post_block == 0
|
||||
let newl = SanitizeRLine(line)
|
||||
if newl =~ '\<\(if\|while\|for\|function\)\s*()$' || newl =~ '\<else$' || newl =~ '<-$'
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if cline =~ '^\s*else'
|
||||
if line =~ '<-\s*if\s*()'
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
else
|
||||
if line =~ '\<if\s*()'
|
||||
return indent(lnum)
|
||||
else
|
||||
return indent(lnum) - &sw
|
||||
return indent(lnum) - shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -474,12 +474,12 @@ function GetRIndent()
|
||||
let ind = indent(lnum)
|
||||
|
||||
if g:r_indent_align_args == 0 && pb != 0
|
||||
let ind += pb * &sw
|
||||
let ind += pb * shiftwidth()
|
||||
return ind
|
||||
endif
|
||||
|
||||
if g:r_indent_align_args == 0 && bb != 0
|
||||
let ind += bb * &sw
|
||||
let ind += bb * shiftwidth()
|
||||
return ind
|
||||
endif
|
||||
|
||||
@@ -489,7 +489,7 @@ function GetRIndent()
|
||||
let pind = 0
|
||||
endif
|
||||
|
||||
if ind == pind || (ind == (pind + &sw) && pline =~ '{$' && ppost_else == 0)
|
||||
if ind == pind || (ind == (pind + shiftwidth()) && pline =~ '{$' && ppost_else == 0)
|
||||
return ind
|
||||
endif
|
||||
|
||||
@@ -509,7 +509,7 @@ function GetRIndent()
|
||||
let pbb = s:Get_paren_balance(pline, '[', ']')
|
||||
endwhile
|
||||
let pind = indent(plnum)
|
||||
if ind == (pind + &sw) && pline =~ '{$'
|
||||
if ind == (pind + shiftwidth()) && pline =~ '{$'
|
||||
return ind
|
||||
endif
|
||||
endwhile
|
||||
|
||||
@@ -82,7 +82,7 @@ function GetRHelpIndent()
|
||||
let closeb = strlen(line2) - strlen(line3)
|
||||
let bb = openb - closeb
|
||||
|
||||
let ind = indent(lnum) + (bb * &sw)
|
||||
let ind = indent(lnum) + (bb * shiftwidth())
|
||||
|
||||
if line =~ '^\s*}\s*$'
|
||||
let ind = indent(lnum)
|
||||
|
||||
213
runtime/indent/rust.vim
Normal file
213
runtime/indent/rust.vim
Normal file
@@ -0,0 +1,213 @@
|
||||
" Vim indent file
|
||||
" Language: Rust
|
||||
" Author: Chris Morgan <me@chrismorgan.info>
|
||||
" Last Change: 2017 Mar 21
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal cindent
|
||||
setlocal cinoptions=L0,(0,Ws,J1,j1
|
||||
setlocal cinkeys=0{,0},!^F,o,O,0[,0]
|
||||
" Don't think cinwords will actually do anything at all... never mind
|
||||
setlocal cinwords=for,if,else,while,loop,impl,mod,unsafe,trait,struct,enum,fn,extern
|
||||
|
||||
" Some preliminary settings
|
||||
setlocal nolisp " Make sure lisp indenting doesn't supersede us
|
||||
setlocal autoindent " indentexpr isn't much help otherwise
|
||||
" Also do indentkeys, otherwise # gets shoved to column 0 :-/
|
||||
setlocal indentkeys=0{,0},!^F,o,O,0[,0]
|
||||
|
||||
setlocal indentexpr=GetRustIndent(v:lnum)
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetRustIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Come here when loading the script the first time.
|
||||
|
||||
function! s:get_line_trimmed(lnum)
|
||||
" Get the line and remove a trailing comment.
|
||||
" Use syntax highlighting attributes when possible.
|
||||
" NOTE: this is not accurate; /* */ or a line continuation could trick it
|
||||
let line = getline(a:lnum)
|
||||
let line_len = strlen(line)
|
||||
if has('syntax_items')
|
||||
" If the last character in the line is a comment, do a binary search for
|
||||
" the start of the comment. synID() is slow, a linear search would take
|
||||
" too long on a long line.
|
||||
if synIDattr(synID(a:lnum, line_len, 1), "name") =~ 'Comment\|Todo'
|
||||
let min = 1
|
||||
let max = line_len
|
||||
while min < max
|
||||
let col = (min + max) / 2
|
||||
if synIDattr(synID(a:lnum, col, 1), "name") =~ 'Comment\|Todo'
|
||||
let max = col
|
||||
else
|
||||
let min = col + 1
|
||||
endif
|
||||
endwhile
|
||||
let line = strpart(line, 0, min - 1)
|
||||
endif
|
||||
return substitute(line, "\s*$", "", "")
|
||||
else
|
||||
" Sorry, this is not complete, nor fully correct (e.g. string "//").
|
||||
" Such is life.
|
||||
return substitute(line, "\s*//.*$", "", "")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:is_string_comment(lnum, col)
|
||||
if has('syntax_items')
|
||||
for id in synstack(a:lnum, a:col)
|
||||
let synname = synIDattr(id, "name")
|
||||
if synname == "rustString" || synname =~ "^rustComment"
|
||||
return 1
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
" without syntax, let's not even try
|
||||
return 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function GetRustIndent(lnum)
|
||||
|
||||
" Starting assumption: cindent (called at the end) will do it right
|
||||
" normally. We just want to fix up a few cases.
|
||||
|
||||
let line = getline(a:lnum)
|
||||
|
||||
if has('syntax_items')
|
||||
let synname = synIDattr(synID(a:lnum, 1, 1), "name")
|
||||
if synname == "rustString"
|
||||
" If the start of the line is in a string, don't change the indent
|
||||
return -1
|
||||
elseif synname =~ '\(Comment\|Todo\)'
|
||||
\ && line !~ '^\s*/\*' " not /* opening line
|
||||
if synname =~ "CommentML" " multi-line
|
||||
if line !~ '^\s*\*' && getline(a:lnum - 1) =~ '^\s*/\*'
|
||||
" This is (hopefully) the line after a /*, and it has no
|
||||
" leader, so the correct indentation is that of the
|
||||
" previous line.
|
||||
return GetRustIndent(a:lnum - 1)
|
||||
endif
|
||||
endif
|
||||
" If it's in a comment, let cindent take care of it now. This is
|
||||
" for cases like "/*" where the next line should start " * ", not
|
||||
" "* " as the code below would otherwise cause for module scope
|
||||
" Fun fact: " /*\n*\n*/" takes two calls to get right!
|
||||
return cindent(a:lnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
" cindent gets second and subsequent match patterns/struct members wrong,
|
||||
" as it treats the comma as indicating an unfinished statement::
|
||||
"
|
||||
" match a {
|
||||
" b => c,
|
||||
" d => e,
|
||||
" f => g,
|
||||
" };
|
||||
|
||||
" Search backwards for the previous non-empty line.
|
||||
let prevlinenum = prevnonblank(a:lnum - 1)
|
||||
let prevline = s:get_line_trimmed(prevlinenum)
|
||||
while prevlinenum > 1 && prevline !~ '[^[:blank:]]'
|
||||
let prevlinenum = prevnonblank(prevlinenum - 1)
|
||||
let prevline = s:get_line_trimmed(prevlinenum)
|
||||
endwhile
|
||||
|
||||
" Handle where clauses nicely: subsequent values should line up nicely.
|
||||
if prevline[len(prevline) - 1] == ","
|
||||
\ && prevline =~# '^\s*where\s'
|
||||
return indent(prevlinenum) + 6
|
||||
endif
|
||||
|
||||
if prevline[len(prevline) - 1] == ","
|
||||
\ && s:get_line_trimmed(a:lnum) !~ '^\s*[\[\]{}]'
|
||||
\ && prevline !~ '^\s*fn\s'
|
||||
\ && prevline !~ '([^()]\+,$'
|
||||
\ && s:get_line_trimmed(a:lnum) !~ '^\s*\S\+\s*=>'
|
||||
" Oh ho! The previous line ended in a comma! I bet cindent will try to
|
||||
" take this too far... For now, let's normally use the previous line's
|
||||
" indent.
|
||||
|
||||
" One case where this doesn't work out is where *this* line contains
|
||||
" square or curly brackets; then we normally *do* want to be indenting
|
||||
" further.
|
||||
"
|
||||
" Another case where we don't want to is one like a function
|
||||
" definition with arguments spread over multiple lines:
|
||||
"
|
||||
" fn foo(baz: Baz,
|
||||
" baz: Baz) // <-- cindent gets this right by itself
|
||||
"
|
||||
" Another case is similar to the previous, except calling a function
|
||||
" instead of defining it, or any conditional expression that leaves
|
||||
" an open paren:
|
||||
"
|
||||
" foo(baz,
|
||||
" baz);
|
||||
"
|
||||
" if baz && (foo ||
|
||||
" bar) {
|
||||
"
|
||||
" Another case is when the current line is a new match arm.
|
||||
"
|
||||
" There are probably other cases where we don't want to do this as
|
||||
" well. Add them as needed.
|
||||
return indent(prevlinenum)
|
||||
endif
|
||||
|
||||
if !has("patch-7.4.355")
|
||||
" cindent before 7.4.355 doesn't do the module scope well at all; e.g.::
|
||||
"
|
||||
" static FOO : &'static [bool] = [
|
||||
" true,
|
||||
" false,
|
||||
" false,
|
||||
" true,
|
||||
" ];
|
||||
"
|
||||
" uh oh, next statement is indented further!
|
||||
|
||||
" Note that this does *not* apply the line continuation pattern properly;
|
||||
" that's too hard to do correctly for my liking at present, so I'll just
|
||||
" start with these two main cases (square brackets and not returning to
|
||||
" column zero)
|
||||
|
||||
call cursor(a:lnum, 1)
|
||||
if searchpair('{\|(', '', '}\|)', 'nbW',
|
||||
\ 's:is_string_comment(line("."), col("."))') == 0
|
||||
if searchpair('\[', '', '\]', 'nbW',
|
||||
\ 's:is_string_comment(line("."), col("."))') == 0
|
||||
" Global scope, should be zero
|
||||
return 0
|
||||
else
|
||||
" At the module scope, inside square brackets only
|
||||
"if getline(a:lnum)[0] == ']' || search('\[', '', '\]', 'nW') == a:lnum
|
||||
if line =~ "^\\s*]"
|
||||
" It's the closing line, dedent it
|
||||
return 0
|
||||
else
|
||||
return &shiftwidth
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" Fall back on cindent, which does it mostly right
|
||||
return cindent(a:lnum)
|
||||
endfunction
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
@@ -3,10 +3,12 @@
|
||||
" Maintainer: Christian Brabandt <cb@256bit.org>
|
||||
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
|
||||
" Original Author: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2016-06-27
|
||||
" Latest Revision: 2017-05-02
|
||||
" License: Vim (see :h license)
|
||||
" Repository: https://github.com/chrisbra/vim-sh-indent
|
||||
" Changelog:
|
||||
" 20170502: - get rid of buffer-shiftwidth function
|
||||
" 20160912: - preserve indentation of here-doc blocks
|
||||
" 20160627: - detect heredocs correctly
|
||||
" 20160213: - detect function definition correctly
|
||||
" 20160202: - use shiftwidth() function
|
||||
@@ -33,15 +35,11 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function s:buffer_shiftwidth()
|
||||
return shiftwidth()
|
||||
endfunction
|
||||
|
||||
let s:sh_indent_defaults = {
|
||||
\ 'default': function('s:buffer_shiftwidth'),
|
||||
\ 'continuation-line': function('s:buffer_shiftwidth'),
|
||||
\ 'case-labels': function('s:buffer_shiftwidth'),
|
||||
\ 'case-statements': function('s:buffer_shiftwidth'),
|
||||
\ 'default': function('shiftwidth'),
|
||||
\ 'continuation-line': function('shiftwidth'),
|
||||
\ 'case-labels': function('shiftwidth'),
|
||||
\ 'case-statements': function('shiftwidth'),
|
||||
\ 'case-breaks': 0 }
|
||||
|
||||
function! s:indent_value(option)
|
||||
@@ -110,6 +108,9 @@ function! GetShIndent()
|
||||
let ind -= s:indent_value('case-breaks')
|
||||
elseif s:is_here_doc(line)
|
||||
let ind = 0
|
||||
" statements, executed within a here document. Keep the current indent
|
||||
elseif match(map(synstack(v:lnum, 1), 'synIDattr(v:val, "name")'), '\c\mheredoc') > -1
|
||||
return indent(v:lnum)
|
||||
endif
|
||||
|
||||
return ind
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim indent file
|
||||
" Language: LaTeX
|
||||
" Maintainer: YiChao Zhou <broken.zhou AT gmail.com>
|
||||
" Maintainer: Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" Created: Sat, 16 Feb 2002 16:50:19 +0100
|
||||
" Version: 0.9.2
|
||||
" Version: 0.9.4
|
||||
" Please email me if you found something I can do. Comments, bug report and
|
||||
" feature request are welcome.
|
||||
|
||||
@@ -15,49 +15,53 @@
|
||||
" 2005/06/15, Moshe Kaminsky <kaminsky AT math.huji.ac.il>
|
||||
" (*) New variables:
|
||||
" g:tex_items, g:tex_itemize_env, g:tex_noindent_env
|
||||
" 2011/3/6, by Zhou YiChao <broken.zhou AT gmail.com>
|
||||
" 2011/3/6, by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Don't change indentation of lines starting with '%'
|
||||
" I don't see any code with '%' and it doesn't work properly
|
||||
" so I add some code.
|
||||
" (*) New features: Add smartindent-like indent for "{}" and "[]".
|
||||
" (*) New variables: g:tex_indent_brace
|
||||
" 2011/9/25, by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2011/9/25, by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Bug fix: smartindent-like indent for "[]"
|
||||
" (*) New features: Align with "&".
|
||||
" (*) New variable: g:tex_indent_and.
|
||||
" 2011/10/23 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2011/10/23 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Bug fix: improve the smartindent-like indent for "{}" and
|
||||
" "[]".
|
||||
" 2012/02/27 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2012/02/27 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Bug fix: support default folding marker.
|
||||
" (*) Indent with "&" is not very handy. Make it not enable by
|
||||
" default.
|
||||
" 2012/03/06 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2012/03/06 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Modify "&" behavior and make it default again. Now "&"
|
||||
" won't align when there are more then one "&" in the previous
|
||||
" line.
|
||||
" (*) Add indent "\left(" and "\right)"
|
||||
" (*) Trust user when in "verbatim" and "lstlisting"
|
||||
" 2012/03/11 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2012/03/11 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Modify "&" so that only indent when current line start with
|
||||
" "&".
|
||||
" 2012/03/12 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2012/03/12 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Modify indentkeys.
|
||||
" 2012/03/18 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2012/03/18 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Add &cpo
|
||||
" 2013/05/02 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2013/05/02 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk
|
||||
" for reporting this.
|
||||
" 2014/06/23 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2014/06/23 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Remove the feature g:tex_indent_and because it is buggy.
|
||||
" (*) If there is not any obvious indentation hints, we do not
|
||||
" alert our user's current indentation.
|
||||
" (*) g:tex_indent_brace now only works if the open brace is the
|
||||
" last character of that line.
|
||||
" 2014/08/03 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" 2014/08/03 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Indent current line if last line has larger indentation
|
||||
" 2014/08/09 by Zhou Yichao <broken.zhou AT gmail.com>
|
||||
" (*) Add missing return value for s:GetEndIndentation(...)
|
||||
" 2016/11/08 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Fix problems for \[ and \]. Thanks Bruno for reporting.
|
||||
" 2017/04/30 by Yichao Zhou <broken.zhou AT gmail.com>
|
||||
" (*) Fix a bug between g:tex_noindent_env and g:tex_indent_items
|
||||
" Now g:tex_noindent_env='document\|verbatim\|itemize' (Emacs
|
||||
" style) is supported. Thanks Miles Wheeler for reporting.
|
||||
"
|
||||
" }}}
|
||||
|
||||
@@ -81,44 +85,44 @@
|
||||
" % Example 2
|
||||
" \tikzexternalize[
|
||||
" prefix=tikz]
|
||||
"
|
||||
"
|
||||
" * g:tex_indent_items
|
||||
"
|
||||
" If this variable is set, item-environments are indented like Emacs does
|
||||
" it, i.e., continuation lines are indented with a shiftwidth.
|
||||
"
|
||||
"
|
||||
" NOTE: I've already set the variable below; delete the corresponding line
|
||||
" if you don't like this behaviour.
|
||||
"
|
||||
" Per default, it is unset.
|
||||
"
|
||||
"
|
||||
" set unset
|
||||
" ----------------------------------------------------------------
|
||||
" \begin{itemize} \begin{itemize}
|
||||
" \begin{itemize} \begin{itemize}
|
||||
" \item blablabla \item blablabla
|
||||
" bla bla bla bla bla bla
|
||||
" bla bla bla bla bla bla
|
||||
" \item blablabla \item blablabla
|
||||
" bla bla bla bla bla bla
|
||||
" \end{itemize} \end{itemize}
|
||||
" bla bla bla bla bla bla
|
||||
" \end{itemize} \end{itemize}
|
||||
"
|
||||
"
|
||||
" * g:tex_items
|
||||
"
|
||||
" A list of tokens to be considered as commands for the beginning of an item
|
||||
" command. The tokens should be separated with '\|'. The initial '\' should
|
||||
" A list of tokens to be considered as commands for the beginning of an item
|
||||
" command. The tokens should be separated with '\|'. The initial '\' should
|
||||
" be escaped. The default is '\\bibitem\|\\item'.
|
||||
"
|
||||
" * g:tex_itemize_env
|
||||
"
|
||||
" A list of environment names, separated with '\|', where the items (item
|
||||
" commands matching g:tex_items) may appear. The default is
|
||||
"
|
||||
" A list of environment names, separated with '\|', where the items (item
|
||||
" commands matching g:tex_items) may appear. The default is
|
||||
" 'itemize\|description\|enumerate\|thebibliography'.
|
||||
"
|
||||
" * g:tex_noindent_env
|
||||
"
|
||||
" A list of environment names. separated with '\|', where no indentation is
|
||||
" A list of environment names. separated with '\|', where no indentation is
|
||||
" required. The default is 'document\|verbatim'.
|
||||
" }}}
|
||||
" }}}
|
||||
|
||||
" Only define the function once
|
||||
if exists("b:did_indent")
|
||||
@@ -146,7 +150,7 @@ if g:tex_indent_items
|
||||
let g:tex_itemize_env = 'itemize\|description\|enumerate\|thebibliography'
|
||||
endif
|
||||
if !exists('g:tex_items')
|
||||
let g:tex_items = '\\bibitem\|\\item'
|
||||
let g:tex_items = '\\bibitem\|\\item'
|
||||
endif
|
||||
else
|
||||
let g:tex_items = ''
|
||||
@@ -177,7 +181,7 @@ function! GetTeXIndent() " {{{
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let line = substitute(getline(lnum), '\s*%.*', '','g') " last line
|
||||
@@ -191,9 +195,9 @@ function! GetTeXIndent() " {{{
|
||||
return indent(v:lnum)
|
||||
end
|
||||
endif
|
||||
|
||||
|
||||
if lnum == 0
|
||||
return 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let ind = indent(lnum)
|
||||
@@ -206,12 +210,14 @@ function! GetTeXIndent() " {{{
|
||||
|
||||
" Add a 'shiftwidth' after beginning of environments.
|
||||
" Don't add it for \begin{document} and \begin{verbatim}
|
||||
""if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim'
|
||||
" if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim'
|
||||
" LH modification : \begin does not always start a line
|
||||
" ZYC modification : \end after \begin won't cause wrong indent anymore
|
||||
if line =~ '\\begin{.*}' && line !~ g:tex_noindent_env
|
||||
let ind = ind + &sw
|
||||
let stay = 0
|
||||
if line =~ '\\begin{.*}'
|
||||
if line !~ g:tex_noindent_env
|
||||
let ind = ind + &sw
|
||||
let stay = 0
|
||||
endif
|
||||
|
||||
if g:tex_indent_items
|
||||
" Add another sw for item-environments
|
||||
@@ -245,29 +251,27 @@ function! GetTeXIndent() " {{{
|
||||
endif
|
||||
|
||||
if g:tex_indent_brace
|
||||
let char = line[strlen(line)-1]
|
||||
if char == '[' || char == '{'
|
||||
if line =~ '[[{]$'
|
||||
let ind += &sw
|
||||
let stay = 0
|
||||
endif
|
||||
|
||||
let cind = indent(v:lnum)
|
||||
let char = cline[cind]
|
||||
if (char == ']' || char == '}') &&
|
||||
\ s:CheckPairedIsLastCharacter(v:lnum, cind)
|
||||
if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, indent(v:lnum))
|
||||
let ind -= &sw
|
||||
let stay = 0
|
||||
endif
|
||||
|
||||
for i in range(indent(lnum)+1, strlen(line)-1)
|
||||
let char = line[i]
|
||||
if char == ']' || char == '}'
|
||||
if s:CheckPairedIsLastCharacter(lnum, i)
|
||||
let ind -= &sw
|
||||
let stay = 0
|
||||
if line !~ '^\s*\\\?[\]}]'
|
||||
for i in range(indent(lnum)+1, strlen(line)-1)
|
||||
let char = line[i]
|
||||
if char == ']' || char == '}'
|
||||
if s:CheckPairedIsLastCharacter(lnum, i)
|
||||
let ind -= &sw
|
||||
let stay = 0
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
endif
|
||||
endif
|
||||
|
||||
" Special treatment for 'item'
|
||||
@@ -309,12 +313,12 @@ function! s:GetLastBeginIndentation(lnum) " {{{
|
||||
let matchend -= 1
|
||||
endif
|
||||
if matchend == 0
|
||||
if line =~ g:tex_itemize_env
|
||||
return indent(lnum) + 2 * &sw
|
||||
endif
|
||||
if line =~ g:tex_noindent_env
|
||||
return indent(lnum)
|
||||
endif
|
||||
if line =~ g:tex_itemize_env
|
||||
return indent(lnum) + 2 * &sw
|
||||
endif
|
||||
return indent(lnum) + &sw
|
||||
endif
|
||||
endfor
|
||||
@@ -348,12 +352,15 @@ endfunction
|
||||
|
||||
" Most of the code is from matchparen.vim
|
||||
function! s:CheckPairedIsLastCharacter(lnum, col) "{{{
|
||||
" Get the character under the cursor and check if it's in 'matchpairs'.
|
||||
let c_lnum = a:lnum
|
||||
let c_col = a:col+1
|
||||
|
||||
let line = getline(c_lnum)
|
||||
if line[c_col-1] == '\'
|
||||
let c_col = c_col + 1
|
||||
endif
|
||||
let c = line[c_col-1]
|
||||
|
||||
let c = getline(c_lnum)[c_col-1]
|
||||
let plist = split(&matchpairs, '.\zs[:,]')
|
||||
let i = index(plist, c)
|
||||
if i < 0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim script to work like "less"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2015 Nov 15
|
||||
" Last Change: 2017 Mar 31
|
||||
|
||||
" Avoid loading this file twice, allow the user to define his own script.
|
||||
if exists("loaded_less")
|
||||
@@ -81,6 +81,10 @@ fun! s:Help()
|
||||
echo "\n"
|
||||
echo "/pattern Search for pattern ?pattern Search backward for pattern"
|
||||
echo "n next pattern match N Previous pattern match"
|
||||
if &foldmethod != "manual"
|
||||
echo "\n"
|
||||
echo "zR open all folds zm increase fold level"
|
||||
endif
|
||||
echo "\n"
|
||||
echo ":n<Enter> Next file :p<Enter> Previous file"
|
||||
echo "\n"
|
||||
@@ -96,7 +100,11 @@ map <C-F> <Space>
|
||||
map <PageDown> <Space>
|
||||
map <kPageDown> <Space>
|
||||
map <S-Down> <Space>
|
||||
map z <Space>
|
||||
" If 'foldmethod' was changed keep the "z" commands, e.g. "zR" to open all
|
||||
" folds.
|
||||
if &foldmethod == "manual"
|
||||
map z <Space>
|
||||
endif
|
||||
map <Esc><Space> <Space>
|
||||
fun! s:NextPage()
|
||||
if line(".") == line("$")
|
||||
|
||||
@@ -4,7 +4,7 @@ For instructions on installing this file, type
|
||||
:help matchit-install
|
||||
inside Vim.
|
||||
|
||||
For Vim version 6.3. Last change: 2016 Mar 28
|
||||
For Vim version 6.3. Last change: 2017 May 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Benji Fisher
|
||||
@@ -242,7 +242,7 @@ Examples:
|
||||
In LaTeX, since "%" is used as the comment character, you can >
|
||||
:let b:match_skip = 'r:%'
|
||||
< Unfortunately, this will skip anything after "\%", an escaped "%". To
|
||||
allow for this, and also "\\%" (an excaped backslash followed by the
|
||||
allow for this, and also "\\%" (an escaped backslash followed by the
|
||||
comment character) you can >
|
||||
:let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%'
|
||||
<
|
||||
@@ -392,7 +392,8 @@ a while. Moral: if a bug (known or not) bothers you, let me know.
|
||||
The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may
|
||||
have undesired effects in Select mode |Select-mode-mapping|. At least, if you
|
||||
want to replace the selection with any character in "ag%[]" there will be a
|
||||
pause of |'updatetime'| first.
|
||||
pause of |'updatetime'| first. E.g., "yV%" would normally work linewise, but
|
||||
the plugin mapping makes it characterwise.
|
||||
|
||||
It would be nice if "\0" were recognized as the entire pattern. That is, it
|
||||
would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1". I may
|
||||
|
||||
24
runtime/pack/dist/opt/matchit/plugin/matchit.vim
vendored
24
runtime/pack/dist/opt/matchit/plugin/matchit.vim
vendored
@@ -1,7 +1,7 @@
|
||||
" matchit.vim: (global plugin) Extended "%" matching
|
||||
" Last Change: 2016 Aug 21
|
||||
" Last Change: 2017 March 26
|
||||
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
|
||||
" Version: 1.13.2, for Vim 6.3+
|
||||
" Version: 1.13.3, for Vim 6.3+
|
||||
" Fix from Fernando Torres included.
|
||||
" Improvement from Ken Takata included.
|
||||
" URL: http://www.vim.org/script.php?script_id=39
|
||||
@@ -89,12 +89,15 @@ let s:notslash = '\\\@<!\%(\\\\\)*'
|
||||
|
||||
function! s:Match_wrapper(word, forward, mode) range
|
||||
" In s:CleanUp(), :execute "set" restore_options .
|
||||
let restore_options = (&ic ? " " : " no") . "ignorecase"
|
||||
if exists("b:match_ignorecase")
|
||||
let restore_options = ""
|
||||
if exists("b:match_ignorecase") && b:match_ignorecase != &ic
|
||||
let restore_options .= (&ic ? " " : " no") . "ignorecase"
|
||||
let &ignorecase = b:match_ignorecase
|
||||
endif
|
||||
let restore_options = " ve=" . &ve . restore_options
|
||||
set ve=
|
||||
if &ve != ''
|
||||
let restore_options = " ve=" . &ve . restore_options
|
||||
set ve=
|
||||
endif
|
||||
" If this function was called from Visual mode, make sure that the cursor
|
||||
" is at the correct end of the Visual range:
|
||||
if a:mode == "v"
|
||||
@@ -287,7 +290,9 @@ endfun
|
||||
" Restore options and do some special handling for Operator-pending mode.
|
||||
" The optional argument is the tail of the matching group.
|
||||
fun! s:CleanUp(options, mode, startline, startcol, ...)
|
||||
execute "set" a:options
|
||||
if strlen(a:options)
|
||||
execute "set" a:options
|
||||
endif
|
||||
" Open folds, if appropriate.
|
||||
if a:mode != "o"
|
||||
if &foldopen =~ "percent"
|
||||
@@ -639,8 +644,9 @@ fun! s:MultiMatch(spflag, mode)
|
||||
if !exists("b:match_words") || b:match_words == ""
|
||||
return ""
|
||||
end
|
||||
let restore_options = (&ic ? "" : "no") . "ignorecase"
|
||||
if exists("b:match_ignorecase")
|
||||
let restore_options = ""
|
||||
if exists("b:match_ignorecase") && b:match_ignorecase != &ic
|
||||
let restore_options .= (&ic ? " " : " no") . "ignorecase"
|
||||
let &ignorecase = b:match_ignorecase
|
||||
endif
|
||||
let startline = line(".")
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: AutoHotkey script file
|
||||
" Maintainer: Michael Wong
|
||||
" https://github.com/mmikeww/autohotkey.vim
|
||||
" Latest Revision: 2017-01-23
|
||||
" Latest Revision: 2017-04-03
|
||||
" Previous Maintainers: SungHyun Nam <goweol@gmail.com>
|
||||
" Nikolai Weibull <now@bitwi.se>
|
||||
|
||||
@@ -106,6 +106,7 @@ syn keyword autohotkeyCommand
|
||||
\ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos
|
||||
\ StringLeft StringRight StringLower StringUpper StringMid StringReplace
|
||||
\ StringSplit StringTrimLeft StringTrimRight StringLen
|
||||
\ StrSplit StrReplace Throw
|
||||
\ Control ControlClick ControlFocus ControlGet ControlGetFocus
|
||||
\ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw
|
||||
\ ControlSetText Menu PostMessage SendMessage SetControlDelay
|
||||
@@ -119,17 +120,18 @@ syn keyword autohotkeyCommand
|
||||
\ SetCapsLockState SetNumLockState SetScrollLockState
|
||||
|
||||
syn keyword autohotkeyFunction
|
||||
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr
|
||||
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr Func
|
||||
\ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage
|
||||
\ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan
|
||||
\ FileExist GetKeyState NumGet NumPut StrGet StrPut RegisterCallback
|
||||
\ IsFunc Trim LTrim RTrim IsObject Object Array FileOpen
|
||||
\ ComObjActive ComObjArray ComObjConnect ComObjCreate ComObjGet
|
||||
\ ComObjError ComObjFlags ComObjQuery ComObjType ComObjValue ComObject
|
||||
\ Format Exception
|
||||
|
||||
syn keyword autohotkeyStatement
|
||||
\ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return
|
||||
\ Suspend Reload
|
||||
\ Suspend Reload new class extends
|
||||
|
||||
syn keyword autohotkeyRepeat
|
||||
\ Loop
|
||||
@@ -138,7 +140,7 @@ syn keyword autohotkeyConditional
|
||||
\ IfExist IfNotExist If IfEqual IfLess IfGreater Else
|
||||
\ IfWinExist IfWinNotExist IfWinActive IfWinNotActive
|
||||
\ IfNotEqual IfLessOrEqual IfGreaterOrEqual
|
||||
\ while until for in
|
||||
\ while until for in try catch finally
|
||||
|
||||
syn match autohotkeyPreProcStart
|
||||
\ nextgroup=
|
||||
@@ -178,7 +180,7 @@ syn keyword autohotkeyPreProc
|
||||
\ Warn
|
||||
|
||||
syn keyword autohotkeyMatchClass
|
||||
\ ahk_group ahk_class ahk_id ahk_pid
|
||||
\ ahk_group ahk_class ahk_id ahk_pid ahk_exe
|
||||
|
||||
syn match autohotkeyNumbers
|
||||
\ display
|
||||
@@ -217,7 +219,7 @@ syn match autohotkeyHotkey
|
||||
\ contains=autohotkeyKey,
|
||||
\ autohotkeyHotkeyDelimiter
|
||||
\ display
|
||||
\ '^.\{-}::'
|
||||
\ '^\s*\S*\%( Up\)\?::'
|
||||
|
||||
syn match autohotkeyKey
|
||||
\ contained
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2016 Nov 18
|
||||
" Last Change: 2017 Apr 30
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -311,44 +311,32 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
|
||||
syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
|
||||
syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
|
||||
endif
|
||||
syn keyword cConstant FLT_RADIX FLT_ROUNDS
|
||||
syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
|
||||
syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
|
||||
syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
|
||||
syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
|
||||
syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
|
||||
syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
|
||||
syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
|
||||
syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
|
||||
syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
|
||||
syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL
|
||||
syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
|
||||
syn keyword cConstant LC_NUMERIC LC_TIME
|
||||
syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
|
||||
syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
|
||||
syn keyword cConstant FLT_RADIX FLT_ROUNDS FLT_DIG FLT_MANT_DIG FLT_EPSILON DBL_DIG DBL_MANT_DIG DBL_EPSILON
|
||||
syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MAX_10_EXP
|
||||
syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP DBL_MIN_10_EXP DBL_MAX_10_EXP LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
|
||||
syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP HUGE_VAL CLOCKS_PER_SEC NULL LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
|
||||
syn keyword cConstant LC_NUMERIC LC_TIME SIG_DFL SIG_ERR SIG_IGN SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
|
||||
" Add POSIX signals as well...
|
||||
syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
|
||||
syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
|
||||
syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
|
||||
syn keyword cConstant SIGUSR1 SIGUSR2
|
||||
syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
|
||||
syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
|
||||
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
|
||||
syn keyword cConstant TMP_MAX stderr stdin stdout
|
||||
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
|
||||
syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
|
||||
syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2
|
||||
syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF FOPEN_MAX FILENAME_MAX L_tmpnam
|
||||
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET TMP_MAX stderr stdin stdout EXIT_FAILURE EXIT_SUCCESS RAND_MAX
|
||||
" POSIX 2001
|
||||
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG
|
||||
syn keyword cConstant SIGVTALRM SIGXCPU SIGXFSZ
|
||||
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG SIGVTALRM SIGXCPU SIGXFSZ
|
||||
" non-POSIX signals
|
||||
syn keyword cConstant SIGWINCH SIGINFO
|
||||
" Add POSIX errors as well
|
||||
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
|
||||
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
|
||||
syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
|
||||
syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
|
||||
syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
|
||||
syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
|
||||
syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
|
||||
" Add POSIX errors as well. List comes from:
|
||||
" http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
|
||||
syn keyword cConstant E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF
|
||||
syn keyword cConstant EBADMSG EBUSY ECANCELED ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK
|
||||
syn keyword cConstant EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTUNREACH EIDRM EILSEQ
|
||||
syn keyword cConstant EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE
|
||||
syn keyword cConstant EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA
|
||||
syn keyword cConstant ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENOPROTOOPT ENOSPC ENOSR
|
||||
syn keyword cConstant ENOSTR ENOSYS ENOTCONN ENOTDIR ENOTEMPTY ENOTRECOVERABLE ENOTSOCK ENOTSUP
|
||||
syn keyword cConstant ENOTTY ENXIO EOPNOTSUPP EOVERFLOW EOWNERDEAD EPERM EPIPE EPROTO
|
||||
syn keyword cConstant EPROTONOSUPPORT EPROTOTYPE ERANGE EROFS ESPIPE ESRCH ESTALE ETIME ETIMEDOUT
|
||||
syn keyword cConstant ETXTBSY EWOULDBLOCK EXDEV
|
||||
" math.h
|
||||
syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
|
||||
syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: C++
|
||||
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
|
||||
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
|
||||
" Last Change: 2016 Oct 28
|
||||
" Last Change: 2017 Jun 05
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -48,7 +48,7 @@ endif
|
||||
if !exists("cpp_no_cpp14")
|
||||
syn case ignore
|
||||
syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>" contains=cFloat
|
||||
syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
|
||||
syn case match
|
||||
endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Haskell
|
||||
" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
|
||||
" Last Change: 2008 Dec 15
|
||||
" Last Change: 2017 Jun 04
|
||||
" Original Author: John Williams <jrw@pobox.com>
|
||||
"
|
||||
" Thanks to Ryan Crumley for suggestions and John Meacham for
|
||||
@@ -62,7 +62,7 @@ syn match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hs
|
||||
syn match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
|
||||
syn match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
|
||||
|
||||
" Keyword definitions. These must be patters instead of keywords
|
||||
" Keyword definitions. These must be patterns instead of keywords
|
||||
" because otherwise they would match as keywords at the start of a
|
||||
" "literate" comment (see lhs.vim).
|
||||
syn match hsModule "\<module\>"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: php PHP 3/4/5/7
|
||||
" Maintainer: Jason Woofenden <jason@jasonwoof.com>
|
||||
" Last Change: Dec 11, 2016
|
||||
" Last Change: Apr 28, 2017
|
||||
" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD
|
||||
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
|
||||
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
@@ -11,32 +11,28 @@
|
||||
" colourscheme, because elflord's colours will better highlight the break-points
|
||||
" (Statements) in your code.
|
||||
"
|
||||
" Options: php_sql_query = 1 for SQL syntax highlighting inside strings
|
||||
" php_htmlInStrings = 1 for HTML syntax highlighting inside strings
|
||||
" php_baselib = 1 for highlighting baselib functions
|
||||
" php_asp_tags = 1 for highlighting ASP-style short tags
|
||||
" php_parent_error_close = 1 for highlighting parent error ] or )
|
||||
" php_parent_error_open = 1 for skipping an php end tag, if there exists an open ( or [ without a closing one
|
||||
" php_oldStyle = 1 for using old colorstyle
|
||||
" php_noShortTags = 1 don't sync <? ?> as php
|
||||
" php_folding = 1 for folding classes and functions
|
||||
" php_folding = 2 for folding all { } regions
|
||||
" php_sync_method = x
|
||||
" x=-1 to sync by search ( default )
|
||||
" x>0 to sync at least x lines backwards
|
||||
" x=0 to sync from start
|
||||
"
|
||||
" Added by Peter Hodge On June 9, 2006:
|
||||
" php_special_functions = 1|0 to highlight functions with abnormal behaviour
|
||||
" php_alt_comparisons = 1|0 to highlight comparison operators in an alternate colour
|
||||
" php_alt_assignByReference = 1|0 to highlight '= &' in an alternate colour
|
||||
"
|
||||
" Note: these all default to 1 (On), so you would set them to '0' to turn them off.
|
||||
" E.g., in your .vimrc or _vimrc file:
|
||||
" let php_special_functions = 0
|
||||
" let php_alt_comparisons = 0
|
||||
" let php_alt_assignByReference = 0
|
||||
" Unletting these variables will revert back to their default (On).
|
||||
" Options:
|
||||
" Set to anything to enable:
|
||||
" php_sql_query SQL syntax highlighting inside strings
|
||||
" php_htmlInStrings HTML syntax highlighting inside strings
|
||||
" php_baselib highlighting baselib functions
|
||||
" php_asp_tags highlighting ASP-style short tags
|
||||
" php_parent_error_close highlighting parent error ] or )
|
||||
" php_parent_error_open skipping an php end tag, if there exists
|
||||
" an open ( or [ without a closing one
|
||||
" php_oldStyle use old colorstyle
|
||||
" php_noShortTags don't sync <? ?> as php
|
||||
" Set to a specific value:
|
||||
" php_folding = 1 fold classes and functions
|
||||
" php_folding = 2 fold all { } regions
|
||||
" php_sync_method = x where x is an integer:
|
||||
" -1 sync by search ( default )
|
||||
" >0 sync at least x lines backwards
|
||||
" 0 sync from start
|
||||
" Set to 0 to _disable_: (Added by Peter Hodge On June 9, 2006)
|
||||
" php_special_functions = 0 highlight functions with abnormal behaviour
|
||||
" php_alt_comparisons = 0 comparison operators in an alternate colour
|
||||
" php_alt_assignByReference = 0 '= &' in an alternate colour
|
||||
"
|
||||
"
|
||||
" Note:
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
" Tom Payne <tom@tompayne.org>
|
||||
" Contributor: Johannes Ranke <jranke@uni-bremen.de>
|
||||
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
|
||||
" Last Change: Thu Aug 25, 2016 08:52PM
|
||||
" Last Change: Sat Apr 08, 2017 07:01PM
|
||||
" Filenames: *.R *.r *.Rhistory *.Rt
|
||||
"
|
||||
" NOTE: The highlighting of R functions is defined in
|
||||
" NOTE: The highlighting of R functions might be defined in
|
||||
" runtime files created by a filetype plugin, if installed.
|
||||
"
|
||||
" CONFIGURATION:
|
||||
@@ -18,7 +18,7 @@
|
||||
"
|
||||
" ROxygen highlighting can be turned off by
|
||||
"
|
||||
" let r_hl_roxygen = 0
|
||||
" let r_syntax_hl_roxygen = 0
|
||||
"
|
||||
" Some lines of code were borrowed from Zhuojun Chen.
|
||||
|
||||
@@ -26,13 +26,25 @@ if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn iskeyword @,48-57,_,.
|
||||
if has("patch-7.4.1142")
|
||||
syn iskeyword @,48-57,_,.
|
||||
else
|
||||
setlocal iskeyword=@,48-57,_,.
|
||||
endif
|
||||
|
||||
" The variables g:r_hl_roxygen and g:r_syn_minlines were renamed on April 8, 2017.
|
||||
if exists("g:r_hl_roxygen")
|
||||
let g:r_syntax_hl_roxygen = g:r_hl_roxygen
|
||||
endif
|
||||
if exists("g:r_syn_minlines")
|
||||
let g:r_syntax_minlines = g:r_syn_minlines
|
||||
endif
|
||||
|
||||
if exists("g:r_syntax_folding") && g:r_syntax_folding
|
||||
setlocal foldmethod=syntax
|
||||
endif
|
||||
if !exists("g:r_hl_roxygen")
|
||||
let g:r_hl_roxygen = 1
|
||||
if !exists("g:r_syntax_hl_roxygen")
|
||||
let g:r_syntax_hl_roxygen = 1
|
||||
endif
|
||||
|
||||
syn case match
|
||||
@@ -42,19 +54,106 @@ syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):"
|
||||
syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*"
|
||||
|
||||
" Roxygen
|
||||
if g:r_hl_roxygen
|
||||
syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend
|
||||
syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey
|
||||
syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained
|
||||
if g:r_syntax_hl_roxygen
|
||||
" A roxygen block can start at the beginning of a file (first version) and
|
||||
" after a blank line (second version). It ends when a line that does not
|
||||
" contain a roxygen comment. In the following comments, any line containing
|
||||
" a roxygen comment marker (one or two hash signs # followed by a single
|
||||
" quote ' and preceded only by whitespace) is called a roxygen line. A
|
||||
" roxygen line containing only a roxygen comment marker, optionally followed
|
||||
" by whitespace is called an empty roxygen line.
|
||||
|
||||
syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword
|
||||
" 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
|
||||
" overriden later by the definitions of rOBlock.
|
||||
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 rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)"
|
||||
syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)"
|
||||
syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)"
|
||||
syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)"
|
||||
syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)"
|
||||
syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)"
|
||||
" When a roxygen block has a title and additional content, the title
|
||||
" consists of one or more roxygen lines (as little as possible are matched),
|
||||
" followed either by an empty roxygen line
|
||||
syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
|
||||
|
||||
" or by a roxygen tag (we match everything starting with @ but not @@ which is used as escape sequence for a literal @).
|
||||
syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
|
||||
|
||||
" If a block contains an @rdname, @describeIn tag, it may have paragraph breaks, but does not have a title
|
||||
syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
|
||||
|
||||
" A title as part of a block is always at the beginning of the block, i.e.
|
||||
" either at the start of a file or after a completely empty line.
|
||||
syn match rOTitle "\%^\(\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 rOCommentKey "#\{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
|
||||
|
||||
" rOTag list generated from the lists in
|
||||
" https://github.com/klutometis/roxygen/R/rd.R and
|
||||
" https://github.com/klutometis/roxygen/R/namespace.R
|
||||
" using s/^ \([A-Za-z0-9]*\) = .*/ syn match rOTag contained "@\1"/
|
||||
" Plus we need the @include tag
|
||||
|
||||
" rd.R
|
||||
syn match rOTag contained "@aliases"
|
||||
syn match rOTag contained "@author"
|
||||
syn match rOTag contained "@backref"
|
||||
syn match rOTag contained "@concept"
|
||||
syn match rOTag contained "@describeIn"
|
||||
syn match rOTag contained "@description"
|
||||
syn match rOTag contained "@details"
|
||||
syn match rOTag contained "@docType"
|
||||
syn match rOTag contained "@encoding"
|
||||
syn match rOTag contained "@evalRd"
|
||||
syn match rOTag contained "@example"
|
||||
syn match rOTag contained "@examples"
|
||||
syn match rOTag contained "@family"
|
||||
syn match rOTag contained "@field"
|
||||
syn match rOTag contained "@format"
|
||||
syn match rOTag contained "@inherit"
|
||||
syn match rOTag contained "@inheritParams"
|
||||
syn match rOTag contained "@inheritDotParams"
|
||||
syn match rOTag contained "@inheritSection"
|
||||
syn match rOTag contained "@keywords"
|
||||
syn match rOTag contained "@method"
|
||||
syn match rOTag contained "@name"
|
||||
syn match rOTag contained "@md"
|
||||
syn match rOTag contained "@noMd"
|
||||
syn match rOTag contained "@noRd"
|
||||
syn match rOTag contained "@note"
|
||||
syn match rOTag contained "@param"
|
||||
syn match rOTag contained "@rdname"
|
||||
syn match rOTag contained "@rawRd"
|
||||
syn match rOTag contained "@references"
|
||||
syn match rOTag contained "@return"
|
||||
syn match rOTag contained "@section"
|
||||
syn match rOTag contained "@seealso"
|
||||
syn match rOTag contained "@slot"
|
||||
syn match rOTag contained "@source"
|
||||
syn match rOTag contained "@template"
|
||||
syn match rOTag contained "@templateVar"
|
||||
syn match rOTag contained "@title"
|
||||
syn match rOTag contained "@usage"
|
||||
" namespace.R
|
||||
syn match rOTag contained "@export"
|
||||
syn match rOTag contained "@exportClass"
|
||||
syn match rOTag contained "@exportMethod"
|
||||
syn match rOTag contained "@exportPattern"
|
||||
syn match rOTag contained "@import"
|
||||
syn match rOTag contained "@importClassesFrom"
|
||||
syn match rOTag contained "@importFrom"
|
||||
syn match rOTag contained "@importMethodsFrom"
|
||||
syn match rOTag contained "@rawNamespace"
|
||||
syn match rOTag contained "@S3method"
|
||||
syn match rOTag contained "@useDynLib"
|
||||
" other
|
||||
syn match rOTag contained "@include"
|
||||
endif
|
||||
|
||||
|
||||
@@ -168,12 +267,28 @@ syn match rBraceError "[)}]" contained
|
||||
syn match rCurlyError "[)\]]" contained
|
||||
syn match rParenError "[\]}]" contained
|
||||
|
||||
if !exists("g:R_hi_fun")
|
||||
let g:R_hi_fun = 1
|
||||
" Use Nvim-R to highlight functions dynamically if it is installed
|
||||
if !exists("g:r_syntax_fun_pattern")
|
||||
let s:ff = split(substitute(globpath(&rtp, "R/functions.vim"), "functions.vim", "", "g"), "\n")
|
||||
if len(s:ff) > 0
|
||||
let g:r_syntax_fun_pattern = 0
|
||||
else
|
||||
let g:r_syntax_fun_pattern = 1
|
||||
endif
|
||||
endif
|
||||
if g:R_hi_fun
|
||||
" Nvim-R:
|
||||
runtime R/functions.vim
|
||||
|
||||
" Only use Nvim-R to highlight functions if they should not be highlighted
|
||||
" according to a generic pattern
|
||||
if g:r_syntax_fun_pattern == 1
|
||||
syn match rFunction '[0-9a-zA-Z_\.]\+\s*\ze('
|
||||
else
|
||||
if !exists("g:R_hi_fun")
|
||||
let g:R_hi_fun = 1
|
||||
endif
|
||||
if g:R_hi_fun
|
||||
" Nvim-R:
|
||||
runtime R/functions.vim
|
||||
endif
|
||||
endif
|
||||
|
||||
syn match rDollar display contained "\$"
|
||||
@@ -205,8 +320,8 @@ if &filetype == "rhelp"
|
||||
syn match rhSection "\\dontrun\>"
|
||||
endif
|
||||
|
||||
if exists("r_syn_minlines")
|
||||
exe "syn sync minlines=" . r_syn_minlines
|
||||
if exists("r_syntax_minlines")
|
||||
exe "syn sync minlines=" . r_syntax_minlines
|
||||
else
|
||||
syn sync minlines=40
|
||||
endif
|
||||
@@ -243,15 +358,17 @@ hi def link rStatement Statement
|
||||
hi def link rString String
|
||||
hi def link rStrError Error
|
||||
hi def link rType Type
|
||||
if g:r_hl_roxygen
|
||||
hi def link rOKeyword Title
|
||||
hi def link rOBlock Comment
|
||||
if g:r_syntax_hl_roxygen
|
||||
hi def link rOTitleTag Operator
|
||||
hi def link rOTag Operator
|
||||
hi def link rOTitleBlock Title
|
||||
hi def link rOBlock Comment
|
||||
hi def link rOBlockNoTitle Comment
|
||||
hi def link rOTitle Title
|
||||
hi def link rOCommentKey Comment
|
||||
hi def link rOExamples SpecialComment
|
||||
endif
|
||||
|
||||
|
||||
let b:current_syntax="r"
|
||||
|
||||
" vim: ts=8 sw=2
|
||||
|
||||
@@ -1,17 +1,26 @@
|
||||
" markdown Text with R statements
|
||||
" Language: markdown with R code chunks
|
||||
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
|
||||
" Last Change: Tue Jun 28, 2016 10:09AM
|
||||
" Last Change: Sat Jan 28, 2017 10:06PM
|
||||
"
|
||||
" CONFIGURATION:
|
||||
" To highlight chunk headers as R code, put in your vimrc:
|
||||
" 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
|
||||
" many other advanced features like folding of markdown sections, it is
|
||||
" recommended to install the vim-pandoc filetype plugin as well as the
|
||||
" 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")
|
||||
finish
|
||||
endif
|
||||
|
||||
" load all of pandoc info
|
||||
" load all of pandoc info, e.g. from
|
||||
" https://github.com/vim-pandoc/vim-pandoc-syntax
|
||||
runtime syntax/pandoc.vim
|
||||
if exists("b:current_syntax")
|
||||
let rmdIsPandoc = 1
|
||||
@@ -22,28 +31,54 @@ else
|
||||
if exists("b:current_syntax")
|
||||
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
|
||||
|
||||
" load all of the r syntax highlighting rules into @R
|
||||
syntax include @R syntax/r.vim
|
||||
if exists("b:current_syntax")
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
|
||||
if exists("g:rmd_syn_hl_chunk")
|
||||
" highlight R code inside chunk header
|
||||
syntax match rmdChunkDelim "^[ \t]*```{r" contained
|
||||
syntax match rmdChunkDelim "}$" contained
|
||||
if !exists("g:rmd_syn_langs")
|
||||
let g:rmd_syn_langs = ["r"]
|
||||
else
|
||||
syntax match rmdChunkDelim "^[ \t]*```{r.*}$" contained
|
||||
let s:hasr = 0
|
||||
for s:lng in g:rmd_syn_langs
|
||||
if s:lng == "r"
|
||||
let s:hasr = 1
|
||||
endif
|
||||
endfor
|
||||
if s:hasr == 0
|
||||
let g:rmd_syn_langs += ["r"]
|
||||
endif
|
||||
endif
|
||||
syntax match rmdChunkDelim "^[ \t]*```$" contained
|
||||
syntax region rmdChunk start="^[ \t]*``` *{r.*}$" end="^[ \t]*```$" contains=@R,rmdChunkDelim keepend fold
|
||||
|
||||
for s:lng in g:rmd_syn_langs
|
||||
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"
|
||||
" highlight R code inside chunk header
|
||||
syntax match rmdRChunkDelim "^[ \t]*```{r" contained
|
||||
syntax match rmdRChunkDelim "}$" contained
|
||||
else
|
||||
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" contained'
|
||||
endif
|
||||
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```$" contained'
|
||||
endfor
|
||||
|
||||
|
||||
" also match and syntax highlight in-line R code
|
||||
syntax match rmdEndInline "`" contained
|
||||
syntax match rmdBeginInline "`r " contained
|
||||
syntax region rmdrInline start="`r " end="`" contains=@R,rmdBeginInline,rmdEndInline keepend
|
||||
syntax region rmdrInline matchgroup=rmdInlineDelim start="`r " end="`" contains=@R containedin=pandocLaTeXRegion,yamlFlowString keepend
|
||||
" I was not able to highlight rmdrInline inside a pandocLaTeXCommand, although
|
||||
" highlighting works within pandocLaTeXRegion and yamlFlowString.
|
||||
syntax cluster texMathZoneGroup add=rmdrInline
|
||||
|
||||
" match slidify special marker
|
||||
syntax match rmdSlidifySpecial "\*\*\*"
|
||||
@@ -56,8 +91,6 @@ if rmdIsPandoc == 0
|
||||
if exists("b:current_syntax")
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
" Extend cluster
|
||||
syn cluster texMathZoneGroup add=rmdrInline
|
||||
" Inline
|
||||
syntax match rmdLaTeXInlDelim "\$"
|
||||
syntax match rmdLaTeXInlDelim "\\\$"
|
||||
@@ -65,19 +98,24 @@ if rmdIsPandoc == 0
|
||||
" Region
|
||||
syntax match rmdLaTeXRegDelim "\$\$" contained
|
||||
syntax match rmdLaTeXRegDelim "\$\$latex$" contained
|
||||
syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend
|
||||
syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend
|
||||
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
|
||||
|
||||
syn sync match rmdSyncChunk grouphere rmdChunk "^[ \t]*``` *{r"
|
||||
for s:lng in g:rmd_syn_langs
|
||||
exe 'syn sync match rmd' . toupper(s:lng) . 'SyncChunk grouphere rmd' . toupper(s:lng) . 'Chunk /^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\)/'
|
||||
endfor
|
||||
|
||||
hi def link rmdChunkDelim Special
|
||||
hi def link rmdBeginInline Special
|
||||
hi def link rmdEndInline Special
|
||||
hi def link rmdBlockQuote Comment
|
||||
hi def link rmdYamlBlockDelim Delim
|
||||
for s:lng in g:rmd_syn_langs
|
||||
exe 'hi def link rmd' . toupper(s:lng) . 'ChunkDelim Special'
|
||||
endfor
|
||||
hi def link rmdInlineDelim Special
|
||||
hi def link rmdSlidifySpecial Special
|
||||
|
||||
let b:current_syntax = "rmd"
|
||||
|
||||
295
runtime/syntax/rust.vim
Normal file
295
runtime/syntax/rust.vim
Normal file
@@ -0,0 +1,295 @@
|
||||
" Vim syntax file
|
||||
" Language: Rust
|
||||
" Maintainer: Patrick Walton <pcwalton@mozilla.com>
|
||||
" Maintainer: Ben Blum <bblum@cs.cmu.edu>
|
||||
" Maintainer: Chris Morgan <me@chrismorgan.info>
|
||||
" Last Change: Feb 24, 2016
|
||||
" For bugs, patches and license go to https://github.com/rust-lang/rust.vim
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Syntax definitions {{{1
|
||||
" Basic keywords {{{2
|
||||
syn keyword rustConditional match if else
|
||||
syn keyword rustRepeat for loop while
|
||||
syn keyword rustTypedef type nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained
|
||||
syn match rustUnionContextual /\<union\_s\+\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*/ transparent contains=rustUnion
|
||||
syn keyword rustOperator as
|
||||
|
||||
syn match rustAssert "\<assert\(\w\)*!" contained
|
||||
syn match rustPanic "\<panic\(\w\)*!" contained
|
||||
syn keyword rustKeyword break
|
||||
syn keyword rustKeyword box nextgroup=rustBoxPlacement skipwhite skipempty
|
||||
syn keyword rustKeyword continue
|
||||
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite skipempty
|
||||
syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
|
||||
syn keyword rustKeyword in impl let
|
||||
syn keyword rustKeyword pub nextgroup=rustPubScope skipwhite skipempty
|
||||
syn keyword rustKeyword return
|
||||
syn keyword rustSuper super
|
||||
syn keyword rustKeyword unsafe where
|
||||
syn keyword rustKeyword use nextgroup=rustModPath skipwhite skipempty
|
||||
" FIXME: Scoped impl's name is also fallen in this category
|
||||
syn keyword rustKeyword mod trait nextgroup=rustIdentifier skipwhite skipempty
|
||||
syn keyword rustStorage move mut ref static const
|
||||
syn match rustDefault /\<default\ze\_s\+\(impl\|fn\|type\|const\)\>/
|
||||
|
||||
syn keyword rustInvalidBareKeyword crate
|
||||
|
||||
syn keyword rustPubScopeCrate crate contained
|
||||
syn match rustPubScopeDelim /[()]/ contained
|
||||
syn match rustPubScope /([^()]*)/ contained contains=rustPubScopeDelim,rustPubScopeCrate,rustSuper,rustModPath,rustModPathSep,rustSelf transparent
|
||||
|
||||
syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty
|
||||
" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting.
|
||||
syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator
|
||||
syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty
|
||||
|
||||
syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||
syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||
|
||||
syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained
|
||||
" Ideally we'd have syntax rules set up to match arbitrary expressions. Since
|
||||
" we don't, we'll just define temporary contained rules to handle balancing
|
||||
" delimiters.
|
||||
syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlacement transparent
|
||||
syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent
|
||||
" {} are handled by rustFoldBraces
|
||||
|
||||
syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount
|
||||
syn match rustMacroRepeatCount ".\?[*+]" contained
|
||||
syn match rustMacroVariable "$\w\+"
|
||||
|
||||
" Reserved (but not yet used) keywords {{{2
|
||||
syn keyword rustReservedKeyword alignof become do offsetof priv pure sizeof typeof unsized yield abstract virtual final override macro
|
||||
|
||||
" Built-in types {{{2
|
||||
syn keyword rustType isize usize char bool u8 u16 u32 u64 u128 f32
|
||||
syn keyword rustType f64 i8 i16 i32 i64 i128 str Self
|
||||
|
||||
" Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2
|
||||
" This section is just straight transformation of the contents of the prelude,
|
||||
" to make it easy to update.
|
||||
|
||||
" Reexported core operators {{{3
|
||||
syn keyword rustTrait Copy Send Sized Sync
|
||||
syn keyword rustTrait Drop Fn FnMut FnOnce
|
||||
|
||||
" Reexported functions {{{3
|
||||
" There’s no point in highlighting these; when one writes drop( or drop::< it
|
||||
" gets the same highlighting anyway, and if someone writes `let drop = …;` we
|
||||
" don’t really want *that* drop to be highlighted.
|
||||
"syn keyword rustFunction drop
|
||||
|
||||
" Reexported types and traits {{{3
|
||||
syn keyword rustTrait Box
|
||||
syn keyword rustTrait ToOwned
|
||||
syn keyword rustTrait Clone
|
||||
syn keyword rustTrait PartialEq PartialOrd Eq Ord
|
||||
syn keyword rustTrait AsRef AsMut Into From
|
||||
syn keyword rustTrait Default
|
||||
syn keyword rustTrait Iterator Extend IntoIterator
|
||||
syn keyword rustTrait DoubleEndedIterator ExactSizeIterator
|
||||
syn keyword rustEnum Option
|
||||
syn keyword rustEnumVariant Some None
|
||||
syn keyword rustEnum Result
|
||||
syn keyword rustEnumVariant Ok Err
|
||||
syn keyword rustTrait SliceConcatExt
|
||||
syn keyword rustTrait String ToString
|
||||
syn keyword rustTrait Vec
|
||||
|
||||
" Other syntax {{{2
|
||||
syn keyword rustSelf self
|
||||
syn keyword rustBoolean true false
|
||||
|
||||
" If foo::bar changes to foo.bar, change this ("::" to "\.").
|
||||
" If foo::bar changes to Foo::bar, change this (first "\w" to "\u").
|
||||
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
|
||||
syn match rustModPathSep "::"
|
||||
|
||||
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
|
||||
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
|
||||
|
||||
" This is merely a convention; note also the use of [A-Z], restricting it to
|
||||
" latin identifiers rather than the full Unicode uppercase. I have not used
|
||||
" [:upper:] as it depends upon 'noignorecase'
|
||||
"syn match rustCapsIdent display "[A-Z]\w\(\w\)*"
|
||||
|
||||
syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?"
|
||||
" This one isn't *quite* right, as we could have binary-& with a reference
|
||||
syn match rustSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1
|
||||
syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1
|
||||
" This isn't actually correct; a closure with no arguments can be `|| { }`.
|
||||
" Last, because the & in && isn't a sigil
|
||||
syn match rustOperator display "&&\|||"
|
||||
" This is rustArrowCharacter rather than rustArrow for the sake of matchparen,
|
||||
" so it skips the ->; see http://stackoverflow.com/a/30309949 for details.
|
||||
syn match rustArrowCharacter display "->"
|
||||
syn match rustQuestionMark display "?\([a-zA-Z]\+\)\@!"
|
||||
|
||||
syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic
|
||||
syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic
|
||||
|
||||
syn match rustEscapeError display contained /\\./
|
||||
syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/
|
||||
syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/
|
||||
syn match rustStringContinuation display contained /\\\n\s*/
|
||||
syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation
|
||||
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell
|
||||
syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell
|
||||
|
||||
syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive,rustCommentLine,rustCommentBlock,rustCommentLineDocError,rustCommentBlockDocError
|
||||
syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait
|
||||
" This list comes from src/libsyntax/ext/deriving/mod.rs
|
||||
" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show).
|
||||
syn keyword rustDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy
|
||||
|
||||
" Number literals
|
||||
syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\="
|
||||
|
||||
" Special case for numbers of the form "1." which are float literals, unless followed by
|
||||
" an identifier, which makes them integer literals with a method call or field access,
|
||||
" or by another ".", which makes them integer literals followed by the ".." token.
|
||||
" (This must go first so the others take precedence.)
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!"
|
||||
" To mark a number as a normal float, it must have at least one of the three things integral values don't have:
|
||||
" a decimal point and more numbers; an exponent; and a type suffix.
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\="
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\="
|
||||
syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)"
|
||||
|
||||
" For the benefit of delimitMate
|
||||
syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u{\x\{1,6}}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
|
||||
syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate
|
||||
syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime
|
||||
|
||||
"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting
|
||||
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
|
||||
syn match rustLabel display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*:"
|
||||
syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/
|
||||
" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII).
|
||||
syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/
|
||||
syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode
|
||||
syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid
|
||||
|
||||
syn match rustShebang /\%^#![^[].*/
|
||||
syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell
|
||||
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell
|
||||
syn region rustCommentLineDocError start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell contained
|
||||
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell
|
||||
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell
|
||||
syn region rustCommentBlockDocError matchgroup=rustCommentBlockDocError start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained
|
||||
syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent
|
||||
syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent
|
||||
syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained transparent
|
||||
" FIXME: this is a really ugly and not fully correct implementation. Most
|
||||
" importantly, a case like ``/* */*`` should have the final ``*`` not being in
|
||||
" a comment, but in practice at present it leaves comments open two levels
|
||||
" deep. But as long as you stay away from that particular case, I *believe*
|
||||
" the highlighting is correct. Due to the way Vim's syntax engine works
|
||||
" (greedy for start matches, unlike Rust's tokeniser which is searching for
|
||||
" the earliest-starting match, start or end), I believe this cannot be solved.
|
||||
" Oh you who would fix it, don't bother with things like duplicating the Block
|
||||
" rules and putting ``\*\@<!`` at the start of them; it makes it worse, as
|
||||
" then you must deal with cases like ``/*/**/*/``. And don't try making it
|
||||
" worse with ``\%(/\@<!\*\)\@<!``, either...
|
||||
|
||||
syn keyword rustTodo contained TODO FIXME XXX NB NOTE
|
||||
|
||||
" Folding rules {{{2
|
||||
" Trivial folding rules to begin with.
|
||||
" FIXME: use the AST to make really good folding
|
||||
syn region rustFoldBraces start="{" end="}" transparent fold
|
||||
|
||||
" Default highlighting {{{1
|
||||
hi def link rustDecNumber rustNumber
|
||||
hi def link rustHexNumber rustNumber
|
||||
hi def link rustOctNumber rustNumber
|
||||
hi def link rustBinNumber rustNumber
|
||||
hi def link rustIdentifierPrime rustIdentifier
|
||||
hi def link rustTrait rustType
|
||||
hi def link rustDeriveTrait rustTrait
|
||||
|
||||
hi def link rustMacroRepeatCount rustMacroRepeatDelimiters
|
||||
hi def link rustMacroRepeatDelimiters Macro
|
||||
hi def link rustMacroVariable Define
|
||||
hi def link rustSigil StorageClass
|
||||
hi def link rustEscape Special
|
||||
hi def link rustEscapeUnicode rustEscape
|
||||
hi def link rustEscapeError Error
|
||||
hi def link rustStringContinuation Special
|
||||
hi def link rustString String
|
||||
hi def link rustCharacterInvalid Error
|
||||
hi def link rustCharacterInvalidUnicode rustCharacterInvalid
|
||||
hi def link rustCharacter Character
|
||||
hi def link rustNumber Number
|
||||
hi def link rustBoolean Boolean
|
||||
hi def link rustEnum rustType
|
||||
hi def link rustEnumVariant rustConstant
|
||||
hi def link rustConstant Constant
|
||||
hi def link rustSelf Constant
|
||||
hi def link rustFloat Float
|
||||
hi def link rustArrowCharacter rustOperator
|
||||
hi def link rustOperator Operator
|
||||
hi def link rustKeyword Keyword
|
||||
hi def link rustTypedef Keyword " More precise is Typedef, but it doesn't feel right for Rust
|
||||
hi def link rustStructure Keyword " More precise is Structure
|
||||
hi def link rustUnion rustStructure
|
||||
hi def link rustPubScopeDelim Delimiter
|
||||
hi def link rustPubScopeCrate rustKeyword
|
||||
hi def link rustSuper rustKeyword
|
||||
hi def link rustReservedKeyword Error
|
||||
hi def link rustRepeat Conditional
|
||||
hi def link rustConditional Conditional
|
||||
hi def link rustIdentifier Identifier
|
||||
hi def link rustCapsIdent rustIdentifier
|
||||
hi def link rustModPath Include
|
||||
hi def link rustModPathSep Delimiter
|
||||
hi def link rustFunction Function
|
||||
hi def link rustFuncName Function
|
||||
hi def link rustFuncCall Function
|
||||
hi def link rustShebang Comment
|
||||
hi def link rustCommentLine Comment
|
||||
hi def link rustCommentLineDoc SpecialComment
|
||||
hi def link rustCommentLineDocError Error
|
||||
hi def link rustCommentBlock rustCommentLine
|
||||
hi def link rustCommentBlockDoc rustCommentLineDoc
|
||||
hi def link rustCommentBlockDocError Error
|
||||
hi def link rustAssert PreCondit
|
||||
hi def link rustPanic PreCondit
|
||||
hi def link rustMacro Macro
|
||||
hi def link rustType Type
|
||||
hi def link rustTodo Todo
|
||||
hi def link rustAttribute PreProc
|
||||
hi def link rustDerive PreProc
|
||||
hi def link rustDefault StorageClass
|
||||
hi def link rustStorage StorageClass
|
||||
hi def link rustObsoleteStorage Error
|
||||
hi def link rustLifetime Special
|
||||
hi def link rustLabel Label
|
||||
hi def link rustInvalidBareKeyword Error
|
||||
hi def link rustExternCrate rustKeyword
|
||||
hi def link rustObsoleteExternMod Error
|
||||
hi def link rustBoxPlacementParens Delimiter
|
||||
hi def link rustQuestionMark Special
|
||||
|
||||
" Other Suggestions:
|
||||
" hi rustAttribute ctermfg=cyan
|
||||
" hi rustDerive ctermfg=cyan
|
||||
" hi rustAssert ctermfg=yellow
|
||||
" hi rustPanic ctermfg=red
|
||||
" hi rustMacro ctermfg=magenta
|
||||
|
||||
syn sync minlines=200
|
||||
syn sync maxlines=500
|
||||
|
||||
let b:current_syntax = "rust"
|
||||
@@ -1,262 +1,259 @@
|
||||
" Vim syntax file
|
||||
" Language: SAS
|
||||
" Maintainer: James Kidd <james.kidd@covance.com>
|
||||
" Last Change: 2012 Apr 20
|
||||
" Corrected bug causing some keywords to appear as strings instead
|
||||
" 18 Jul 2008 by Paulo Tanimoto <ptanimoto@gmail.com>
|
||||
" Fixed comments with * taking multiple lines.
|
||||
" Fixed highlighting of macro keywords.
|
||||
" Added words to cases that didn't fit anywhere.
|
||||
" 02 Jun 2003
|
||||
" Added highlighting for additional keywords and such;
|
||||
" Attempted to match SAS default syntax colors;
|
||||
" Changed syncing so it doesn't lose colors on large blocks;
|
||||
" Much thanks to Bob Heckel for knowledgeable tweaking.
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
" Language: SAS
|
||||
" Maintainer: Zhen-Huan Hu <wildkeny@gmail.com>
|
||||
" Original Maintainer: James Kidd <james.kidd@covance.com>
|
||||
" Version: 3.0.0
|
||||
" Last Change: Mar 10, 2017
|
||||
"
|
||||
" 2017 Mar 7
|
||||
"
|
||||
" Upgrade version number to 3.0. Improvements include:
|
||||
" - Improve sync speed
|
||||
" - Largely enhance precision
|
||||
" - Update keywords in the latest SAS (as of Mar 2017)
|
||||
" - Add syntaxes for date/time constants
|
||||
" - Add syntax for data lines
|
||||
" - Add (back) syntax for TODO in comments
|
||||
"
|
||||
" 2017 Feb 9
|
||||
"
|
||||
" Add syntax folding
|
||||
"
|
||||
" 2016 Oct 10
|
||||
"
|
||||
" Add highlighting for functions
|
||||
"
|
||||
" 2016 Sep 14
|
||||
"
|
||||
" Change the implementation of syntaxing
|
||||
" macro function names so that macro parameters same
|
||||
" as SAS keywords won't be highlighted
|
||||
" (Thank Joug Raw for the suggestion)
|
||||
" Add section highlighting:
|
||||
" - Use /** and **/ to define a section
|
||||
" - It functions the same as a comment but
|
||||
" with different highlighting
|
||||
"
|
||||
" 2016 Jun 14
|
||||
"
|
||||
" Major changes so upgrade version number to 2.0
|
||||
" Overhaul the entire script (again). Improvements include:
|
||||
" - Higher precision
|
||||
" - Faster synchronization
|
||||
" - Separate color for control statements
|
||||
" - Highlight hash and java objects
|
||||
" - Highlight macro variables in double quoted strings
|
||||
" - Update all syntaxes based on SAS 9.4
|
||||
" - Add complete SAS/GRAPH and SAS/STAT procedure syntaxes
|
||||
" - Add Proc TEMPLATE and GTL syntaxes
|
||||
" - Add complete DS2 syntaxes
|
||||
" - Add basic IML syntaxes
|
||||
" - Many other improvements and bug fixes
|
||||
" Drop support for VIM version < 600
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn region sasString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn region sasString start=+'+ skip=+\\\\\|\\"+ end=+'+
|
||||
" Basic SAS syntaxes
|
||||
syn keyword sasOperator and eq ge gt in le lt ne not of or
|
||||
syn keyword sasReserved _all_ _automatic_ _char_ _character_ _data_ _infile_ _last_ _n_ _name_ _null_ _num_ _numeric_ _temporary_ _user_ _webout_
|
||||
" Strings
|
||||
syn region sasString start=+'+ skip=+''+ end=+'+ contains=@Spell
|
||||
syn region sasString start=+"+ skip=+""+ end=+"+ contains=sasMacroVariable,@Spell
|
||||
" Constants
|
||||
syn match sasNumber /\v<\d+%(\.\d+)=%(>|e[\-+]=\d+>)/ display
|
||||
syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=:\d{2}:\d{2}%(:\d{2})=%(am|pm)\1dt>/ display
|
||||
syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=\1d>/ display
|
||||
syn match sasDateTime /\v(['"])\d{2}:\d{2}%(:\d{2})=%(am|pm)\1t>/ display
|
||||
" Comments
|
||||
syn keyword sasTodo todo tbd fixme contained
|
||||
syn region sasComment start='/\*' end='\*/' contains=sasTodo
|
||||
syn region sasComment start='\v%(^|;)\s*\zs\%=\*' end=';'me=s-1 contains=sasTodo
|
||||
syn region sasSectLbl matchgroup=sasSectLblEnds start='/\*\*\s*' end='\s*\*\*/' concealends
|
||||
" Macros
|
||||
syn match sasMacroVariable '\v\&+\w+%(\.\w+)=' display
|
||||
syn match sasMacroReserved '\v\%%(abort|by|copy|display|do|else|end|global|goto|if|include|input|let|list|local|macro|mend|put|return|run|symdel|syscall|sysexec|syslput|sysrput|then|to|until|window|while)>' display
|
||||
syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%\w+\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction
|
||||
syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%q=sysfunc\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction,sasDataStepFunction
|
||||
" Syntax cluster for basic SAS syntaxes
|
||||
syn cluster sasBasicSyntax contains=sasOperator,sasReserved,sasNumber,sasDateTime,sasString,sasComment,sasMacroReserved,sasMacroFunction,sasMacroVariable,sasSectLbl
|
||||
|
||||
" Want region from 'cards;' to ';' to be captured (Bob Heckel)
|
||||
syn region sasCards start="^\s*CARDS.*" end="^\s*;\s*$"
|
||||
syn region sasCards start="^\s*DATALINES.*" end="^\s*;\s*$"
|
||||
" Formats
|
||||
syn match sasFormat '\v\$\w+\.' display contained
|
||||
syn match sasFormat '\v<\w+\.%(\d+>)=' display contained
|
||||
syn region sasFormatContext start='.' end=';'me=s-1 contained contains=@sasBasicSyntax,sasFormat
|
||||
|
||||
syn match sasNumber "-\=\<\d*\.\=[0-9_]\>"
|
||||
" Define global statements that can be accessed out of data step or procedures
|
||||
syn keyword sasGlobalStatementKeyword catname dm endsas filename footnote footnote1 footnote2 footnote3 footnote4 footnote5 footnote6 footnote7 footnote8 footnote9 footnote10 missing libname lock ods options page quit resetline run sasfile skip sysecho title title1 title2 title3 title4 title5 title6 title7 title8 title9 title10 contained
|
||||
syn keyword sasGlobalStatementODSKeyword chtml csvall docbook document escapechar epub epub2 epub3 exclude excel graphics html html3 html5 htmlcss imode listing markup output package path pcl pdf preferences phtml powerpoint printer proclabel proctitle ps results rtf select show tagsets trace usegopt verify wml contained
|
||||
syn match sasGlobalStatement '\v%(^|;)\s*\zs\h\w*>' display transparent contains=sasGlobalStatementKeyword
|
||||
syn match sasGlobalStatement '\v%(^|;)\s*\zsods>' display transparent contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
|
||||
" Block comment
|
||||
syn region sasComment start="/\*" end="\*/" contains=sasTodo
|
||||
" Data step statements, 9.4
|
||||
syn keyword sasDataStepFunctionName abs addr addrlong airy allcomb allperm anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 attrc attrn band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat catq cats catt catx cdf ceil ceilz cexist char choosec choosen cinv close cmiss cnonct coalesce coalescec collate comb compare compbl compfuzz compged complev compound compress constant convx convxp cos cosh cot count countc countw csc css cumipmt cumprinc curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datdif date datejul datepart datetime day dclose dcreate depdb depdbsl depsl depsyd deptab dequote deviance dhms dif digamma dim dinfo divide dnum dopen doptname doptnum dosubl dread dropnote dsname dsncatlgd dur durp effrate envlen erf erfc euclid exist exp fact fappend fclose fcol fcopy fdelete fetch fetchobs fexist fget fileexist filename fileref finance find findc findw finfo finv fipname fipnamel fipstate first floor floorz fmtinfo fnonct fnote fopen foptname foptnum fpoint fpos fput fread frewind frlen fsep fuzz fwrite gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz getoption getvarc getvarn graycode harmean harmeanz hbound hms holiday holidayck holidaycount holidayname holidaynx holidayny holidaytest hour htmldecode htmlencode ibessel ifc ifn index indexc indexw input inputc inputn int intcindex intck intcycle intfit intfmt intget intindex intnx intrr intseas intshift inttest intz iorcmsg ipmt iqr irr jbessel juldate juldate7 kurtosis lag largest lbound lcm lcomb left length lengthc lengthm lengthn lexcomb lexcombi lexperk lexperm lfact lgamma libname libref log log1px log10 log2 logbeta logcdf logistic logpdf logsdf lowcase lperm lpnorm mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modexist module modulec modulen modz month mopen mort msplint mvalid contained
|
||||
syn keyword sasDataStepFunctionName n netpv nliteral nmiss nomrate normal notalnum notalpha notcntrl notdigit note notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv nvalid nwkdom open ordinal pathname pctl pdf peek peekc peekclong peeklong perm pmt point poisson ppmt probbeta probbnml probbnrm probchi probf probgam probhypr probit probmc probnegb probnorm probt propcase prxchange prxmatch prxparen prxparse prxposn ptrlongadd put putc putn pvp qtr quantile quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni rename repeat resolve reverse rewind right rms round rounde roundz saving savings scan sdf sec second sha256 sha256hex sha256hmachex sign sin sinh skewness sleep smallest soapweb soapwebmeta soapwipservice soapwipsrs soapws soapwsmeta soundex spedis sqrt squantile std stderr stfips stname stnamel strip subpad substr substrn sum sumabs symexist symget symglobl symlocal sysexist sysget sysmsg sysparm sysprocessid sysprocessname sysprod sysrc system tan tanh time timepart timevalue tinv tnonct today translate transtrn tranwrd trigamma trim trimn trunc tso typeof tzoneid tzonename tzoneoff tzones2u tzoneu2s uniform upcase urldecode urlencode uss uuidgen var varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vtype vtypex vvalue vvaluex week weekday whichc whichn wto year yieldp yrdif yyq zipcity zipcitydistance zipfips zipname zipnamel zipstate contained
|
||||
syn keyword sasDataStepCallRoutineName allcomb allcombi allperm cats catt catx compcost execute graycode is8601_convert label lexcomb lexcombi lexperk lexperm logistic missing module poke pokelong prxchange prxdebug prxfree prxnext prxposn prxsubstr ranbin rancau rancomb ranexp rangam rannor ranperk ranperm ranpoi rantbl rantri ranuni scan set sleep softmax sortc sortn stdize streaminit symput symputx system tanh tso vname vnext wto contained
|
||||
syn region sasDataStepFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
|
||||
syn region sasDataStepFunctionFormatContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction,sasFormat
|
||||
syn match sasDataStepFunction '\v<\w+\ze\(' contained contains=sasDataStepFunctionName,sasDataStepCallRoutineName nextgroup=sasDataStepFunctionContext
|
||||
syn match sasDataStepFunction '\v%(input|put)\ze\(' contained contains=sasDataStepFunctionName nextgroup=sasDataStepFunctionFormatContext
|
||||
syn keyword sasDataStepHashMethodName add check clear definedata definedone definekey delete do_over equals find find_next find_prev first has_next has_prev last next output prev ref remove removedup replace replacedup reset_dup setcur sum sumdup contained
|
||||
syn region sasDataStepHashMethodContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
|
||||
syn match sasDataStepHashMethod '\v\.\w+\ze\(' contained contains=sasDataStepHashMethodName nextgroup=sasDataStepHashMethodContext
|
||||
syn keyword sasDataStepHashAttributeName item_size num_items contained
|
||||
syn match sasDataStepHashAttribute '\v\.\w+>\ze\_[^(]' display contained contains=sasDataStepHashAttributeName
|
||||
syn keyword sasDataStepControl continue do end go goto if leave link otherwise over return select to until when while contained
|
||||
syn keyword sasDataStepControl else then contained nextgroup=sasDataStepStatementKeyword skipwhite skipnl skipempty
|
||||
syn keyword sasDataStepHashOperator _new_ contained
|
||||
syn keyword sasDataStepStatementKeyword abort array attrib by call cards cards4 datalines datalines4 dcl declare delete describe display drop error execute file format infile informat input keep label length lines lines4 list lostcard merge modify output put putlog redirect remove rename replace retain set stop update where window contained
|
||||
syn keyword sasDataStepStatementHashKeyword hash hiter javaobj contained
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDataStepStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(dcl|declare)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataStepStatementHashKeyword skipwhite skipnl skipempty
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(format|informat|input|put)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(cards|datalines|lines)4=\s*;' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataLine skipwhite skipnl skipempty
|
||||
syn region sasDataLine start='^' end='^;'me=s-1 contained
|
||||
syn region sasDataStep matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsdata>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,@sasDataStepSyntax
|
||||
syn cluster sasDataStepSyntax contains=sasDataStepFunction,sasDataStepHashOperator,sasDataStepHashAttribute,sasDataStepHashMethod,sasDataStepControl,sasDataStepStatement
|
||||
|
||||
" Ignore misleading //JCL SYNTAX... (Bob Heckel)
|
||||
syn region sasComment start="[^/][^/]/\*" end="\*/" contains=sasTodo
|
||||
" Procedures, base SAS, 9.4
|
||||
syn keyword sasProcStatementKeyword abort age append array attrib audit block break by calid cdfplot change checkbox class classlev column compute contents copy create datarow dbencoding define delete deletefunc deletesubr delimiter device dialog dur endcomp exact exchange exclude explore fin fmtlib fontfile fontpath format formats freq function getnames guessingrows hbar hdfs histogram holidur holifin holistart holivar id idlabel informat inset invalue item key keylabel keyword label line link listfunc listsubr mapmiss mapreduce mean menu messages meta modify opentype outargs outdur outfin output outstart pageby partial picture pie pig plot ppplot printer probplot profile prompter qqplot radiobox ranks rbreak rbutton rebuild record remove rename repair report roptions save select selection separator source star start statistics struct submenu subroutine sum sumby table tables test text trantab truetype type1 types value var vbar ways weight where with write contained
|
||||
syn match sasProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcStatement '\v%(^|;)\s*\zs%(format|informat)>' display contained contains=sasProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc%(\s+\h\w*)=>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
|
||||
syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(catalog|chart|datasets|document|plot)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
|
||||
|
||||
" Previous code for comments was written by Bob Heckel
|
||||
" Comments with * may take multiple lines (Paulo Tanimoto)
|
||||
syn region sasComment start=";\s*\*"hs=s+1 end=";" contains=sasTodo
|
||||
" Procedures, SAS/GRAPH, 9.4
|
||||
syn keyword sasGraphProcStatementKeyword add area axis bar block bubble2 byline cc ccopy cdef cdelete chart cmap choro copy delete device dial donut exclude flow format fs goptions gout grid group hbar hbar3d hbullet hslider htrafficlight id igout label legend list modify move nobyline note pattern pie pie3d plot plot2 preview prism quit rename replay select scatter speedometer star surface symbol tc tcopy tdef tdelete template tile toggle treplay vbar vbar3d vtrafficlight vbullet vslider where contained
|
||||
syn match sasGraphProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasGraphProcStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasGraphProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasGraphProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(g3d|g3grid|ganno|gcontour|gdevice|geocode|gfont|ginside|goptions|gproject|greduce|gremove|mapimport)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
|
||||
syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(gareabar|gbarline|gchart|gkpi|gmap|gplot|gradar|greplay|gslide|gtile)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
|
||||
|
||||
" Comments with * starting after a semicolon (Paulo Tanimoto)
|
||||
syn region sasComment start="^\s*\*" end=";" contains=sasTodo
|
||||
" Procedures, SAS/STAT, 14.1
|
||||
syn keyword sasAnalyticalProcStatementKeyword absorb add array assess baseline bayes beginnodata bivar bootstrap bounds by cdfplot cells class cluster code compute condition contrast control coordinates copy cosan cov covtest coxreg der design determ deviance direct directions domain effect effectplot effpart em endnodata equality estimate exact exactoptions factor factors fcs filter fitindex format freq fwdlink gender grid group grow hazardratio height hyperprior id impjoint inset insetgroup invar invlink ippplot lincon lineqs lismod lmtests location logistic loglin lpredplot lsmeans lsmestimate manova matings matrix mcmc mean means missmodel mnar model modelaverage modeleffects monotone mstruct mtest multreg name nlincon nloptions oddsratio onecorr onesamplefreq onesamplemeans onewayanova outfiles output paired pairedfreq pairedmeans parameters parent parms partial partition path pathdiagram pcov performance plot population poststrata power preddist predict predpplot priors process probmodel profile prune pvar ram random ratio reference refit refmodel renameparm repeated replicate repweights response restore restrict retain reweight ridge rmsstd roc roccontrast rules samplesize samplingunit seed size scale score selection show simtests simulate slice std stderr store strata structeq supplementary table tables test testclass testfreq testfunc testid time transform treatments trend twosamplefreq twosamplemeans towsamplesurvival twosamplewilcoxon uds units univar var variance varnames weight where with zeromodel contained
|
||||
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasAnalyticalProcStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasAnalyticalProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(aceclus|adaptivereg|bchoice|boxplot|calis|cancorr|candisc|cluster|corresp|discrim|distance|factor|fastclus|fmm|freq|gam|gampl|gee|genmod|glimmix|glmmod|glmpower|glmselect|hpcandisc|hpfmm|hpgenselect|hplmixed|hplogistic|hpmixed|hpnlmod|hppls|hpprincomp|hpquantselect|hpreg|hpsplit|iclifetest|icphreg|inbreed|irt|kde|krige2d|lattice|lifereg|lifetest|loess|logistic|mcmc|mds|mi|mianalyze|mixed|modeclus|multtest|nested|nlin|nlmixed|npar1way|orthoreg|phreg|plm|pls|power|princomp|prinqual|probit|quantlife|quantreg|quantselect|robustreg|rsreg|score|seqdesign|seqtest|sim2d|simnormal|spp|stdize|stdrate|stepdisc|surveyfreq|surveyimpute|surveylogistic|surveymeans|surveyphreg|surveyreg|surveyselect|tpspline|transreg|tree|ttest|varclus|varcomp|variogram)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
|
||||
syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(anova|arima|catmod|factex|glm|model|optex|plan|reg)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
|
||||
|
||||
" This line defines macro variables in code. "hi def link" at end of file
|
||||
" defines the color scheme. Begin region with ampersand and end with
|
||||
" any non-word character offset by -1; put ampersand in the skip list
|
||||
" just in case it is used to concatenate macro variable values.
|
||||
" Procedures, ODS graphics, 9.4
|
||||
syn keyword sasODSGraphicsProcStatementKeyword band block bubble by colaxis compare dattrvar density dot dropline dynamic ellipse ellipseparm format fringe gradlegend hbar hbarbasic hbarparm hbox heatmap heatmapparm highlow histogram hline inset keylegend label lineparm loess matrix needle parent panelby pbspline plot polygon refline reg rowaxis scatter series spline step style styleattrs symbolchar symbolimage text vbar vbarbasic vbarparm vbox vector vline waterfall where xaxis x2axis yaxis y2axis yaxistable contained
|
||||
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasODSGraphicsProcStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasODSGraphicsProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn region sasODSGraphicsProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(sgdesign|sgpanel|sgplot|sgrender|sgscatter)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasODSGraphicsProcStatement
|
||||
|
||||
" Thanks to ronald h<>llwarth for this fix to an intra-versioning
|
||||
" problem with this little feature
|
||||
" Proc TEMPLATE, 9.4
|
||||
syn keyword sasProcTemplateClause as into
|
||||
syn keyword sasProcTemplateStatementKeyword block break cellstyle class close column compute continue define delete delstream do done dynamic edit else end eval flush footer header import iterate link list mvar ndent next nmvar notes open path put putl putlog putq putstream putvars replace set source stop style test text text2 text3 translate trigger unblock unset xdent contained
|
||||
syn keyword sasProcTemplateStatementComplexKeyword cellvalue column crosstabs event footer header statgraph style table tagset contained
|
||||
syn keyword sasProcTemplateGTLStatementKeyword axislegend axistable bandplot barchart barchartparm begingraph beginpolygon beginpolyline bihistogram3dparm blockplot boxplot boxplotparm bubbleplot continuouslegend contourplotparm dendrogram discretelegend drawarrow drawimage drawline drawoval drawrectangle drawtext dropline ellipse ellipseparm endgraph endinnermargin endlayout endpolygon endpolyline endsidebar entry entryfootnote entrytitle fringeplot heatmap heatmapparm highlowplot histogram histogramparm innermargin layout legenditem legendtextitems linechart lineparm loessplot mergedlegend modelband needleplot pbsplineplot polygonplot referenceline regressionplot scatterplot seriesplot sidebar stepplot surfaceplotparm symbolchar symbolimage textplot vectorplot waterfallchart contained
|
||||
syn keyword sasProcTemplateGTLComplexKeyword datalattice datapanel globallegend gridded lattice overlay overlayequated overlay3d region contained
|
||||
syn match sasProcTemplateStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcTemplateStatementKeyword,sasProcTemplateGTLStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasProcTemplateStatement '\v%(^|;)\s*\zsdefine>' display contained contains=sasProcTemplateStatementKeyword nextgroup=sasProcTemplateStatementComplexKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcTemplateStatement '\v%(^|;)\s*\zslayout>' display contained contains=sasProcTemplateGTLStatementKeyword nextgroup=sasProcTemplateGTLComplexKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcTemplateStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn region sasProcTemplate matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+template>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcTemplateClause,sasProcTemplateStatement
|
||||
|
||||
syn region sasMacroVar start="&" skip="[_&]" end="\W"he=e-1
|
||||
" Proc SQL, 9.4
|
||||
syn keyword sasProcSQLFunctionName avg count css cv freq max mean median min n nmiss prt range std stderr sum sumwgt t uss var contained
|
||||
syn region sasProcSQLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasProcSQLFunction
|
||||
syn match sasProcSQLFunction '\v<\w+\ze\(' contained contains=sasProcSQLFunctionName,sasDataStepFunctionName nextgroup=sasProcSQLFunctionContext
|
||||
syn keyword sasProcSQLClause add asc between by calculated cascade case check connection constraint cross desc distinct drop else end escape except exists foreign from full group having in inner intersect into is join key left libname like modify natural newline notrim null on order outer primary references restrict right separated set then to trimmed union unique user using values when where contained
|
||||
syn keyword sasProcSQLClause as contained nextgroup=sasProcSQLStatementKeyword skipwhite skipnl skipempty
|
||||
syn keyword sasProcSQLStatementKeyword connect delete disconnect execute insert reset select update validate contained
|
||||
syn keyword sasProcSQLStatementComplexKeyword alter create describe drop contained nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
|
||||
syn keyword sasProcSQLStatementNextKeyword index table view contained
|
||||
syn match sasProcSQLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcSQLStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasProcSQLStatement '\v%(^|;)\s*\zs%(alter|create|describe|drop)>' display contained contains=sasProcSQLStatementComplexKeyword nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcSQLStatement '\v%(^|;)\s*\zsvalidate>' display contained contains=sasProcSQLStatementKeyword nextgroup=sasProcSQLStatementKeyword,sasProcSQLStatementComplexKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcSQLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn region sasProcSQL matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+sql>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcSQLFunction,sasProcSQLClause,sasProcSQLStatement
|
||||
|
||||
" SAS/DS2, 9.4
|
||||
syn keyword sasDS2FunctionName abs anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat cats catt catx ceil ceilz choosec choosen cmp cmpt coalesce coalescec comb compare compbl compfuzz compound compress constant convx convxp cos cosh count countc countw css cumipmt cumprinc cv datdif date datejul datepart datetime day dequote deviance dhms dif digamma dim divide dur durp effrate erf erfc exp fact find findc findw floor floorz fmtinfo fuzz gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz harmean harmeanz hbound hms holiday hour index indexc indexw inputc inputn int intcindex intck intcycle intdt intfit intget intindex intnest intnx intrr intseas intshift inttest intts intz ipmt iqr irr juldate juldate7 kcount kstrcat kstrip kupdate kupdates kurtosis lag largest lbound lcm left length lengthc lengthm lengthn lgamma log logbeta log10 log1px log2 lowcase mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modz month mort n ndims netpv nmiss nomrate notalnum notalpha notcntrl notdigit notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv null nwkdom ordinal pctl perm pmt poisson power ppmt probbeta probbnml probbnrm probchi probdf probf probgam probhypr probit probmc probmed probnegb probnorm probt prxchange prxmatch prxparse prxposn put pvp qtr quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni repeat reverse right rms round rounde roundz savings scan sec second sha256hex sha256hmachex sign sin sinh skewness sleep smallest sqlexec sqrt std stderr streaminit strip substr substrn sum sumabs tan tanh time timepart timevalue tinv to_date to_double to_time to_timestamp today translate transtrn tranwrd trigamma trim trimn trunc uniform upcase uss uuidgen var verify vformat vinarray vinformat vlabel vlength vname vtype week weekday whichc whichn year yieldp yrdif yyq contained
|
||||
syn region sasDS2FunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDS2Function
|
||||
syn match sasDS2Function '\v<\w+\ze\(' contained contains=sasDS2FunctionName nextgroup=sasDS2FunctionContext
|
||||
syn keyword sasDS2Control continue data dcl declare do drop else end enddata endpackage endthread from go goto if leave method otherwise package point return select then thread to until when while contained
|
||||
syn keyword sasDS2StatementKeyword array by forward keep merge output put rename retain set stop vararray varlist contained
|
||||
syn keyword sasDS2StatementComplexKeyword package thread contained
|
||||
syn match sasDS2Statement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDS2StatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasDS2Statement '\v%(^|;)\s*\zs%(dcl|declare|drop)>' display contained contains=sasDS2StatementKeyword nextgroup=sasDS2StatementComplexKeyword skipwhite skipnl skipempty
|
||||
syn match sasDS2Statement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn region sasDS2 matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+ds2>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDS2Function,sasDS2Control,sasDS2Statement
|
||||
|
||||
" I dont think specific PROCs need to be listed if use this line (Bob Heckel).
|
||||
syn match sasProc "^\s*PROC \w\+"
|
||||
syn keyword sasStep RUN QUIT DATA
|
||||
" SAS/IML, 14.1
|
||||
syn keyword sasIMLFunctionName abs all allcomb allperm any apply armasim bin blankstr block branks bspline btran byte char choose col colvec concat contents convexit corr corr2cov countmiss countn countunique cov cov2corr covlag cshape cusum cuprod cv cvexhull datasets design designf det diag dif dimension distance do duration echelon eigval eigvec element exp expmatrix expandgrid fft forward froot full gasetup geomean ginv hadamard half hankel harmean hdir hermite homogen i ifft insert int inv invupdt isempty isskipped j jroot kurtosis lag length loc log logabsdet mad magic mahalanobis max mean median min mod moduleic modulein name ncol ndx2sub nleng norm normal nrow num opscal orpol parentname palette polyroot prod product pv quartile rancomb randdirichlet randfun randmultinomial randmvt randnormal randwishart ranperk ranperm range rank ranktie rates ratio remove repeat root row rowcat rowcatc rowvec rsubstr sample setdif shape shapecol skewness solve sparse splinev spot sqrsym sqrt sqrvech ssq standard std storage sub2ndx substr sum sweep symsqr t toeplitz trace trisolv type uniform union unique uniqueby value var vecdiag vech xmult xsect yield contained
|
||||
syn keyword sasIMLCallRoutineName appcort armacov armalik bar box change comport delete eigen execute exportdatasettor exportmatrixtor farmacov farmafit farmalik farmasim fdif gaend gagetmem gagetval gainit gareeval garegen gasetcro gasetmut gasetobj gasetsel gblkvp gblkvpd gclose gdelete gdraw gdrawl geneig ggrid ginclude gopen gpie gpiexy gpoint gpoly gport gportpop gportstk gscale gscript gset gshow gsorth gstart gstop gstrlen gtext gvtext gwindow gxaxis gyaxis heatmapcont heatmapdisc histogram importdatasetfromr importmatrixfromr ipf itsolver kalcvf kalcvs kaldff kaldfs lav lcp lms lp lpsolve lts lupdt marg maxqform mcd milpsolve modulei mve nlpcg nlpdd nlpfdd nlpfea nlphqn nlplm nlpnms nlpnra nlpnrr nlpqn nlpqua nlptr ode odsgraph ortvec pgraf push qntl qr quad queue randgen randseed rdodt rupdt rename rupdt rzlind scatter seq seqscale seqshift seqscale seqshift series solvelin sort sortndx sound spline splinec svd tabulate tpspline tpsplnev tsbaysea tsdecomp tsmlocar tsmlomar tsmulmar tspears tspred tsroot tstvcar tsunimar valset varmacov varmalik varmasim vnormal vtsroot wavft wavget wavift wavprint wavthrsh contained
|
||||
syn region sasIMLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasIMLFunction
|
||||
syn match sasIMLFunction '\v<\w+\ze\(' contained contains=sasIMLFunctionName,sasDataStepFunction nextgroup=sasIMLFunctionContext
|
||||
syn keyword sasIMLControl abort by do else end finish goto if link pause quit resume return run start stop then to until while contained
|
||||
syn keyword sasIMLStatementKeyword append call close closefile create delete display edit file find force free index infile input list load mattrib print purge read remove replace reset save setin setout show sort store summary use window contained
|
||||
syn match sasIMLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasIMLStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasIMLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn region sasIML matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+iml>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasIMLFunction,sasIMLControl,sasIMLStatement
|
||||
|
||||
" Macro definition
|
||||
syn region sasMacro start='\v\%macro>' end='\v\%mend>' fold keepend contains=@sasBasicSyntax,@sasDataStepSyntax,sasDataStep,sasProc,sasODSGraphicsProc,sasGraphProc,sasAnalyticalProc,sasProcTemplate,sasProcSQL,sasDS2,sasIML
|
||||
|
||||
" Base SAS Procs - version 8.1
|
||||
|
||||
syn keyword sasConditional DO ELSE END IF THEN UNTIL WHILE
|
||||
|
||||
syn keyword sasStatement ABORT ARRAY ATTRIB BY CALL CARDS CARDS4 CATNAME
|
||||
syn keyword sasStatement CONTINUE DATALINES DATALINES4 DELETE DISPLAY
|
||||
syn keyword sasStatement DM DROP ENDSAS ERROR FILE FILENAME FOOTNOTE
|
||||
syn keyword sasStatement FORMAT GOTO INFILE INFORMAT INPUT KEEP
|
||||
syn keyword sasStatement LABEL LEAVE LENGTH LIBNAME LINK LIST LOSTCARD
|
||||
syn keyword sasStatement MERGE MISSING MODIFY OPTIONS OUTPUT PAGE
|
||||
syn keyword sasStatement PUT REDIRECT REMOVE RENAME REPLACE RETAIN
|
||||
syn keyword sasStatement RETURN SELECT SET SKIP STARTSAS STOP TITLE
|
||||
syn keyword sasStatement UPDATE WAITSAS WHERE WINDOW X SYSTASK
|
||||
|
||||
" Keywords that are used in Proc SQL
|
||||
" I left them as statements because SAS's enhanced editor highlights
|
||||
" them the same as normal statements used in data steps (Jim Kidd)
|
||||
|
||||
syn keyword sasStatement ADD AND ALTER AS CASCADE CHECK CREATE
|
||||
syn keyword sasStatement DELETE DESCRIBE DISTINCT DROP FOREIGN
|
||||
syn keyword sasStatement FROM GROUP HAVING INDEX INSERT INTO IN
|
||||
syn keyword sasStatement KEY LIKE MESSAGE MODIFY MSGTYPE NOT
|
||||
syn keyword sasStatement NULL ON OR ORDER PRIMARY REFERENCES
|
||||
syn keyword sasStatement RESET RESTRICT SELECT SET TABLE
|
||||
syn keyword sasStatement UNIQUE UPDATE VALIDATE VIEW WHERE
|
||||
|
||||
" Match declarations have to appear one per line (Paulo Tanimoto)
|
||||
syn match sasStatement "FOOTNOTE\d"
|
||||
syn match sasStatement "TITLE\d"
|
||||
|
||||
" Match declarations have to appear one per line (Paulo Tanimoto)
|
||||
syn match sasMacro "%BQUOTE"
|
||||
syn match sasMacro "%NRBQUOTE"
|
||||
syn match sasMacro "%CMPRES"
|
||||
syn match sasMacro "%QCMPRES"
|
||||
syn match sasMacro "%COMPSTOR"
|
||||
syn match sasMacro "%DATATYP"
|
||||
syn match sasMacro "%DISPLAY"
|
||||
syn match sasMacro "%DO"
|
||||
syn match sasMacro "%ELSE"
|
||||
syn match sasMacro "%END"
|
||||
syn match sasMacro "%EVAL"
|
||||
syn match sasMacro "%GLOBAL"
|
||||
syn match sasMacro "%GOTO"
|
||||
syn match sasMacro "%IF"
|
||||
syn match sasMacro "%INDEX"
|
||||
syn match sasMacro "%INPUT"
|
||||
syn match sasMacro "%KEYDEF"
|
||||
syn match sasMacro "%LABEL"
|
||||
syn match sasMacro "%LEFT"
|
||||
syn match sasMacro "%LENGTH"
|
||||
syn match sasMacro "%LET"
|
||||
syn match sasMacro "%LOCAL"
|
||||
syn match sasMacro "%LOWCASE"
|
||||
syn match sasMacro "%MACRO"
|
||||
syn match sasMacro "%MEND"
|
||||
syn match sasMacro "%NRBQUOTE"
|
||||
syn match sasMacro "%NRQUOTE"
|
||||
syn match sasMacro "%NRSTR"
|
||||
syn match sasMacro "%PUT"
|
||||
syn match sasMacro "%QCMPRES"
|
||||
syn match sasMacro "%QLEFT"
|
||||
syn match sasMacro "%QLOWCASE"
|
||||
syn match sasMacro "%QSCAN"
|
||||
syn match sasMacro "%QSUBSTR"
|
||||
syn match sasMacro "%QSYSFUNC"
|
||||
syn match sasMacro "%QTRIM"
|
||||
syn match sasMacro "%QUOTE"
|
||||
syn match sasMacro "%QUPCASE"
|
||||
syn match sasMacro "%SCAN"
|
||||
syn match sasMacro "%STR"
|
||||
syn match sasMacro "%SUBSTR"
|
||||
syn match sasMacro "%SUPERQ"
|
||||
syn match sasMacro "%SYSCALL"
|
||||
syn match sasMacro "%SYSEVALF"
|
||||
syn match sasMacro "%SYSEXEC"
|
||||
syn match sasMacro "%SYSFUNC"
|
||||
syn match sasMacro "%SYSGET"
|
||||
syn match sasMacro "%SYSLPUT"
|
||||
syn match sasMacro "%SYSPROD"
|
||||
syn match sasMacro "%SYSRC"
|
||||
syn match sasMacro "%SYSRPUT"
|
||||
syn match sasMacro "%THEN"
|
||||
syn match sasMacro "%TO"
|
||||
syn match sasMacro "%TRIM"
|
||||
syn match sasMacro "%UNQUOTE"
|
||||
syn match sasMacro "%UNTIL"
|
||||
syn match sasMacro "%UPCASE"
|
||||
syn match sasMacro "%VERIFY"
|
||||
syn match sasMacro "%WHILE"
|
||||
syn match sasMacro "%WINDOW"
|
||||
|
||||
" SAS Functions
|
||||
|
||||
syn keyword sasFunction ABS ADDR AIRY ARCOS ARSIN ATAN ATTRC ATTRN
|
||||
syn keyword sasFunction BAND BETAINV BLSHIFT BNOT BOR BRSHIFT BXOR
|
||||
syn keyword sasFunction BYTE CDF CEIL CEXIST CINV CLOSE CNONCT COLLATE
|
||||
syn keyword sasFunction COMPBL COMPOUND COMPRESS COS COSH CSS CUROBS
|
||||
syn keyword sasFunction CV DACCDB DACCDBSL DACCSL DACCSYD DACCTAB
|
||||
syn keyword sasFunction DAIRY DATE DATEJUL DATEPART DATETIME DAY
|
||||
syn keyword sasFunction DCLOSE DEPDB DEPDBSL DEPDBSL DEPSL DEPSL
|
||||
syn keyword sasFunction DEPSYD DEPSYD DEPTAB DEPTAB DEQUOTE DHMS
|
||||
syn keyword sasFunction DIF DIGAMMA DIM DINFO DNUM DOPEN DOPTNAME
|
||||
syn keyword sasFunction DOPTNUM DREAD DROPNOTE DSNAME ERF ERFC EXIST
|
||||
syn keyword sasFunction EXP FAPPEND FCLOSE FCOL FDELETE FETCH FETCHOBS
|
||||
syn keyword sasFunction FEXIST FGET FILEEXIST FILENAME FILEREF FINFO
|
||||
syn keyword sasFunction FINV FIPNAME FIPNAMEL FIPSTATE FLOOR FNONCT
|
||||
syn keyword sasFunction FNOTE FOPEN FOPTNAME FOPTNUM FPOINT FPOS
|
||||
syn keyword sasFunction FPUT FREAD FREWIND FRLEN FSEP FUZZ FWRITE
|
||||
syn keyword sasFunction GAMINV GAMMA GETOPTION GETVARC GETVARN HBOUND
|
||||
syn keyword sasFunction HMS HOSTHELP HOUR IBESSEL INDEX INDEXC
|
||||
syn keyword sasFunction INDEXW INPUT INPUTC INPUTN INT INTCK INTNX
|
||||
syn keyword sasFunction INTRR IRR JBESSEL JULDATE KURTOSIS LAG LBOUND
|
||||
syn keyword sasFunction LEFT LENGTH LGAMMA LIBNAME LIBREF LOG LOG10
|
||||
syn keyword sasFunction LOG2 LOGPDF LOGPMF LOGSDF LOWCASE MAX MDY
|
||||
syn keyword sasFunction MEAN MIN MINUTE MOD MONTH MOPEN MORT N
|
||||
syn keyword sasFunction NETPV NMISS NORMAL NOTE NPV OPEN ORDINAL
|
||||
syn keyword sasFunction PATHNAME PDF PEEK PEEKC PMF POINT POISSON POKE
|
||||
syn keyword sasFunction PROBBETA PROBBNML PROBCHI PROBF PROBGAM
|
||||
syn keyword sasFunction PROBHYPR PROBIT PROBNEGB PROBNORM PROBT PUT
|
||||
syn keyword sasFunction PUTC PUTN QTR QUOTE RANBIN RANCAU RANEXP
|
||||
syn keyword sasFunction RANGAM RANGE RANK RANNOR RANPOI RANTBL RANTRI
|
||||
syn keyword sasFunction RANUNI REPEAT RESOLVE REVERSE REWIND RIGHT
|
||||
syn keyword sasFunction ROUND SAVING SCAN SDF SECOND SIGN SIN SINH
|
||||
syn keyword sasFunction SKEWNESS SOUNDEX SPEDIS SQRT STD STDERR STFIPS
|
||||
syn keyword sasFunction STNAME STNAMEL SUBSTR SUM SYMGET SYSGET SYSMSG
|
||||
syn keyword sasFunction SYSPROD SYSRC SYSTEM TAN TANH TIME TIMEPART
|
||||
syn keyword sasFunction TINV TNONCT TODAY TRANSLATE TRANWRD TRIGAMMA
|
||||
syn keyword sasFunction TRIM TRIMN TRUNC UNIFORM UPCASE USS VAR
|
||||
syn keyword sasFunction VARFMT VARINFMT VARLABEL VARLEN VARNAME
|
||||
syn keyword sasFunction VARNUM VARRAY VARRAYX VARTYPE VERIFY VFORMAT
|
||||
syn keyword sasFunction VFORMATD VFORMATDX VFORMATN VFORMATNX VFORMATW
|
||||
syn keyword sasFunction VFORMATWX VFORMATX VINARRAY VINARRAYX VINFORMAT
|
||||
syn keyword sasFunction VINFORMATD VINFORMATDX VINFORMATN VINFORMATNX
|
||||
syn keyword sasFunction VINFORMATW VINFORMATWX VINFORMATX VLABEL
|
||||
syn keyword sasFunction VLABELX VLENGTH VLENGTHX VNAME VNAMEX VTYPE
|
||||
syn keyword sasFunction VTYPEX WEEKDAY YEAR YYQ ZIPFIPS ZIPNAME ZIPNAMEL
|
||||
syn keyword sasFunction ZIPSTATE
|
||||
|
||||
" Handy settings for using vim with log files
|
||||
syn keyword sasLogMsg NOTE
|
||||
syn keyword sasWarnMsg WARNING
|
||||
syn keyword sasErrMsg ERROR
|
||||
|
||||
" Always contained in a comment (Bob Heckel)
|
||||
syn keyword sasTodo TODO TBD FIXME contained
|
||||
|
||||
" These don't fit anywhere else (Bob Heckel).
|
||||
" Added others that were missing.
|
||||
syn keyword sasUnderscore _ALL_ _AUTOMATIC_ _CHARACTER_ _INFILE_ _N_ _NAME_ _NULL_ _NUMERIC_ _USER_ _WEBOUT_
|
||||
|
||||
" End of SAS Functions
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
|
||||
" Default sas enhanced editor color syntax
|
||||
hi sComment term=bold cterm=NONE ctermfg=Green ctermbg=Black gui=NONE guifg=DarkGreen guibg=White
|
||||
hi sCard term=bold cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Black guibg=LightYellow
|
||||
hi sDate_Time term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
|
||||
hi sKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
|
||||
hi sFmtInfmt term=NONE cterm=NONE ctermfg=LightGreen ctermbg=Black gui=NONE guifg=SeaGreen guibg=White
|
||||
hi sString term=NONE cterm=NONE ctermfg=Magenta ctermbg=Black gui=NONE guifg=Purple guibg=White
|
||||
hi sText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
|
||||
hi sNumber term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
|
||||
hi sProc term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
|
||||
hi sSection term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
|
||||
hi mDefine term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
|
||||
hi mKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
|
||||
hi mReference term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Blue guibg=White
|
||||
hi mSection term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
|
||||
hi mText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
|
||||
|
||||
" Colors that closely match SAS log colors for default color scheme
|
||||
hi lError term=NONE cterm=NONE ctermfg=Red ctermbg=Black gui=none guifg=Red guibg=White
|
||||
hi lWarning term=NONE cterm=NONE ctermfg=Green ctermbg=Black gui=none guifg=Green guibg=White
|
||||
hi lNote term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black gui=none guifg=Blue guibg=White
|
||||
|
||||
|
||||
" Special hilighting for the SAS proc section
|
||||
|
||||
hi def link sasComment sComment
|
||||
hi def link sasConditional sKeyword
|
||||
hi def link sasStep sSection
|
||||
hi def link sasFunction sKeyword
|
||||
hi def link sasMacro mKeyword
|
||||
hi def link sasMacroVar NonText
|
||||
hi def link sasNumber sNumber
|
||||
hi def link sasStatement sKeyword
|
||||
hi def link sasString sString
|
||||
hi def link sasProc sProc
|
||||
" (Bob Heckel)
|
||||
hi def link sasTodo Todo
|
||||
hi def link sasErrMsg lError
|
||||
hi def link sasWarnMsg lWarning
|
||||
hi def link sasLogMsg lNote
|
||||
hi def link sasCards sCard
|
||||
" (Bob Heckel)
|
||||
hi def link sasUnderscore PreProc
|
||||
" Define default highlighting
|
||||
hi def link sasComment Comment
|
||||
hi def link sasTodo Delimiter
|
||||
hi def link sasSectLbl Title
|
||||
hi def link sasSectLblEnds Comment
|
||||
hi def link sasNumber Number
|
||||
hi def link sasDateTime Constant
|
||||
hi def link sasString String
|
||||
hi def link sasDataStepControl Keyword
|
||||
hi def link sasProcTemplateClause Keyword
|
||||
hi def link sasProcSQLClause Keyword
|
||||
hi def link sasDS2Control Keyword
|
||||
hi def link sasIMLControl Keyword
|
||||
hi def link sasOperator Operator
|
||||
hi def link sasGlobalStatementKeyword Statement
|
||||
hi def link sasGlobalStatementODSKeyword Statement
|
||||
hi def link sasSectionKeyword Statement
|
||||
hi def link sasDataStepFunctionName Function
|
||||
hi def link sasDataStepCallRoutineName Function
|
||||
hi def link sasDataStepStatementKeyword Statement
|
||||
hi def link sasDataStepStatementHashKeyword Statement
|
||||
hi def link sasDataStepHashOperator Operator
|
||||
hi def link sasDataStepHashMethodName Function
|
||||
hi def link sasDataStepHashAttributeName Identifier
|
||||
hi def link sasProcStatementKeyword Statement
|
||||
hi def link sasODSGraphicsProcStatementKeyword Statement
|
||||
hi def link sasGraphProcStatementKeyword Statement
|
||||
hi def link sasAnalyticalProcStatementKeyword Statement
|
||||
hi def link sasProcTemplateStatementKeyword Statement
|
||||
hi def link sasProcTemplateStatementComplexKeyword Statement
|
||||
hi def link sasProcTemplateGTLStatementKeyword Statement
|
||||
hi def link sasProcTemplateGTLComplexKeyword Statement
|
||||
hi def link sasProcSQLFunctionName Function
|
||||
hi def link sasProcSQLStatementKeyword Statement
|
||||
hi def link sasProcSQLStatementComplexKeyword Statement
|
||||
hi def link sasProcSQLStatementNextKeyword Statement
|
||||
hi def link sasDS2FunctionName Function
|
||||
hi def link sasDS2StatementKeyword Statement
|
||||
hi def link sasIMLFunctionName Function
|
||||
hi def link sasIMLCallRoutineName Function
|
||||
hi def link sasIMLStatementKeyword Statement
|
||||
hi def link sasMacroReserved PreProc
|
||||
hi def link sasMacroVariable Define
|
||||
hi def link sasMacroFunctionName Define
|
||||
hi def link sasDataLine SpecialChar
|
||||
hi def link sasFormat SpecialChar
|
||||
hi def link sasReserved Special
|
||||
|
||||
" Syncronize from beginning to keep large blocks from losing
|
||||
" syntax coloring while moving through code.
|
||||
@@ -264,4 +261,5 @@ syn sync fromstart
|
||||
|
||||
let b:current_syntax = "sas"
|
||||
|
||||
" vim: ts=8
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
32
runtime/syntax/sbt.vim
Normal file
32
runtime/syntax/sbt.vim
Normal file
@@ -0,0 +1,32 @@
|
||||
" Vim syntax file
|
||||
" Language: sbt
|
||||
" Maintainer: Steven Dobay <stevendobay at protonmail.com>
|
||||
" Last Change: 2017.04.30
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! syntax/scala.vim
|
||||
|
||||
syn region sbtString start="\"[^"]" skip="\\\"" end="\"" contains=sbtStringEscape
|
||||
syn match sbtStringEscape "\\u[0-9a-fA-F]\{4}" contained
|
||||
syn match sbtStringEscape "\\[nrfvb\\\"]" contained
|
||||
|
||||
syn match sbtIdentitifer "^\S\+\ze\s*\(:=\|++=\|+=\|<<=\|<+=\)"
|
||||
syn match sbtBeginningSeq "^[Ss]eq\>"
|
||||
|
||||
syn match sbtSpecial "\(:=\|++=\|+=\|<<=\|<+=\)"
|
||||
|
||||
syn match sbtLineComment "//.*"
|
||||
syn region sbtComment start="/\*" end="\*/"
|
||||
syn region sbtDocComment start="/\*\*" end="\*/" keepend
|
||||
|
||||
hi link sbtString String
|
||||
hi link sbtIdentitifer Keyword
|
||||
hi link sbtBeginningSeq Keyword
|
||||
hi link sbtSpecial Special
|
||||
hi link sbtComment Comment
|
||||
hi link sbtLineComment Comment
|
||||
hi link sbtDocComment Comment
|
||||
|
||||
File diff suppressed because one or more lines are too long
78
src/Makefile
78
src/Makefile
@@ -207,7 +207,7 @@
|
||||
#SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar
|
||||
#SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert
|
||||
#SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif,Athena4.6b (P) Lennart Schultz
|
||||
#Tandem/NSK (c) Matthew Woehlke
|
||||
#Tandem/NSK (c) Matthew Woehlke
|
||||
#Unisys 6035 cc +X11 Motif 5.3 (8) Glauber Ribeiro
|
||||
#ESIX V4.2 cc +X11 6.0 (a) Reinhard Wobst
|
||||
#Mac OS X 10.[23] gcc Carbon 6.2 (x) Bram Moolenaar
|
||||
@@ -403,6 +403,7 @@ CClink = $(CC)
|
||||
# First one is for static linking, second one for dynamic loading.
|
||||
# Use --with-luajit if you want to use LuaJIT instead of Lua.
|
||||
# Set PATH environment variable to find lua or luajit executable.
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
#CONF_OPT_LUA = --enable-luainterp
|
||||
#CONF_OPT_LUA = --enable-luainterp=dynamic
|
||||
#CONF_OPT_LUA = --enable-luainterp --with-luajit
|
||||
@@ -429,16 +430,15 @@ CClink = $(CC)
|
||||
# the next line.
|
||||
# When you get an error for a missing "perl.exp" file, try creating an empty
|
||||
# one: "touch perl.exp".
|
||||
# This requires at least "small" features, "tiny" doesn't work.
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
#CONF_OPT_PERL = --enable-perlinterp
|
||||
#CONF_OPT_PERL = --enable-perlinterp=dynamic
|
||||
|
||||
# PYTHON
|
||||
# Uncomment this when you want to include the Python interface.
|
||||
# Requires small features or better, fails with tiny features.
|
||||
# Uncomment lines here when you want to include the Python interface.
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
# NOTE: This may cause threading to be enabled, which has side effects (such
|
||||
# as using different libraries and debugging becomes more difficult).
|
||||
# NOTE: Using this together with Perl may cause a crash in initialization.
|
||||
# For Python3 support make a symbolic link in /usr/local/bin:
|
||||
# ln -s python3 python3.1
|
||||
# If both python2.x and python3.x are enabled then the linking will be via
|
||||
@@ -454,6 +454,7 @@ CClink = $(CC)
|
||||
# Uncomment this when you want to include the Ruby interface.
|
||||
# First one for static linking, second one for loading when used.
|
||||
# Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu).
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
#CONF_OPT_RUBY = --enable-rubyinterp
|
||||
#CONF_OPT_RUBY = --enable-rubyinterp=dynamic
|
||||
#CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
|
||||
@@ -617,7 +618,7 @@ AUTOCONF = autoconf
|
||||
#PURIFY = purify
|
||||
|
||||
# VALGRIND - remove the # to use valgrind for memory leaks and access errors.
|
||||
# Used for the unittest targets.
|
||||
# Used for the unittest targets.
|
||||
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=25 --log-file=valgrind.$@
|
||||
|
||||
# NBDEBUG - debugging the netbeans interface.
|
||||
@@ -649,15 +650,15 @@ LINT_OPTIONS = -beprxzF
|
||||
# coverage information. (provided by Yegappan Lakshmanan)
|
||||
# 1. make clean, run configure and build Vim as usual.
|
||||
# 2. Generate the baseline code coverage information:
|
||||
# $ lcov -c -i -b . -d objects -o objects/coverage_base.info
|
||||
# $ lcov -c -i -b . -d objects -o objects/coverage_base.info
|
||||
# 3. Run "make test" to run the unit tests. The code coverage information will
|
||||
# be generated in the src/objects directory.
|
||||
# 4. Generate the code coverage information from the tests:
|
||||
# $ lcov -c -b . -d objects/ -o objects/coverage_test.info
|
||||
# $ lcov -c -b . -d objects/ -o objects/coverage_test.info
|
||||
# 5. Combine the baseline and test code coverage data:
|
||||
# $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
|
||||
# $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
|
||||
# 6. Process the test coverage data and generate a report in html:
|
||||
# $ genhtml objects/coverage_total.info -o objects
|
||||
# $ genhtml objects/coverage_total.info -o objects
|
||||
# 7. Open the objects/index.html file in a web browser to view the coverage
|
||||
# information.
|
||||
#
|
||||
@@ -1407,6 +1408,11 @@ PROTO_FLAGS = -d -E"$(CPP)" $(NO_ATTR)
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
# We would normally use "mkdir -p" but it doesn't work properly everywhere.
|
||||
# Using AC_PROG_MKDIR_P in configure.ac has a problem with the "auto"
|
||||
# directory. Always use the install-sh script, it's slower but reliable.
|
||||
MKDIR_P = $(SHELL) install-sh -c -d
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .pro
|
||||
|
||||
@@ -1884,10 +1890,12 @@ autoconf:
|
||||
-rm -rf autom4te.cache
|
||||
-rm -f auto/config.status auto/config.cache
|
||||
|
||||
# Re-execute this Makefile to include the new auto/config.mk produced by
|
||||
# configure Only used when typing "make" with a fresh auto/config.mk.
|
||||
myself:
|
||||
$(MAKE) -f Makefile all
|
||||
# Run vim script to generate the Ex command lookup table.
|
||||
# This only needs to be run when a command name has been added or changed.
|
||||
# If this fails because you don't have Vim yet, first build and install Vim
|
||||
# without changes.
|
||||
cmdidxs: ex_cmds.h
|
||||
vim -u NONE -i NONE -X -S create_cmdidxs.vim
|
||||
|
||||
|
||||
# The normal command to compile a .c file to its .o file.
|
||||
@@ -2079,7 +2087,7 @@ test1 \
|
||||
test30 test31 test32 test33 test34 test36 test37 test38 test39 \
|
||||
test40 test41 test42 test43 test44 test45 test48 test49 \
|
||||
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \
|
||||
test60 test64 test65 test66 test67 test68 test69 \
|
||||
test60 test64 test66 test67 test68 test69 \
|
||||
test70 test72 test73 test74 test75 test77 test78 test79 \
|
||||
test80 test82 test83 test84 test85 test86 test87 test88 \
|
||||
test90 test91 test94 test95 test97 test98 test99 \
|
||||
@@ -2096,6 +2104,7 @@ test_arglist \
|
||||
test_backspace_opt \
|
||||
test_breakindent \
|
||||
test_bufwintabinfo \
|
||||
test_cd \
|
||||
test_cdo \
|
||||
test_changedtick \
|
||||
test_channel \
|
||||
@@ -2111,10 +2120,10 @@ test_arglist \
|
||||
test_delete \
|
||||
test_diffmode \
|
||||
test_digraph \
|
||||
test_functions \
|
||||
test_display \
|
||||
test_edit \
|
||||
test_ex_undo \
|
||||
test_ex_z \
|
||||
test_execute_func \
|
||||
test_expand \
|
||||
test_expand_dllpath \
|
||||
@@ -2124,6 +2133,7 @@ test_arglist \
|
||||
test_feedkeys \
|
||||
test_file_perm \
|
||||
test_fileformat \
|
||||
test_filetype \
|
||||
test_filter_cmd \
|
||||
test_filter_map \
|
||||
test_findfile \
|
||||
@@ -2131,9 +2141,11 @@ test_arglist \
|
||||
test_fnameescape \
|
||||
test_fnamemodify \
|
||||
test_fold \
|
||||
test_functions \
|
||||
test_ga \
|
||||
test_gf \
|
||||
test_glob2regpat \
|
||||
test_global \
|
||||
test_gn \
|
||||
test_goto \
|
||||
test_gui \
|
||||
@@ -2185,6 +2197,7 @@ test_arglist \
|
||||
test_pyx2 \
|
||||
test_pyx3 \
|
||||
test_quickfix \
|
||||
test_quotestar \
|
||||
test_recover \
|
||||
test_regexp_latin \
|
||||
test_regexp_utf8 \
|
||||
@@ -2211,6 +2224,7 @@ test_arglist \
|
||||
test_tabpage \
|
||||
test_tagcase \
|
||||
test_tagjump \
|
||||
test_taglist \
|
||||
test_tcl \
|
||||
test_textobjects \
|
||||
test_timers \
|
||||
@@ -2551,7 +2565,7 @@ DESKTOPPATH = $(DESTDIR)$(DATADIR)/applications
|
||||
KDEPATH = $(HOME)/.kde/share/icons
|
||||
install-icons:
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
$(SHELL) ./mkinstalldirs $(ICON48PATH) $(ICON32PATH) \
|
||||
$(MKDIR_P) $(ICON48PATH) $(ICON32PATH) \
|
||||
$(ICON16PATH) $(DESKTOPPATH); \
|
||||
fi
|
||||
|
||||
@@ -2592,7 +2606,7 @@ $(DESTDIR)$(exec_prefix) $(DEST_BIN) \
|
||||
$(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) $(DEST_MACRO) \
|
||||
$(DEST_PACK) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \
|
||||
$(DEST_AUTO) $(DEST_AUTO)/xml $(DEST_PLUG):
|
||||
-$(SHELL) ./mkinstalldirs $@
|
||||
$(MKDIR_P) $@
|
||||
-chmod $(DIRMOD) $@
|
||||
|
||||
# create links from various names to vim. This is only done when the links
|
||||
@@ -2755,7 +2769,8 @@ uninstall_runtime:
|
||||
# Clean up all the files that have been produced, except configure's.
|
||||
# We support common typing mistakes for Juergen! :-)
|
||||
clean celan: testclean
|
||||
-rm -f *.o objects/* core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o
|
||||
-rm -f *.o core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o
|
||||
-rm -rf objects
|
||||
-rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c auto/gui_gtk_gresources.c auto/gui_gtk_gresources.h
|
||||
-rm -f conftest* *~ auto/link.sed
|
||||
-rm -f testdir/opt_test.vim
|
||||
@@ -2772,25 +2787,25 @@ clean celan: testclean
|
||||
SHADOWDIR = shadow
|
||||
|
||||
shadow: runtime pixmaps
|
||||
mkdir $(SHADOWDIR)
|
||||
cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../vimtutor ../gvimtutor ../mkinstalldirs .
|
||||
$(MKDIR_P) $(SHADOWDIR)
|
||||
cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../vimtutor ../gvimtutor ../install-sh .
|
||||
mkdir $(SHADOWDIR)/auto
|
||||
cd $(SHADOWDIR)/auto; ln -s ../../auto/configure .
|
||||
mkdir $(SHADOWDIR)/po
|
||||
$(MKDIR_P) $(SHADOWDIR)/po
|
||||
cd $(SHADOWDIR)/po; ln -s ../../po/*.po ../../po/*.mak ../../po/*.vim ../../po/Makefile .
|
||||
cd $(SHADOWDIR); rm -f auto/link.sed
|
||||
cp Makefile configure $(SHADOWDIR)
|
||||
rm -f $(SHADOWDIR)/auto/config.mk $(SHADOWDIR)/config.mk.dist
|
||||
cp config.mk.dist $(SHADOWDIR)/auto/config.mk
|
||||
cp config.mk.dist $(SHADOWDIR)
|
||||
mkdir $(SHADOWDIR)/xxd
|
||||
$(MKDIR_P) $(SHADOWDIR)/xxd
|
||||
cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
|
||||
if test -d $(RSRC_DIR); then \
|
||||
cd $(SHADOWDIR); \
|
||||
ln -s ../infplist.xml .; \
|
||||
ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
|
||||
fi
|
||||
mkdir $(SHADOWDIR)/testdir
|
||||
$(MKDIR_P) $(SHADOWDIR)/testdir
|
||||
cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \
|
||||
../../testdir/Make_all.mak \
|
||||
../../testdir/README.txt \
|
||||
@@ -2927,7 +2942,7 @@ auto/gui_gtk_gresources.h: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS)
|
||||
objects: objects/.dirstamp
|
||||
|
||||
objects/.dirstamp:
|
||||
mkdir -p objects
|
||||
$(MKDIR_P) objects
|
||||
touch objects/.dirstamp
|
||||
|
||||
# All object files depend on the objects directory, so that parallel make
|
||||
@@ -3258,8 +3273,7 @@ install_macosx: gui_bundle
|
||||
# Generate the help tags file now, it won't work with "make installruntime".
|
||||
-@srcdir=`pwd`; cd $(HELPSOURCE); $(MAKE) VIMEXE=$$srcdir/$(VIMTARGET) vimtags
|
||||
# Install the runtime files. Recursive!
|
||||
-mkdir -p $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime
|
||||
# -mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin
|
||||
$(MKDIR_P) $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime
|
||||
srcdir=`pwd`; $(MAKE) -f Makefile installruntime \
|
||||
VIMEXE=$$srcdir/$(VIMTARGET) \
|
||||
prefix=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR) \
|
||||
@@ -3277,16 +3291,16 @@ gui_bundle: $(RESDIR) bundle-dir bundle-executable bundle-info bundle-resource \
|
||||
bundle-language
|
||||
|
||||
$(RESDIR):
|
||||
mkdir -p $@
|
||||
$(MKDIR_P) $@
|
||||
|
||||
bundle-dir: $(APPDIR)/Contents $(VIMTARGET)
|
||||
# Make a link to the runtime directory, so that we can try out the executable
|
||||
# without installing it.
|
||||
mkdir -p $(RESDIR)/vim
|
||||
$(MKDIR_P) $(RESDIR)/vim
|
||||
-ln -s `pwd`/../runtime $(RESDIR)/vim
|
||||
|
||||
bundle-executable: $(VIMTARGET)
|
||||
mkdir -p $(APPDIR)/Contents/MacOS
|
||||
$(MKDIR_P) $(APPDIR)/Contents/MacOS
|
||||
cp $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET)
|
||||
|
||||
bundle-info: bundle-dir
|
||||
@@ -3317,8 +3331,8 @@ bundle-rsrc: os_mac.rsr.hqx
|
||||
bundle-language: bundle-dir
|
||||
|
||||
$(APPDIR)/Contents:
|
||||
-$(SHELL) ./mkinstalldirs $(APPDIR)/Contents/MacOS
|
||||
-$(SHELL) ./mkinstalldirs $(RESDIR)/English.lproj
|
||||
$(MKDIR_P) $(APPDIR)/Contents/MacOS
|
||||
$(MKDIR_P) $(RESDIR)/English.lproj
|
||||
|
||||
|
||||
###############################################################################
|
||||
|
||||
10
src/arabic.c
10
src/arabic.c
@@ -24,7 +24,9 @@ static int chg_c_a2s(int cur_c);
|
||||
static int chg_c_a2i(int cur_c);
|
||||
static int chg_c_a2m(int cur_c);
|
||||
static int chg_c_a2f(int cur_c);
|
||||
#if 0
|
||||
static int chg_c_i2m(int cur_c);
|
||||
#endif
|
||||
static int chg_c_f2m(int cur_c);
|
||||
static int chg_c_laa2i(int hid_c);
|
||||
static int chg_c_laa2f(int hid_c);
|
||||
@@ -418,7 +420,10 @@ chg_c_a2f(int cur_c)
|
||||
|
||||
/*
|
||||
* Change shape - from Initial to Medial
|
||||
* This code is unreachable, because for the relevant characters ARABIC_CHAR()
|
||||
* is FALSE;
|
||||
*/
|
||||
#if 0
|
||||
static int
|
||||
chg_c_i2m(int cur_c)
|
||||
{
|
||||
@@ -450,6 +455,7 @@ chg_c_i2m(int cur_c)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ -608,7 +614,11 @@ arabic_shape(
|
||||
else if (!shape_c || A_is_f(shape_c) || A_is_s(shape_c) || prev_laa)
|
||||
curr_c = A_is_valid(next_c) ? chg_c_a2i(c) : chg_c_a2s(c);
|
||||
else if (A_is_valid(next_c))
|
||||
#if 0
|
||||
curr_c = A_is_iso(c) ? chg_c_a2m(c) : chg_c_i2m(c);
|
||||
#else
|
||||
curr_c = A_is_iso(c) ? chg_c_a2m(c) : 0;
|
||||
#endif
|
||||
else if (A_is_valid(prev_c))
|
||||
curr_c = chg_c_a2f(c);
|
||||
else
|
||||
|
||||
31
src/auto/configure
vendored
31
src/auto/configure
vendored
@@ -3446,7 +3446,7 @@ ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
ac_ext=c
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
@@ -3723,7 +3723,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||
|
||||
fi
|
||||
rm -f conftest*
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
|
||||
$as_echo_n "checking for fgrep... " >&6; }
|
||||
if ${ac_cv_path_FGREP+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
@@ -3789,7 +3789,7 @@ fi
|
||||
$as_echo "$ac_cv_path_FGREP" >&6; }
|
||||
FGREP="$ac_cv_path_FGREP"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
|
||||
$as_echo_n "checking for library containing strerror... " >&6; }
|
||||
if ${ac_cv_search_strerror+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
@@ -3844,7 +3844,7 @@ if test "$ac_res" != no; then :
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
|
||||
fi
|
||||
for ac_prog in gawk mawk nawk awk
|
||||
for ac_prog in gawk mawk nawk awk
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
@@ -8997,11 +8997,6 @@ $as_echo "no" >&6; }
|
||||
fi
|
||||
fi
|
||||
if test "x$GUITYPE" = "xGTK"; then
|
||||
if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
|
||||
|| test "0$gtk_minor_version" -ge 2; then
|
||||
$as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
if test -z "$SKIP_GNOME"; then
|
||||
{
|
||||
|
||||
@@ -9294,8 +9289,6 @@ $as_echo "no" >&6; }
|
||||
SKIP_MOTIF=YES
|
||||
GUITYPE=GTK
|
||||
|
||||
$as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
|
||||
|
||||
$as_echo "#define USE_GTK3 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
@@ -11506,16 +11499,15 @@ if test "x$vim_cv_terminfo" = "xyes" ; then
|
||||
|
||||
fi
|
||||
|
||||
if test "x$olibs" != "x$LIBS"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what tgetent() returns for an unknown terminal" >&5
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what tgetent() returns for an unknown terminal" >&5
|
||||
$as_echo_n "checking what tgetent() returns for an unknown terminal... " >&6; }
|
||||
if ${vim_cv_tgent+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
if test "$cross_compiling" = yes; then :
|
||||
if test "$cross_compiling" = yes; then :
|
||||
|
||||
as_fn_error $? "failed to compile test program." "$LINENO" 5
|
||||
as_fn_error $? "failed to compile test program." "$LINENO" 5
|
||||
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
@@ -11535,11 +11527,11 @@ main()
|
||||
_ACEOF
|
||||
if ac_fn_c_try_run "$LINENO"; then :
|
||||
|
||||
vim_cv_tgent=zero
|
||||
vim_cv_tgent=zero
|
||||
|
||||
else
|
||||
|
||||
vim_cv_tgent=non-zero
|
||||
vim_cv_tgent=non-zero
|
||||
|
||||
fi
|
||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
||||
@@ -11551,10 +11543,9 @@ fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_tgent" >&5
|
||||
$as_echo "$vim_cv_tgent" >&6; }
|
||||
|
||||
if test "x$vim_cv_tgent" = "xzero" ; then
|
||||
$as_echo "#define TGETENT_ZERO_ERR 0" >>confdefs.h
|
||||
if test "x$vim_cv_tgent" = "xzero" ; then
|
||||
$as_echo "#define TGETENT_ZERO_ERR 0" >>confdefs.h
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termcap.h contains ospeed" >&5
|
||||
|
||||
23
src/buffer.c
23
src/buffer.c
@@ -372,18 +372,23 @@ open_buffer(
|
||||
set_bufref(bufref_T *bufref, buf_T *buf)
|
||||
{
|
||||
bufref->br_buf = buf;
|
||||
bufref->br_fnum = buf->b_fnum;
|
||||
bufref->br_buf_free_count = buf_free_count;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if "bufref->br_buf" points to a valid buffer.
|
||||
* Return TRUE if "bufref->br_buf" points to the same buffer as when
|
||||
* set_bufref() was called and it is a valid buffer.
|
||||
* Only goes through the buffer list if buf_free_count changed.
|
||||
* Also checks if b_fnum is still the same, a :bwipe followed by :new might get
|
||||
* the same allocated memory, but it's a different buffer.
|
||||
*/
|
||||
int
|
||||
bufref_valid(bufref_T *bufref)
|
||||
{
|
||||
return bufref->br_buf_free_count == buf_free_count
|
||||
? TRUE : buf_valid(bufref->br_buf);
|
||||
? TRUE : buf_valid(bufref->br_buf)
|
||||
&& bufref->br_fnum == bufref->br_buf->b_fnum;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2261,14 +2266,14 @@ free_buf_options(
|
||||
}
|
||||
|
||||
/*
|
||||
* get alternate file n
|
||||
* set linenr to lnum or altfpos.lnum if lnum == 0
|
||||
* also set cursor column to altfpos.col if 'startofline' is not set.
|
||||
* Get alternate file "n".
|
||||
* Set linenr to "lnum" or altfpos.lnum if "lnum" == 0.
|
||||
* Also set cursor column to altfpos.col if 'startofline' is not set.
|
||||
* if (options & GETF_SETMARK) call setpcmark()
|
||||
* if (options & GETF_ALT) we are jumping to an alternate file.
|
||||
* if (options & GETF_SWITCH) respect 'switchbuf' settings when jumping
|
||||
*
|
||||
* return FAIL for failure, OK for success
|
||||
* Return FAIL for failure, OK for success.
|
||||
*/
|
||||
int
|
||||
buflist_getfile(
|
||||
@@ -2347,8 +2352,8 @@ buflist_getfile(
|
||||
#endif
|
||||
|
||||
++RedrawingDisabled;
|
||||
if (getfile(buf->b_fnum, NULL, NULL, (options & GETF_SETMARK),
|
||||
lnum, forceit) <= 0)
|
||||
if (GETFILE_SUCCESS(getfile(buf->b_fnum, NULL, NULL,
|
||||
(options & GETF_SETMARK), lnum, forceit)))
|
||||
{
|
||||
--RedrawingDisabled;
|
||||
|
||||
@@ -2999,7 +3004,7 @@ buflist_findlnum(buf_T *buf)
|
||||
|
||||
#if defined(FEAT_LISTCMDS) || defined(PROTO)
|
||||
/*
|
||||
* List all know file names (for :files and :buffers command).
|
||||
* List all known file names (for :files and :buffers command).
|
||||
*/
|
||||
void
|
||||
buflist_list(exarg_T *eap)
|
||||
|
||||
@@ -2404,7 +2404,7 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
curbuf = curwin->w_buffer;
|
||||
}
|
||||
}
|
||||
redraw_buf_later(buffer, VALID);
|
||||
redraw_buf_and_status_later(buffer, VALID);
|
||||
channel_need_redraw = TRUE;
|
||||
}
|
||||
|
||||
@@ -2571,9 +2571,14 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
if (nl == NULL)
|
||||
{
|
||||
/* Flush remaining message that is missing a NL. */
|
||||
buf = vim_realloc(buf, node->rq_buflen + 1);
|
||||
if (buf == NULL)
|
||||
char_u *new_buf;
|
||||
|
||||
new_buf = vim_realloc(buf, node->rq_buflen + 1);
|
||||
if (new_buf == NULL)
|
||||
/* This might fail over and over again, should the message
|
||||
* be dropped? */
|
||||
return FALSE;
|
||||
buf = new_buf;
|
||||
node->rq_buffer = buf;
|
||||
nl = buf + node->rq_buflen++;
|
||||
*nl = NUL;
|
||||
@@ -5143,12 +5148,17 @@ job_stop(job_T *job, typval_T *argvars)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (job->jv_status == JOB_ENDED)
|
||||
{
|
||||
ch_log(job->jv_channel, "Job has already ended, job_stop() skipped");
|
||||
return 0;
|
||||
}
|
||||
ch_logs(job->jv_channel, "Stopping job with '%s'", (char *)arg);
|
||||
if (mch_stop_job(job, arg) == FAIL)
|
||||
return 0;
|
||||
|
||||
/* Assume that "hup" does not kill the job. */
|
||||
if (job->jv_channel != NULL && STRCMP(arg, "hup") != 0)
|
||||
/* Assume that only "kill" will kill the job. */
|
||||
if (job->jv_channel != NULL && STRCMP(arg, "kill") == 0)
|
||||
job->jv_channel->ch_job_killed = TRUE;
|
||||
|
||||
/* We don't try freeing the job, obviously the caller still has a
|
||||
|
||||
@@ -960,7 +960,7 @@ vim_isfilec_or_wc(int c)
|
||||
}
|
||||
|
||||
/*
|
||||
* return TRUE if 'c' is a printable character
|
||||
* Return TRUE if 'c' is a printable character.
|
||||
* Assume characters above 0x100 are printable (multi-byte), except for
|
||||
* Unicode.
|
||||
*/
|
||||
@@ -1717,7 +1717,7 @@ vim_toupper(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return c;
|
||||
if (c >= 0x80)
|
||||
if (c >= 0x80 || !(cmp_flags & CMP_KEEPASCII))
|
||||
{
|
||||
if (enc_utf8)
|
||||
return utf_toupper(c);
|
||||
@@ -1733,6 +1733,8 @@ vim_toupper(int c)
|
||||
if (enc_latin1like)
|
||||
return latin1upper[c];
|
||||
}
|
||||
if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
|
||||
return TOUPPER_ASC(c);
|
||||
return TOUPPER_LOC(c);
|
||||
}
|
||||
|
||||
@@ -1741,7 +1743,7 @@ vim_tolower(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return c;
|
||||
if (c >= 0x80)
|
||||
if (c >= 0x80 || !(cmp_flags & CMP_KEEPASCII))
|
||||
{
|
||||
if (enc_utf8)
|
||||
return utf_tolower(c);
|
||||
@@ -1757,6 +1759,8 @@ vim_tolower(int c)
|
||||
if (enc_latin1like)
|
||||
return latin1lower[c];
|
||||
}
|
||||
if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
|
||||
return TOLOWER_ASC(c);
|
||||
return TOLOWER_LOC(c);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -398,9 +398,6 @@
|
||||
/* Define if you use KDE and want KDE Toolbar support. */
|
||||
#undef FEAT_KDETOOLBAR
|
||||
|
||||
/* Define if GTK+ multihead support is available (requires GTK+ >= 2.1.1). */
|
||||
#undef HAVE_GTK_MULTIHEAD
|
||||
|
||||
/* Define if your X has own locale library */
|
||||
#undef X_LOCALE
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
the first targets to make vim are: scratch config myself
|
||||
the first target to make vim is: reconfig
|
||||
srcdir = .
|
||||
VIMNAME = vim
|
||||
EXNAME = ex
|
||||
|
||||
@@ -11,12 +11,12 @@ AC_DEFINE(UNIX)
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC dnl required by almost everything
|
||||
AC_PROG_CPP dnl required by header file checks
|
||||
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
|
||||
AC_PROG_FGREP dnl finds working grep -F
|
||||
AC_ISC_POSIX dnl required by AC_C_CROSS
|
||||
AC_PROG_AWK dnl required for "make html" in ../doc
|
||||
AC_PROG_CC dnl required by almost everything
|
||||
AC_PROG_CPP dnl required by header file checks
|
||||
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
|
||||
AC_PROG_FGREP dnl finds working grep -F
|
||||
AC_ISC_POSIX dnl required by AC_C_CROSS
|
||||
AC_PROG_AWK dnl required for "make html" in ../doc
|
||||
|
||||
dnl Don't strip if we don't have it
|
||||
AC_CHECK_PROG(STRIP, strip, strip, :)
|
||||
@@ -2606,10 +2606,6 @@ if test -z "$SKIP_GTK2"; then
|
||||
fi
|
||||
fi
|
||||
if test "x$GUITYPE" = "xGTK"; then
|
||||
if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
|
||||
|| test "0$gtk_minor_version" -ge 2; then
|
||||
AC_DEFINE(HAVE_GTK_MULTIHEAD)
|
||||
fi
|
||||
dnl
|
||||
dnl if GTK exists, then check for GNOME.
|
||||
dnl
|
||||
@@ -2658,7 +2654,6 @@ if test -z "$SKIP_GTK3"; then
|
||||
SKIP_MOTIF=YES
|
||||
GUITYPE=GTK
|
||||
AC_SUBST(GTK_LIBNAME)
|
||||
AC_DEFINE(HAVE_GTK_MULTIHEAD)
|
||||
AC_DEFINE(USE_GTK3)
|
||||
fi
|
||||
fi
|
||||
@@ -3355,10 +3350,9 @@ if test "x$vim_cv_terminfo" = "xyes" ; then
|
||||
AC_DEFINE(TERMINFO)
|
||||
fi
|
||||
|
||||
if test "x$olibs" != "x$LIBS"; then
|
||||
AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent],
|
||||
[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent],
|
||||
[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include "confdefs.h"
|
||||
#ifdef HAVE_TERMCAP_H
|
||||
# include <termcap.h>
|
||||
@@ -3369,18 +3363,17 @@ if test "x$olibs" != "x$LIBS"; then
|
||||
#endif
|
||||
main()
|
||||
{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }
|
||||
]])],[
|
||||
vim_cv_tgent=zero
|
||||
],[
|
||||
vim_cv_tgent=non-zero
|
||||
],[
|
||||
AC_MSG_ERROR(failed to compile test program.)
|
||||
])
|
||||
]])],[
|
||||
vim_cv_tgent=zero
|
||||
],[
|
||||
vim_cv_tgent=non-zero
|
||||
],[
|
||||
AC_MSG_ERROR(failed to compile test program.)
|
||||
])
|
||||
|
||||
if test "x$vim_cv_tgent" = "xzero" ; then
|
||||
AC_DEFINE(TGETENT_ZERO_ERR, 0)
|
||||
fi
|
||||
])
|
||||
|
||||
if test "x$vim_cv_tgent" = "xzero" ; then
|
||||
AC_DEFINE(TGETENT_ZERO_ERR, 0)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether termcap.h contains ospeed)
|
||||
|
||||
81
src/create_cmdidxs.vim
Normal file
81
src/create_cmdidxs.vim
Normal file
@@ -0,0 +1,81 @@
|
||||
" This script generates the tables cmdidxs1[] and cmdidxs2[][] which,
|
||||
" given a Ex command, determine the first value to probe to find
|
||||
" a matching command in cmdnames[] based on the first character
|
||||
" and the first 2 characters of the command.
|
||||
" This is used to speed up lookup in cmdnames[].
|
||||
"
|
||||
" Script should be run every time new Ex commands are added in Vim,
|
||||
" from the src/vim directory, since it reads commands from "ex_cmds.h".
|
||||
|
||||
let cmds = []
|
||||
let skipped_cmds = 0
|
||||
|
||||
for line in readfile('ex_cmds.h')
|
||||
if line =~ '^EX(CMD_'
|
||||
let m = matchlist(line, '^EX(CMD_\S*,\s*"\([a-z][^"]*\)"')
|
||||
if len(m) >= 2
|
||||
let cmds += [ m[1] ]
|
||||
else
|
||||
let skipped_cmds += 1
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
let cmdidxs1 = {}
|
||||
let cmdidxs2 = {}
|
||||
|
||||
for i in range(len(cmds) - 1, 0, -1)
|
||||
let cmd = cmds[i]
|
||||
let c1 = cmd[0] " First character of command
|
||||
let c2 = cmd[1] " Second character of command (if any)
|
||||
|
||||
let cmdidxs1{c1} = i
|
||||
if c2 >= 'a' && c2 <= 'z'
|
||||
let cmdidxs2{c1}{c2} = i
|
||||
endif
|
||||
endfor
|
||||
|
||||
let output = [ '/* Automatically generated code by create_cmdidxs.vim' ]
|
||||
let output += [ ' *' ]
|
||||
let output += [ ' * Table giving the index of the first command in cmdnames[] to lookup' ]
|
||||
let output += [ ' * based on the first letter of a command.' ]
|
||||
let output += [ ' */' ]
|
||||
let output += [ 'static const unsigned short cmdidxs1[26] =' ]
|
||||
let output += [ '{' ]
|
||||
|
||||
let a_to_z = map(range(char2nr('a'), char2nr('z')), 'nr2char(v:val)')
|
||||
for c1 in a_to_z
|
||||
let line = ' /* ' . c1 . ' */ ' . cmdidxs1{c1} . ((c1 == 'z') ? '' : ',')
|
||||
let output += [ line ]
|
||||
endfor
|
||||
let output += [ '};' ]
|
||||
let output += [ '' ]
|
||||
let output += [ '/*' ]
|
||||
let output += [ ' * Table giving the index of the first command in cmdnames[] to lookup' ]
|
||||
let output += [ ' * based on the first 2 letters of a command.' ]
|
||||
let output += [ ' * Values in cmdidxs2[c1][c2] are relative to cmdidxs1[c1] so that they' ]
|
||||
let output += [ ' * fit in a byte.' ]
|
||||
let output += [ ' */' ]
|
||||
let output += [ 'static const unsigned char cmdidxs2[26][26] =' ]
|
||||
let output += [ '{ /* a b c d e f g h i j k l m n o p q r s t u v w x y z */' ]
|
||||
|
||||
for c1 in a_to_z
|
||||
let line = ' /* ' . c1 . ' */ {'
|
||||
for c2 in a_to_z
|
||||
if exists('cmdidxs2{c1}{c2}')
|
||||
let line .= printf('%3d', cmdidxs2{c1}{c2} - cmdidxs1{c1})
|
||||
else
|
||||
let line .= ' 0'
|
||||
endif
|
||||
let line .= (c2 == 'z') ? '' : ','
|
||||
endfor
|
||||
let line .= ' }' . ((c1 == 'z') ? '' : ',')
|
||||
let output += [ line ]
|
||||
endfor
|
||||
|
||||
let output += [ '};' ]
|
||||
let output += [ '' ]
|
||||
let output += [ 'static const int command_count = ' . (len(cmds) + skipped_cmds) . ';' ]
|
||||
|
||||
call writefile(output, "ex_cmdidxs.h")
|
||||
quit
|
||||
22
src/dict.c
22
src/dict.c
@@ -59,13 +59,23 @@ rettv_dict_alloc(typval_T *rettv)
|
||||
if (d == NULL)
|
||||
return FAIL;
|
||||
|
||||
rettv->vval.v_dict = d;
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv_dict_set(rettv, d);
|
||||
rettv->v_lock = 0;
|
||||
++d->dv_refcount;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set a dictionary as the return value
|
||||
*/
|
||||
void
|
||||
rettv_dict_set(typval_T *rettv, dict_T *d)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = d;
|
||||
if (d != NULL)
|
||||
++d->dv_refcount;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free a Dictionary, including all non-container items it contains.
|
||||
* Ignores the reference count.
|
||||
@@ -646,11 +656,7 @@ failret:
|
||||
|
||||
*arg = skipwhite(*arg + 1);
|
||||
if (evaluate)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = d;
|
||||
++d->dv_refcount;
|
||||
}
|
||||
rettv_dict_set(rettv, d);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1244,7 +1244,8 @@ ex_diffoff(exarg_T *eap)
|
||||
wp->w_p_wrap = wp->w_p_wrap_save;
|
||||
#ifdef FEAT_FOLDING
|
||||
free_string_option(wp->w_p_fdm);
|
||||
wp->w_p_fdm = vim_strsave(wp->w_p_fdm_save);
|
||||
wp->w_p_fdm = vim_strsave(
|
||||
*wp->w_p_fdm_save ? wp->w_p_fdm_save : (char_u*)"manual");
|
||||
|
||||
if (wp->w_p_fdc == diff_foldcolumn)
|
||||
wp->w_p_fdc = wp->w_p_fdc_save;
|
||||
|
||||
69
src/edit.c
69
src/edit.c
@@ -96,6 +96,7 @@ struct compl_S
|
||||
static compl_T *compl_first_match = NULL;
|
||||
static compl_T *compl_curr_match = NULL;
|
||||
static compl_T *compl_shown_match = NULL;
|
||||
static compl_T *compl_old_match = NULL;
|
||||
|
||||
/* After using a cursor key <Enter> selects a match in the popup menu,
|
||||
* otherwise it inserts a line break. */
|
||||
@@ -3431,6 +3432,7 @@ ins_compl_free(void)
|
||||
} while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
|
||||
compl_first_match = compl_curr_match = NULL;
|
||||
compl_shown_match = NULL;
|
||||
compl_old_match = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4272,7 +4274,6 @@ ins_compl_get_exp(pos_T *ini)
|
||||
char_u *ptr;
|
||||
char_u *dict = NULL;
|
||||
int dict_f = 0;
|
||||
compl_T *old_match;
|
||||
int set_match_pos;
|
||||
|
||||
if (!compl_started)
|
||||
@@ -4286,7 +4287,7 @@ ins_compl_get_exp(pos_T *ini)
|
||||
last_match_pos = first_match_pos = *ini;
|
||||
}
|
||||
|
||||
old_match = compl_curr_match; /* remember the last current match */
|
||||
compl_old_match = compl_curr_match; /* remember the last current match */
|
||||
pos = (compl_direction == FORWARD) ? &last_match_pos : &first_match_pos;
|
||||
/* For ^N/^P loop over all the flags/windows/buffers in 'complete' */
|
||||
for (;;)
|
||||
@@ -4388,6 +4389,11 @@ ins_compl_get_exp(pos_T *ini)
|
||||
}
|
||||
}
|
||||
|
||||
/* If complete() was called then compl_pattern has been reset. The
|
||||
* following won't work then, bail out. */
|
||||
if (compl_pattern == NULL)
|
||||
break;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case -1:
|
||||
@@ -4621,7 +4627,7 @@ ins_compl_get_exp(pos_T *ini)
|
||||
|
||||
/* check if compl_curr_match has changed, (e.g. other type of
|
||||
* expansion added something) */
|
||||
if (type != 0 && compl_curr_match != old_match)
|
||||
if (type != 0 && compl_curr_match != compl_old_match)
|
||||
found_new_match = OK;
|
||||
|
||||
/* break the loop for specialized modes (use 'complete' just for the
|
||||
@@ -4660,13 +4666,16 @@ ins_compl_get_exp(pos_T *ini)
|
||||
|| (ctrl_x_mode != 0 && !CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)))
|
||||
i = ins_compl_make_cyclic();
|
||||
|
||||
/* If several matches were added (FORWARD) or the search failed and has
|
||||
* just been made cyclic then we have to move compl_curr_match to the next
|
||||
* or previous entry (if any) -- Acevedo */
|
||||
compl_curr_match = compl_direction == FORWARD ? old_match->cp_next
|
||||
: old_match->cp_prev;
|
||||
if (compl_curr_match == NULL)
|
||||
compl_curr_match = old_match;
|
||||
if (compl_old_match != NULL)
|
||||
{
|
||||
/* If several matches were added (FORWARD) or the search failed and has
|
||||
* just been made cyclic then we have to move compl_curr_match to the
|
||||
* next or previous entry (if any) -- Acevedo */
|
||||
compl_curr_match = compl_direction == FORWARD ? compl_old_match->cp_next
|
||||
: compl_old_match->cp_prev;
|
||||
if (compl_curr_match == NULL)
|
||||
compl_curr_match = compl_old_match;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -4756,7 +4765,6 @@ ins_compl_next(
|
||||
int in_compl_func) /* called from complete_check() */
|
||||
{
|
||||
int num_matches = -1;
|
||||
int i;
|
||||
int todo = count;
|
||||
compl_T *found_compl = NULL;
|
||||
int found_end = FALSE;
|
||||
@@ -4948,15 +4956,30 @@ ins_compl_next(
|
||||
*/
|
||||
if (compl_shown_match->cp_fname != NULL)
|
||||
{
|
||||
STRCPY(IObuff, "match in file ");
|
||||
i = (vim_strsize(compl_shown_match->cp_fname) + 16) - sc_col;
|
||||
if (i <= 0)
|
||||
i = 0;
|
||||
else
|
||||
STRCAT(IObuff, "<");
|
||||
STRCAT(IObuff, compl_shown_match->cp_fname + i);
|
||||
msg(IObuff);
|
||||
redraw_cmdline = FALSE; /* don't overwrite! */
|
||||
char *lead = _("match in file");
|
||||
int space = sc_col - vim_strsize((char_u *)lead) - 2;
|
||||
char_u *s;
|
||||
char_u *e;
|
||||
|
||||
if (space > 0)
|
||||
{
|
||||
/* We need the tail that fits. With double-byte encoding going
|
||||
* back from the end is very slow, thus go from the start and keep
|
||||
* the text that fits in "space" between "s" and "e". */
|
||||
for (s = e = compl_shown_match->cp_fname; *e != NUL; MB_PTR_ADV(e))
|
||||
{
|
||||
space -= ptr2cells(e);
|
||||
while (space < 0)
|
||||
{
|
||||
space += ptr2cells(s);
|
||||
MB_PTR_ADV(s);
|
||||
}
|
||||
}
|
||||
vim_snprintf((char *)IObuff, IOSIZE, "%s %s%s", lead,
|
||||
s > compl_shown_match->cp_fname ? "<" : "", s);
|
||||
msg(IObuff);
|
||||
redraw_cmdline = FALSE; /* don't overwrite! */
|
||||
}
|
||||
}
|
||||
|
||||
return num_matches;
|
||||
@@ -9003,7 +9026,7 @@ ins_bs(
|
||||
#endif
|
||||
|
||||
/*
|
||||
* delete newline!
|
||||
* Delete newline!
|
||||
*/
|
||||
if (curwin->w_cursor.col == 0)
|
||||
{
|
||||
@@ -9018,7 +9041,7 @@ ins_bs(
|
||||
(linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
|
||||
return FALSE;
|
||||
--Insstart.lnum;
|
||||
Insstart.col = MAXCOL;
|
||||
Insstart.col = (colnr_T)STRLEN(ml_get(Insstart.lnum));
|
||||
}
|
||||
/*
|
||||
* In replace mode:
|
||||
@@ -9510,7 +9533,7 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
|
||||
#endif
|
||||
buf[idx++] = c;
|
||||
buf[idx] = NUL;
|
||||
if (end != NUL && STRNCMP(buf, end, idx) == 0)
|
||||
if (end != NULL && STRNCMP(buf, end, idx) == 0)
|
||||
{
|
||||
if (end[idx] == NUL)
|
||||
break; /* Found the end of paste code. */
|
||||
|
||||
20
src/eval.c
20
src/eval.c
@@ -4665,9 +4665,7 @@ eval_index(
|
||||
item = item->li_next;
|
||||
}
|
||||
clear_tv(rettv);
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = l;
|
||||
++l->lv_refcount;
|
||||
rettv_list_set(rettv, l);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5327,6 +5325,10 @@ garbage_collect(int testing)
|
||||
abort = abort || set_ref_in_timer(copyID);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_QUICKFIX
|
||||
abort = abort || set_ref_in_quickfix(copyID);
|
||||
#endif
|
||||
|
||||
if (!abort)
|
||||
{
|
||||
/*
|
||||
@@ -6120,13 +6122,16 @@ var2fpos(
|
||||
if (name[1] == '0') /* "w0": first visible line */
|
||||
{
|
||||
update_topline();
|
||||
pos.lnum = curwin->w_topline;
|
||||
/* In silent Ex mode topline is zero, but that's not a valid line
|
||||
* number; use one instead. */
|
||||
pos.lnum = curwin->w_topline > 0 ? curwin->w_topline : 1;
|
||||
return &pos;
|
||||
}
|
||||
else if (name[1] == '$') /* "w$": last visible line */
|
||||
{
|
||||
validate_botline();
|
||||
pos.lnum = curwin->w_botline - 1;
|
||||
/* In silent Ex mode botline is zero, return zero then. */
|
||||
pos.lnum = curwin->w_botline > 0 ? curwin->w_botline - 1 : 0;
|
||||
return &pos;
|
||||
}
|
||||
}
|
||||
@@ -8325,7 +8330,6 @@ ex_execute(exarg_T *eap)
|
||||
* follows is displayed on a new line when scrolling back at the
|
||||
* more prompt. */
|
||||
msg_sb_eol();
|
||||
msg_start();
|
||||
}
|
||||
|
||||
if (eap->cmdidx == CMD_echomsg)
|
||||
@@ -8480,9 +8484,7 @@ getwinvar(
|
||||
|
||||
if (opts != NULL)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = opts;
|
||||
++opts->dv_refcount;
|
||||
rettv_dict_set(rettv, opts);
|
||||
done = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
159
src/evalfunc.c
159
src/evalfunc.c
@@ -739,10 +739,10 @@ static struct fst
|
||||
{"reltimefloat", 1, 1, f_reltimefloat},
|
||||
#endif
|
||||
{"reltimestr", 1, 1, f_reltimestr},
|
||||
{"remote_expr", 2, 3, f_remote_expr},
|
||||
{"remote_expr", 2, 4, f_remote_expr},
|
||||
{"remote_foreground", 1, 1, f_remote_foreground},
|
||||
{"remote_peek", 1, 2, f_remote_peek},
|
||||
{"remote_read", 1, 1, f_remote_read},
|
||||
{"remote_read", 1, 2, f_remote_read},
|
||||
{"remote_send", 2, 3, f_remote_send},
|
||||
{"remote_startserver", 1, 1, f_remote_startserver},
|
||||
{"remove", 2, 3, f_remove},
|
||||
@@ -824,7 +824,7 @@ static struct fst
|
||||
{"tabpagenr", 0, 1, f_tabpagenr},
|
||||
{"tabpagewinnr", 1, 2, f_tabpagewinnr},
|
||||
{"tagfiles", 0, 0, f_tagfiles},
|
||||
{"taglist", 1, 1, f_taglist},
|
||||
{"taglist", 1, 2, f_taglist},
|
||||
#ifdef FEAT_FLOAT
|
||||
{"tan", 1, 1, f_tan},
|
||||
{"tanh", 1, 1, f_tanh},
|
||||
@@ -3005,8 +3005,7 @@ f_expand(typval_T *argvars, typval_T *rettv)
|
||||
&& get_tv_number_chk(&argvars[2], &error)
|
||||
&& !error)
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
}
|
||||
|
||||
s = get_tv_string(&argvars[0]);
|
||||
@@ -3353,9 +3352,9 @@ f_float2nr(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if (get_float_arg(argvars, &f) == OK)
|
||||
{
|
||||
if (f < -VARNUM_MAX)
|
||||
if (f <= -VARNUM_MAX + DBL_EPSILON)
|
||||
rettv->vval.v_number = -VARNUM_MAX;
|
||||
else if (f > VARNUM_MAX)
|
||||
else if (f >= VARNUM_MAX - DBL_EPSILON)
|
||||
rettv->vval.v_number = VARNUM_MAX;
|
||||
else
|
||||
rettv->vval.v_number = (varnumber_T)f;
|
||||
@@ -3589,7 +3588,8 @@ f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
fold_count = foldedCount(curwin, lnum, &foldinfo);
|
||||
if (fold_count > 0)
|
||||
{
|
||||
text = get_foldtext(curwin, lnum, lnum + fold_count - 1, &foldinfo, buf);
|
||||
text = get_foldtext(curwin, lnum, lnum + fold_count - 1,
|
||||
&foldinfo, buf);
|
||||
if (text == buf)
|
||||
text = vim_strsave(text);
|
||||
rettv->vval.v_string = text;
|
||||
@@ -3908,12 +3908,7 @@ f_get(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
else if (STRCMP(what, "dict") == 0)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = pt->pt_dict;
|
||||
if (pt->pt_dict != NULL)
|
||||
++pt->pt_dict->dv_refcount;
|
||||
}
|
||||
rettv_dict_set(rettv, pt->pt_dict);
|
||||
else if (STRCMP(what, "args") == 0)
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
@@ -4213,9 +4208,7 @@ f_getbufvar(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if (opts != NULL)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = opts;
|
||||
++opts->dv_refcount;
|
||||
rettv_dict_set(rettv, opts);
|
||||
done = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -5240,24 +5233,6 @@ f_getwininfo(typval_T *argvars, typval_T *rettv)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "getwinposx()" function
|
||||
*/
|
||||
static void
|
||||
f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
rettv->vval.v_number = -1;
|
||||
#ifdef FEAT_GUI
|
||||
if (gui.in_use)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (gui_mch_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = x;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "win_findbuf()" function
|
||||
*/
|
||||
@@ -5305,6 +5280,33 @@ f_win_id2win(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_number = win_id2win(argvars);
|
||||
}
|
||||
|
||||
/*
|
||||
* "getwinposx()" function
|
||||
*/
|
||||
static void
|
||||
f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
rettv->vval.v_number = -1;
|
||||
#ifdef FEAT_GUI
|
||||
if (gui.in_use)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (gui_mch_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = x;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (term_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = x;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "getwinposy()" function
|
||||
*/
|
||||
@@ -5319,6 +5321,15 @@ f_getwinposy(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
|
||||
if (gui_mch_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = y;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (term_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = y;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -5353,8 +5364,7 @@ f_glob(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
if (get_tv_number_chk(&argvars[2], &error))
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
}
|
||||
if (argvars[3].v_type != VAR_UNKNOWN
|
||||
&& get_tv_number_chk(&argvars[3], &error))
|
||||
@@ -5410,8 +5420,7 @@ f_globpath(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
if (get_tv_number_chk(&argvars[3], &error))
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
}
|
||||
if (argvars[4].v_type != VAR_UNKNOWN
|
||||
&& get_tv_number_chk(&argvars[4], &error))
|
||||
@@ -7698,6 +7707,7 @@ static int mkdir_recurse(char_u *dir, int prot);
|
||||
/*
|
||||
* Create the directory in which "dir" is located, and higher levels when
|
||||
* needed.
|
||||
* Return OK or FAIL.
|
||||
*/
|
||||
static int
|
||||
mkdir_recurse(char_u *dir, int prot)
|
||||
@@ -8515,6 +8525,7 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr)
|
||||
char_u *keys;
|
||||
char_u *r = NULL;
|
||||
char_u buf[NUMBUFLEN];
|
||||
int timeout = 0;
|
||||
# ifdef WIN32
|
||||
HWND w;
|
||||
# else
|
||||
@@ -8528,16 +8539,19 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr)
|
||||
if (check_connection() == FAIL)
|
||||
return;
|
||||
# endif
|
||||
if (argvars[2].v_type != VAR_UNKNOWN
|
||||
&& argvars[3].v_type != VAR_UNKNOWN)
|
||||
timeout = get_tv_number(&argvars[3]);
|
||||
|
||||
server_name = get_tv_string_chk(&argvars[0]);
|
||||
if (server_name == NULL)
|
||||
return; /* type error; errmsg already given */
|
||||
keys = get_tv_string_buf(&argvars[1], buf);
|
||||
# ifdef WIN32
|
||||
if (serverSendToVim(server_name, keys, &r, &w, expr, TRUE) < 0)
|
||||
if (serverSendToVim(server_name, keys, &r, &w, expr, timeout, TRUE) < 0)
|
||||
# else
|
||||
if (serverSendToVim(X_DISPLAY, server_name, keys, &r, &w, expr, 0, TRUE)
|
||||
< 0)
|
||||
if (serverSendToVim(X_DISPLAY, server_name, keys, &r, &w, expr, timeout,
|
||||
0, TRUE) < 0)
|
||||
# endif
|
||||
{
|
||||
if (r != NULL)
|
||||
@@ -8555,13 +8569,15 @@ remote_common(typval_T *argvars, typval_T *rettv, int expr)
|
||||
char_u str[30];
|
||||
char_u *idvar;
|
||||
|
||||
sprintf((char *)str, PRINTF_HEX_LONG_U, (long_u)w);
|
||||
v.di_tv.v_type = VAR_STRING;
|
||||
v.di_tv.vval.v_string = vim_strsave(str);
|
||||
idvar = get_tv_string_chk(&argvars[2]);
|
||||
if (idvar != NULL)
|
||||
if (idvar != NULL && *idvar != NUL)
|
||||
{
|
||||
sprintf((char *)str, PRINTF_HEX_LONG_U, (long_u)w);
|
||||
v.di_tv.v_type = VAR_STRING;
|
||||
v.di_tv.vval.v_string = vim_strsave(str);
|
||||
set_var(idvar, &v.di_tv, FALSE);
|
||||
vim_free(v.di_tv.vval.v_string);
|
||||
vim_free(v.di_tv.vval.v_string);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -8633,7 +8649,7 @@ f_remote_peek(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
rettv->vval.v_number = -1;
|
||||
else
|
||||
{
|
||||
s = serverGetReply((HWND)n, FALSE, FALSE, FALSE);
|
||||
s = serverGetReply((HWND)n, FALSE, FALSE, FALSE, 0);
|
||||
rettv->vval.v_number = (s != NULL);
|
||||
}
|
||||
# else
|
||||
@@ -8670,17 +8686,24 @@ f_remote_read(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
|
||||
if (serverid != NULL && !check_restricted() && !check_secure())
|
||||
{
|
||||
int timeout = 0;
|
||||
# ifdef WIN32
|
||||
/* The server's HWND is encoded in the 'id' parameter */
|
||||
long_u n = 0;
|
||||
# endif
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
timeout = get_tv_number(&argvars[1]);
|
||||
|
||||
# ifdef WIN32
|
||||
sscanf((char *)serverid, SCANF_HEX_LONG_U, &n);
|
||||
if (n != 0)
|
||||
r = serverGetReply((HWND)n, FALSE, TRUE, TRUE);
|
||||
r = serverGetReply((HWND)n, FALSE, TRUE, TRUE, timeout);
|
||||
if (r == NULL)
|
||||
# else
|
||||
if (check_connection() == FAIL || serverReadReply(X_DISPLAY,
|
||||
serverStrToWin(serverid), &r, FALSE) < 0)
|
||||
if (check_connection() == FAIL
|
||||
|| serverReadReply(X_DISPLAY, serverStrToWin(serverid),
|
||||
&r, FALSE, timeout) < 0)
|
||||
# endif
|
||||
EMSG(_("E277: Unable to read a server reply"));
|
||||
}
|
||||
@@ -9119,9 +9142,7 @@ f_reverse(typval_T *argvars, typval_T *rettv)
|
||||
list_append(l, li);
|
||||
li = ni;
|
||||
}
|
||||
rettv->vval.v_list = l;
|
||||
rettv->v_type = VAR_LIST;
|
||||
++l->lv_refcount;
|
||||
rettv_list_set(rettv, l);
|
||||
l->lv_idx = l->lv_len - l->lv_idx - 1;
|
||||
}
|
||||
}
|
||||
@@ -10024,7 +10045,8 @@ set_qf_ll_list(
|
||||
act = get_tv_string_chk(action_arg);
|
||||
if (act == NULL)
|
||||
return; /* type error; errmsg already given */
|
||||
if ((*act == 'a' || *act == 'r' || *act == ' ') && act[1] == NUL)
|
||||
if ((*act == 'a' || *act == 'r' || *act == ' ' || *act == 'f') &&
|
||||
act[1] == NUL)
|
||||
action = *act;
|
||||
else
|
||||
EMSG2(_(e_invact), act);
|
||||
@@ -10708,9 +10730,7 @@ do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
|
||||
(char_u *)(sort ? N_("sort() argument") : N_("uniq() argument")),
|
||||
TRUE))
|
||||
goto theend;
|
||||
rettv->vval.v_list = l;
|
||||
rettv->v_type = VAR_LIST;
|
||||
++l->lv_refcount;
|
||||
rettv_list_set(rettv, l);
|
||||
|
||||
len = list_len(l);
|
||||
if (len <= 1)
|
||||
@@ -11732,7 +11752,7 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
break;
|
||||
|
||||
case 'n': /* name */
|
||||
p = get_highlight_name(NULL, id - 1);
|
||||
p = get_highlight_name_ext(NULL, id - 1, FALSE);
|
||||
break;
|
||||
|
||||
case 'r': /* reverse */
|
||||
@@ -11798,8 +11818,7 @@ f_synconcealed(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
char_u str[NUMBUFLEN];
|
||||
#endif
|
||||
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
|
||||
#if defined(FEAT_SYN_HL) && defined(FEAT_CONCEAL)
|
||||
lnum = get_tv_lnum(argvars); /* -1 on type error */
|
||||
@@ -11856,8 +11875,7 @@ f_synstack(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
int id;
|
||||
#endif
|
||||
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
lnum = get_tv_lnum(argvars); /* -1 on type error */
|
||||
@@ -12023,9 +12041,7 @@ get_cmd_output_as_rettv(
|
||||
list_append(list, li);
|
||||
}
|
||||
|
||||
++list->lv_refcount;
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = list;
|
||||
rettv_list_set(rettv, list);
|
||||
list = NULL;
|
||||
}
|
||||
else
|
||||
@@ -12254,6 +12270,7 @@ f_tagfiles(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
static void
|
||||
f_taglist(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
char_u *fname = NULL;
|
||||
char_u *tag_pattern;
|
||||
|
||||
tag_pattern = get_tv_string(&argvars[0]);
|
||||
@@ -12262,8 +12279,10 @@ f_taglist(typval_T *argvars, typval_T *rettv)
|
||||
if (*tag_pattern == NUL)
|
||||
return;
|
||||
|
||||
if (argvars[1].v_type != VAR_UNKNOWN)
|
||||
fname = get_tv_string(&argvars[1]);
|
||||
if (rettv_list_alloc(rettv) == OK)
|
||||
(void)get_tags(rettv->vval.v_list, tag_pattern);
|
||||
(void)get_tags(rettv->vval.v_list, tag_pattern, fname);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -12428,8 +12447,7 @@ f_test_null_channel(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
static void
|
||||
f_test_null_dict(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = NULL;
|
||||
rettv_dict_set(rettv, NULL);
|
||||
}
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
@@ -12444,8 +12462,7 @@ f_test_null_job(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
static void
|
||||
f_test_null_list(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
72
src/ex_cmdidxs.h
Normal file
72
src/ex_cmdidxs.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* Automatically generated code by create_cmdidxs.vim
|
||||
*
|
||||
* Table giving the index of the first command in cmdnames[] to lookup
|
||||
* based on the first letter of a command.
|
||||
*/
|
||||
static const unsigned short cmdidxs1[26] =
|
||||
{
|
||||
/* a */ 0,
|
||||
/* b */ 19,
|
||||
/* c */ 42,
|
||||
/* d */ 103,
|
||||
/* e */ 125,
|
||||
/* f */ 145,
|
||||
/* g */ 161,
|
||||
/* h */ 167,
|
||||
/* i */ 176,
|
||||
/* j */ 194,
|
||||
/* k */ 196,
|
||||
/* l */ 201,
|
||||
/* m */ 259,
|
||||
/* n */ 277,
|
||||
/* o */ 297,
|
||||
/* p */ 309,
|
||||
/* q */ 348,
|
||||
/* r */ 351,
|
||||
/* s */ 370,
|
||||
/* t */ 437,
|
||||
/* u */ 472,
|
||||
/* v */ 483,
|
||||
/* w */ 501,
|
||||
/* x */ 516,
|
||||
/* y */ 525,
|
||||
/* z */ 526
|
||||
};
|
||||
|
||||
/*
|
||||
* Table giving the index of the first command in cmdnames[] to lookup
|
||||
* based on the first 2 letters of a command.
|
||||
* Values in cmdidxs2[c1][c2] are relative to cmdidxs1[c1] so that they
|
||||
* fit in a byte.
|
||||
*/
|
||||
static const unsigned char cmdidxs2[26][26] =
|
||||
{ /* a b c d e f g h i j k l m n o p q r s t u v w x y z */
|
||||
/* a */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 7, 15, 0, 16, 0, 0, 0, 0, 0 },
|
||||
/* b */ { 2, 0, 0, 4, 5, 7, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 0, 13, 0, 0, 0, 0, 22, 0, 0, 0 },
|
||||
/* c */ { 3, 10, 12, 14, 16, 18, 21, 0, 0, 0, 0, 29, 33, 36, 42, 51, 53, 54, 55, 0, 57, 0, 60, 0, 0, 0 },
|
||||
/* d */ { 0, 0, 0, 0, 0, 0, 0, 0, 6, 15, 0, 16, 0, 0, 17, 0, 0, 19, 20, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0 },
|
||||
/* f */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0 },
|
||||
/* g */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 4, 5, 0, 0, 0, 0 },
|
||||
/* h */ { 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* i */ { 1, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 5, 6, 0, 0, 0, 0, 0, 13, 0, 15, 0, 0, 0, 0, 0 },
|
||||
/* j */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 },
|
||||
/* k */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* l */ { 3, 9, 11, 15, 16, 20, 23, 28, 0, 0, 0, 30, 33, 36, 40, 46, 0, 48, 57, 49, 50, 54, 56, 0, 0, 0 },
|
||||
/* m */ { 1, 0, 0, 0, 7, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 },
|
||||
/* n */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 10, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0 },
|
||||
/* o */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 0, 0, 0, 0, 0, 0, 9, 0, 11, 0, 0, 0 },
|
||||
/* p */ { 1, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 0, 0, 16, 17, 26, 0, 27, 0, 28, 0 },
|
||||
/* q */ { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 18, 0, 0, 0, 0 },
|
||||
/* s */ { 2, 6, 15, 0, 18, 22, 0, 24, 25, 0, 0, 28, 30, 34, 38, 40, 0, 48, 0, 49, 0, 61, 62, 0, 63, 0 },
|
||||
/* t */ { 2, 0, 19, 0, 22, 23, 0, 24, 0, 25, 0, 26, 27, 28, 29, 30, 0, 31, 33, 0, 34, 0, 0, 0, 0, 0 },
|
||||
/* u */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* v */ { 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 9, 12, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 0, 0 },
|
||||
/* w */ { 2, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 8, 0, 9, 10, 0, 12, 0, 13, 14, 0, 0, 0, 0 },
|
||||
/* x */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0 },
|
||||
/* y */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
|
||||
};
|
||||
|
||||
static const int command_count = 539;
|
||||
@@ -3520,11 +3520,14 @@ check_readonly(int *forceit, buf_T *buf)
|
||||
|
||||
/*
|
||||
* Try to abandon current file and edit a new or existing file.
|
||||
* 'fnum' is the number of the file, if zero use ffname/sfname.
|
||||
* "fnum" is the number of the file, if zero use ffname/sfname.
|
||||
* "lnum" is the line number for the cursor in the new file (if non-zero).
|
||||
*
|
||||
* Return 1 for "normal" error, 2 for "not written" error, 0 for success
|
||||
* -1 for successfully opening another file.
|
||||
* 'lnum' is the line number for the cursor in the new file (if non-zero).
|
||||
* Return:
|
||||
* GETFILE_ERROR for "normal" error,
|
||||
* GETFILE_NOT_WRITTEN for "not written" error,
|
||||
* GETFILE_SAME_FILE for success
|
||||
* GETFILE_OPEN_OTHER for successfully opening another file.
|
||||
*/
|
||||
int
|
||||
getfile(
|
||||
@@ -3540,10 +3543,10 @@ getfile(
|
||||
char_u *free_me = NULL;
|
||||
|
||||
if (text_locked())
|
||||
return 1;
|
||||
return GETFILE_ERROR;
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (curbuf_locked())
|
||||
return 1;
|
||||
return GETFILE_ERROR;
|
||||
#endif
|
||||
|
||||
if (fnum == 0)
|
||||
@@ -3570,7 +3573,7 @@ getfile(
|
||||
if (other)
|
||||
--no_wait_return;
|
||||
EMSG(_(e_nowrtmsg));
|
||||
retval = 2; /* file has been changed */
|
||||
retval = GETFILE_NOT_WRITTEN; /* file has been changed */
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
@@ -3584,14 +3587,14 @@ getfile(
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
check_cursor_lnum();
|
||||
beginline(BL_SOL | BL_FIX);
|
||||
retval = 0; /* it's in the same file */
|
||||
retval = GETFILE_SAME_FILE; /* it's in the same file */
|
||||
}
|
||||
else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
|
||||
(P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0),
|
||||
curwin) == OK)
|
||||
retval = -1; /* opened another file */
|
||||
retval = GETFILE_OPEN_OTHER; /* opened another file */
|
||||
else
|
||||
retval = 1; /* error encountered */
|
||||
retval = GETFILE_ERROR; /* error encountered */
|
||||
|
||||
theend:
|
||||
vim_free(free_me);
|
||||
@@ -4564,7 +4567,7 @@ ex_change(exarg_T *eap)
|
||||
ex_z(exarg_T *eap)
|
||||
{
|
||||
char_u *x;
|
||||
int bigness;
|
||||
long bigness;
|
||||
char_u *kind;
|
||||
int minus = 0;
|
||||
linenr_T start, end, curs, i;
|
||||
@@ -4601,7 +4604,12 @@ ex_z(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
{
|
||||
bigness = atoi((char *)x);
|
||||
bigness = atol((char *)x);
|
||||
|
||||
/* bigness could be < 0 if atol(x) overflows. */
|
||||
if (bigness > 2 * curbuf->b_ml.ml_line_count || bigness < 0)
|
||||
bigness = 2 * curbuf->b_ml.ml_line_count;
|
||||
|
||||
p_window = bigness;
|
||||
if (*kind == '=')
|
||||
bigness += 2;
|
||||
@@ -4659,6 +4667,8 @@ ex_z(exarg_T *eap)
|
||||
|
||||
if (curs > curbuf->b_ml.ml_line_count)
|
||||
curs = curbuf->b_ml.ml_line_count;
|
||||
else if (curs < 1)
|
||||
curs = 1;
|
||||
|
||||
for (i = start; i <= end; i++)
|
||||
{
|
||||
@@ -4681,7 +4691,11 @@ ex_z(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
|
||||
curwin->w_cursor.lnum = curs;
|
||||
if (curwin->w_cursor.lnum != curs)
|
||||
{
|
||||
curwin->w_cursor.lnum = curs;
|
||||
curwin->w_cursor.col = 0;
|
||||
}
|
||||
ex_no_reprint = TRUE;
|
||||
}
|
||||
|
||||
@@ -7962,7 +7976,7 @@ sign_list_defined(sign_T *sp)
|
||||
if (sp->sn_line_hl > 0)
|
||||
{
|
||||
MSG_PUTS(" linehl=");
|
||||
p = get_highlight_name(NULL, sp->sn_line_hl - 1);
|
||||
p = get_highlight_name_ext(NULL, sp->sn_line_hl - 1, FALSE);
|
||||
if (p == NULL)
|
||||
MSG_PUTS("NONE");
|
||||
else
|
||||
@@ -7971,7 +7985,7 @@ sign_list_defined(sign_T *sp)
|
||||
if (sp->sn_text_hl > 0)
|
||||
{
|
||||
MSG_PUTS(" texthl=");
|
||||
p = get_highlight_name(NULL, sp->sn_text_hl - 1);
|
||||
p = get_highlight_name_ext(NULL, sp->sn_text_hl - 1, FALSE);
|
||||
if (p == NULL)
|
||||
MSG_PUTS("NONE");
|
||||
else
|
||||
|
||||
@@ -1623,7 +1623,7 @@ EX(CMD_wincmd, "wincmd", ex_wincmd,
|
||||
NEEDARG|WORD1|RANGE|NOTADR,
|
||||
ADDR_WINDOWS),
|
||||
EX(CMD_windo, "windo", ex_listdo,
|
||||
BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
|
||||
NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
|
||||
ADDR_WINDOWS),
|
||||
EX(CMD_winpos, "winpos", ex_winpos,
|
||||
EXTRA|TRLBAR|CMDWIN,
|
||||
|
||||
@@ -3633,27 +3633,41 @@ theend:
|
||||
vim_free(ffname);
|
||||
}
|
||||
|
||||
static int did_source_packages = FALSE;
|
||||
/*
|
||||
* Add all packages in the "start" directory to 'runtimepath'.
|
||||
*/
|
||||
void
|
||||
add_pack_start_dirs(void)
|
||||
{
|
||||
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
|
||||
add_pack_plugin, &APP_ADD_DIR);
|
||||
}
|
||||
|
||||
/*
|
||||
* Load plugins from all packages in the "start" directory.
|
||||
*/
|
||||
void
|
||||
load_start_packages(void)
|
||||
{
|
||||
did_source_packages = TRUE;
|
||||
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
|
||||
add_pack_plugin, &APP_LOAD);
|
||||
}
|
||||
|
||||
/*
|
||||
* ":packloadall"
|
||||
* Find plugins in the package directories and source them.
|
||||
* "eap" is NULL when invoked during startup.
|
||||
*/
|
||||
void
|
||||
ex_packloadall(exarg_T *eap)
|
||||
{
|
||||
if (!did_source_packages || (eap != NULL && eap->forceit))
|
||||
if (!did_source_packages || eap->forceit)
|
||||
{
|
||||
did_source_packages = TRUE;
|
||||
|
||||
/* First do a round to add all directories to 'runtimepath', then load
|
||||
* the plugins. This allows for plugins to use an autoload directory
|
||||
* of another plugin. */
|
||||
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
|
||||
add_pack_plugin, &APP_ADD_DIR);
|
||||
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
|
||||
add_pack_plugin, &APP_LOAD);
|
||||
add_pack_start_dirs();
|
||||
load_start_packages();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -494,40 +494,7 @@ static void ex_folddo(exarg_T *eap);
|
||||
*/
|
||||
#define DO_DECLARE_EXCMD
|
||||
#include "ex_cmds.h"
|
||||
|
||||
/*
|
||||
* Table used to quickly search for a command, based on its first character.
|
||||
*/
|
||||
static cmdidx_T cmdidxs[27] =
|
||||
{
|
||||
CMD_append,
|
||||
CMD_buffer,
|
||||
CMD_change,
|
||||
CMD_delete,
|
||||
CMD_edit,
|
||||
CMD_file,
|
||||
CMD_global,
|
||||
CMD_help,
|
||||
CMD_insert,
|
||||
CMD_join,
|
||||
CMD_k,
|
||||
CMD_list,
|
||||
CMD_move,
|
||||
CMD_next,
|
||||
CMD_open,
|
||||
CMD_print,
|
||||
CMD_quit,
|
||||
CMD_read,
|
||||
CMD_substitute,
|
||||
CMD_t,
|
||||
CMD_undo,
|
||||
CMD_vglobal,
|
||||
CMD_write,
|
||||
CMD_xit,
|
||||
CMD_yank,
|
||||
CMD_z,
|
||||
CMD_bang
|
||||
};
|
||||
#include "ex_cmdidxs.h"
|
||||
|
||||
static char_u dollar_command[2] = {'$', 0};
|
||||
|
||||
@@ -614,7 +581,6 @@ restore_dbg_stuff(struct dbg_stuff *dsp)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* do_exmode(): Repeatedly get commands for the "Ex" mode, until the ":vi"
|
||||
* command is given.
|
||||
@@ -3006,7 +2972,10 @@ do_one_cmd(
|
||||
|
||||
doend:
|
||||
if (curwin->w_cursor.lnum == 0) /* can happen with zero line number */
|
||||
{
|
||||
curwin->w_cursor.lnum = 1;
|
||||
curwin->w_cursor.col = 0;
|
||||
}
|
||||
|
||||
if (errormsg != NULL && *errormsg != NUL && !did_emsg)
|
||||
{
|
||||
@@ -3208,10 +3177,25 @@ find_command(exarg_T *eap, int *full UNUSED)
|
||||
}
|
||||
}
|
||||
|
||||
if (ASCII_ISLOWER(*eap->cmd))
|
||||
eap->cmdidx = cmdidxs[CharOrdLow(*eap->cmd)];
|
||||
if (ASCII_ISLOWER(eap->cmd[0]))
|
||||
{
|
||||
int c1 = eap->cmd[0];
|
||||
int c2 = eap->cmd[1];
|
||||
|
||||
if (command_count != (int)CMD_SIZE)
|
||||
{
|
||||
iemsg((char_u *)_("E943: Command table needs to be updated, run 'make cmdidxs'"));
|
||||
getout(1);
|
||||
}
|
||||
|
||||
/* Use a precomputed index for fast look-up in cmdnames[]
|
||||
* taking into account the first 2 letters of eap->cmd. */
|
||||
eap->cmdidx = cmdidxs1[CharOrdLow(c1)];
|
||||
if (ASCII_ISLOWER(c2))
|
||||
eap->cmdidx += cmdidxs2[CharOrdLow(c1)][CharOrdLow(c2)];
|
||||
}
|
||||
else
|
||||
eap->cmdidx = cmdidxs[26];
|
||||
eap->cmdidx = CMD_bang;
|
||||
|
||||
for ( ; (int)eap->cmdidx < (int)CMD_SIZE;
|
||||
eap->cmdidx = (cmdidx_T)((int)eap->cmdidx + 1))
|
||||
@@ -5058,6 +5042,7 @@ expand_filename(
|
||||
&& eap->cmdidx != CMD_lgrep
|
||||
&& eap->cmdidx != CMD_grepadd
|
||||
&& eap->cmdidx != CMD_lgrepadd
|
||||
&& eap->cmdidx != CMD_hardcopy
|
||||
#ifndef UNIX
|
||||
&& !(eap->argt & NOSPC)
|
||||
#endif
|
||||
@@ -10306,6 +10291,7 @@ ex_normal(exarg_T *eap)
|
||||
{
|
||||
curwin->w_cursor.lnum = eap->line1++;
|
||||
curwin->w_cursor.col = 0;
|
||||
check_cursor_moved(curwin);
|
||||
}
|
||||
|
||||
exec_normal_cmd(
|
||||
@@ -10905,6 +10891,9 @@ eval_vars(
|
||||
result = strbuf;
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
result = (char_u *)""; /* avoid gcc warning */
|
||||
break;
|
||||
}
|
||||
|
||||
resultlen = (int)STRLEN(result); /* length of new string */
|
||||
@@ -12184,13 +12173,22 @@ ex_filetype(exarg_T *eap)
|
||||
}
|
||||
|
||||
/*
|
||||
* ":setfiletype {name}"
|
||||
* ":setfiletype [FALLBACK] {name}"
|
||||
*/
|
||||
static void
|
||||
ex_setfiletype(exarg_T *eap)
|
||||
{
|
||||
if (!did_filetype)
|
||||
set_option_value((char_u *)"filetype", 0L, eap->arg, OPT_LOCAL);
|
||||
{
|
||||
char_u *arg = eap->arg;
|
||||
|
||||
if (STRNCMP(arg, "FALLBACK ", 9) == 0)
|
||||
arg += 9;
|
||||
|
||||
set_option_value((char_u *)"filetype", 0L, arg, OPT_LOCAL);
|
||||
if (arg != eap->arg)
|
||||
did_filetype = FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ static void clear_hist_entry(histentry_T *hisptr);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_CMDWIN
|
||||
static int ex_window(void);
|
||||
static int open_cmdwin(void);
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
||||
@@ -773,7 +773,7 @@ getcmdline(
|
||||
/*
|
||||
* Open a window to edit the command line (and history).
|
||||
*/
|
||||
c = ex_window();
|
||||
c = open_cmdwin();
|
||||
some_key_typed = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1292,7 +1292,7 @@ getcmdline(
|
||||
goto cmdline_not_changed;
|
||||
|
||||
case K_IGNORE:
|
||||
/* Ignore mouse event or ex_window() result. */
|
||||
/* Ignore mouse event or open_cmdwin() result. */
|
||||
goto cmdline_not_changed;
|
||||
|
||||
#ifdef FEAT_GUI_W32
|
||||
@@ -3336,11 +3336,18 @@ cmdline_del(int from)
|
||||
*/
|
||||
void
|
||||
redrawcmdline(void)
|
||||
{
|
||||
redrawcmdline_ex(TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
redrawcmdline_ex(int do_compute_cmdrow)
|
||||
{
|
||||
if (cmd_silent)
|
||||
return;
|
||||
need_wait_return = FALSE;
|
||||
compute_cmdrow();
|
||||
if (do_compute_cmdrow)
|
||||
compute_cmdrow();
|
||||
redrawcmd();
|
||||
cursorcmd();
|
||||
}
|
||||
@@ -4147,7 +4154,7 @@ showmatches(expand_T *xp, int wildmenu UNUSED)
|
||||
got_int = FALSE; /* only int. the completion, not the cmd line */
|
||||
#ifdef FEAT_WILDMENU
|
||||
else if (wildmenu)
|
||||
win_redr_status_matches(xp, num_files, files_found, 0, showtail);
|
||||
win_redr_status_matches(xp, num_files, files_found, -1, showtail);
|
||||
#endif
|
||||
else
|
||||
{
|
||||
@@ -6796,7 +6803,7 @@ cmd_gchar(int offset)
|
||||
* K_IGNORE if editing continues
|
||||
*/
|
||||
static int
|
||||
ex_window(void)
|
||||
open_cmdwin(void)
|
||||
{
|
||||
struct cmdline_info save_ccline;
|
||||
bufref_T old_curbuf;
|
||||
@@ -6841,6 +6848,7 @@ ex_window(void)
|
||||
# endif
|
||||
/* don't use a new tab page */
|
||||
cmdmod.tab = 0;
|
||||
cmdmod.noswapfile = 1;
|
||||
|
||||
/* Create a window for the command-line buffer. */
|
||||
if (win_split((int)p_cwh, WSP_BOT) == FAIL)
|
||||
@@ -6857,7 +6865,6 @@ ex_window(void)
|
||||
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
|
||||
(void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
|
||||
set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
|
||||
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
|
||||
curbuf->b_p_ma = TRUE;
|
||||
#ifdef FEAT_FOLDING
|
||||
curwin->w_p_fen = FALSE;
|
||||
|
||||
@@ -1695,7 +1695,7 @@ conv_to_pvim(void)
|
||||
ptr[i] = toF_leading(ptr[i]);
|
||||
++i;
|
||||
|
||||
while (canF_Rjoin(ptr[i]) && i < llen)
|
||||
while (i < llen && canF_Rjoin(ptr[i]))
|
||||
{
|
||||
ptr[i] = toF_Rjoin(ptr[i]);
|
||||
if (F_isterm(ptr[i]) || !F_isalpha(ptr[i]))
|
||||
|
||||
10
src/fileio.c
10
src/fileio.c
@@ -9033,6 +9033,11 @@ win_found:
|
||||
win_remove(curwin, NULL);
|
||||
aucmd_win_used = FALSE;
|
||||
last_status(FALSE); /* may need to remove last status line */
|
||||
|
||||
if (!valid_tabpage_win(curtab))
|
||||
/* no valid window in current tabpage */
|
||||
close_tabpage(curtab);
|
||||
|
||||
restore_snapshot(SNAP_AUCMD_IDX, FALSE);
|
||||
(void)win_comp_pos(); /* recompute window positions */
|
||||
unblock_autocmds();
|
||||
@@ -9311,6 +9316,7 @@ apply_autocmds_group(
|
||||
proftime_T wait_time;
|
||||
#endif
|
||||
int did_save_redobuff = FALSE;
|
||||
save_redo_T save_redo;
|
||||
|
||||
/*
|
||||
* Quickly return if there are no autocommands for this event or
|
||||
@@ -9516,7 +9522,7 @@ apply_autocmds_group(
|
||||
if (!ins_compl_active())
|
||||
#endif
|
||||
{
|
||||
saveRedobuff();
|
||||
saveRedobuff(&save_redo);
|
||||
did_save_redobuff = TRUE;
|
||||
}
|
||||
did_filetype = keep_filetype;
|
||||
@@ -9619,7 +9625,7 @@ apply_autocmds_group(
|
||||
{
|
||||
restore_search_patterns();
|
||||
if (did_save_redobuff)
|
||||
restoreRedobuff();
|
||||
restoreRedobuff(&save_redo);
|
||||
did_filetype = FALSE;
|
||||
while (au_pending_free_buf != NULL)
|
||||
{
|
||||
|
||||
18
src/fold.c
18
src/fold.c
@@ -2755,7 +2755,7 @@ foldUpdateIEMSRecurse(
|
||||
/* End of fold found, update the length when it got shorter. */
|
||||
if (fp->fd_len != flp->lnum - fp->fd_top)
|
||||
{
|
||||
if (fp->fd_top + fp->fd_len > bot + 1)
|
||||
if (fp->fd_top + fp->fd_len - 1 > bot)
|
||||
{
|
||||
/* fold continued below bot */
|
||||
if (getlevel == foldlevelMarker
|
||||
@@ -2928,7 +2928,7 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
|
||||
{
|
||||
/* 2: or 3: need to delete nested folds */
|
||||
foldRemove(&fp->fd_nested, top - fp->fd_top, bot - fp->fd_top);
|
||||
if (fp->fd_top + fp->fd_len > bot + 1)
|
||||
if (fp->fd_top + fp->fd_len - 1 > bot)
|
||||
{
|
||||
/* 3: need to split it. */
|
||||
foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot);
|
||||
@@ -2970,10 +2970,12 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
|
||||
|
||||
/* foldReverseOrder() {{{2 */
|
||||
static void
|
||||
foldReverseOrder(garray_T *gap, linenr_T start, linenr_T end)
|
||||
foldReverseOrder(garray_T *gap, linenr_T start_arg, linenr_T end_arg)
|
||||
{
|
||||
fold_T *left, *right;
|
||||
fold_T tmp;
|
||||
linenr_T start = start_arg;
|
||||
linenr_T end = end_arg;
|
||||
|
||||
for (; start < end; start++, end--)
|
||||
{
|
||||
@@ -3133,10 +3135,14 @@ foldMoveRange(garray_T *gap, linenr_T line1, linenr_T line2, linenr_T dest)
|
||||
dest_index = fold_index(fp, gap);
|
||||
|
||||
/*
|
||||
* All folds are now correct, but they are not necessarily in the correct
|
||||
* order. We have to swap folds in the range [move_end, dest_index) with
|
||||
* those in the range [move_start, move_end).
|
||||
* All folds are now correct, but not necessarily in the correct order. We
|
||||
* must swap folds in the range [move_end, dest_index) with those in the
|
||||
* range [move_start, move_end).
|
||||
*/
|
||||
if (move_end == 0)
|
||||
/* There are no folds after those moved, hence no folds have been moved
|
||||
* out of order. */
|
||||
return;
|
||||
foldReverseOrder(gap, (linenr_T)move_start, (linenr_T)dest_index - 1);
|
||||
foldReverseOrder(gap, (linenr_T)move_start,
|
||||
(linenr_T)(move_start + dest_index - move_end - 1));
|
||||
|
||||
@@ -42,10 +42,6 @@
|
||||
|
||||
static buffheader_T redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
static buffheader_T old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
|
||||
static buffheader_T save_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
static buffheader_T save_old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
#endif
|
||||
static buffheader_T recordbuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
|
||||
static int typeahead_char = 0; /* typeahead char that's not flushed */
|
||||
@@ -521,27 +517,22 @@ CancelRedo(void)
|
||||
* Save redobuff and old_redobuff to save_redobuff and save_old_redobuff.
|
||||
* Used before executing autocommands and user functions.
|
||||
*/
|
||||
static int save_level = 0;
|
||||
|
||||
void
|
||||
saveRedobuff(void)
|
||||
saveRedobuff(save_redo_T *save_redo)
|
||||
{
|
||||
char_u *s;
|
||||
|
||||
if (save_level++ == 0)
|
||||
{
|
||||
save_redobuff = redobuff;
|
||||
redobuff.bh_first.b_next = NULL;
|
||||
save_old_redobuff = old_redobuff;
|
||||
old_redobuff.bh_first.b_next = NULL;
|
||||
save_redo->sr_redobuff = redobuff;
|
||||
redobuff.bh_first.b_next = NULL;
|
||||
save_redo->sr_old_redobuff = old_redobuff;
|
||||
old_redobuff.bh_first.b_next = NULL;
|
||||
|
||||
/* Make a copy, so that ":normal ." in a function works. */
|
||||
s = get_buffcont(&save_redobuff, FALSE);
|
||||
if (s != NULL)
|
||||
{
|
||||
add_buff(&redobuff, s, -1L);
|
||||
vim_free(s);
|
||||
}
|
||||
/* Make a copy, so that ":normal ." in a function works. */
|
||||
s = get_buffcont(&save_redo->sr_redobuff, FALSE);
|
||||
if (s != NULL)
|
||||
{
|
||||
add_buff(&redobuff, s, -1L);
|
||||
vim_free(s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -550,15 +541,12 @@ saveRedobuff(void)
|
||||
* Used after executing autocommands and user functions.
|
||||
*/
|
||||
void
|
||||
restoreRedobuff(void)
|
||||
restoreRedobuff(save_redo_T *save_redo)
|
||||
{
|
||||
if (--save_level == 0)
|
||||
{
|
||||
free_buff(&redobuff);
|
||||
redobuff = save_redobuff;
|
||||
free_buff(&old_redobuff);
|
||||
old_redobuff = save_old_redobuff;
|
||||
}
|
||||
free_buff(&redobuff);
|
||||
redobuff = save_redo->sr_redobuff;
|
||||
free_buff(&old_redobuff);
|
||||
old_redobuff = save_redo->sr_old_redobuff;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -932,7 +920,7 @@ init_typebuf(void)
|
||||
typebuf.tb_noremap = noremapbuf_init;
|
||||
typebuf.tb_buflen = TYPELEN_INIT;
|
||||
typebuf.tb_len = 0;
|
||||
typebuf.tb_off = 0;
|
||||
typebuf.tb_off = MAXMAPLEN + 4;
|
||||
typebuf.tb_change_cnt = 1;
|
||||
}
|
||||
}
|
||||
@@ -986,11 +974,21 @@ ins_typebuf(
|
||||
typebuf.tb_off -= addlen;
|
||||
mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
|
||||
}
|
||||
else if (typebuf.tb_len == 0 && typebuf.tb_buflen
|
||||
>= addlen + 3 * (MAXMAPLEN + 4))
|
||||
{
|
||||
/*
|
||||
* Buffer is empty and string fits in the existing buffer.
|
||||
* Leave some space before and after, if possible.
|
||||
*/
|
||||
typebuf.tb_off = (typebuf.tb_buflen - addlen - 3 * (MAXMAPLEN + 4)) / 2;
|
||||
mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Need to allocate a new buffer.
|
||||
* In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
|
||||
* In typebuf.tb_buf there must always be room for 3 * (MAXMAPLEN + 4)
|
||||
* characters. We add some extra room to avoid having to allocate too
|
||||
* often.
|
||||
*/
|
||||
@@ -1303,7 +1301,7 @@ alloc_typebuf(void)
|
||||
return FAIL;
|
||||
}
|
||||
typebuf.tb_buflen = TYPELEN_INIT;
|
||||
typebuf.tb_off = 0;
|
||||
typebuf.tb_off = MAXMAPLEN + 4; /* can insert without realloc */
|
||||
typebuf.tb_len = 0;
|
||||
typebuf.tb_maplen = 0;
|
||||
typebuf.tb_silent = 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user