1
0
forked from aniani/vim

Update runtime files.

This commit is contained in:
Bram Moolenaar 2014-08-29 15:12:19 +02:00
parent 773b158de8
commit 34401cca5a
16 changed files with 268 additions and 55 deletions

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2014 Aug 16 *eval.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1102,9 +1102,9 @@ are known inside the current Vim session. Using expand() will first try using
the environment variables known inside the current Vim session. If that the environment variables known inside the current Vim session. If that
fails, a shell will be used to expand the variable. This can be slow, but it fails, a shell will be used to expand the variable. This can be slow, but it
does expand all variables that the shell knows about. Example: > does expand all variables that the shell knows about. Example: >
:echo $version :echo $shell
:echo expand("$version") :echo expand("$shell")
The first one probably doesn't echo anything, the second echoes the $version The first one probably doesn't echo anything, the second echoes the $shell
variable (if your shell supports it). variable (if your shell supports it).
@ -2622,7 +2622,7 @@ cursor({list})
line. line.
If {col} is zero, the cursor will stay in the current column. If {col} is zero, the cursor will stay in the current column.
If {curswant} is given it is used to set the preferred column If {curswant} is given it is used to set the preferred column
for vertical movment. Otherwise {col} is used. for vertical movement. Otherwise {col} is used.
When 'virtualedit' is used {off} specifies the offset in When 'virtualedit' is used {off} specifies the offset in
screen columns from the start of the character. E.g., a screen columns from the start of the character. E.g., a
position within a <Tab> or after the last character. position within a <Tab> or after the last character.
@ -2913,7 +2913,8 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()*
< <
Expand() can also be used to expand variables and environment Expand() can also be used to expand variables and environment
variables that are only known in a shell. But this can be variables that are only known in a shell. But this can be
slow, because a shell must be started. See |expr-env-expand|. slow, because a shell may be used to do the expansion. See
|expr-env-expand|.
The expanded variable is still handled like a list of file The expanded variable is still handled like a list of file
names. When an environment variable cannot be expanded, it is names. When an environment variable cannot be expanded, it is
left unchanged. Thus ":echo expand('$FOOBAR')" results in left unchanged. Thus ":echo expand('$FOOBAR')" results in
@ -5490,7 +5491,7 @@ setreg({regname}, {value} [,{options}])
Returns zero for success, non-zero for failure. Returns zero for success, non-zero for failure.
*E883* *E883*
Note: you may not use |List| containing more then one item to Note: you may not use |List| containing more than one item to
set search and expression registers. Lists containing no set search and expression registers. Lists containing no
items act like empty strings. items act like empty strings.
@ -5640,7 +5641,7 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
after Strings, |Lists| after Numbers. For sorting text in the after Strings, |Lists| after Numbers. For sorting text in the
current buffer use |:sort|. current buffer use |:sort|.
When {func} is given and it is is '1' or 'i' then case is When {func} is given and it is '1' or 'i' then case is
ignored. ignored.
When {func} is given and it is 'n' then all items will be When {func} is given and it is 'n' then all items will be

View File

@ -1,4 +1,4 @@
*os_vms.txt* For Vim version 7.4. Last change: 2014 Feb 24 *os_vms.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL VIM REFERENCE MANUAL
@ -774,7 +774,7 @@ Version 7.4
- correct RealWaitForChar - correct RealWaitForChar
- after 7.4-119 use different functions lib$cvtf_to_internal_time because Alpha and VAX have - 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 G_FLOAT but IA64 uses IEEE float otherwise Vim crashes
- guard agains crashes that are caused by mixed filenames - guard against crashes that are caused by mixed filenames
- [TESTDIR]make_vms.mms changed to see the output files - [TESTDIR]make_vms.mms changed to see the output files
- Improve tests, update known issues - Improve tests, update known issues
- minor compiler warnings fixed - minor compiler warnings fixed

View File

