# HG changeset patch # User Christian Brabandt # Date 1526163305 -7200 # Node ID a9fdf01085a83c1865a75805d206dbd7840d1b72 # Parent c02f0e120b114c66f82876e29794430688fe3805 Update runtime files. commit https://github.com/vim/vim/commit/7db25fed5de1be922b8cbb0328149469606a0424 Author: Bram Moolenaar Date: Sun May 13 00:02:36 2018 +0200 Update runtime files. diff --git a/runtime/autoload/xmlformat.vim b/runtime/autoload/xmlformat.vim new file mode 100644 --- /dev/null +++ b/runtime/autoload/xmlformat.vim @@ -0,0 +1,112 @@ +" Vim plugin for formatting XML +" Last Change: Thu, 15 Jan 2015 21:26:55 +0100 +" Version: 0.1 +" Author: Christian Brabandt +" Script: http://www.vim.org/scripts/script.php?script_id= +" License: VIM License +" GetLatestVimScripts: ???? 18 :AutoInstall: xmlformat.vim +" Documentation: see :h xmlformat.txt (TODO!) +" --------------------------------------------------------------------- +" Load Once: {{{1 +if exists("g:loaded_xmlformat") || &cp + finish +endif +let g:loaded_xmlformat = 1 +let s:keepcpo = &cpo +set cpo&vim + +" Main function: Format the input {{{1 +func! xmlformat#Format() + " only allow reformatting through the gq command + " (e.g. Vim is in normal mode) + if mode() != 'n' + " do not fall back to internal formatting + return 0 + endif + let sw = shiftwidth() + let prev = prevnonblank(v:lnum-1) + let s:indent = indent(prev)/sw + let result = [] + let lastitem = prev ? getline(prev) : '' + let is_xml_decl = 0 + " split on `<`, but don't split on very first opening < + for item in split(getline(v:lnum), '.\@<=[>]\zs') + if s:EndTag(item) + let s:indent = s:DecreaseIndent() + call add(result, s:Indent(item)) + elseif s:EmptyTag(lastitem) + call add(result, s:Indent(item)) + elseif s:StartTag(lastitem) && s:IsTag(item) + let s:indent += 1 + call add(result, s:Indent(item)) + else + if !s:IsTag(item) + " Simply split on '<' + let t=split(item, '.<\@=\zs') + let s:indent+=1 + call add(result, s:Indent(t[0])) + let s:indent = s:DecreaseIndent() + call add(result, s:Indent(t[1])) + else + call add(result, s:Indent(item)) + endif + endif + let lastitem = item + endfor + + if !empty(result) + exe v:lnum. ",". (v:lnum + v:count - 1). 'd' + call append(v:lnum - 1, result) + " Might need to remove the last line, if it became empty because of the + " append() call + let last = v:lnum + len(result) + if getline(last) is '' + exe last. 'd' + endif + endif + + " do not run internal formatter! + return 0 +endfunc +" Check if given tag is XML Declaration header {{{1 +func! s:IsXMLDecl(tag) + return a:tag =~? '^\s*\s*$' +endfunc +" Return tag indented by current level {{{1 +func! s:Indent(item) + return repeat(' ', shiftwidth()*s:indent). s:Trim(a:item) +endfu +" Return item trimmed from leading whitespace {{{1 +func! s:Trim(item) + if exists('*trim') + return trim(a:item) + else + return matchstr(a:item, '\S\+.*') + endif +endfunc +" Check if tag is a new opening tag {{{1 +func! s:StartTag(tag) + return a:tag =~? '^\s*<[^/?]' +endfunc +" Remove one level of indentation {{{1 +func! s:DecreaseIndent() + return (s:indent > 0 ? s:indent - 1 : 0) +endfunc +" Check if tag is a closing tag {{{1 +func! s:EndTag(tag) + return a:tag =~? '^\s*" +func! s:IsTag(tag) + return s:Trim(a:tag)[0] == '<' +endfunc +" Check if tag is empty {{{1 +func! s:EmptyTag(tag) + return a:tag =~ '/>\s*$' +endfunc +" Restoration And Modelines: {{{1 +let &cpo= s:keepcpo +unlet s:keepcpo +" Modeline {{{1 +" vim: fdm=marker fdl=0 ts=2 et sw=0 sts=-1 diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 8.0. Last change: 2018 May 06 +*change.txt* For Vim version 8.0. Last change: 2018 May 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -1445,6 +1445,55 @@ to the name of an external program for V 'textwidth' and other options have no effect on formatting by an external program. + *format-formatexpr* +The 'formatexpr' option can be set to a Vim Script function that performs +reformatting of the buffer. This should usually happen in an |ftplugin|, +since formatting is highly dependent on the type of file. It makes +sense to use an |autoload| script, so the corresponding script is only loaded +when actually needed and the script should be called format.vim. + +For example, the XML filetype plugin distributed with Vim in the $VIMRUNTIME +directory, sets the 'formatexpr' option to: > + + setlocal formatexpr=xmlformat#Format() + +That means, you will find the corresponding script, defining the +xmlformat#Format() function, in the directory: +`$VIMRUNTIME/autoload/xmlformat.vim` + +Here is an example script that removes trailing whitespace from the selected +text. Put it in your autoload directory, e.g. ~/.vim/autoload/format.vim: > + + func! format#Format() + " only reformat on explicit gq command + if mode() != 'n' + " fall back to Vims internal reformatting + return 1 + endif + let lines = getline(v:lnum, v:lnum + v:count - 1) + call map(lines, {key, val -> substitute(val, '\s\+$', '', 'g')}) + call setline('.', lines) + + " do not run internal formatter! + return 0 + endfunc + +You can then enable the formatting by executing: > + setlocal formatexpr=format#Format() +> +Note: this function explicitly returns non-zero when called from insert mode +(which basically means, text is inserted beyond the 'textwidth' limit). This +causes Vim to fall back to reformat the text by using the internal formatter. + +However, if the |gq| command is used to reformat the text, the function +will receive the selected lines, trim trailing whitespace from those lines and +put them back in place. If you are going to split single lines into multiple +lines, be careful not to overwrite anything. + +If you want to allow reformatting of text from insert or replace mode, one has +to be very careful, because the function might be called recursively. For +debugging it helps to set the 'debug' option. + *right-justify* There is no command in Vim to right justify text. You can do it with an external command, like "par" (e.g.: "!}par" to format until the end of the diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 8.0. Last change: 2017 Oct 19 +*cmdline.txt* For Vim version 8.0. Last change: 2018 May 10 VIM REFERENCE MANUAL by Bram Moolenaar @@ -412,14 +412,17 @@ CTRL-D List names that match the patter match is inserted. After the last match, the first is used again (wrap around). The behavior can be changed with the 'wildmode' option. + *c_* + Like 'wildchar' or , but begin with the last match and + then go to the previous match. + does not work everywhere. *c_CTRL-N* CTRL-N After using 'wildchar' which got multiple matches, go to next match. Otherwise recall more recent command-line from history. - *c_CTRL-P* *c_* + *c_CTRL-P* CTRL-P After using 'wildchar' which got multiple matches, go to previous match. Otherwise recall older command-line from - history. only works with the GUI, on the Amiga and - with MS-DOS. + history. *c_CTRL-A* CTRL-A All names that match the pattern in front of the cursor are inserted. diff --git a/runtime/doc/tags b/runtime/doc/tags --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -6137,6 +6137,7 @@ fork os_unix.txt /*fork* form.vim syntax.txt /*form.vim* format-bullet-list tips.txt /*format-bullet-list* format-comments change.txt /*format-comments* +format-formatexpr change.txt /*format-formatexpr* formatting change.txt /*formatting* formfeed intro.txt /*formfeed* fortran.vim syntax.txt /*fortran.vim* diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -1,4 +1,4 @@ -*terminal.txt* For Vim version 8.0. Last change: 2018 May 04 +*terminal.txt* For Vim version 8.0. Last change: 2018 May 11 VIM REFERENCE MANUAL by Bram Moolenaar @@ -317,7 +317,7 @@ the job ends while in Terminal-Normal mo When the job outputs lines in the terminal, such that the contents scrolls off the top, those lines are remembered and can be seen in Terminal-Normal mode. The number of lines is limited by the 'termwinscroll' option. When going over -this limit, the first 10% of the scrolled lins are deleted and are lost. +this limit, the first 10% of the scrolled lines are deleted and are lost. Cursor style ~ diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1,4 +1,4 @@ -*todo.txt* For Vim version 8.0. Last change: 2018 May 05 +*todo.txt* For Vim version 8.0. Last change: 2018 May 12 VIM REFERENCE MANUAL by Bram Moolenaar @@ -38,16 +38,8 @@ entered there will not be repeated below Terminal emulator window: - Still some stuff to implement and bugs to fix, see src/terminal.c -Problem with sudo. #2758 - -Looks like an error for inserting register makes ":file other" not work. -(Tom M, 2018 Mar 28) Reset did_emsg after inserting a register. -Or at the top of the loop? (Apr 4) - -Make assert_functions return non-zero on failure. Make sure they add one -entry to v:errors then. -Use WaitForAssert() in tests: give error when failed. -Remove asserts after WaitFor(). +On Win32 when not in the console and t_Co >= 256, allow using 'tgc'. +(Nobuhiro Takasaki, #2833) Also check t_Co. balloon_show() does not work properly in the terminal. (Ben Jackson, 2017 Dec 20, #2481) @@ -163,6 +155,9 @@ ch_sendraw() with long string does not t a deadlock if the reading side is waiting for the write to finish. (Nate Bosch, 2018 Jan 13, #2548) +Patch to include a cfilter plugin to filter quickfix/location lists. +(Yegappan Lakshmanan, 2018 May 12) + Add Makefiles to the runtime/spell directory tree, since nobody uses Aap. Will have to explain the manual steps (downloading the .aff and .dic files, applying the diff, etc. @@ -181,6 +176,8 @@ With foldmethod=syntax and nofoldenable Using 'wildignore' also applies to literally entered file name. Also with :drop (remote commands). +Patch to support ":tag -" Last Changed: 20 Jan 2009 -" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin +" Maintainer: Christian Brabandt +" Last Changed: May 08th, 2018 +" Repository: https://github.com/chrisbra/vim-xml-ftplugin +" Previous Maintainer: Dan Sharp +" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 @@ -10,16 +12,16 @@ let b:did_ftplugin = 1 " Make sure the continuation lines below do not cause problems in " compatibility mode. let s:save_cpo = &cpo -set cpo-=C +set cpo&vim setlocal commentstring= -setlocal comments=s: +" Remove the middlepart from the comments section, as this causes problems: +" https://groups.google.com/d/msg/vim_dev/x4GT-nqa0Kg/jvtRnEbtAnMJ +setlocal comments=s: setlocal formatoptions-=t -if !exists("g:ft_xml_autocomment") || (g:ft_xml_autocomment == 1) - setlocal formatoptions+=croql -endif - +setlocal formatoptions+=croql +setlocal formatexpr=xmlformat#Format() " XML: thanks to Johannes Zellner and Akbar Ibrahim " - case sensitive @@ -39,7 +41,6 @@ if exists("loaded_matchit") \ '<\@<=\%([^ \t>/]\+\)\%(\s\+[^/>]*\|$\):/>' endif -" " For Omni completion, by Mikolaj Machowski. if exists('&ofu') setlocal ofu=xmlcomplete#CompleteTags @@ -47,17 +48,17 @@ endif command! -nargs=+ XMLns call xmlcomplete#CreateConnection() command! -nargs=? XMLent call xmlcomplete#CreateEntConnection() - " Change the :browse e filter to primarily show xml-related files. -if has("gui_win32") +if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter="XML Files (*.xml)\t*.xml\n" . - \ "DTD Files (*.dtd)\t*.dtd\n" . - \ "All Files (*.*)\t*.*\n" + \ "DTD Files (*.dtd)\t*.dtd\n" . + \ "XSD Files (*.xsd)\t*.xsd\n" . + \ "All Files (*.*)\t*.*\n" endif " Undo the stuff we changed. -let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions<" . - \ " | unlet! b:match_ignorecase b:match_words b:browsefilter" +let b:undo_ftplugin = "setlocal commentstring< comments< formatoptions< formatexpr< " . + \ " | unlet! b:match_ignorecase b:match_words b:browsefilter" " Restore the saved compatibility options. let &cpo = s:save_cpo diff --git a/runtime/indent/sh.vim b/runtime/indent/sh.vim --- a/runtime/indent/sh.vim +++ b/runtime/indent/sh.vim @@ -3,7 +3,7 @@ " Maintainer: Christian Brabandt " Previous Maintainer: Peter Aronoff " Original Author: Nikolai Weibull -" Latest Revision: 2017-08-08 +" Latest Revision: 2018-05-12 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-sh-indent " Changelog: @@ -59,12 +59,15 @@ function! GetShIndent() if lnum == 0 return 0 endif + let line = getline(lnum) let pnum = prevnonblank(lnum - 1) - + let pline = getline(pnum) let ind = indent(lnum) - let line = getline(lnum) - if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' + + " Check contents of previous lines + if line =~ '^\s*\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>' || + \ (&ft is# 'zsh' && line =~ '\%(if\|then\|do\|else\|elif\|case\|while\|until\|for\|select\|foreach\)\>') if line !~ '\<\%(fi\|esac\|done\|end\)\>\s*\%(#.*\)\=$' let ind += s:indent_value('default') endif @@ -72,21 +75,35 @@ function! GetShIndent() if !s:is_case_ended(line) let ind += s:indent_value('case-statements') endif - elseif line =~ '^\s*\<\k\+\>\s*()\s*{' || line =~ '^\s*{' || line =~ '^\s*function\s*\w\S\+\s*\%(()\)\?\s*{' + " function definition + elseif s:is_function_definition(line) if line !~ '}\s*\%(#.*\)\=$' let ind += s:indent_value('default') endif elseif s:is_continuation_line(line) - if pnum == 0 || !s:is_continuation_line(getline(pnum)) + if pnum == 0 || !s:is_continuation_line(pline) let ind += s:indent_value('continuation-line') endif - elseif pnum != 0 && s:is_continuation_line(getline(pnum)) - let ind = indent(s:find_continued_lnum(pnum)) + elseif s:end_block(line) && !s:start_block(line) + let ind -= s:indent_value('default') + elseif pnum != 0 && s:is_continuation_line(pline) && !s:end_block(getline(v:lnum)) + " only add indent, if line and pline is in the same block + let i = v:lnum + let ind2 = indent(s:find_continued_lnum(pnum)) + while !s:is_empty(getline(i)) && i > pnum + let i -= 1 + endw + if i == pnum + let ind += ind2 + else + let ind = ind2 + endif endif let pine = line + " Check content of current line let line = getline(v:lnum) - if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\|end\)\>' || line =~ '^\s*}' + if line =~ '^\s*\%(then\|do\|else\|elif\|fi\|done\|end\)\>' || s:end_block(line) let ind -= s:indent_value('default') elseif line =~ '^\s*esac\>' && s:is_case_empty(getline(v:lnum - 1)) let ind -= s:indent_value('default') @@ -112,14 +129,24 @@ function! GetShIndent() " 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) + elseif s:is_comment(line) && s:is_empty(getline(v:lnum-1)) + return indent(v:lnum) endif - return ind + return ind > 0 ? ind : 0 endfunction function! s:is_continuation_line(line) - return a:line =~ '\%(\%(^\|[^\\]\)\\\|&&\|||\||\)' . + " Comment, cannot be a line continuation + if a:line =~ '^\s*#' + return 0 + else + " start-of-line + " \\ or && or || or | + " followed optionally by { or # + return a:line =~ '\%(\%(^\|[^\\]\)\\\|&&\|||\||\)' . \ '\s*\({\s*\)\=\(#.*\)\=$' + endif endfunction function! s:find_continued_lnum(lnum) @@ -130,6 +157,12 @@ function! s:find_continued_lnum(lnum) return i endfunction +function! s:is_function_definition(line) + return a:line =~ '^\s*\<\k\+\>\s*()\s*{' || + \ a:line =~ '^\s*{' || + \ a:line =~ '^\s*function\s*\w\S\+\s*\%(()\)\?\s*{' +endfunction + function! s:is_case_label(line, pnum) if a:line !~ '^\s*(\=.*)' return 0 @@ -195,5 +228,29 @@ function! s:escape(pattern) return '\V'. escape(a:pattern, '\\') endfunction +function! s:is_empty(line) + return a:line =~ '^\s*$' +endfunction + +function! s:end_block(line) + return a:line =~ '^\s*}' +endfunction + +function! s:start_block(line) + return a:line =~ '{\s*\(#.*\)\?$' +endfunction + +function! s:find_start_block(lnum) + let i = a:lnum + while i > 1 && !s:start_block(getline(i)) + let i -= 1 + endwhile + return i +endfunction + +function! s:is_comment(line) + return a:line =~ '^\s*#' +endfunction + let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/indent/tex.vim b/runtime/indent/tex.vim --- a/runtime/indent/tex.vim +++ b/runtime/indent/tex.vim @@ -1,12 +1,16 @@ -" Vim indent file -" Language: LaTeX -" Maintainer: Yichao Zhou -" Created: Sat, 16 Feb 2002 16:50:19 +0100 -" Version: 1.0.0 +" Vim indent file for TeX +" Language: TeX +" Maintainer: Christian Brabandt +" Previous Maintainer: YiChao Zhou +" Latest Revision: 2017-05-03 +" Version: 0.9.3 +" Repository: https://github.com/chrisbra/vim-tex-indent +" Documention: :h ft-tex-indent +" Created: Sat, 16 Feb 2002 16:50:19 +0100 " Please email me if you found something I can do. Comments, bug report and " feature request are welcome. -" Last Update: {{{ +" Last Update: {{{1 " 25th Sep 2002, by LH : " (*) better support for the option " (*) use some regex instead of several '||'. @@ -15,122 +19,64 @@ " 2005/06/15, Moshe Kaminsky " (*) New variables: " g:tex_items, g:tex_itemize_env, g:tex_noindent_env -" 2011/3/6, by Yichao Zhou +" 2011/3/6, by Zhou YiChao " (*) 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 Yichao Zhou +" 2011/9/25, by Zhou Yichao " (*) Bug fix: smartindent-like indent for "[]" " (*) New features: Align with "&". " (*) New variable: g:tex_indent_and. -" 2011/10/23 by Yichao Zhou +" 2011/10/23 by Zhou Yichao " (*) Bug fix: improve the smartindent-like indent for "{}" and " "[]". -" 2012/02/27 by Yichao Zhou +" 2012/02/27 by Zhou Yichao " (*) Bug fix: support default folding marker. " (*) Indent with "&" is not very handy. Make it not enable by " default. -" 2012/03/06 by Yichao Zhou +" 2012/03/06 by Zhou Yichao " (*) 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 Yichao Zhou +" 2012/03/11 by Zhou Yichao " (*) Modify "&" so that only indent when current line start with " "&". -" 2012/03/12 by Yichao Zhou +" 2012/03/12 by Zhou Yichao " (*) Modify indentkeys. -" 2012/03/18 by Yichao Zhou +" 2012/03/18 by Zhou Yichao " (*) Add &cpo -" 2013/05/02 by Yichao Zhou +" 2013/05/02 by Zhou Yichao " (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk " for reporting this. -" 2014/06/23 by Yichao Zhou +" 2014/06/23 by Zhou Yichao " (*) 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 Yichao Zhou +" 2014/08/03 by Zhou Yichao " (*) Indent current line if last line has larger indentation -" 2016/11/08 by Yichao Zhou -" (*) Fix problems for \[ and \]. Thanks Bruno for reporting. -" 2017/04/30 by Yichao Zhou -" (*) 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. -" 2018/02/07 by Yichao Zhou -" (*) Make indentation more smart in the normal mode +" 2014/08/09 by Zhou Yichao +" (*) Add missing return value for s:GetEndIndentation(...) +" 2017/05/02: new maintainer Christian Brabandt +" 2017/05/02: use shiftwidth() function +" 2017/05/02: do not add indent when environment starts and ends +" at previous line +" 2017/05/03: release 0.9.3 submitted for inclusion with Vim " " }}} - -" Document: {{{ -" -" To set the following options (ok, currently it's just one), add a line like -" let g:tex_indent_items = 1 -" to your ~/.vimrc. -" -" * g:tex_indent_brace -" -" If this variable is unset or non-zero, it will use smartindent-like style -" for "{}" and "[]". Now this only works if the open brace is the last -" character of that line. -" -" % Example 1 -" \usetikzlibrary{ -" external -" } -" -" % 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. -" -" set unset -" ------------------------------------------------------ -" \begin{itemize} \begin{itemize} -" \item blablabla \item blablabla -" bla bla bla bla bla bla -" \item blablabla \item blablabla -" 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 -" 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 -" 'itemize\|description\|enumerate\|thebibliography'. -" -" * g:tex_noindent_env -" -" A list of environment names. separated with '\|', where no indentation is -" required. The default is 'document\|verbatim'. -" }}} - -" Only define the function once +" Only define the function once {{{1 if exists("b:did_indent") finish endif let s:cpo_save = &cpo set cpo&vim - -" Define global variable {{{ - +" Define global variable {{{1 let b:did_indent = 1 if !exists("g:tex_indent_items") @@ -147,7 +93,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 = '' @@ -156,17 +102,17 @@ endif if !exists("g:tex_noindent_env") let g:tex_noindent_env = 'document\|verbatim\|lstlisting' endif "}}} - -" VIM Setting " {{{ +" VIM Setting " {{{1 setlocal autoindent setlocal nosmartindent setlocal indentexpr=GetTeXIndent() setlocal indentkeys& exec 'setlocal indentkeys+=[,(,{,),},],\&' . substitute(g:tex_items, '^\|\(\\|\)', ',=', 'g') let g:tex_items = '^\s*' . substitute(g:tex_items, '^\(\^\\s\*\)*', '', '') + +let b:undo_indent = 'setlocal indentexpr< indentkeys< smartindent< autoindent<' " }}} - -function! GetTeXIndent() " {{{ +function! GetTeXIndent() " {{{1 " Find a non-blank line above the current line. let lnum = prevnonblank(v:lnum - 1) let cnum = v:lnum @@ -178,7 +124,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 @@ -192,9 +138,9 @@ function! GetTeXIndent() " {{{ return indent(v:lnum) end endif - + if lnum == 0 - return 0 + return 0 endif let ind = indent(lnum) @@ -205,16 +151,12 @@ function! GetTeXIndent() " {{{ return indent(v:lnum) endif - " Add a 'shiftwidth' after beginning of environments. - " Don't add it for \begin{document} and \begin{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{.*}' - if line !~ g:tex_noindent_env - let ind = ind + shiftwidth() - let stay = 0 - endif + " Add a 'shiftwidth' after beginning of environments + " But don't do it for g:tex_noindent_env or when it also ends at the + " previous line. + if line =~ '\\begin{.*}' && line !~ '\\end{.*}' && line !~ g:tex_noindent_env + let ind = ind + shiftwidth() + let stay = 0 if g:tex_indent_items " Add another sw for item-environments @@ -248,27 +190,29 @@ function! GetTeXIndent() " {{{ endif if g:tex_indent_brace - if line =~ '[[{]$' + let char = line[strlen(line)-1] + if char == '[' || char == '{' let ind += shiftwidth() let stay = 0 endif - if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, indent(v:lnum)) + let cind = indent(v:lnum) + let char = cline[cind] + if (char == ']' || char == '}') && + \ s:CheckPairedIsLastCharacter(v:lnum, cind) let ind -= shiftwidth() let stay = 0 endif - 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 -= shiftwidth() - 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 -= shiftwidth() + let stay = 0 endif - endfor - endif + endif + endfor endif " Special treatment for 'item' @@ -287,9 +231,8 @@ function! GetTeXIndent() " {{{ endif endif - if stay && mode() == 'i' - " If there is no obvious indentation hint, and indentation is triggered - " in insert mode, we trust our user. + if stay + " If there is no obvious indentation hint, we trust our user. if empty(cline) return ind else @@ -299,8 +242,7 @@ function! GetTeXIndent() " {{{ return ind endif endfunction "}}} - -function! s:GetLastBeginIndentation(lnum) " {{{ +function! s:GetLastBeginIndentation(lnum) " {{{1 let matchend = 1 for lnum in range(a:lnum-1, max([a:lnum - g:tex_max_scan_line, 1]), -1) let line = getline(lnum) @@ -311,19 +253,19 @@ function! s:GetLastBeginIndentation(lnum let matchend -= 1 endif if matchend == 0 + if line =~ g:tex_itemize_env + return indent(lnum) + 2 * shiftwidth() + endif if line =~ g:tex_noindent_env return indent(lnum) endif - if line =~ g:tex_itemize_env - return indent(lnum) + 2 * shiftwidth() - endif return indent(lnum) + shiftwidth() endif endfor return -1 endfunction -function! s:GetEndIndentation(lnum) " {{{ +function! s:GetEndIndentation(lnum) " {{{1 if getline(a:lnum) =~ '\\begin{.*}.*\\end{.*}' return -1 endif @@ -350,15 +292,12 @@ 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 @@ -407,8 +346,8 @@ function! s:CheckPairedIsLastCharacter(l endif return 0 -endfunction "}}} - +endfunction +" Reset cpo setting {{{1 let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim --- a/runtime/syntax/zsh.vim +++ b/runtime/syntax/zsh.vim @@ -2,7 +2,7 @@ " Language: Zsh shell script " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2017-11-22 +" Latest Revision: 2018-05-12 " License: Vim (see :h license) " Repository: https://github.com/chrisbra/vim-zsh @@ -67,15 +67,15 @@ syn match zshRedir '|&\=' syn region zshHereDoc matchgroup=zshRedir \ start='<\@' - \ contains=@zshSubst + \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString syn region zshHereDoc matchgroup=zshRedir \ start='<\@' - \ contains=@zshSubst + \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString syn region zshHereDoc matchgroup=zshRedir \ start='<\@' - \ contains=@zshSubst + \ contains=@zshSubst,@zshDerefs,zshQuoted,zshPOSIXString syn region zshHereDoc matchgroup=zshRedir \ start=+<\@' @@ -118,8 +118,8 @@ syn keyword zshCommands alias au \ ttyctl type ulimit umask unalias unfunction \ unhash unlimit unset vared wait \ whence where which zcompile zformat zftp zle - \ zmodload zparseopts zprof zpty zregexparse - \ zsocket zstyle ztcp + \ zmodload zparseopts zprof zpty zrecompile + \ zregexparse zsocket zstyle ztcp " Options, generated by: echo ${(j:\n:)options[(I)*]} | sort " Create a list of option names from zsh source dir: diff --git a/src/po/de.po b/src/po/de.po --- a/src/po/de.po +++ b/src/po/de.po @@ -2103,7 +2103,7 @@ msgstr "E223: rekursives Mapping" #, c-format msgid "E224: global abbreviation already exists for %s" -msgstr "E224: Globale Abkürzung für %s existiert bereits" +msgstr "E224: Globale Kurzform für %s existiert bereits" #, c-format msgid "E225: global mapping already exists for %s" @@ -2111,14 +2111,14 @@ msgstr "E225: Globales Mapping für %s existiert bereits" #, c-format msgid "E226: abbreviation already exists for %s" -msgstr "E226: Abkürzung für %s existiert bereits" +msgstr "E226: Kurzform %s existiert bereits" #, c-format msgid "E227: mapping already exists for %s" msgstr "E227: Mapping für %s existiert bereits" msgid "No abbreviation found" -msgstr "Keine Abkürzung gefunden" +msgstr "Keine Kurzform gefunden" msgid "No mapping found" msgstr "Kein Mapping gefunden" @@ -2153,7 +2153,7 @@ msgid "E254: Cannot allocate color %s" msgstr "E254: Kann die Farbe %s nicht zuweisen." msgid "No match at cursor, finding next" -msgstr "Kein Treffer beim Cursur, finde den nächsten" +msgstr "Kein Treffer beim Cursor, finde den nächsten" msgid " " msgstr " " @@ -6612,7 +6612,7 @@ msgid "E23: No alternate file" msgstr "E23: Keine alternative Datei" msgid "E24: No such abbreviation" -msgstr "E24: Keine Abkürzung gefunden" +msgstr "E24: Diese Kurzform nicht gefunden" msgid "E477: No ! allowed" msgstr "E477: Kein ! erlaubt" diff --git a/src/po/eo.po b/src/po/eo.po --- a/src/po/eo.po +++ b/src/po/eo.po @@ -18,13 +18,14 @@ msgstr "" "Project-Id-Version: Vim(Esperanto)\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-04-30 19:32+0200\n" -"PO-Revision-Date: 2018-05-30 20:14+0200\n" +"PO-Revision-Date: 2018-05-07 23:01+0200\n" "Last-Translator: Dominique PELLÉ \n" "Language-Team: \n" "Language: eo\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" msgid "E831: bf_key_init() called with empty password" msgstr "E831: bf_key_init() alvokita kun malplena pasvorto" @@ -61,7 +62,7 @@ msgid "E931: Buffer cannot be registered msgstr "E931: Bufro ne povas esti registrita" msgid "E937: Attempt to delete a buffer that is in use" -msgstr "E937: Provo de forviÅo de bufro, kiu estas uzanta" +msgstr "E937: Provo de forviÅo de bufro, kiu estas en uzo" msgid "E515: No buffers were unloaded" msgstr "E515: Neniu bufro estis malÅargita" @@ -634,7 +635,7 @@ msgstr "E795: Ne eblas forviÅi variablon %s" #, c-format msgid "E704: Funcref variable name must start with a capital: %s" -msgstr "E704: Nomo de variablo Funcref devas finiÄi per majusklo: %s" +msgstr "E704: Nomo de variablo Funcref devas eki per majusklo: %s" #, c-format msgid "E705: Variable name conflicts with existing function: %s" @@ -2589,7 +2590,7 @@ msgid "" " t: Find this text string\n" msgstr "" "\n" -" a: Trovi valirizojn al tiu simbolo\n" +" a: Trovi valorizojn al tiu simbolo\n" " c: Trovi funkciojn, kiuj alvokas tiun funkcion\n" " d: Trovi funkciojn alvokataj de tiu funkcio\n" " e: Trovi tiun egrep-Åablonon\n" @@ -3470,7 +3471,7 @@ msgstr "" #, c-format msgid "" "E833: %s is encrypted and this version of Vim does not support encryption" -msgstr "E833: %s estas ĉifrata kaj tiu versio de Vim ne subtenas ĉifradon" +msgstr "E833: %s estas ĉifrita kaj tiu versio de Vim ne subtenas ĉifradon" msgid " has been damaged (page size is smaller than minimum value).\n" msgstr " difektiÄis (paÄa grando pli malgranda ol minimuma valoro).\n" @@ -3488,7 +3489,7 @@ msgstr "E308: Averto: Originala dosiero eble ÅanÄiÄis" #, c-format msgid "Swap file is encrypted: \"%s\"" -msgstr "Perumutodosiero .swp estas ĉifrata: \"%s\"" +msgstr "Permutodosiero .swp estas ĉifrita: \"%s\"" msgid "" "\n" @@ -3517,7 +3518,7 @@ msgid "" "to use the same key for text file and swap file" msgstr "" "\n" -"por uzi la saman Ålosilon por la teksta dosiero kaj permuto dosiero .swp" +"por uzi la saman Ålosilon por la teksta dosiero kaj permutodosiero .swp" #, c-format msgid "E309: Unable to read block 1 from %s" @@ -3590,7 +3591,7 @@ msgstr "" msgid "Using crypt key from swap file for the text file.\n" msgstr "" -"Uzas Ålosilon de ĉifrado el permuto dosiero .swp por la teksta dosiero.\n" +"Uzas Ålosilon de ĉifrado el permutodosiero .swp por la teksta dosiero.\n" msgid "Swap files found:" msgstr "Permutodosiero .swp trovita:" @@ -4550,7 +4551,7 @@ msgstr "Ne povis Åalti kuntekston de sekureco %s por %s" #, c-format msgid "Could not get security context %s for %s. Removing it!" msgstr "" -"Ne povis akiri kuntekston de sekureco %s por %s. Gi nun estas forigata!" +"Ne povis akiri kuntekston de sekureco %s por %s. Äœi nun estas forigata!" msgid "" "\n" @@ -4849,7 +4850,7 @@ msgstr "" "regulesprimo estos uzata " msgid "Switching to backtracking RE engine for pattern: " -msgstr "Åœangota al malavanca motoro de regulesprimo por Åablono: " +msgstr "ÅœanÄas al malavanca motoro de regulesprimo por Åablono: " msgid "E865: (NFA) Regexp end encountered prematurely" msgstr "E865: (NFA) Trovis finon de regulesprimo tro frue" @@ -5852,7 +5853,7 @@ msgstr "E823: Ne estas malfara dosiero: #, c-format msgid "E832: Non-encrypted file has encrypted undo file: %s" -msgstr "E832: Ne ĉifrata dosiero havas ĉifratan malfaran dosieron: %s" +msgstr "E832: Ne ĉifrita dosiero havas ĉifritan malfaran dosieron: %s" #, c-format msgid "E826: Undo file decryption failed: %s" @@ -5860,7 +5861,7 @@ msgstr "E826: Malĉifrado de malfara dosiero malsukcesis: %s" #, c-format msgid "E827: Undo file is encrypted: %s" -msgstr "E827: Malfara dosiero estas ĉifrata: %s" +msgstr "E827: Malfara dosiero estas ĉifrita: %s" #, c-format msgid "E824: Incompatible undo file: %s" @@ -7085,7 +7086,7 @@ msgid "" "Vim macro files (*.vim)\t*.vim\n" "All Files (*.*)\t*.*\n" msgstr "" -"Doserioj de vim-makrooj (*.vim)\t*.vim\n" +"Dosierioj de vim-makrooj (*.vim)\t*.vim\n" "Ĉiuj dosieroj (*.*)\t*.*\n" msgid "All Files (*.*)\t*.*\n" @@ -7108,7 +7109,7 @@ msgid "" "Vim macro files (*.vim)\t*.vim\n" "All Files (*)\t*\n" msgstr "" -"Doserioj de vim-makrooj (*.vim)\t*.vim\n" +"Dosierioj de vim-makrooj (*.vim)\t*.vim\n" "Ĉiuj dosieroj (*)\t*\n" msgid "All Files (*)\t*\n" diff --git a/src/po/fr.po b/src/po/fr.po --- a/src/po/fr.po +++ b/src/po/fr.po @@ -12,14 +12,15 @@ msgid "" msgstr "" "Project-Id-Version: Vim(Français)\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-04-27 17:51+0200\n" -"PO-Revision-Date: 2018-04-27 18:06+0200\n" +"POT-Creation-Date: 2018-05-08 09:00+0200\n" +"PO-Revision-Date: 2018-05-08 09:17+0200\n" "Last-Translator: Dominique Pellé \n" "Language-Team: \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO_8859-15\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" msgid "E831: bf_key_init() called with empty password" msgstr "E831: bf_key_init() appelée avec un mot de passe vide" @@ -7363,3 +7364,47 @@ msgid "" msgstr "" "Impossible d'initialiser le chemin : sys.math n'est pas une liste\n" "Vous devez maintenant ajouter vim.VIM_SPECIAL_PATH à sys.path" + +msgid "" +"Vim macro files (*.vim)\t*.vim\n" +"All Files (*.*)\t*.*\n" +msgstr "" +"Fichiers de macros Vim (*.vim)\t*.vim\n" +"Tous les fichiers (*.*)\t*.*\n" + +msgid "All Files (*.*)\t*.*\n" +msgstr "Tous les fichiers (*.)\t*.*\n" + +msgid "" +"All Files (*.*)\t*.*\n" +"C source (*.c, *.h)\t*.c;*.h\n" +"C++ source (*.cpp, *.hpp)\t*.cpp;*.hpp\n" +"VB code (*.bas, *.frm)\t*.bas;*.frm\n" +"Vim files (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n" +msgstr "" +"Tous les fichiers (*.*)\t*.*\n" +"Source C (*.c, *.h)\t*.c;*.h\n" +"Source C++ (*.cpp, *.hpp)\t*.cpp;*.hpp\n" +"Code VB (*.bas, *.frm)\t*.bas;*.frm\n" +"Fichiers Vim (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n" + +msgid "" +"Vim macro files (*.vim)\t*.vim\n" +"All Files (*)\t*\n" +msgstr "" +"Fichiers de macros Vim (*.vim)\t*.vim\n" +"Tous les fichiers (*)\t*\n" + +msgid "All Files (*)\t*\n" +msgstr "Tous les fichiers (*)\t*\n" + +msgid "" +"All Files (*)\t*\n" +"C source (*.c, *.h)\t*.c;*.h\n" +"C++ source (*.cpp, *.hpp)\t*.cpp;*.hpp\n" +"Vim files (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n" +msgstr "" +"Tous les fichiers (*)\t*\n" +"Source C (*.c, *.h)\t*.c;*.h\n" +"Source C++ (*.cpp, *.hpp)\t*.cpp;*.hpp\n" +"Fichiers Vim (*.vim, _vimrc, _gvimrc)\t*.vim;_vimrc;_gvimrc\n"