diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-09-02 21:07:30 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-09-02 21:07:30 +0200 |
commit | 20aac6c1126988339611576d425965a25a777658 (patch) | |
tree | 7954ca9025cbef1081a0ea9ad231e5692c6238b0 /runtime | |
parent | acca8df9d475bbfbafc71691ebc3b857ecd2777e (diff) | |
download | vim-git-20aac6c1126988339611576d425965a25a777658.tar.gz |
Update runtime files.
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/autoload/ccomplete.vim | 39 | ||||
-rw-r--r-- | runtime/autoload/dist/ft.vim | 2 | ||||
-rw-r--r-- | runtime/autoload/tar.vim | 33 | ||||
-rw-r--r-- | runtime/compiler/stack.vim | 37 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 2 | ||||
-rw-r--r-- | runtime/doc/gui_x11.txt | 18 | ||||
-rw-r--r-- | runtime/doc/if_pyth.txt | 12 | ||||
-rw-r--r-- | runtime/doc/options.txt | 2 | ||||
-rw-r--r-- | runtime/doc/tags | 3 | ||||
-rw-r--r-- | runtime/doc/todo.txt | 50 | ||||
-rw-r--r-- | runtime/ftplugin/cmake.vim | 20 | ||||
-rw-r--r-- | runtime/indent/dosbatch.vim | 59 | ||||
-rw-r--r-- | runtime/indent/teraterm.vim | 4 | ||||
-rw-r--r-- | runtime/syntax/teraterm.vim | 17 | ||||
-rw-r--r-- | runtime/tutor/tutor.es | 2 | ||||
-rw-r--r-- | runtime/tutor/tutor.es.utf-8 | 2 | ||||
-rw-r--r-- | runtime/tutor/tutor.ru.utf-8 | 12 |
17 files changed, 246 insertions, 68 deletions
diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim index d5bfa076a..156b3af02 100644 --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: C " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2012 Jun 20 +" Last Change: 2018 Aug 20 let s:cpo_save = &cpo set cpo&vim @@ -72,8 +72,10 @@ function! ccomplete#Complete(findstart, base) " Split item in words, keep empty word after "." or "->". " "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc. " We can't use split, because we need to skip nested [...]. + " "aa[...]" -> ['aa', '[...]'], "aa.bb[...]" -> ['aa', 'bb', '[...]'], etc. let items = [] let s = 0 + let arrays = 0 while 1 let e = match(base, '\.\|->\|\[', s) if e < 0 @@ -107,6 +109,7 @@ function! ccomplete#Complete(findstart, base) endwhile let e += 1 call add(items, strpart(base, s, e - s)) + let arrays += 1 let s = e endif endwhile @@ -161,15 +164,26 @@ function! ccomplete#Complete(findstart, base) endif endif let res = [{'match': match, 'tagline' : '', 'kind' : kind, 'info' : line}] + elseif len(items) == arrays + 1 + " Completing one word and it's a local array variable: build tagline + " from declaration line + let match = items[0] + let kind = 'v' + let tagline = "\t/^" . line . '$/' + let res = [{'match': match, 'tagline' : tagline, 'kind' : kind, 'info' : line}] else " Completing "var.", "var.something", etc. let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1) endif endif - if len(items) == 1 + if len(items) == 1 || len(items) == arrays + 1 " Only one part, no "." or "->": complete from tags file. - let tags = taglist('^' . base) + if len(items) == 1 + let tags = taglist('^' . base) + else + let tags = taglist('^' . items[0] . '$') + endif " Remove members, these can't appear without something in front. call filter(tags, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1') @@ -516,11 +530,24 @@ function! s:StructMembers(typename, items, all) endif endif + " Skip over [...] items + let idx = 0 + while 1 + if idx >= len(a:items) + let target = '' " No further items, matching all members + break + endif + if a:items[idx][0] != '[' + let target = a:items[idx] + break + endif + let idx += 1 + endwhile " Put matching members in matches[]. let matches = [] for l in qflist let memb = matchstr(l['text'], '[^\t]*') - if memb =~ '^' . a:items[0] + if memb =~ '^' . target " Skip matches local to another file. if match(l['text'], "\tfile:") < 0 || bufnr('%') == bufnr(matchstr(l['text'], '\t\zs[^\t]*')) let item = {'match': memb, 'tagline': l['text']} @@ -540,8 +567,8 @@ function! s:StructMembers(typename, items, all) endfor if len(matches) > 0 - " Skip over [...] items - let idx = 1 + " Skip over next [...] items + let idx += 1 while 1 if idx >= len(a:items) return matches " No further items, return the result. diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index 81fdc9d95..160cdcff6 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -632,7 +632,7 @@ endfunc " Choose context, plaintex, or tex (LaTeX) based on these rules: " 1. Check the first line of the file for "%&<format>". " 2. Check the first 1000 non-comment lines for LaTeX or ConTeXt keywords. -" 3. Default to "latex" or to g:tex_flavor, can be set in user's vimrc. +" 3. Default to "plain" or to g:tex_flavor, can be set in user's vimrc. func dist#ft#FTtex() let firstline = getline(1) if firstline =~ '^%&\s*\a\+' diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 34eab9670..d92fe1b18 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -152,13 +152,16 @@ fun! tar#Browse(tarfile) " assuming cygwin let tarfile=substitute(system("cygpath -u ".shellescape(tarfile,0)),'\n$','','e') endif + + let gzip_command = s:get_gzip_command(tarfile) + let curlast= line("$") if tarfile =~# '\.\(gz\|tgz\)$' " call Decho("1: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.lrp' " call Decho("2: exe silent r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - ") - exe "sil! r! cat -- ".shellescape(tarfile,1)."|gzip -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " + exe "sil! r! cat -- ".shellescape(tarfile,1)."|" . gzip_command . " -d -c -|".g:tar_cmd." -".g:tar_browseoptions." - " elseif tarfile =~# '\.\(bz2\|tbz\|tb2\)$' " call Decho("3: exe silent r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - ") exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_browseoptions." - " @@ -287,15 +290,18 @@ fun! tar#Read(fname,mode) else let tar_secure= " " endif + + let gzip_command = s:get_gzip_command(tarfile) + if tarfile =~# '\.bz2$' " call Decho("7: exe silent r! bzip2 -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.\(gz\|tgz\)$' " call Decho("5: exe silent r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd.' -'.g:tar_readoptions.' - '.tar_secure.shellescape(fname,1)) - exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! " . gzip_command . " -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lrp$' " call Decho("6: exe silent r! cat ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) - exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! cat -- ".shellescape(tarfile,1)." | " . gzip_command . " -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp elseif tarfile =~# '\.lzma$' " call Decho("7: exe silent r! lzma -d -c ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp) exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp @@ -389,6 +395,8 @@ fun! tar#Write(fname) let tarfile = substitute(b:tarfile,'tarfile:\(.\{-}\)::.*$','\1','') let fname = substitute(b:tarfile,'tarfile:.\{-}::\(.*\)$','\1','') + let gzip_command = s:get_gzip_command(tarfile) + " handle compressed archives if tarfile =~# '\.bz2' call system("bzip2 -d -- ".shellescape(tarfile,0)) @@ -396,12 +404,12 @@ fun! tar#Write(fname) let compress= "bzip2 -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") elseif tarfile =~# '\.gz' - call system("gzip -d -- ".shellescape(tarfile,0)) + call system(gzip_command . " -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.gz','','e') let compress= "gzip -- ".shellescape(tarfile,0) " call Decho("compress<".compress.">") elseif tarfile =~# '\.tgz' - call system("gzip -d -- ".shellescape(tarfile,0)) + call system(gzip_command . " -d -- ".shellescape(tarfile,0)) let tarfile = substitute(tarfile,'\.tgz','.tar','e') let compress= "gzip -- ".shellescape(tarfile,0) let tgz = 1 @@ -581,7 +589,9 @@ fun! tar#Vimuntar(...) " if necessary, decompress the tarball; then, extract it if tartail =~ '\.tgz' - if executable("gunzip") + if executable("bzip2") + silent exe "!bzip2 -d ".shellescape(tartail) + elseif executable("gunzip") silent exe "!gunzip ".shellescape(tartail) elseif executable("gzip") silent exe "!gzip -d ".shellescape(tartail) @@ -619,6 +629,15 @@ fun! tar#Vimuntar(...) " call Dret("tar#Vimuntar") endfun +func s:get_gzip_command(file) + if a:file =~# 'z$' && executable('bzip2') + " Some .tgz files are actually compressed with bzip2. Since bzip2 can + " handle the format from gzip, use it if the command exists. + return 'bzip2' + endif + return 'gzip' +endfunc + " ===================================================================== " Modelines And Restoration: {{{1 let &cpo= s:keepcpo diff --git a/runtime/compiler/stack.vim b/runtime/compiler/stack.vim new file mode 100644 index 000000000..4236b4c8b --- /dev/null +++ b/runtime/compiler/stack.vim @@ -0,0 +1,37 @@ +" Vim compiler file +" Compiler: Haskell Stack +" Maintainer: Daniel Campoverde <alx@sillybytes.net> +" Latest Revision: 2018-08-27 + +if exists("current_compiler") + finish +endif +let current_compiler = "stack" + +let s:cpo_save = &cpo +set cpo&vim + + +CompilerSet errorformat= + \%-G%.%#:\ build\ %.%#, + \%-G%.%#:\ configure\ %.%#, + \%-G[%.%#]%.%#, + \%-G%.%#preprocessing\ %.%#, + \%-G%.%#configuring\ %.%#, + \%-G%.%#building\ %.%#, + \%-G%.%#linking\ %.%#, + \%-G%.%#installing\ %.%#, + \%-G%.%#registering\ %.%#, + \%-G%.%#:\ copy/register%.%#, + \%-G%.%#process\ exited\ %.%#, + \%-G%.%#--builddir=%.%#, + \%-G--%.%#, + \%-G%.%#\|%.%#, + \%E%f:%l:%c:\ error:,%+Z\ \ \ \ %m, + \%E%f:%l:%c:\ error:\ %m,%-Z, + \%W%f:%l:%c:\ warning:,%+Z\ \ \ \ %m, + \%W%f:%l:%c:\ warning:\ %m,%-Z, + + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index b8ab0f308..640816521 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -8013,7 +8013,7 @@ substitute({expr}, {pat}, {sub}, {flags}) *substitute()* |submatch()| returns. Example: > :echo substitute(s, '%\(\x\x\)', {m -> '0x' . m[1]}, 'g') -swapinfo({fname}) swapinfo() +swapinfo({fname}) *swapinfo()* The result is a dictionary, which holds information about the swapfile {fname}. The available fields are: version VIM version diff --git a/runtime/doc/gui_x11.txt b/runtime/doc/gui_x11.txt index 6b7a77307..a95b9fd6b 100644 --- a/runtime/doc/gui_x11.txt +++ b/runtime/doc/gui_x11.txt @@ -376,8 +376,8 @@ you might have to use the file ~/.gtkrc-2.0 instead, depending on your distribution. For GTK+ 3, an effect similar to the above can be obtained by adding the -following snippet of CSS code to $XDG_HOME_DIR/gtk-3.0/gtk.css (usually, -$HOME/.config/gtk-3.0/gtk.css): +following snippet of CSS code to $XDG_HOME_DIR/gtk-3.0/gtk.css (see the next +section): For GTK+ 3 < 3.20: > @@ -408,6 +408,10 @@ stable support for GTK+ CSS: GTK+ uses CSS for styling and layout of widgets. In this subsection, we'll have a quick look at GTK+ CSS through simple, illustrative examples. +You can usually edit the config with: > + vim $HOME/.config/gtk-3.0/gtk.css + + Example 1. Empty Space Adjustment ~ By default, the toolbar and the tabline of the GTK+ 3 GUI are somewhat larger @@ -492,6 +496,16 @@ unexpectedly less attractive or even deteriorates their usability. Keep this in mind always when you try improving a theme. +Example 3. border color + +To eliminate borders when maximized: > + + @define-color bg_color #1B2B34; + #vim-main-window { + background-color: @bg_color; + } + + Using Vim as a GTK+ plugin ~ *gui-gtk-socketid* When the GTK+ version of Vim starts up normally, it creates its own top level diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index d21de4b46..a93f3cbb4 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -82,6 +82,18 @@ Examples: :pydo return "%s\t%d" % (line[::-1], len(line)) :pydo if line: return "%4d: %s" % (linenr, line) < +One can use `:pydo` in possible conjunction with `:py` to filter a range using +python. For example: > + + :py3 << EOF + needle = vim.eval('@a') + replacement = vim.eval('@b') + + def py_vim_string_replace(str): + return str.replace(needle, replacement) + EOF + :'<,'>py3do return py_vim_string_replace(line) +< *:pyfile* *:pyf* :[range]pyf[ile] {file} Execute the Python script in {file}. The whole diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 9d2d6bfc4..b5e9626bb 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -846,6 +846,8 @@ A jump table for the options with a short description can be found at |Q_op|. '{A-Z0-9}, or `{A-Z0-9} command takes one to another file. Note that for some commands the 'autowrite' option is not used, see 'autowriteall' for that. + Some buffers will not be written, specifically when 'buttype' is + "nowrite", "nofile", "terminal" or "prompt". *'autowriteall'* *'awa'* *'noautowriteall'* *'noawa'* 'autowriteall' 'awa' boolean (default off) diff --git a/runtime/doc/tags b/runtime/doc/tags index 75615fe2c..9f6f3bde3 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -5408,6 +5408,7 @@ catch-order eval.txt /*catch-order* catch-text eval.txt /*catch-text* cc change.txt /*cc* ceil() eval.txt /*ceil()* +cfilter-plugin quickfix.txt /*cfilter-plugin* ch.vim syntax.txt /*ch.vim* ch_canread() eval.txt /*ch_canread()* ch_close() eval.txt /*ch_close()* @@ -8659,6 +8660,7 @@ swap-file recover.txt /*swap-file* swapchoice-variable eval.txt /*swapchoice-variable* swapcommand-variable eval.txt /*swapcommand-variable* swapfile-changed version4.txt /*swapfile-changed* +swapinfo() eval.txt /*swapinfo()* swapname-variable eval.txt /*swapname-variable* sybase ft_sql.txt /*sybase* syn-sync-grouphere syntax.txt /*syn-sync-grouphere* @@ -9639,6 +9641,7 @@ windows98 os_win32.txt /*windows98* windowsme os_win32.txt /*windowsme* winheight() eval.txt /*winheight()* winid windows.txt /*winid* +winlayout() eval.txt /*winlayout()* winline() eval.txt /*winline()* winnr() eval.txt /*winnr()* winrestcmd() eval.txt /*winrestcmd()* diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 818cb3741..38773e02a 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -43,6 +43,7 @@ browser use: https://github.com/vim/vim/issues/1234 - :s/foo using CTRL-G moves to another line, should not happen, or use the correct line (it uses the last but one line) (Lifepillar, Aug 18, #3345) - Also support range: :/foo/,/bar/delete +- Also support for user command, e.g. Cfilter - :%s/foo should take the first match below the cursor line, unless there isn't one? Then :%s?foo should take the first match above the cursor line. @@ -109,27 +110,12 @@ Improve fallback for menu translations, to avoid having to create lots of files that source the actual file. E.g. menu_da_de -> menu_da Include part of #3242? -Using ":file" in quickfix window during an autocommand doesn't work. -(Jason Franklin, 2018 May 23) Allow for using it when there is no argument. -Patch should now work. (Jason Franklin, 2018 Aug 12) - -Include Chinese-Taiwan translations. (bystar, #3261) - -Screendump test fails even though characters are the same. -Some attribute difference that isn't included in the screenshot? -(Elimar Riesebieter, 2018 Aug 21) - Completion mixes results from the current buffer with tags and other files. Happens when typing CTRL-N while still search for results. E.g., type "b_" in terminal.c and then CTRL-N twice. Should do current file first and not split it up when more results are found. (Also #1890) -Patch to support VTP better. (Nobuhiro Takasaki, 2018 Aug 19, #3347) - -Patch with improvement for ccomplete: #3350 -Try it out. Perhaps write a test? - More warnings from static analysis: https://lgtm.com/projects/g/vim/vim/alerts/?mode=list @@ -195,8 +181,22 @@ Adjust windows installer explanation of behavior. (scootergrisen, #3310) Set g:actual_curbuf when evaluating 'statusline', not just with an expression. (Daniel Hahler, 2018 Aug 8, #3299) +Using an external diff is inefficient. Not all systems have a good diff +program available (esp. MS-Windows). Would be nice to have in internal diff +implementation. Can then also use this for displaying changes within a line. +Olaf Dabrunz is working on this. (10 Jan 2016) +9 Instead invoking an external diff program, use builtin code. One can be + found here: http://www.ioplex.com/~miallen/libmba/dl/src/diff.c + It's complicated and badly documented. +Alternative: use the xdiff library. Unfinished Patch from Christian Brabandt, +2018 Mar 20, #2732) + Difference between two regexp engines: #3373 +Patch to add arguments to argc() and argv(). (Yegappan Lakshmanan, 2016 Jan +24, #832) Also need a way to get the global arg list? Update later on Jan 24 +Update Mar 5. Update Apr 7. Update Jun 5. + When the last line wraps, selecting with the mouse below that line only includes the first screen line. (2018 Aug 23, #3368) @@ -245,6 +245,9 @@ balloon_show() does not work properly in the terminal. (Ben Jackson, 2017 Dec Also see #2352, want better control over balloon, perhaps set the position. Should also be possible to add highlighting, like in the status line? +Patch to fix that executable() may fail on very long filename in MS-Windows. +(Ken Takata, 2016 Feb 1) + Try out background make plugin: https://github.com/AndrewVos/vim-make-background or asyncmake: @@ -430,16 +433,6 @@ CTRL-X on zero gets stuck on 0xfffffffffffffffe. (Hengyang Zhao, #2746) Invalid range error when using BufWinLeave for closing terminal. (Gabriel Barta, 2017 Nov 15, #2339) -Using an external diff is inefficient. Not all systems have a good diff -program available (esp. MS-Windows). Would be nice to have in internal diff -implementation. Can then also use this for displaying changes within a line. -Olaf Dabrunz is working on this. (10 Jan 2016) -9 Instead invoking an external diff program, use builtin code. One can be - found here: http://www.ioplex.com/~miallen/libmba/dl/src/diff.c - It's complicated and badly documented. -Alternative: use the xdiff library. Unfinished Patch from Christian Brabandt, -2018 Mar 20, #2732) - ml_get errors with buggy script. (Dominique, 2017 Apr 30) Error in emsg with buggy script. (Dominique, 2017 Apr 30) @@ -1128,9 +1121,6 @@ Patch to add <restore> to :windo, :bufdo, etc. (Christian Brabandt, 2015 Jan 6, 2nd message) Alternative: ":keeppos" command modifier: ":keeppos windo {cmd}". -Patch to fix that executable() may fail on very long filename in MS-Windows. -(Ken Takata, 2016 Feb 1) - Patch to fix display of listchars on the cursorline. (Nayuri Aohime, 2013) Update suggested by Yasuhiro Matsumoto, 2014 Nov 25: https://gist.github.com/presuku/d3d6b230b9b6dcfc0477 @@ -1192,10 +1182,6 @@ I can't recommend it though. Build with Python on Mac does not always use the right library. (Kazunobu Kuriyama, 2015 Mar 28) -Patch to add arguments to argc() and argv(). (Yegappan Lakshmanan, 2016 Jan -24) Also need a way to get the global arg list? Update later on Jan 24 -Update Mar 5. Update Apr 7. Update Jun 5. - To support Thai (and other languages) word boundaries, include the ICU library: http://userguide.icu-project.org/boundaryanalysis diff --git a/runtime/ftplugin/cmake.vim b/runtime/ftplugin/cmake.vim index e81cd4071..94c007629 100644 --- a/runtime/ftplugin/cmake.vim +++ b/runtime/ftplugin/cmake.vim @@ -1,16 +1,34 @@ " Vim filetype plugin " Language: CMake " Maintainer: Keith Smiley <keithbsmiley@gmail.com> -" Last Change: 2017 Dec 24 +" Last Change: 2018 Aug 30 " Only do this when not done yet for this buffer if exists("b:did_ftplugin") finish endif +" save 'cpo' for restoration at the end of this file +let s:cpo_save = &cpo +set cpo&vim + " Don't load another plugin for this buffer let b:did_ftplugin = 1 let b:undo_ftplugin = "setl commentstring<" +if exists('loaded_matchit') + let b:match_words = '\<if\>:\<elseif\>\|\<else\>:\<endif\>' + \ . ',\<foreach\>\|\<while\>:\<break\>:\<endforeach\>\|\<endwhile\>' + \ . ',\<macro\>:\<endmacro\>' + \ . ',\<function\>:\<endfunction\>' + let b:match_ignorecase = 1 + + let b:undo_ftplugin .= "| unlet b:match_words" +endif + setlocal commentstring=#\ %s + +" restore 'cpo' and clean up buffer variable +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/indent/dosbatch.vim b/runtime/indent/dosbatch.vim new file mode 100644 index 000000000..aea2a184d --- /dev/null +++ b/runtime/indent/dosbatch.vim @@ -0,0 +1,59 @@ +" Vim indent file +" Language: MSDOS batch file (with NT command extensions) +" Maintainer: Ken Takata +" URL: https://github.com/k-takata/vim-dosbatch-indent +" Last Change: 2017 May 10 +" Filenames: *.bat +" License: VIM License + +if exists("b:did_indent") + finish +endif +let b:did_indent = 1 + +setlocal nosmartindent +setlocal noautoindent +setlocal indentexpr=GetDosBatchIndent(v:lnum) +setlocal indentkeys=!^F,o,O +setlocal indentkeys+=0=) + +if exists("*GetDosBatchIndent") + finish +endif + +let s:cpo_save = &cpo +set cpo&vim + +function! GetDosBatchIndent(lnum) + let l:prevlnum = prevnonblank(a:lnum-1) + if l:prevlnum == 0 + " top of file + return 0 + endif + + " grab the previous and current line, stripping comments. + let l:prevl = substitute(getline(l:prevlnum), '\c^\s*\%(@\s*\)\?rem\>.*$', '', '') + let l:thisl = getline(a:lnum) + let l:previ = indent(l:prevlnum) + + let l:ind = l:previ + + if l:prevl =~? '^\s*@\=if\>.*(\s*$' || + \ l:prevl =~? '\<do\>\s*(\s*$' || + \ l:prevl =~? '\<else\>\s*\%(if\>.*\)\?(\s*$' || + \ l:prevl =~? '^.*\(&&\|||\)\s*(\s*$' + " previous line opened a block + let l:ind += shiftwidth() + endif + if l:thisl =~ '^\s*)' + " this line closed a block + let l:ind -= shiftwidth() + endif + + return l:ind +endfunction + +let &cpo = s:cpo_save +unlet s:cpo_save + +" vim: ts=8 sw=2 sts=2 diff --git a/runtime/indent/teraterm.vim b/runtime/indent/teraterm.vim index 370283c77..35d735429 100644 --- a/runtime/indent/teraterm.vim +++ b/runtime/indent/teraterm.vim @@ -1,9 +1,9 @@ " Vim indent file " Language: Tera Term Language (TTL) -" Based on Tera Term Version 4.92 +" Based on Tera Term Version 4.100 " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-teraterm -" Last Change: 2017 Jun 13 +" Last Change: 2018-08-31 " Filenames: *.ttl " License: VIM License diff --git a/runtime/syntax/teraterm.vim b/runtime/syntax/teraterm.vim index 192499673..9115320bf 100644 --- a/runtime/syntax/teraterm.vim +++ b/runtime/syntax/teraterm.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: Tera Term Language (TTL) -" Based on Tera Term Version 4.92 +" Based on Tera Term Version 4.100 " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-teraterm -" Last Change: 2016 Aug 17 +" Last Change: 2018-08-31 " Filenames: *.ttl " License: VIM License @@ -75,12 +75,13 @@ syn keyword ttlCommunicationCommand contained \ logrotate logstart logwrite quickvanrecv \ quickvansend recvln restoresetup scprecv scpsend \ send sendbreak sendbroadcast sendfile sendkcode - \ sendln sendlnbroadcast sendmulticast setbaud - \ setdebug setdtr setecho setmulticastname setrts - \ setsync settitle showtt testlink unlink wait - \ wait4all waitevent waitln waitn waitrecv waitregex - \ xmodemrecv xmodemsend ymodemrecv ymodemsend - \ zmodemrecv zmodemsend + \ sendln sendlnbroadcast sendlnmulticast sendmulticast + \ setbaud setdebug setdtr setecho setflowctrl + \ setmulticastname setrts setspeed setsync settitle + \ showtt testlink unlink wait wait4all waitevent + \ waitln waitn waitrecv waitregex xmodemrecv + \ xmodemsend ymodemrecv ymodemsend zmodemrecv + \ zmodemsend syn keyword ttlStringCommand contained \ code2str expandenv int2str regexoption sprintf \ sprintf2 str2code str2int strcompare strconcat diff --git a/runtime/tutor/tutor.es b/runtime/tutor/tutor.es index 268c40cd9..ab213c3b0 100644 --- a/runtime/tutor/tutor.es +++ b/runtime/tutor/tutor.es @@ -76,7 +76,7 @@ Nota: Las teclas de movimiento del cursor tambin funcionan. Pero usando 1. Mueva el cursor a la lnea de abajo sealada con --->. 2. Para corregir los errores, mueva el cursor hasta que est bajo el - carcter que va aser borrado. + carcter que va a ser borrado. 3. Pulse la tecla x para borrar el carcter sobrante. diff --git a/runtime/tutor/tutor.es.utf-8 b/runtime/tutor/tutor.es.utf-8 index 7ddb8d458..a85ecd4c9 100644 --- a/runtime/tutor/tutor.es.utf-8 +++ b/runtime/tutor/tutor.es.utf-8 @@ -76,7 +76,7 @@ Nota: Las teclas de movimiento del cursor también funcionan. Pero usando 1. Mueva el cursor a la línea de abajo señalada con --->. 2. Para corregir los errores, mueva el cursor hasta que esté bajo el - carácter que va aser borrado. + carácter que va a ser borrado. 3. Pulse la tecla x para borrar el carácter sobrante. diff --git a/runtime/tutor/tutor.ru.utf-8 b/runtime/tutor/tutor.ru.utf-8 index 77cb47b48..aa9ba407c 100644 --- a/runtime/tutor/tutor.ru.utf-8 +++ b/runtime/tutor/tutor.ru.utf-8 @@ -540,7 +540,7 @@ ---> "ошшшибка" это не способ написания слова `ошибка'; ошшшибка это ошибка. -Замечание! Если при поиске будет достигнут конц файла, то поиск будет продолжен +Замечание! Если при поиске будет достигнут конец файла, то поиск будет продолжен с начала. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -607,15 +607,15 @@ парную скобку. 4. Для подстановки `стало' вместо первого `было' в строке, наберите - :s/old/new + :s/было/стало Для подстановки `стало' вместо всех `было' в строке, наберите - :s/old/new/g + :s/было/стало/g Для замены в интервале между двумя строками, наберите - :#,#s/old/new/g + :#,#s/было/стало/g Для замены всех вхождений `было' на `стало' в файле, наберите - :%s/old/new/g + :%s/было/стало/g Чтобы редактор каждый раз запрашивал подтверждение, добавьте 'c' - :%s/old/new/gc + :%s/было/стало/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Урок 5.1: КАК ВЫПОЛНИТЬ ВНЕШНЮЮ КОМАНДУ |