@ -1,4 +1,4 @@
*os_win32.txt* For Vim version 7.4. Last change: 2012 May 18 *os_win32.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL by George Reilly VIM REFERENCE MANUAL by George Reilly
@ -334,7 +334,7 @@ A. You have two possible solutions depending on what you want:
:!start /min ctags -R . :!start /min ctags -R .
< When it has finished you should see file named "tags" in your current < When it has finished you should see file named "tags" in your current
directory. You should notice the window title blinking on your taskbar. directory. You should notice the window title blinking on your taskbar.
This is more noticable for commands that take longer. This is more noticeable for commands that take longer.
Now delete the "tags" file and run this command: > Now delete the "tags" file and run this command: >
:!start /b ctags -R . :!start /b ctags -R .
< You should have the same "tags" file, but this time there will be no < You should have the same "tags" file, but this time there will be no

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 7.4. Last change: 2014 Jul 30 *pattern.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -829,6 +829,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
branch is used. Example: > branch is used. Example: >
/\(.\{-}\zsFab\)\{3} /\(.\{-}\zsFab\)\{3}
< Finds the third occurrence of "Fab". < Finds the third occurrence of "Fab".
This cannot be followed by a multi. *E888*
{not in Vi} {not available when compiled without the |+syntax| feature} {not in Vi} {not available when compiled without the |+syntax| feature}
*/\ze* */\ze*
\ze Matches at any position, and sets the end of the match there: The \ze Matches at any position, and sets the end of the match there: The
@ -837,6 +838,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
branch is used. branch is used.
Example: "end\ze\(if\|for\)" matches the "end" in "endif" and Example: "end\ze\(if\|for\)" matches the "end" in "endif" and
"endfor". "endfor".
This cannot be followed by a multi. *E888*
{not in Vi} {not available when compiled without the |+syntax| feature} {not in Vi} {not available when compiled without the |+syntax| feature}
*/\%^* *start-of-file* */\%^* *start-of-file*

View File

@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.4. Last change: 2014 Jun 27 *syntax.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -501,7 +501,7 @@ inserted for that purpose if no line numbers are shown. This ID attribute
takes the form of L123 for single-buffer HTML pages, or W2L123 for diff-view takes the form of L123 for single-buffer HTML pages, or W2L123 for diff-view
pages, and is used to jump to a specific line (in a specific window of a diff pages, and is used to jump to a specific line (in a specific window of a diff
view). Javascript is inserted to open any closed dynamic folds view). Javascript is inserted to open any closed dynamic folds
(|g:html_dynamic_folds|) containing the specificed line before jumping. The (|g:html_dynamic_folds|) containing the specified line before jumping. The
javascript also allows omitting the window ID in the url, and the leading L. javascript also allows omitting the window ID in the url, and the leading L.
For example: > For example: >

View File

@ -4329,6 +4329,8 @@ E884 eval.txt /*E884*
E885 sign.txt /*E885* E885 sign.txt /*E885*
E886 starting.txt /*E886* E886 starting.txt /*E886*
E887 if_pyth.txt /*E887* E887 if_pyth.txt /*E887*
E888 pattern.txt /*E888*
E888 pattern.txt /*E888*
E89 message.txt /*E89* E89 message.txt /*E89*
E90 message.txt /*E90* E90 message.txt /*E90*
E91 options.txt /*E91* E91 options.txt /*E91*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.4. Last change: 2014 Aug 23 *todo.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -58,15 +58,9 @@ Patch to make getregtype() return the right size for non-linux systems.
(Yasuhiro Matsumoto, 2014 Jul 8) (Yasuhiro Matsumoto, 2014 Jul 8)
Breaks test_eval. Inefficient, can we only compute y_width when needed? Breaks test_eval. Inefficient, can we only compute y_width when needed?
Patch to fix a problem with breakindent. (Christian Brabandt, 2014 Aug 17)
It's actually not a breakindent problem. With test: Aug 19.
With renamed test: Aug 20
Problem that a previous silent ":throw" causes a following try/catch not to Problem that a previous silent ":throw" causes a following try/catch not to
work. (ZyX, 2013 Sep 28) work. (ZyX, 2013 Sep 28)
ml_get error when using Python, issue 248.
Patch to fix typos in help files. (Dominique, 2014 Aug 9) Patch to fix typos in help files. (Dominique, 2014 Aug 9)
Way to reproduce problem that characters are put on the screen twice in Insert Way to reproduce problem that characters are put on the screen twice in Insert
@ -75,11 +69,21 @@ Related to setting TMODE_COOK. Perhaps we can omit that for system()?
Update for Romanian spell file. (Vanilla Ice, 2014 Aug 13) Update for Romanian spell file. (Vanilla Ice, 2014 Aug 13)
exepath() may return the wrong value. Patch by Yasuhiro Matsumoto, 2014 Aug
26.
Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan 30)
Also fixes wrong result from executable().
Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
Patch to remove ETO_IGNORELANGUAGE, it causes Chinese characters not to show Patch to remove ETO_IGNORELANGUAGE, it causes Chinese characters not to show
up. (Paul Moore, 2014 Jul 30) up. (Paul Moore, 2014 Jul 30)
Should it depend on the Windows version? Waiting for feedback. Should it depend on the Windows version? Waiting for feedback.
No longer needed after including DirectX patch? No longer needed after including DirectX patch?
Fix for ":set all&" not taking care of side effect. (Yukihiro Nakadaira, 2014
Aug 28)
Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
14) 14)
Make ":1close" close the first window. Make ":1close" close the first window.
@ -104,6 +108,8 @@ Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31)
Patch to handle list with some items locked. (ZyX, 2014 Aug 17) Patch to handle list with some items locked. (ZyX, 2014 Aug 17)
Prefer the second solution. Prefer the second solution.
Issue 252. Patch by Christian, 2014 Aug 26.
":cd C:\Windows\System32\drivers\etc*" does not work, even though the ":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29) directory exists. (Sergio Gallelli, 2013 Dec 29)
@ -118,7 +124,7 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack) Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
Value returned by virtcol() changes depending on how lines wrap. This is Value returned by virtcol() changes depending on how lines wrap. This is
inconsistant with the documentation. inconsistent with the documentation.
MS-Windows: Crash opening very long file name starting with "\\". MS-Windows: Crash opening very long file name starting with "\\".
(Christian Brock, 2012 Jun 29) (Christian Brock, 2012 Jun 29)
@ -141,20 +147,18 @@ Spell files use a latin single quote. Unicode also has another single quote:
New OpenOffice spell files support this with ICONV. But they are not New OpenOffice spell files support this with ICONV. But they are not
compatible with Vim spell files. The old files can no longer be downloaded. compatible with Vim spell files. The old files can no longer be downloaded.
Win32: use different args for SearchPath()? (Yasuhiro Matsumoto, 2009 Jan 30)
Also fixes wrong result from executable().
Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12) Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
More tests May 14. Update May 29. Update Aug 10. More tests May 14. Update May 29. Update Aug 10.
The garbage collector may use too much stack. Make set_ref_in_item() The garbage collector may use too much stack. Make set_ref_in_item()
iterative instead of recursive. Test program by Marc Weber (2013 Dec 10) iterative instead of recursive. Test program by Marc Weber (2013 Dec 10)
Patch by Ben Fritz, 2014 Jun 22. Patch by Ben Fritz, 2014 Jun 22.
Related: Vim hangs when freeing a lot of objects. Patch by Yasuhiro
Matsumoto, 2014 Aug 26.
Idea: For a window in the middle (has window above and below it), use Idea: For a window in the middle (has window above and below it), use
right-mouse-drag on the status line to move a window up/down without changing right-mouse-drag on the status line to move a window up/down without changing
it's height? It's like dragging the status bar above it at the same time. its height? It's like dragging the status bar above it at the same time.
Can we make ":unlet $VAR" use unsetenv() to delete the env var? Can we make ":unlet $VAR" use unsetenv() to delete the env var?
What for systems that don't have unsetenv()? What for systems that don't have unsetenv()?
@ -239,7 +243,7 @@ instead. (Samuel Ferencik, 2013 Sep 28)
Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4) Patch for XDG base directory support. (Jean François Bignolles, 2014 Mar 4)
Remark on the docs. Should not be a compile time feature. But then what? Remark on the docs. Should not be a compile time feature. But then what?
Completion of ":e" is ":earlier", whould be ":edit". Complete to the matching Completion of ":e" is ":earlier", should be ":edit". Complete to the matching
command instead of doing this alphabetically. (Mikel Jorgensen) command instead of doing this alphabetically. (Mikel Jorgensen)
Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29). Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29).
@ -1447,8 +1451,8 @@ files with "foo/**" in 'path'. (Kalisiak, 2006 July 15)
Additional info: When using the |wildcards| ** globing, vim hangs Additional info: When using the |wildcards| ** globing, vim hangs
indefinitely on lots of directories. The |file-searching| globing, like in indefinitely on lots of directories. The |file-searching| globing, like in
":set path=/**" does not hang as often as with globing with |wildcards|, like ":set path=/**" does not hang as often as with globing with |wildcards|, like
in ":1find /**/file". This is for a files that unix "find" can find very in ":1find /**/file". This is for files that unix "find" can find very
quick. Merging the 2 kinds of globing might make this an easier fix. (Ian quickly. Merging the 2 kinds of globing might make this an easier fix. (Ian
Kelling, 2008 July 4) Kelling, 2008 July 4)
When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the

View File

@ -1,4 +1,4 @@
*usr_04.txt* For Vim version 7.4. Last change: 2008 Sep 06 *usr_04.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -186,7 +186,7 @@ commands:
/four<Enter> find the first string "four" /four<Enter> find the first string "four"
cwfive<Esc> change the word to "five" cwfive<Esc> change the word to "five"
n find the next "four" n find the next "four"
. repeat the change to "five' . repeat the change to "five"
n find the next "four" n find the next "four"
. repeat the change . repeat the change
etc. etc.

View File

@ -1,4 +1,4 @@
*version6.txt* For Vim version 7.4. Last change: 2013 Jul 28 *version6.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -7816,7 +7816,7 @@ Files: src/buffer.c, src/eval.c, src/ex_docmd.c, src/fileio.c,
Patch 6.1.212 Patch 6.1.212
Problem: When Vim was started with "-R" ":new" creates a buffer Problem: When Vim was started with "-R" ":new" creates a buffer
'noreadonly' while ":enew" has 'readonly' set. (Preben Guldberg) 'noreadonly' while ":enew" has 'readonly' set. (Preben Guldberg)
Solution: Don't set 'readonly in a new empty buffer for ":enew". Solution: Don't set 'readonly' in a new empty buffer for ":enew".
Files: src/ex_docmd.c Files: src/ex_docmd.c
Patch 6.1.213 Patch 6.1.213

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.4. Last change: 2013 Nov 18 *version7.txt* For Vim version 7.4. Last change: 2014 Aug 29
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -1626,10 +1626,10 @@ and merge it back in.
When running the tests and one of them fails to produce "test.out" the When running the tests and one of them fails to produce "test.out" the
following tests are still executed. This helps when running out of memory. following tests are still executed. This helps when running out of memory.
When compiling with EXITFREE defined and the ccmalloc library it is possible When compiling with EXITFREE defined and the ccmalloc library, it is possible
to detect memory leaks. Some memory will always reported as leaked, such as to detect memory leaks. Some memory will always be reported as leaked, such
allocated by X11 library functions and the memory allocated in alloc_cmdbuff() as allocated by X11 library functions and the memory allocated in
to store the ":quit" command. alloc_cmdbuff() to store the ":quit" command.
Moved the code for printing to src/hardcopy.c. Moved the code for printing to src/hardcopy.c.
@ -2038,8 +2038,8 @@ Removed the "COUNT" flag from ":argadd", to avoid ":argadd 1*" to be used like
Avoid that $LANG is used for the menus when LC_MESSAGES is "en_US". Avoid that $LANG is used for the menus when LC_MESSAGES is "en_US".
Added backslashes before dashes in the vim.1 manual page to make the appear as Added backslashes before dashes in the vim.1 manual page to make them appear
real dashes. (Pierr Habouzit) as real dashes. (Pierr Habouzit)
Where "gq" left the cursor depended on the value of 'formatprg'. Now "gq" Where "gq" left the cursor depended on the value of 'formatprg'. Now "gq"
always leaves the cursor at the last line of the formatted text. always leaves the cursor at the last line of the formatted text.
@ -2049,7 +2049,7 @@ detection may try to check the contents of the file while it's still
compressed. Skip setting 'filetype' for compressed files until they have been compressed. Skip setting 'filetype' for compressed files until they have been
decompressed. Required for patterns that end in a "*". decompressed. Required for patterns that end in a "*".
Starting with an argument "+cmd" or "-S script" causes the cursor the be moved Starting with an argument "+cmd" or "-S script" causes the cursor to be moved
to the first line. That breaks a BufReadPost autocommand that uses g`". to the first line. That breaks a BufReadPost autocommand that uses g`".
Don't move the cursor if it's somewhere past the first line. Don't move the cursor if it's somewhere past the first line.
@ -6485,7 +6485,7 @@ Patch 7.1.282 (extra)
Problem: Win64: Edit with Vim context menu isn't installed correctly. Problem: Win64: Edit with Vim context menu isn't installed correctly.
Compiler warnings and a few other things. Compiler warnings and a few other things.
Solution: Add [ and ] to entry of class name. Use UINT_PTR instead of UINT. Solution: Add [ and ] to entry of class name. Use UINT_PTR instead of UINT.
And a fixes for the other things. (George V. Reilly) And fixes for other things. (George V. Reilly)
Files: src/GvimExt/Makefile, src/dosinst.c, src/if_ole.cpp, src/if_ole.h, Files: src/GvimExt/Makefile, src/dosinst.c, src/if_ole.cpp, src/if_ole.h,
src/if_ole.idl, src/INSTALLpc.txt, src/Make_mvc.mak, src/if_ole.idl, src/INSTALLpc.txt, src/Make_mvc.mak,
src/os_win32.c, src/os_win32.c,
@ -15783,7 +15783,7 @@ Files: src/if_py_both.h, src/if_python3.c, src/testdir/test86.in,
src/testdir/test87.ok src/testdir/test87.ok
Patch 7.3.944 Patch 7.3.944
Problem: External program receives the termrespone. Problem: External program receives the termresponse.
Solution: Insert a delay and discard input. (Hayaki Saito) Solution: Insert a delay and discard input. (Hayaki Saito)
Files: src/term.c Files: src/term.c

View File

@ -1,7 +1,7 @@
" Vim support file to detect file types " Vim support file to detect file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Aug 23 " Last Change: 2014 Aug 29
" Listen very carefully, I will say this only once " Listen very carefully, I will say this only once
if exists("did_load_filetypes") if exists("did_load_filetypes")
@ -530,6 +530,9 @@ au BufNewFile,BufRead configure.in,configure.ac setf config
" CUDA Cumpute Unified Device Architecture " CUDA Cumpute Unified Device Architecture
au BufNewFile,BufRead *.cu setf cuda au BufNewFile,BufRead *.cu setf cuda
" Dockerfile
au BufNewFile,BufRead Dockerfile setf=dockerfile
" WildPackets EtherPeek Decoder " WildPackets EtherPeek Decoder
au BufNewFile,BufRead *.dcd setf dcd au BufNewFile,BufRead *.dcd setf dcd

View File

@ -0,0 +1,16 @@
" Vim filetype plugin
" Language: Dockerfile
" Maintainer: Honza Pokorny <http://honza.ca>
" Last Change: 2014 Aug 29
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
endif
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let b:undo_ftplugin = "setl commentstring<"
setlocal commentstring=#\ %s

View File

@ -1,13 +1,168 @@
" Vim indent file " Vim indent file
" Language: JSON " Language: JSON
" Maintainer: David Barnett <daviebdawg+vim@gmail.com> " Mantainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
" Last Change: 2014 Jul 16 " Last Change: 2014 Aug 29
" https://github.com/jakar/vim-json/commit/20b650e22aa750c4ab6a66aa646bdd95d7cd548a#diff-e81fc111b2052e306d126bd9989f7b7c
" Original Author: Rogerz Zhang <rogerz.zhang at gmail.com> http://github.com/rogerz/vim-json
" Acknowledgement: Based off of vim-javascript maintained by Darrick Wiebe
" http://www.vim.org/scripts/script.php?script_id=2765
if exists('b:did_indent') " 0. Initialization {{{1
finish " =================
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal nosmartindent
" Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetJSONIndent()
setlocal indentkeys=0{,0},0),0[,0],!^F,o,O,e
" Only define the function once.
if exists("*GetJSONIndent")
finish
endif endif
" JSON is a subset of JavaScript. JavaScript indenting should work fine. let s:cpo_save = &cpo
runtime! indent/javascript.vim set cpo&vim
let b:did_indent = 1 " 1. Variables {{{1
" ============
let s:line_term = '\s*\%(\%(\/\/\).*\)\=$'
" Regex that defines blocks.
let s:block_regex = '\%({\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term
" 2. Auxiliary Functions {{{1
" ======================
" Check if the character at lnum:col is inside a string.
function s:IsInString(lnum, col)
return synIDattr(synID(a:lnum, a:col, 1), 'name') == 'jsonString'
endfunction
" Find line above 'lnum' that isn't empty, or in a string.
function s:PrevNonBlankNonString(lnum)
let lnum = prevnonblank(a:lnum)
while lnum > 0
" If the line isn't empty or in a string, end search.
let line = getline(lnum)
if !(s:IsInString(lnum, 1) && s:IsInString(lnum, strlen(line)))
break
endif
let lnum = prevnonblank(lnum - 1)
endwhile
return lnum
endfunction
" Check if line 'lnum' has more opening brackets than closing ones.
function s:LineHasOpeningBrackets(lnum)
let open_0 = 0
let open_2 = 0
let open_4 = 0
let line = getline(a:lnum)
let pos = match(line, '[][(){}]', 0)
while pos != -1
let idx = stridx('(){}[]', line[pos])
if idx % 2 == 0
let open_{idx} = open_{idx} + 1
else
let open_{idx - 1} = open_{idx - 1} - 1
endif
let pos = match(line, '[][(){}]', pos + 1)
endwhile
return (open_0 > 0) . (open_2 > 0) . (open_4 > 0)
endfunction
function s:Match(lnum, regex)
let col = match(getline(a:lnum), a:regex) + 1
return col > 0 && !s:IsInString(a:lnum, col) ? col : 0
endfunction
" 3. GetJSONIndent Function {{{1
" =========================
function GetJSONIndent()
" 3.1. Setup {{{2
" ----------
" Set up variables for restoring position in file. Could use v:lnum here.
let vcol = col('.')
" 3.2. Work on the current line {{{2
" -----------------------------
" Get the current line.
let line = getline(v:lnum)
let ind = -1
" If we got a closing bracket on an empty line, find its match and indent
" according to it.
let col = matchend(line, '^\s*[]}]')
if col > 0 && !s:IsInString(v:lnum, col)
call cursor(v:lnum, col)
let bs = strpart('{}[]', stridx('}]', line[col - 1]) * 2, 2)
let pairstart = escape(bs[0], '[')
let pairend = escape(bs[1], ']')
let pairline = searchpair(pairstart, '', pairend, 'bW')
if pairline > 0
let ind = indent(pairline)
else
let ind = virtcol('.') - 1
endif
return ind
endif
" If we are in a multi-line string, don't do anything to it.
if s:IsInString(v:lnum, matchend(line, '^\s*') + 1)
return indent('.')
endif
" 3.3. Work on the previous line. {{{2
" -------------------------------
let lnum = prevnonblank(v:lnum - 1)
if lnum == 0
return 0
endif
" Set up variables for current line.
let line = getline(lnum)
let ind = indent(lnum)
" If the previous line ended with a block opening, add a level of indent.
" if s:Match(lnum, s:block_regex)
" return indent(lnum) + &sw
" endif
" If the previous line contained an opening bracket, and we are still in it,
" add indent depending on the bracket type.
if line =~ '[[({]'
let counts = s:LineHasOpeningBrackets(lnum)
if counts[0] == '1' || counts[1] == '1' || counts[2] == '1'
return ind + &sw
else
call cursor(v:lnum, vcol)
end
endif
" }}}2
return ind
endfunction
" }}}1
let &cpo = s:cpo_save
unlet s:cpo_save
" vim:set sw=2 sts=2 ts=8 noet:

View File

@ -1,7 +1,7 @@
" Vim support file to detect file types in scripts " Vim support file to detect file types in scripts
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2013 May 24 " Last change: 2014 Aug 24
" This file is called by an autocommand for every file that has just been " This file is called by an autocommand for every file that has just been
" loaded into a buffer. It checks if the type of file can be recognized by " loaded into a buffer. It checks if the type of file can be recognized by
@ -319,6 +319,10 @@ else
elseif s:line1 =~ '^==\d\+== valgrind' || s:line3 =~ '^==\d\+== Using valgrind' elseif s:line1 =~ '^==\d\+== valgrind' || s:line3 =~ '^==\d\+== Using valgrind'
set ft=valgrind set ft=valgrind
" Go docs
elseif s:line1 =~ '^PACKAGE DOCUMENTATION$'
set ft=godoc
" Renderman Interface Bytestream " Renderman Interface Bytestream
elseif s:line1 =~ '^##RenderMan' elseif s:line1 =~ '^##RenderMan'
set ft=rib set ft=rib

View File

@ -5,6 +5,7 @@
" URL: http://asciidoc.org/ " URL: http://asciidoc.org/
" Licence: GPL (http://www.gnu.org) " Licence: GPL (http://www.gnu.org)
" Remarks: Vim 6 or greater " Remarks: Vim 6 or greater
" Last Update: 2014 Aug 29 (see Issue 240)
" Limitations: " Limitations:
" "
" - Nested quoted text formatting is highlighted according to the outer " - Nested quoted text formatting is highlighted according to the outer
@ -155,7 +156,8 @@ hi def link asciidocQuotedAttributeList Special
hi def link asciidocQuotedBold Special hi def link asciidocQuotedBold Special
hi def link asciidocQuotedDoubleQuoted Label hi def link asciidocQuotedDoubleQuoted Label
hi def link asciidocQuotedEmphasized2 Type hi def link asciidocQuotedEmphasized2 Type
hi def link asciidocQuotedEmphasized Type hi asciidocQuotedEmphasizedItalic term=italic cterm=italic gui=italic
hi def link asciidocQuotedEmphasized asciidocQuotedEmphasizedItalic
hi def link asciidocQuotedMonospaced2 Identifier hi def link asciidocQuotedMonospaced2 Identifier
hi def link asciidocQuotedMonospaced Identifier hi def link asciidocQuotedMonospaced Identifier
hi def link asciidocQuotedSingleQuoted Label hi def link asciidocQuotedSingleQuoted Label

View File

@ -0,0 +1,24 @@
" dockerfile.vim - Syntax highlighting for Dockerfiles
" Maintainer: Honza Pokorny <http://honza.ca>
" Version: 0.5
" Last Change: 2014 Aug 29
" License: BSD
if exists("b:current_syntax")
finish
endif
let b:current_syntax = "dockerfile"
syntax case ignore
syntax match dockerfileKeyword /\v^\s*(ONBUILD\s+)?(ADD|CMD|ENTRYPOINT|ENV|EXPOSE|FROM|MAINTAINER|RUN|USER|VOLUME|WORKDIR|COPY)\s/
syntax region dockerfileString start=/\v"/ skip=/\v\\./ end=/\v"/
syntax match dockerfileComment "\v^\s*#.*$"
hi def link dockerfileString String
hi def link dockerfileKeyword Keyword
hi def link dockerfileComment Comment