Compare commits

..

84 Commits

Author SHA1 Message Date
Bram Moolenaar
84d17a6f9e updated for version 7.4.462
Problem:    Setting the local value of 'backupcopy' empty gives an error.
            (Peter Mattern)
Solution:   When using an empty value set the flags to zero. (Hirohito
            Higashi)
2014-09-29 17:15:18 +02:00
Bram Moolenaar
7ddc642a0c updated for version 7.4.461
Problem:    MS-Windows: When collate is on the number of copies is too high.
Solution:   Only set the collated/uncollated count when collate is on.
            (Yasuhiro Matsumoto)
2014-09-27 11:18:19 +02:00
Bram Moolenaar
da014b9441 updated for version 7.4.460
Problem:    Can't build without the quickfix feature. (Erik Falor)
Solution:   Add a #ifdef.
2014-09-24 13:26:44 +02:00
Bram Moolenaar
cddc91ccb4 updated for version 7.4.459
Problem:    Can't change the icon after building Vim.
Solution:   Load the icon from a file on startup. (Yasuhiro Matsumoto)
2014-09-23 21:53:41 +02:00
Bram Moolenaar
cfc216e7b0 updated for version 7.4.458
Problem:    Issue 252: Cursor moves in a zero-height window.
Solution:   Check for zero height. (idea by Christian Brabandt)
2014-09-23 18:37:56 +02:00
Bram Moolenaar
1db60c47d9 updated for version 7.4.457
Problem:    Using getchar() in an expression mapping may result in
            K_CURSORHOLD, which can't be recognized.
Solution:   Add the <CursorHold> key.  (Hirohito Higashi)
2014-09-23 16:49:46 +02:00
Bram Moolenaar
b8ee25acab updated for version 7.4.456
Problem:    'backupcopy' is global, cannot write only some files in a
            different way.
Solution:   Make 'backupcopy' global-local. (Christian Brabandt)
2014-09-23 15:45:08 +02:00
Bram Moolenaar
4b9d637e9c updated for version 7.4.455
Problem:    Completion for :buf does not use 'wildignorecase'. (Akshay H)
Solution:   Pass the 'wildignorecase' flag around.
2014-09-23 14:24:40 +02:00
Bram Moolenaar
d355c50a2a updated for version 7.4.454
Problem:    When using a Visual selection of multiple words and doing CTRL-W_]
            it jumps to the tag matching the word under the cursor, not the
            selected text.  (Patrick hemmer)
Solution:   Do not reset Visual mode. (idea by Christian Brabandt)
2014-09-23 13:48:43 +02:00
Bram Moolenaar
91e15e13da Updated runtime files. 2014-09-19 22:38:48 +02:00
Bram Moolenaar
3fa57e0d50 updated for version 7.4.453
Problem:    Still can't build with tiny features.
Solution:   Add #ifdef.
2014-09-19 22:23:26 +02:00
Bram Moolenaar
eb21e4ccf5 updated for version 7.4.452
Problem:    Can't build with tiny features. (Tony Mechelynck)
Solution:   Use "return" instead of "break".
2014-09-19 22:05:53 +02:00
Bram Moolenaar
1ecfd9cb09 updated for version 7.4.451
Problem:    Calling system() with empty input gives an error for writing the
            temp file.
Solution:   Do not try writing if the string length is zero. (Olaf Dabrunz)
2014-09-19 20:45:23 +02:00
Bram Moolenaar
9c8d9e1952 updated for version 7.4.450
Problem:    Not all commands that edit another buffer support the +cmd
            argument.
Solution:   Add the +cmd argument to relevant commands. (Marcin Szamotulski)
2014-09-19 20:07:26 +02:00
Bram Moolenaar
5bfa2ed6e4 updated for version 7.4.449
Problem:    Can't easily close the help window. (Chris Gaal)
Solution:   Add ":helpclose". (Christian Brabandt)
2014-09-19 19:39:34 +02:00
Bram Moolenaar
4ee40b0515 updated for version 7.4.448
Problem:    Using ETO_IGNORELANGUAGE causes problems.
Solution:   Remove this flag. (Paul Moore)
2014-09-19 16:13:53 +02:00
Bram Moolenaar
b4b43bb572 updated for version 7.4.447
Problem:    Spell files from Hunspell may generate a lot of errors.
Solution:   Add the IGNOREEXTRA flag.
2014-09-19 16:04:11 +02:00
Bram Moolenaar
5d2bae8b1c updated for version 7.4.446
Problem:    In some situations, when setting up an environment to trigger an
            autocommand, the environment is not properly restored.
Solution:   Check the return value of switch_win() and call restore_win()
            always.  (Daniel Hahler)
2014-09-19 14:26:36 +02:00
Bram Moolenaar
714db3bb81 updated for version 7.4.445
Problem:    Clipboard may be cleared on startup.
Solution:   Set clip_did_set_selection to -1 during startup. (Christian
            Brabandt)
2014-09-19 13:46:52 +02:00
Bram Moolenaar
103650de90 updated for version 7.4.444
Problem:    Reversed question mark not recognized as punctuation. (Issue 258)
Solution:   Add the Supplemental Punctuation range.
2014-09-15 14:25:54 +02:00
Bram Moolenaar
3516928c75 updated for version 7.4.443
Problem:    Error reported by ubsan when running test 72.
Solution:   Add type cast to unsigned. (Dominique Pelle)
2014-09-11 22:50:09 +02:00
Bram Moolenaar
3089a1068d updated for version 7.4.442
Problem:    Using unitinialized variable.
Solution:   Pass the first window of the tabpage.
2014-09-09 23:11:49 +02:00
Bram Moolenaar
6e932461cb Update runtime files. 2014-09-09 18:48:09 +02:00
Bram Moolenaar
58da707d24 updated for version 7.4.441
Problem:    Endless loop and other problems when 'cedit' is set to CTRL-C.
Solution:   Do not call ex_window() when ex_normal_busy or got_int was set.
            (Yasuhiro Matsumoto)
2014-09-09 18:45:49 +02:00
Bram Moolenaar
834def3872 updated for version 7.4.440
Problem:    Omni complete popup drawn incorrectly.
Solution:   Call validate_cursor() instead of check_cursor(). (Hirohito
            Higashi)
2014-09-09 18:29:33 +02:00
Bram Moolenaar
f638cbce76 updated for version 7.4.439
Problem:    Duplicate message in message history.  Some quickfix messages
            appear twice. (Gary Johnson)
Solution:   Do not reset keep_msg too early. (Hirohito Higashi)
2014-09-09 17:47:38 +02:00
Bram Moolenaar
5a4eceb02a updated for version 7.4.438
Problem:    Cached values for 'cino' not reset for ":set all&".
Solution:   Call parse_cino(). (Yukihiro Nakadaira)
2014-09-09 17:33:07 +02:00
Bram Moolenaar
fb03140730 updated for version 7.4.437
Problem:    New and old regexp engine are not consistent.
Solution:   Also give an error for "\ze*" for the old regexp engine.
2014-09-09 17:18:49 +02:00
Bram Moolenaar
371932a775 updated for version 7.4.436
Problem:    ml_get error for autocommand that moves the cursor of the current
            window.
Solution:   Check the cursor position after switching back to the current
            buffer.  (Christian Brabandt)
2014-09-09 16:59:38 +02:00
Bram Moolenaar
0026d47d8c updated for version 7.4.435
Problem:    Line formatting behaves differently when 'linebreak' is set.
            (mvxxc)
Solution:   Disable 'linebreak' temporarily. (Christian Brabandt)
2014-09-09 16:32:39 +02:00
Bram Moolenaar
0e2ea1beb4 updated for version 7.4.434
Problem:    gettabvar() is not consistent with getwinvar() and getbufvar().
Solution:   Return a dict with all variables when the varname is empty.
            (Yasuhiro Matsumoto)
2014-09-09 16:13:08 +02:00
Bram Moolenaar
13e2a0af66 updated for version 7.4.433
Problem:    Test 75 fails on MS-Windows.
Solution:   Use ":normal" instead of feedkeys(). (Michael Soyka)
2014-09-09 13:52:58 +02:00
Bram Moolenaar
14993322b1 updated for version 7.4.432
Problem:    When the startup code expands command line arguments, setting
            'encoding' will not properly convert the arguments.
Solution:   Call get_cmd_argsW() early in main(). (Yasuhiro Matsumoto)
2014-09-09 12:25:33 +02:00
Bram Moolenaar
120f4a878f updated for version 7.4.431
Problem:    Compiler warning.
Solution:   Add type cast. (Mike Williams)
2014-09-09 12:22:06 +02:00
Bram Moolenaar
5d5fbe7a2b updated for version 7.4.430
Problem:    test_listlbr fails when compiled with normal features.
Solution:   Check for the +conceal feature.
2014-08-30 18:10:18 +02:00
Bram Moolenaar
84d8cdd769 updated for version 7.4.429
Problem:    Build fails with fewer features. (Elimar Riesebieter)
Solution:   Add #ifdef.
2014-08-30 13:32:06 +02:00
Bram Moolenaar
c40bdee42a updated for version 7.4.428
Problem:    executable() may return a wrong result on MS-Windows.
Solution:   Change the way SearchPath() is called. (Yasuhiro Matsumoto, Ken
            Takata)
2014-08-29 17:45:32 +02:00
Bram Moolenaar
52a7246f01 updated for version 7.4.427
Problem:    When an InsertCharPre autocommand executes system() typeahead may
            be echoed and messes up the display. (Jacob Niehus)
Solution:   Do not set cooked mode when invoked from ":silent".
2014-08-29 15:53:52 +02:00
Bram Moolenaar
96f3a49b3b updated for version 7.4.426
Problem:    README File missing from list of files.
Solution:   Update the list of files.
2014-08-29 15:12:54 +02:00
Bram Moolenaar
34401cca5a Update runtime files. 2014-08-29 15:12:19 +02:00
Bram Moolenaar
773b158de8 updated for version 7.4.425
Problem:    When 'showbreak' is used "gj" may move to the wrong position.
            (Nazri Ramliy)
Solution:   Adjust virtcol when 'showbreak' is set. (Christian Brabandt)
2014-08-29 14:20:51 +02:00
Bram Moolenaar
d7408fa0ce updated for version 7.4.424
Problem:    Get ml_get error when using Python to delete lines in a buffer
            that is not in a window.  issue 248.
Solution:   Do not try adjusting the cursor for a different buffer.
2014-08-29 13:49:52 +02:00
Bram Moolenaar
e4df164692 updated for version 7.4.423
Problem:    expand("$shell") does not work as documented.
Solution:   Do not escape the $ when expanding environment variables.
2014-08-29 12:58:44 +02:00
Bram Moolenaar
49f9dd7b91 updated for version 7.4.422
Problem:    When using conceal with linebreak some text is not displayed
            correctly. (Grüner Gimpel)
Solution:   Check for conceal mode when using linebreak. (Christian Brabandt)
2014-08-29 12:08:43 +02:00
Bram Moolenaar
2d46e6075b updated for version 7.4.421
Problem:    Crash when searching for "\ze*". (Urtica Dioica)
Solution:   Disallow a multi after \ze and \zs.
2014-08-29 11:56:32 +02:00
Bram Moolenaar
a9537d238e updated for version 7.4.420
Problem:    It's not obvious how to add a new test.
Solution:   Add a README file. (Christian Brabandt)
2014-08-29 10:04:47 +02:00
Bram Moolenaar
f2d912e8bc updated for version 7.4.419
Problem:    Whan part of a list is locked it's possible to make changes.
Solution:   Check if any of the list items is locked before make a change.
            (ZyX)
2014-08-29 09:46:10 +02:00
Bram Moolenaar
26f08b06b6 updated for version 7.4.418
Problem:    When leaving ":append" the cursor shape is like in Insert mode.
            (Jacob Niehus)
Solution:   Do not have State set to INSERT when calling getline().
2014-08-29 09:02:27 +02:00
Bram Moolenaar
285ed7e049 updated for version 7.4.417
Problem:    After splitting a window and setting 'breakindent' the default
            minimum with is not respected.
Solution:   Call briopt_check() when copying options to a new window.
2014-08-24 21:39:49 +02:00
Bram Moolenaar
9576508975 updated for version 7.4.416
Problem:    Problem with breakindent/showbreak and tabs.
Solution:   Handle tabs differently. (Christian Brabandt)
2014-08-24 21:19:25 +02:00
Bram Moolenaar
7b61a546d8 Runtime file updates. 2014-08-23 15:31:19 +02:00
Bram Moolenaar
92f4baace8 Update version number to 7.4.415 2014-08-23 14:18:52 +02:00
Bram Moolenaar
5a31b46bff updated for version 7.4.415
Problem:    Cannot build.  Warning for shadowed variable. (John Little)
Solution:   Add missing change.  Remove declaration.
2014-08-23 14:16:20 +02:00
Bram Moolenaar
d5005164e1 updated for version 7.4.414
Problem:    Cannot define a command only when it's used.
Solution:   Add the CmdUndefined autocommand event. (partly by Yasuhiro
            Matsumoto)
2014-08-22 23:05:54 +02:00
Bram Moolenaar
fb539273c9 Updated runtime files. 2014-08-22 19:21:47 +02:00
Bram Moolenaar
d2e8087b53 updated for version 7.4.413
Problem:    MS-Windows: Using US international keyboard layout, inserting dead
            key by pressing space does not always work.  Issue 250.
Solution:   Let MS-Windows translate the message. (John Wellesz)
2014-08-22 18:44:33 +02:00
Bram Moolenaar
ce2f2e061d updated for version 7.4.412
Problem:    Can't build on Windows XP with MSVC.
Solution:   Add SUBSYSTEM_VER to the Makefile. (Yongwei Wu)
2014-08-22 18:12:57 +02:00
Bram Moolenaar
1b338d2022 updated for version 7.4.411
Problem:    "foo bar" sorts before "foo" with sort(). (John Little)
Solution:   Avoid putting quotes around strings before comparing them.
2014-08-22 13:13:27 +02:00
Bram Moolenaar
42f06f9dbc updated for version 7.4.410
Problem:    Fold does not open after search when there is a CmdwinLeave
            autocommand.
Solution:   Restore KeyTyped. (Jacob Niehus)
2014-08-17 17:24:07 +02:00
Bram Moolenaar
d5f62b14e1 updated for version 7.4.409
Problem:    Can't build with Perl on Fedora 20.
Solution:   Find xsubpp in another directory. (Michael Henry)
2014-08-17 17:05:44 +02:00
Bram Moolenaar
2a5868ab1e Add files missing from 7.4.408. 2014-08-16 19:45:02 +02:00
Bram Moolenaar
b5cf6c34e8 updated for version 7.4.408
Problem:    Visual block insert breaks a multi-byte character.
Solution:   Calculate the position properly. (Yasuhiro Matsumoto)
2014-08-16 18:36:43 +02:00
Bram Moolenaar
1fc7e972b0 updated for version 7.4.407
Problem:    Inserting text for Visual block mode, with cursor movement,
            repeats the wrong text. (Aleksandar Ivanov)
Solution:   Reset the update_Insstart_orig flag. (Christian Brabandt)
2014-08-16 18:13:03 +02:00
Bram Moolenaar
0ddd1b5e35 updated for version 7.4.406
Problem:    Test 72 and 100 fail on MS-Windows.
Solution:   Set fileformat to unix in the tests. (Taro Muraoka)
2014-08-16 17:34:34 +02:00
Bram Moolenaar
5307de0746 updated for version 7.4.405
Problem:    Screen updating is slow when using matches.
Solution:   Do not use the ">=" as in patch 7.4.362, check the lnum.
2014-08-16 16:28:36 +02:00
Bram Moolenaar
9b8f021d93 updated for version 7.4.404
Problem:    Windows 64 bit compiler warnings.
Solution:   Add type casts. (Mike Williams)
2014-08-13 22:05:53 +02:00
Bram Moolenaar
2be795084f updated for version 7.4.403
Problem:    Valgrind reports errors when running test 72. (Dominique Pelle)
Solution:   Reset the local 'cryptmethod' option before storing the seed.
            Set the seed in the memfile even when there is no block0 yet.
2014-08-13 21:58:28 +02:00
Bram Moolenaar
5a669b9481 updated for version 7.4.402
Problem:    Test 72 crashes under certain conditions. (Kazunobu Kuriyama)
Solution:   Clear the whole bufinfo_T early.
2014-08-12 20:14:33 +02:00
Bram Moolenaar
07cf382e22 updated for version 7.4.401
Problem:    Can't build on MS-Windows.
Solution:   Include the new files in all the Makefiles.
2014-08-10 16:31:50 +02:00
Bram Moolenaar
d21e8b3a17 updated for version 7.4.400
Problem:    List of distributed files is incomplete.
Solution:   Add recently added files.
2014-08-10 13:46:36 +02:00
Bram Moolenaar
8f4ac01544 updated for version 7.4.399
Problem:    Encryption implementation is messy.  Blowfish encryption has a
            weakness.
Solution:   Refactor the encryption, store the state in an allocated struct
            instead of using a save/restore mechanism.  Introduce the
            "blowfish2" method, which does not have the weakness and encrypts
            the whole undo file. (largely by David Leadbeater)
2014-08-10 13:38:34 +02:00
Bram Moolenaar
0106b4b891 updated for version 7.4.398
Problem:    Gcc error for the argument of InterlockedIncrement() and
            InterlockedDecrement(). (Axel Bender)
Solution:   Remove "unsigned" from the cRefCount_ declaration.
2014-08-07 13:55:10 +02:00
Bram Moolenaar
e98cfe1cc9 updated for version 7.4.397
Problem:    Matchparen only uses the topmost syntax item.
Solution:   Go through the syntax stack to find items. (James McCoy)
            Also use getcurpos() when possible.
2014-08-06 19:09:16 +02:00
Bram Moolenaar
6b1ee34aa0 updated for version 7.4.396
Problem:    When 'clipboard' is "unnamed", :g/pat/d is very slow. (Praful)
Solution:   Only set the clipboard after the last delete. (Christian Brabandt)
2014-08-06 18:17:11 +02:00
Bram Moolenaar
04d17ae167 updated for version 7.4.395
Problem:    C indent is wrong below an if with wrapped condition followed by
            curly braces. (Trevor Powell)
Solution:   Make a copy of tryposBrace.
2014-08-06 17:44:14 +02:00
Bram Moolenaar
9b352c46f0 updated for version 7.4.394
Problem:    When using DirectX last italic character is incomplete.
Solution:   Add one to the number of cells. (Ken Takata)
2014-08-06 16:49:55 +02:00
Bram Moolenaar
b5a7a8b545 updated for version 7.4.393
Problem:    Text drawing on newer MS-Windows systems is suboptimal.  Some
            multi-byte characters are not displayed, even though the same font
            in Notepad can display them. (Srinath Avadhanula)
Solution:   Add the 'renderoptions' option to enable Direct-X drawing. (Taro
            Muraoka)
2014-08-06 14:52:30 +02:00
Bram Moolenaar
8c1329cb59 updated for version 7.4.392
Problem:    Not easy to detect type of command line window.
Solution:   Add the getcmdwintype() function. (Jacob Niehus)
2014-08-06 13:36:59 +02:00
Bram Moolenaar
e0f148270a updated for version 7.4.391
Problem:    No 'cursorline' highlighting when the cursor is on a line with
            diff highlighting. (Benjamin Fritz)
Solution:   Combine the highlight attributes. (Christian Brabandt)
2014-08-06 13:20:56 +02:00
Bram Moolenaar
ece29e8013 updated for version 7.4.390
Problem:    Advancing pointer over end of a string.
Solution:   Init quote character to -1 instead of zero. (Dominique Pelle)
2014-08-06 12:49:18 +02:00
Bram Moolenaar
4e067c898e updated for version 7.4.389
Problem:    Still sometimes Vim enters Replace mode when starting up.
Solution:   Use a different solution in detecting the termresponse and
            location response. (Hayaki Saito)
2014-07-30 17:21:58 +02:00
Bram Moolenaar
b81c85d8f3 updated for version 7.4.388
Problem:    With 'linebreak' set and 'list' unset a Tab is not counted
            properly. (Kent Sibilev)
Solution:   Check the 'list' option. (Christian Brabandt)
2014-07-30 16:44:22 +02:00
Bram Moolenaar
4f5ce33d41 updated for version 7.4.387
Problem:    "4gro" replaces one character then executes "ooo". (Urtica Dioica)
Solution:   Write the ESC in the second stuff buffer.
2014-07-30 16:00:58 +02:00
Bram Moolenaar
23fb7a9955 updated for version 7.4.386
Problem:    When splitting a window the changelist position is wrong.
Solution:   Copy the changelist position. (Jacob Niehus)
2014-07-30 14:05:00 +02:00
180 changed files with 6395 additions and 1874 deletions

View File

@@ -11,6 +11,8 @@ SRC_ALL = \
src/blowfish.c \
src/buffer.c \
src/charset.c \
src/crypt.c \
src/crypt_zip.c \
src/diff.c \
src/digraph.c \
src/edit.c \
@@ -80,6 +82,7 @@ SRC_ALL = \
src/xxd/xxd.c \
src/main.aap \
src/testdir/main.aap \
src/testdir/README.txt \
src/testdir/*.in \
src/testdir/sautest/autoload/*.vim \
src/testdir/test[0-9]*.ok \
@@ -103,6 +106,8 @@ SRC_ALL = \
src/proto/blowfish.pro \
src/proto/buffer.pro \
src/proto/charset.pro \
src/proto/crypt.pro \
src/proto/crypt_zip.pro \
src/proto/diff.pro \
src/proto/digraph.pro \
src/proto/edit.pro \
@@ -289,6 +294,8 @@ SRC_DOS = \
src/dosinst.h \
src/glbl_ime.cpp \
src/glbl_ime.h \
src/gui_dwrite.cpp \
src/gui_dwrite.h \
src/gui_w16.c \
src/gui_w32.c \
src/gui_w48.c \

View File

@@ -3,7 +3,7 @@
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" URL: https://github.com/shawncplus/phpcomplete.vim
" Last Change: 2014 May 30
" Last Change: 2014 Aug 10
"
" OPTIONS:
"
@@ -94,9 +94,9 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
" Check if we are inside of PHP markup
let pos = getpos('.')
let phpbegin = searchpairpos('<?', '', '?>', 'bWn',
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\|comment"')
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
let phpend = searchpairpos('<?', '', '?>', 'Wn',
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\|comment"')
\ 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
if phpbegin == [0,0] && phpend == [0,0]
" We are outside of any PHP markup. Complete HTML
@@ -277,7 +277,7 @@ endfunction
" }}}
function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
" Complete everything else -
" Complete everything
" + functions, DONE
" + keywords of language DONE
" + defines (constant definitions), DONE
@@ -803,7 +803,7 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
endif
let relative_name = namespace_part.tag.name
" match base without the namespace part for namespaced base but not namespaced tags, for tagfiles with old ctags
if !has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && stridx(tag.name, base[len(namespace_part):]) == 0
if !has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && stridx(tolower(tag.name), tolower(base[len(namespace_part):])) == 0
call add(no_namespace_matches, {'word': leading_slash.relative_name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
endif
if has_key(tag, 'namespace') && index(kinds, tag.kind) != -1 && tag.namespace ==? namespace_for_class
@@ -949,12 +949,11 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
endif
endfor
let jvars = join(variables, ' ')
let svars = split(jvars, '\$')
let static_vars = split(join(variables, ' '), '\$')
let c_variables = {}
let var_index = 0
for i in svars
for i in static_vars
let c_var = matchstr(i,
\ '^\zs[a-zA-Z_\x7f-\xff][a-zA-Z_0-9\x7f-\xff]*\ze')
if c_var != ''
@@ -1083,7 +1082,6 @@ endfunction
" }}}
function! phpcomplete#GetTaglist(pattern) " {{{
let cache_checksum = ''
if g:phpcomplete_cache_taglists == 1
" build a string with format of "<tagfile>:<mtime>$<tagfile2>:<mtime2>..."
@@ -1447,6 +1445,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" Get class name
" Class name can be detected in few ways:
" @var $myVar class
" @var class $myVar
" in the same line (php 5.4 (new Class)-> syntax)
" line above
" or line in tags file
@@ -1525,6 +1524,11 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
let object_is_array = (object =~ '\v^[^[]+\[' ? 1 : 0)
let object = matchstr(object, variable_name_pattern)
let function_boundary = phpcomplete#GetCurrentFunctionBoundaries()
let search_end_line = max([1, function_boundary[0][0]])
" -1 makes us ignore the current line (where the completion was invoked
let lines = reverse(getline(search_end_line, line('.') - 1))
" check Constant lookup
let constant_object = matchstr(a:context, '\zs'.class_name_pattern.'\ze::')
if constant_object != ''
@@ -1533,21 +1537,20 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
if classname_candidate == ''
" scan the file backwards from current line for explicit type declaration (@var $variable Classname)
let i = 1 " start from the current line - 1
while i < a:start_line
let line = getline(a:start_line - i)
for line in lines
" in file lookup for /* @var $foo Class */
if line =~# '@var\s\+'.object.'\s\+'.class_name_pattern
let classname_candidate = matchstr(line, '@var\s\+'.object.'\s\+\zs'.class_name_pattern.'\(\[\]\)\?')
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
elseif line !~ '^\s*$'
" type indicator comments should be next to the variable
" non empty lines break the search
endif
" in file lookup for /* @var Class $foo */
if line =~# '@var\s\+'.class_name_pattern.'\s\+'.object
let classname_candidate = matchstr(line, '@var\s\+\zs'.class_name_pattern.'\(\[\]\)\?\ze'.'\s\+'.object)
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
let i += 1
endwhile
endfor
endif
if classname_candidate != ''
@@ -1555,12 +1558,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
" return absolute classname, without leading \
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
endif
" scan the file backwards from the current line
let i = 1
while i < a:start_line " {{{
let line = getline(a:start_line - i)
for line in lines " {{{
" do in-file lookup of $var = new Class
if line =~# '^\s*'.object.'\s*=\s*new\s\+'.class_name_pattern && !object_is_array
let classname_candidate = matchstr(line, object.'\c\s*=\s*new\s*\zs'.class_name_pattern.'\ze')
@@ -1607,6 +1607,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
for arg in args
if arg =~# object.'\(,\|$\)'
let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
endfor
@@ -1625,6 +1626,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
for param in docblock.params
if param.name =~? object
let classname_candidate = matchstr(param.type, class_name_pattern.'\(\[\]\)\?')
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
break
endif
endfor
@@ -1722,7 +1724,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
endif
let i += 1
endwhile " }}}
endfor " }}}
if classname_candidate != ''
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
@@ -1934,7 +1936,7 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
call search('{')
let endline = line('.')
let content = join(getline(cfline, endline),"\n")
let content = join(getline(cfline, endline), "\n")
" Catch extends
if content =~? 'extends'
let extends_class = matchstr(content, 'class\_s\+'.a:class_name.'\_s\+extends\_s\+\zs'.class_name_pattern.'\ze')
@@ -1962,7 +1964,9 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
let namespace = '\'
endif
let classlocation = phpcomplete#GetClassLocation(extends_class, namespace)
if classlocation != '' && filereadable(classlocation)
if classlocation == "VIMPHP_BUILTINOBJECT"
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(extends_class)])]
elseif classlocation != '' && filereadable(classlocation)
let full_file_path = fnamemodify(classlocation, ':p')
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class)
elseif tolower(current_namespace) == tolower(namespace)
@@ -1985,6 +1989,51 @@ function! phpcomplete#GetClassContents(classlocation, class_name) " {{{
endfunction
" }}}
function! phpcomplete#GenerateBuiltinClassStub(class_info) " {{{
let re = 'class '.a:class_info['name']." {"
for [name, initializer] in items(a:class_info.constants)
let re .= "\n\tconst ".name." = ".initializer.";"
endfor
for [name, info] in items(a:class_info.properties)
let re .= "\n\t// @var $".name." ".info.type
let re .= "\n\tpublic $".name.";"
endfor
for [name, info] in items(a:class_info.static_properties)
let re .= "\n\t// @var ".name." ".info.type
let re .= "\n\tpublic static ".name." = ".info.initializer.";"
endfor
for [name, info] in items(a:class_info.methods)
if name =~ '^__'
continue
endif
let re .= "\n\t/**"
let re .= "\n\t * ".name
let re .= "\n\t *"
let re .= "\n\t * @return ".info.return_type
let re .= "\n\t */"
let re .= "\n\tpublic function ".name."(".info.signature."){"
let re .= "\n\t}"
endfor
for [name, info] in items(a:class_info.static_methods)
let re .= "\n\t/**"
let re .= "\n\t * ".name
let re .= "\n\t *"
let re .= "\n\t * @return ".info.return_type
let re .= "\n\t */"
let re .= "\n\tpublic static function ".name."(".info.signature."){"
let re .= "\n\t}"
endfor
let re .= "\n}"
return { 'class': a:class_info['name'],
\ 'content': re,
\ 'namespace': '',
\ 'imports': {},
\ 'file': 'VIMPHP_BUILTINOBJECT',
\ 'mtime': 0,
\ }
endfunction " }}}
function! phpcomplete#GetDocBlock(sccontent, search) " {{{
let i = 0
let l = 0
@@ -2307,6 +2356,40 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
endfunction
" }}}
function! phpcomplete#GetCurrentFunctionBoundaries() " {{{
let old_cursor_pos = [line('.'), col('.')]
let current_line_no = old_cursor_pos[0]
let function_pattern = '\c\(.*\%#\)\@!\_^\s*\zs\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\_.\{-}(\_.\{-})\_.\{-}{'
let func_start_pos = searchpos(function_pattern, 'Wbc')
if func_start_pos == [0, 0]
call cursor(old_cursor_pos[0], old_cursor_pos[1])
return 0
endif
" get the line where the function declaration actually started
call search('\cfunction\_.\{-}(\_.\{-})\_.\{-}{', 'Wce')
" get the position of the function block's closing "}"
let func_end_pos = searchpairpos('{', '', '}', 'W')
if func_end_pos == [0, 0]
" there is a function start but no end found, assume that we are in a
" function but the user did not typed the closing "}" yet and the
" function runs to the end of the file
let func_end_pos = [line('$'), len(getline(line('$')))]
endif
" Decho func_start_pos[0].' <= '.current_line_no.' && '.current_line_no.' <= '.func_end_pos[0]
if func_start_pos[0] <= current_line_no && current_line_no <= func_end_pos[0]
call cursor(old_cursor_pos[0], old_cursor_pos[1])
return [func_start_pos, func_end_pos]
endif
call cursor(old_cursor_pos[0], old_cursor_pos[1])
return 0
endfunction
" }}}
function! phpcomplete#ExpandClassName(classname, current_namespace, imports) " {{{
" if there's an imported class, just use that class's information
if has_key(a:imports, a:classname) && (a:imports[a:classname].kind == 'c' || a:imports[a:classname].kind == 'i')

29
runtime/compiler/go.vim Normal file
View File

@@ -0,0 +1,29 @@
" Vim compiler file
" Compiler: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2014 Aug 16
if exists('current_compiler')
finish
endif
let current_compiler = 'go'
if exists(':CompilerSet') != 2
command -nargs=* CompilerSet setlocal <args>
endif
let s:save_cpo = &cpo
set cpo-=C
CompilerSet makeprg=go\ build
CompilerSet errorformat=
\%-G#\ %.%#,
\%A%f:%l:%c:\ %m,
\%A%f:%l:\ %m,
\%C%*\\s%m,
\%-G%.%#
let &cpo = s:save_cpo
unlet s:save_cpo
" vim: sw=2 sts=2 et

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.4. Last change: 2014 May 02
*autocmd.txt* For Vim version 7.4. Last change: 2014 Aug 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -278,6 +278,7 @@ Name triggered by ~
|ShellCmdPost| after executing a shell command
|ShellFilterPost| after filtering with a shell command
|CmdUndefined| a user command is used but it isn't defined
|FuncUndefined| a user function is used but it isn't defined
|SpellFileMissing| a spell file is used but it can't be found
|SourcePre| before sourcing a Vim script
@@ -465,6 +466,16 @@ BufWriteCmd Before writing the whole buffer to a file.
*BufWritePost*
BufWritePost After writing the whole buffer to a file
(should undo the commands for BufWritePre).
*CmdUndefined*
CmdUndefined When a user command is used but it isn't
defined. Useful for defining a command only
when it's used. The pattern is matched
against the command name. Both <amatch> and
<afile> are set to the name of the command.
NOTE: Autocompletion won't work until the
command is defined. An alternative is to
always define the user command and have it
invoke an autoloaded function. See |autoload|.
*CmdwinEnter*
CmdwinEnter After entering the command-line window.
Useful for setting options specifically for
@@ -670,6 +681,8 @@ FuncUndefined When a user function is used but it isn't
when it's used. The pattern is matched
against the function name. Both <amatch> and
<afile> are set to the name of the function.
NOTE: When writing Vim scripts a better
alternative is to use an autoloaded function.
See |autoload-functions|.
*GUIEnter*
GUIEnter After starting the GUI successfully, and after

View File

@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 7.4. Last change: 2014 Feb 23
*cmdline.txt* For Vim version 7.4. Last change: 2014 Sep 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -56,7 +56,7 @@ history tables:
These are completely separate. Each history can only be accessed when
entering the same type of line.
Use the 'history' option to set the number of lines that are remembered
(default: 20).
(default: 50).
Notes:
- When you enter a command-line that is exactly the same as an older one, the
old one is removed (to avoid repeated commands moving older commands out of
@@ -1084,6 +1084,9 @@ another window, or drag statuslines of other windows. You can drag the
statusline of the command-line window itself and the statusline above it.
Thus you can resize the command-line window, but not others.
The |getcmdwintype()| function returns the type of the command-line being
edited as described in |cmdwin-char|.
AUTOCOMMANDS

View File

@@ -1,4 +1,4 @@
*editing.txt* For Vim version 7.4. Last change: 2014 Jul 19
*editing.txt* For Vim version 7.4. Last change: 2014 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -609,7 +609,10 @@ list of the current window.
{not in Vi}
:[count]arga[dd] {name} .. *:arga* *:argadd* *E479*
Add the {name}s to the argument list.
:[count]arga[dd]
Add the {name}s to the argument list. When {name} is
omitted at the current buffer name to the argument
list.
If [count] is omitted, the {name}s are added just
after the current entry in the argument list.
Otherwise they are added after the [count]'th file.
@@ -1370,8 +1373,13 @@ lose your work. The undo file can be disabled without much disadvantage. >
Note: The text in memory is not encrypted. A system administrator may be able
to see your text while you are editing it. When filtering text with
":!filter" or using ":w !command" the text is not encrypted, this may reveal
it to others. The 'viminfo' file is not encrypted.
":!filter" or using ":w !command" the text is also not encrypted, this may
reveal it to others. The 'viminfo' file is not encrypted.
You could do this to edit very secret text: >
:set noundofile viminfo=
:noswapfile edit secrets.txt
Keep in mind that without a swap file you risk loosing your work in a crash.
WARNING: If you make a typo when entering the key and then write the file and
exit, the text will be lost!
@@ -1398,18 +1406,25 @@ To disable the encryption, reset the 'key' option to an empty value: >
:set key=
You can use the 'cryptmethod' option to select the type of encryption, use one
of these two: >
:setlocal cm=zip " weak method, backwards compatible
:setlocal cm=blowfish " strong method
of these: >
:setlocal cm=zip " weak method, backwards compatible
:setlocal cm=blowfish " method with flaws
:setlocal cm=blowfish2 " medium strong method
Do this before writing the file. When reading an encrypted file it will be
set automatically to the method used when that file was written. You can
change 'cryptmethod' before writing that file to change the method.
To set the default method, used for new files, use one of these in your
|vimrc| file: >
set cm=zip
set cm=blowfish
set cm=blowfish2
Use the first one if you need to be compatible with Vim 7.2 and older. Using
"blowfish2" is highly recommended if you can use a Vim version that supports
it.
The message given for reading and writing a file will show "[crypted]" when
using zip, "[blowfish]" when using blowfish.
using zip, "[blowfish]" when using blowfish, etc.
When writing an undo file, the same key and method will be used for the text
in the undo file. |persistent-undo|.
@@ -1444,7 +1459,7 @@ lines to "/etc/magic", "/usr/share/misc/magic" or wherever your system has the
0 string VimCrypt~ Vim encrypted file
>9 string 01 - "zip" cryptmethod
>9 string 02 - "blowfish" cryptmethod
>9 string 03 - "blowfish2" cryptmethod
Notes:
- Encryption is not possible when doing conversion with 'charconvert'.
@@ -1468,6 +1483,10 @@ Notes:
- Pkzip uses the same encryption as 'cryptmethod' "zip", and US Govt has no
objection to its export. Pkzip's public file APPNOTE.TXT describes this
algorithm in detail.
- The implmentation of 'cryptmethod' "blowfish" has a flaw. It is possible to
crack the first 64 bytes of a file and in some circumstances more of the
file. Use of it is not recommended, but it's still the strongest method
supported by Vim 7.3 and 7.4. The "zip" method is even weaker.
- Vim originates from the Netherlands. That is where the sources come from.
Thus the encryption code is not exported from the USA.

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2014 Jul 19
*eval.txt* For Vim version 7.4. Last change: 2014 Sep 09
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
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: >
:echo $version
:echo expand("$version")
The first one probably doesn't echo anything, the second echoes the $version
:echo $shell
:echo expand("$shell")
The first one probably doesn't echo anything, the second echoes the $shell
variable (if your shell supports it).
@@ -1807,7 +1807,8 @@ getchar( [expr]) Number get one character from the user
getcharmod( ) Number modifiers for the last typed character
getcmdline() String return the current command-line
getcmdpos() Number return cursor position in command-line
getcmdtype() String return the current command-line type
getcmdtype() String return current command-line type
getcmdwintype() String return current command-line window type
getcurpos() List position of the cursor
getcwd() String the current working directory
getfontname( [{name}]) String name of font being used
@@ -2112,8 +2113,8 @@ argidx() The result is the current index in the argument list. 0 is
arglistid([{winnr}, [ {tabnr} ]])
Return the argument list ID. This is a number which
identifies the argument list being used. Zero is used for the
global argument list.
Return zero if the arguments are invalid.
global argument list. See |arglist|.
Return -1 if the arguments are invalid.
Without arguments use the current window.
With {winnr} only use this window in the current tab page.
@@ -2621,7 +2622,7 @@ cursor({list})
line.
If {col} is zero, the cursor will stay in the current 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
screen columns from the start of the character. E.g., a
position within a <Tab> or after the last character.
@@ -2912,7 +2913,8 @@ expand({expr} [, {nosuf} [, {list}]]) *expand()*
<
Expand() can also be used to expand variables and environment
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
names. When an environment variable cannot be expanded, it is
left unchanged. Thus ":echo expand('$FOOBAR')" results in
@@ -3344,11 +3346,17 @@ getcmdtype() *getcmdtype()*
? backward search command
@ |input()| command
- |:insert| or |:append| command
= |i_CTRL-R_=|
Only works when editing the command line, thus requires use of
|c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
Returns an empty string otherwise.
Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|.
getcmdwintype() *getcmdwintype()*
Return the current |command-line-window| type. Possible return
values are the same as |getcmdtype()|. Returns an empty string
when not in the command-line window.
*getcurpos()*
getcurpos() Get the position of the cursor. This is like getpos('.'), but
includes an extra item in the list:
@@ -3359,7 +3367,7 @@ getcurpos() Get the position of the cursor. This is like getpos('.'), but
let save_cursor = getcurpos()
MoveTheCursorAround
call setpos('.', save_cursor)
<
*getcwd()*
getcwd() The result is a String, which is the name of the current
working directory.
@@ -3568,6 +3576,8 @@ gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()*
Get the value of a tab-local variable {varname} in tab page
{tabnr}. |t:var|
Tabs are numbered starting with one.
When {varname} is empty a dictionary with all tab-local
variables is returned.
Note that the name without "t:" must be used.
When the tab or variable doesn't exist {def} or an empty
string is returned, there is no error message.
@@ -5484,7 +5494,7 @@ setreg({regname}, {value} [,{options}])
Returns zero for success, non-zero for failure.
*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
items act like empty strings.
@@ -5634,7 +5644,7 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
after Strings, |Lists| after Numbers. For sorting text in the
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.
When {func} is given and it is 'n' then all items will be
@@ -6086,6 +6096,12 @@ system({expr} [, {input}]) *system()* *E677*
list items converted to NULs).
Pipes are not used.
When prepended by |:silent| the shell will not be set to
cooked mode. This is meant to be used for commands that do
not need the user to type. It avoids stray characters showing
up on the screen which require |CTRL-L| to remove. >
:silent let f = system('ls *.vim')
<
Note: Use |shellescape()| or |::S| with |expand()| or
|fnamemodify()| to escape special characters in a command
argument. Newlines in {expr} may cause the command to fail.
@@ -6622,6 +6638,7 @@ dialog_con Compiled with console dialog support.
dialog_gui Compiled with GUI dialog support.
diff Compiled with |vimdiff| and 'diff' support.
digraphs Compiled with support for digraphs.
directx Compiled with support for Direct-X and 'renderoptions'.
dnd Compiled with support for the "~ register |quote_~|.
dos16 16 bits DOS version of Vim.
dos32 32 bits DOS (DJGPP) version of Vim.

View File

@@ -1,4 +1,4 @@
*helphelp.txt* For Vim version 7.4. Last change: 2012 Nov 28
*helphelp.txt* For Vim version 7.4. Last change: 2014 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -96,6 +96,9 @@ Help on help files *helphelp*
find a tag in a file with the same language as the
current file. See |help-translated|.
*:helpc* *:helpclose*
:helpc[lose] Close one help window, if there is one.
*:helpg* *:helpgrep*
:helpg[rep] {pattern}[@xx]
Search all help text files and make a list of lines

View File

@@ -1,4 +1,4 @@
*index.txt* For Vim version 7.4. Last change: 2014 Mar 25
*index.txt* For Vim version 7.4. Last change: 2014 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1244,6 +1244,7 @@ tag command action ~
|:gvim| :gv[im] start the GUI
|:hardcopy| :ha[rdcopy] send text to the printer
|:help| :h[elp] open a help window
|:helpclose| :helpc[lose] close one help window
|:helpfind| :helpf[ind] dialog to open a help window
|:helpgrep| :helpg[rep] like ":grep" but searches help files
|:helptags| :helpt[ags] generate help tags for a directory

View File

@@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.4. Last change: 2014 Jul 06
*insert.txt* For Vim version 7.4. Last change: 2014 Aug 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -51,6 +51,8 @@ char action ~
abbreviation.
Note: If your <Esc> key is hard to hit on your keyboard, train
yourself to use CTRL-[.
If Esc doesn't work and you are using a Mac, try CTRL-Esc.
Or disable Listening under Accessibility preferences.
*i_CTRL-C*
CTRL-C Quit insert mode, go back to Normal mode. Do not check for
abbreviations. Does not trigger the |InsertLeave| autocommand

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.4. Last change: 2014 Jul 23
*options.txt* For Vim version 7.4. Last change: 2014 Sep 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -921,7 +921,7 @@ A jump table for the options with a short description can be found at |Q_op|.
*'backupcopy'* *'bkc'*
'backupcopy' 'bkc' string (Vi default for Unix: "yes", otherwise: "auto")
global
global or local to buffer |global-local|
{not in Vi}
When writing a file and a backup is made, this option tells how it's
done. This is a comma separated list of words.
@@ -2229,10 +2229,18 @@ A jump table for the options with a short description can be found at |Q_op|.
zip PkZip compatible method. A weak kind of encryption.
Backwards compatible with Vim 7.2 and older.
*blowfish*
blowfish Blowfish method. Strong encryption. Requires Vim 7.3
or later, files can NOT be read by Vim 7.2 and older.
This adds a "seed" to the file, every time you write
the file the encrypted bytes will be different.
blowfish Blowfish method. Medium strong encryption but it has
an implementation flaw. Requires Vim 7.3 or later,
files can NOT be read by Vim 7.2 and older. This adds
a "seed" to the file, every time you write the file
the encrypted bytes will be different.
*blowfish2*
blowfish2 Blowfish method. Medium strong encryption. Requires
Vim 7.4.399 or later, files can NOT be read by Vim 7.3
and older. This adds a "seed" to the file, every time
you write the file the encrypted bytes will be
different. The whole undo file is encrypted, not just
the pieces of text.
When reading an encrypted file 'cryptmethod' will be set automatically
to the detected method of the file being read. Thus if you write it
@@ -3361,7 +3369,7 @@ A jump table for the options with a short description can be found at |Q_op|.
NOTE: This option is reset when 'compatible' is set.
*'grepformat'* *'gfm'*
'grepformat' 'gfm' string (default "%f:%l%m,%f %l%m")
'grepformat' 'gfm' string (default "%f:%l:%m,%f:%l%m,%f %l%m")
global
{not in Vi}
Format to recognize for the ":grep" command output.
@@ -5650,6 +5658,77 @@ A jump table for the options with a short description can be found at |Q_op|.
this option at the default "on". Only switch it off when working with
old Vi scripts.
*'renderoptions'* *'rop'*
'renderoptions' 'rop' string (default: empty)
global
{not in Vi}
{only available when compiled with GUI and DIRECTX on
MS-Windows}
Select a text renderer and set its options. The options depend on the
renderer.
Syntax: >
set rop=type:{renderer}(,{name}:{value})*
<
Currently, only one optional renderer is available.
render behavior ~
directx Vim will draw text using DirectX (DirectWrite). It makes
drawn glyphs more beautiful than default GDI.
It requires 'encoding' is "utf-8", and only works on
MS-Windows Vista or newer version.
Options:
name meaning type value ~
gamma gamma float 1.0 - 2.2 (maybe)
contrast enhancedContrast float (unknown)
level clearTypeLevel float (unknown)
geom pixelGeometry int 0 - 2 (see below)
renmode renderingMode int 0 - 6 (see below)
taamode textAntialiasMode int 0 - 3 (see below)
See this URL for detail:
http://msdn.microsoft.com/en-us/library/dd368190.aspx
For geom: structure of a device pixel.
0 - DWRITE_PIXEL_GEOMETRY_FLAT
1 - DWRITE_PIXEL_GEOMETRY_RGB
2 - DWRITE_PIXEL_GEOMETRY_BGR
See this URL for detail:
http://msdn.microsoft.com/en-us/library/dd368114.aspx
For renmode: method of rendering glyphs.
0 - DWRITE_RENDERING_MODE_DEFAULT
1 - DWRITE_RENDERING_MODE_ALIASED
2 - DWRITE_RENDERING_MODE_GDI_CLASSIC
3 - DWRITE_RENDERING_MODE_GDI_NATURAL
4 - DWRITE_RENDERING_MODE_NATURAL
5 - DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
6 - DWRITE_RENDERING_MODE_OUTLINE
See this URL for detail:
http://msdn.microsoft.com/en-us/library/dd368118.aspx
For taamode: antialiasing mode used for drawing text.
0 - D2D1_TEXT_ANTIALIAS_MODE_DEFAULT
1 - D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE
2 - D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE
3 - D2D1_TEXT_ANTIALIAS_MODE_ALIASED
See this URL for detail:
http://msdn.microsoft.com/en-us/library/dd368170.aspx
Example: >
set encoding=utf-8
set gfn=Ricty_Diminished:h12:cSHIFTJIS
set rop=type:directx
<
If select a raster font (Courier, Terminal or FixedSys) to
'guifont', it fallbacks to be drawn by GDI automatically.
Other render types are currently not supported.
*'report'*
'report' number (default 2)
global
@@ -7771,6 +7850,7 @@ A jump table for the options with a short description can be found at |Q_op|.
fold options
options options and mappings local to a window or buffer (not
global values for local options)
localoptions same as "options"
slash backslashes in file names replaced with forward
slashes
unix with Unix end-of-line format (single <NL>), even when

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
@@ -774,7 +774,7 @@ Version 7.4
- correct RealWaitForChar
- after 7.4-119 use different functions lib$cvtf_to_internal_time because Alpha and VAX have
G_FLOAT but IA64 uses IEEE float otherwise Vim crashes
- guard 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
- Improve tests, update known issues
- 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
@@ -334,7 +334,7 @@ A. You have two possible solutions depending on what you want:
:!start /min ctags -R .
< When it has finished you should see file named "tags" in your current
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: >
:!start /b ctags -R .
< 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 May 28
*pattern.txt* For Vim version 7.4. Last change: 2014 Sep 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -706,11 +706,18 @@ overview.
But to limit the time needed, only the line where what follows matches
is searched, and one line before that (if there is one). This should
be sufficient to match most things and not be too slow.
The part of the pattern after "\@<=" and "\@<!" are checked for a
match first, thus things like "\1" don't work to reference \(\) inside
the preceding atom. It does work the other way around:
Example matches ~
\1\@<=,\([a-z]\+\) ",abc" in "abc,abc"
In the old regexp engine the part of the pattern after "\@<=" and
"\@<!" are checked for a match first, thus things like "\1" don't work
to reference \(\) inside the preceding atom. It does work the other
way around:
Bad example matches ~
\%#=1\1\@<=,\([a-z]\+\) ",abc" in "abc,abc"
However, the new regexp engine works differently, it is better to not
rely on this behavior, do not use \@<= if it can be avoided:
Example matches ~
\([a-z]\+\)\zs,\1 ",abc" in "abc,abc"
\@123<=
Like "\@<=" but only look back 123 bytes. This avoids trying lots
@@ -822,6 +829,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
branch is used. Example: >
/\(.\{-}\zsFab\)\{3}
< 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}
*/\ze*
\ze Matches at any position, and sets the end of the match there: The
@@ -830,6 +838,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
branch is used.
Example: "end\ze\(if\|for\)" matches the "end" in "endif" and
"endfor".
This cannot be followed by a multi. |E888|
{not in Vi} {not available when compiled without the |+syntax| feature}
*/\%^* *start-of-file*

View File

@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 7.4. Last change: 2014 Jun 25
*quickref.txt* For Vim version 7.4. Last change: 2014 Aug 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -831,6 +831,7 @@ Short explanation of each option: *option-list*
'regexpengine' 're' default regexp engine to use
'relativenumber' 'rnu' show relative line number in front of each line
'remap' allow mappings to work recursively
'renderoptions' 'rop' options for text rendering on Windows
'report' threshold for reporting nr. of lines changed
'restorescreen' 'rs' Win32: restore screen when exiting
'revins' 'ri' inserting characters will work backwards

View File

@@ -1,4 +1,4 @@
*spell.txt* For Vim version 7.4. Last change: 2014 Jul 02
*spell.txt* For Vim version 7.4. Last change: 2014 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1058,6 +1058,9 @@ this text to start with a "#" so that mistakes don't go unnoticed. Example:
SFX F 0 in [^i]n # Spion > Spionin ~
SFX F 0 nen in # Bauerin > Bauerinnen ~
However, to avoid lots of errors in affix files written for Myspell, you can
add the IGNOREEXTRA flag.
Apparently Myspell allows an affix name to appear more than once. Since this
might also be a mistake, Vim checks for an extra "S". The affix files for
Myspell that use this feature apparently have this flag. Example:
@@ -1111,6 +1114,14 @@ Specifically, the affix flags can be used for:
- CIRCUMFIX, as explained just below.
IGNOREEXTRA *spell-IGNOREEXTRA*
Normally Vim gives an error for an extra field that does not start with '#'.
This avoids errors going unnoticed. However, some files created for Myspell
or Hunspell may contain many entries with an extra field. Use the IGNOREEXTRA
flag to avoid lots of errors.
CIRCUMFIX *spell-CIRCUMFIX*
The CIRCUMFIX flag means a prefix and suffix must be added at the same time.

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 Sep 09
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
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
(|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.
For example: >
@@ -2975,6 +2975,7 @@ TEX *tex.vim* *ft-tex-syntax* *latex-syntax*
Tex: Taking Advantage of Conceal Mode |tex-conceal|
Tex: Selective Conceal Mode |g:tex_conceal|
Tex: Controlling iskeyword |g:tex_isk|
Tex: Fine Subscript and Superscript Control |tex-supersub|
*tex-folding* *g:tex_fold_enabled*
Tex: Want Syntax Folding? ~
@@ -3068,6 +3069,7 @@ selectively to enable just some syntax highlighting: >
<
As an example, let g:tex_fast= "M" will allow math-associated highlighting
but suppress all the other region-based syntax highlighting.
(also see: |g:tex_conceal| and |tex-supersub|)
*tex-morecommands* *tex-package*
Tex: Want To Highlight More Commands? ~
@@ -3169,6 +3171,28 @@ syntax highlighting script handles this with the following logic:
* If g:tex_isk exists, then it will be used for the local 'iskeyword'
* Else the local 'iskeyword' will be set to 48-57,a-z,A-Z,192-255
*tex-supersub* *g:tex_superscripts* *g:tex_subscripts*
Tex: Fine Subscript and Superscript Control~
See |tex-conceal| for how to enable concealed character replacement.
See |g:tex_conceal| for selectively concealing accents, bold/italic,
math, Greek, and superscripts/subscripts.
One may exert fine control over which superscripts and subscripts one
wants syntax-based concealment for (see |:syn-cchar|). Since not all
fonts support all characters, one may override the
concealed-replacement lists; by default these lists are given by: >
let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]"
let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]"
<
For example, I use Luxi Mono Bold; it doesn't support subscript
characters for "hklmnpst", so I put >
let g:tex_subscripts= "[0-9aeijoruvx,+-/().]"
< in ~/.vim/ftplugin/tex/tex.vim in order to avoid having inscrutable
utf-8 glyphs appear.
TF *tf.vim* *ft-tf-syntax*

View File

@@ -756,6 +756,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'regexpengine' options.txt /*'regexpengine'*
'relativenumber' options.txt /*'relativenumber'*
'remap' options.txt /*'remap'*
'renderoptions' options.txt /*'renderoptions'*
'report' options.txt /*'report'*
'restorescreen' options.txt /*'restorescreen'*
'revins' options.txt /*'revins'*
@@ -766,6 +767,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'rlc' options.txt /*'rlc'*
'rnu' options.txt /*'rnu'*
'ro' options.txt /*'ro'*
'rop' options.txt /*'rop'*
'rs' options.txt /*'rs'*
'rtp' options.txt /*'rtp'*
'ru' options.txt /*'ru'*
@@ -1171,6 +1173,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
+dialog_gui various.txt /*+dialog_gui*
+diff various.txt /*+diff*
+digraphs various.txt /*+digraphs*
+directx various.txt /*+directx*
+dnd various.txt /*+dnd*
+emacs_tags various.txt /*+emacs_tags*
+eval various.txt /*+eval*
@@ -2245,6 +2248,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:ha print.txt /*:ha*
:hardcopy print.txt /*:hardcopy*
:help helphelp.txt /*:help*
:helpc helphelp.txt /*:helpc*
:helpclose helphelp.txt /*:helpclose*
:helpf helphelp.txt /*:helpf*
:helpfind helphelp.txt /*:helpfind*
:helpg helphelp.txt /*:helpg*
@@ -3451,6 +3456,7 @@ CTRL-^ editing.txt /*CTRL-^*
CTRL-{char} intro.txt /*CTRL-{char}*
Chinese mbyte.txt /*Chinese*
Cmd-event autocmd.txt /*Cmd-event*
CmdUndefined autocmd.txt /*CmdUndefined*
Cmdline cmdline.txt /*Cmdline*
Cmdline-mode cmdline.txt /*Cmdline-mode*
CmdwinEnter autocmd.txt /*CmdwinEnter*
@@ -4325,6 +4331,7 @@ E884 eval.txt /*E884*
E885 sign.txt /*E885*
E886 starting.txt /*E886*
E887 if_pyth.txt /*E887*
E888 pattern.txt /*E888*
E89 message.txt /*E89*
E90 message.txt /*E90*
E91 options.txt /*E91*
@@ -4902,6 +4909,7 @@ blockwise-operators visual.txt /*blockwise-operators*
blockwise-register change.txt /*blockwise-register*
blockwise-visual visual.txt /*blockwise-visual*
blowfish options.txt /*blowfish*
blowfish2 options.txt /*blowfish2*
bold syntax.txt /*bold*
bom-bytes mbyte.txt /*bom-bytes*
book intro.txt /*book*
@@ -6075,6 +6083,8 @@ g:tex_isk syntax.txt /*g:tex_isk*
g:tex_no_error syntax.txt /*g:tex_no_error*
g:tex_nospell syntax.txt /*g:tex_nospell*
g:tex_stylish syntax.txt /*g:tex_stylish*
g:tex_subscripts syntax.txt /*g:tex_subscripts*
g:tex_superscripts syntax.txt /*g:tex_superscripts*
g:tex_verbspell syntax.txt /*g:tex_verbspell*
g:var eval.txt /*g:var*
g:vimball_home pi_vimball.txt /*g:vimball_home*
@@ -6138,6 +6148,7 @@ getcharmod() eval.txt /*getcharmod()*
getcmdline() eval.txt /*getcmdline()*
getcmdpos() eval.txt /*getcmdpos()*
getcmdtype() eval.txt /*getcmdtype()*
getcmdwintype() eval.txt /*getcmdwintype()*
getcurpos() eval.txt /*getcurpos()*
getcwd() eval.txt /*getcwd()*
getfontname() eval.txt /*getfontname()*
@@ -7816,6 +7827,7 @@ spell-FLAG spell.txt /*spell-FLAG*
spell-FOL spell.txt /*spell-FOL*
spell-FORBIDDENWORD spell.txt /*spell-FORBIDDENWORD*
spell-HOME spell.txt /*spell-HOME*
spell-IGNOREEXTRA spell.txt /*spell-IGNOREEXTRA*
spell-KEEPCASE spell.txt /*spell-KEEPCASE*
spell-KEY spell.txt /*spell-KEY*
spell-LANG spell.txt /*spell-LANG*
@@ -8293,6 +8305,7 @@ tex-runon syntax.txt /*tex-runon*
tex-slow syntax.txt /*tex-slow*
tex-stopzone syntax.txt /*tex-stopzone*
tex-style syntax.txt /*tex-style*
tex-supersub syntax.txt /*tex-supersub*
tex-sync syntax.txt /*tex-sync*
tex-verb syntax.txt /*tex-verb*
tex.vim syntax.txt /*tex.vim*

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.4. Last change: 2014 Jul 26
*todo.txt* For Vim version 7.4. Last change: 2014 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -47,8 +47,12 @@ Regexp problems:
- Does not work with NFA regexp engine:
\%u, \%x, \%o, \%d followed by a composing character
- Bug relating to back references. (Ingo Karkat, 2014 Jul 24)
- Using back reference before the capturing group sometimes works with the old
engine, can we do this with the new engine? E.g. with
"/\%(<\1>\)\@<=.*\%(<\/\(\w\+\)>\)\@=" matching text inside HTML tags.
Still using freed memory after using setloclist(). (lcd, 2014 Jul 23)
More info Jul 24. Not clear why.
Patch to make getregtype() return the right size for non-linux systems.
(Yasuhiro Matsumoto, 2014 Jul 8)
@@ -57,21 +61,40 @@ Breaks test_eval. Inefficient, can we only compute y_width when needed?
Problem that a previous silent ":throw" causes a following try/catch not to
work. (ZyX, 2013 Sep 28)
DiffChange highlighting doesn't combine with 'cursurline'. (Benjamin Fritz)
Patch by Christian (2014 Jul 12)
Patch to avoid problems with encoding conversion with diff.vim.
(Yasuhiro Matsumoto, 2014 Sep 1.
Depends on current language, language of file can be different.
BufWinLeave autocommand executed in the wrong buffer? (Davit Samvelyan, 2014
Jul 14)
Patch for C/C++ syntax string handling. (Brian Bi, 2014 Sep 13)
When 'clipboard' is "unnamed", :g/pat/d is very slow. Only set the clipboard
after the last delete? (Praful, 2014 May 28)
Patch by Christian Brabandt, 2014 Jun 18. Update Jun 25.
When using a visual selection of multiple words and doing CTRL-W_] it jumps to
the tag matching the word under the cursor, not the selected text.
(Patrick hemmer)
Patch by Christian, 2014 Aug 8.
Completion for :buf does not use 'wildignorecase'. (Akshay H, 2014 May 31)
'backupcopy' should be global-local, so that some files can be written in a
different way. Patch by Christian, 2014 Sep 17.
Patch to handle list with some items locked. (ZyX, 2014 Aug 17)
Prefer the second solution.
Issue 252. Patch by Christian, 2014 Aug 26.
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29)
Patch by Marcin Szamotulski to add count to :close (2014 Aug 10, update Aug
14, Aug 30)
Make ":1close" close the first window.
Make ":+1close" close the next window.
Make ":-1close" close the previous window.
Doesn't look right, asked for updates.
Patch to add a special key name for K_CURSORHOLD. (Hirohito Higashi, 2014 Aug
10)
The entries added by matchaddpos() are returned by getmatches() but can't be
set with setmatches(). (lcd47, 2014 Jun 29)
@@ -79,53 +102,53 @@ Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
When using an undo file, also restore the changelist, so that "g;" works.
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 "\\".
(Christian Brock, 2012 Jun 29)
ml_updatechunk() is slow when retrying for another encoding. (John Little,
2014 Sep 11)
Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
Patch to allow for a different icon on MS-Windows. (Yasuhiro Matsumoto, 2014
Sep 7).
Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19)
Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
"hi link" does not respect groups with GUI settings only. (Mark Lodato, 2014
Jun 8)
Syntax file for gnuplot. Existing one is very old. (Andrew Rasmussen, 2014
Feb 24)
Issue 174: Detect Mason files.
No error for missing endwhile. (ZyX, 2014 Mar 20)
Phpcomplete.vim update. (Complex, 2014 Jan 15)
start_global_changes() plus end_global_changes() causes problem for
clip_unnamed_plus. (Jason Pleau, 2014 Sep 12)
Patch to add :arglocal and :arglists. (Marcin Szamotulski, 2014 Aug 6)
PHP syntax is extremely slow. (Anhad Jai Singh, 2014 Jan 19)
Patch for matchparen. (James McCoy, 2014 Jul 11)
Spell files use a latin single quote. Unicode also has another single quote:
0x2019. (Ron Aaron, 2014 Apr 4)
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.
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: use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
More tests May 14. Update May 29.
Win32: patch to use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
More tests May 14. Update May 29. Update Aug 10.
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)
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
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?
What for systems that don't have unsetenv()?
@@ -202,7 +225,8 @@ Patch to support sorting on floating point number. (Alex Jakushev, 2010 Oct
Patch to support expression argument to sort() instead of a function name.
Yasuhiro Matsumoto, 2013 May 31.
Or should we add a more general mechanism, like lambda functions?
Or should we add a more general mechanism, like a lambda() function?
Patch by Yasuhiro Matsumoto, 2014 Sep 16.
VMS: Select() doesn't work properly, typing ESC may hang Vim. Use sys$qiow
instead. (Samuel Ferencik, 2013 Sep 28)
@@ -210,11 +234,13 @@ instead. (Samuel Ferencik, 2013 Sep 28)
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?
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)
Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29).
Patch to get MSVC version in a nicer way. (Ken Takata, 2014 Jul 24)
Patch to make test 100 work on MS-Windows. (Taro Muraoka, 2013 Dec 12)
Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14)
@@ -230,15 +256,12 @@ Issue 28.
Go through more coverity reports.
Patch to add ":undorecover", get as much text out of the undo file as
possible. (Christian Brabandt, 2014 Mar 12)
possible. (Christian Brabandt, 2014 Mar 12, update Aug 22)
Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
Updated spec ftplugin. (Matěj Cepl, 2013 Oct 16)
Some quickfix messages appear twice. (Gary Johnson, 2014 Feb 16)
Patch by Christian Brabandt, 2014 Feb 17.
Patch to right-align signs. (James Kolb (email james), 2013 Sep 23)
Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12)
@@ -367,7 +390,7 @@ Patch to allow setting w:quickfix_title via setqflist() and setloclist()
functions. (Christian Brabandt, 2013 May 8, update May 21)
Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14)
Second one. Update May 22.
Update by Daniel Hahler, 2014 Jul 4.
Update by Daniel Hahler, 2014 Jul 4, Aug 14.
Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
@@ -422,13 +445,6 @@ signs? Patch by Christian Brabandt, 2013 Aug 22.
Patch to remove flicker from popup menu. (Yasuhiro Matsumoto, 2013 Aug 15)
Patch to use directX to draw text on Windows. Adds the 'renderoptions'
option. (Taro Muraoka, 2013 Jan 25, update 2013 Apr 3, May 14)
Fixes this problem:
8 Win32: Multi-byte characters are not displayed, even though the same font
in Notepad can display them. (Srinath Avadhanula) Try with the
UTF-8-demo.txt page with Andale Mono.
Patch to add 'completeselect' option. Specifies how to select a candidate in
insert completion. (Shougo, 2013 May 29)
Update to add to existing 'completeopt'. 2013 May 30
@@ -642,6 +658,7 @@ effects? (Christian Brabandt, 2012 Aug 5, Update 2013 Aug 12)
Would also need to do this for spellbadword() and spellsuggest().
Patch for variable tabstops. On github (Christian Brabandt, 2014 May 15)
Update Aug 16 (email).
On 64 bit MS-Windows "long" is only 32 bits, but we sometimes need to store a
64 bits value. Change all number options to use nropt_T and define it to the
@@ -1349,10 +1366,6 @@ Jul 31)
C syntax: {} inside () causes following {} to be highlighted as error.
(Michalis Giannakidis, 2006 Jun 1)
Can't easily close the help window, like ":pc" closes the preview window and
":ccl" closes the quickfix window. Add ":hclose". (Chris Gaal)
Patch for :helpclose, Christian Brabandt, 2010 Sep 6.
When 'diffopt' has "context:0" a single deleted line causes two folds to merge
and mess up syncing. (Austin Jennings, 2008 Jan 31)
@@ -1426,8 +1439,8 @@ files with "foo/**" in 'path'. (Kalisiak, 2006 July 15)
Additional info: When using the |wildcards| ** globing, vim hangs
indefinitely on lots of directories. The |file-searching| globing, like in
":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
quick. Merging the 2 kinds of globing might make this an easier fix. (Ian
in ":1find /**/file". This is for files that unix "find" can find very
quickly. Merging the 2 kinds of globing might make this an easier fix. (Ian
Kelling, 2008 July 4)
When the file name has parenthesis, e.g., "foo (bar).txt", ":!ls '%'" has the
@@ -1881,6 +1894,10 @@ restored. (Luc St-Louis)
Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler,
2010 Jun 30)
Add an option for a minimal text length before inserting a line break for
'textwidth'. Avoids very short lines when a very long word follows.
(Kartik Agaram)
At next release:
- Build a huge version by default.
@@ -3048,6 +3065,8 @@ Spell checking:
Diff mode:
9 When making small changes, e.g. deleting a character, update the diff.
Possibly without running diff.
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 quite big and badly documented though.
@@ -3942,7 +3961,6 @@ Autocommands:
when exiting isn't a good idea.
CursorHoldC - CursorHold while command-line editing
WinMoved - when windows have been moved around, e.g, ":wincmd J"
CmdUndefined - Like FuncUndefined but for user commands.
SearchPost - After doing a search command (e.g. to do "M")
PreDirChanged/PostDirChanged
- Before/after ":cd" has been used (for changing 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
@@ -186,7 +186,7 @@ commands:
/four<Enter> find the first string "four"
cwfive<Esc> change the word to "five"
n find the next "four"
. repeat the change to "five'
. repeat the change to "five"
n find the next "four"
. repeat the change
etc.

View File

@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 7.4. Last change: 2014 May 28
*usr_41.txt* For Vim version 7.4. Last change: 2014 Aug 16
VIM USER MANUAL - by Bram Moolenaar
@@ -793,6 +793,7 @@ Command line: *command-line-functions*
getcmdpos() get position of the cursor in the command line
setcmdpos() set position of the cursor in the command line
getcmdtype() return the current command-line type
getcmdwintype() return the current command-line window type
Quickfix and location lists: *quickfix-functions*
getqflist() list of quickfix errors

View File

@@ -1,4 +1,4 @@
*various.txt* For Vim version 7.4. Last change: 2014 May 22
*various.txt* For Vim version 7.4. Last change: 2014 Aug 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -337,6 +337,7 @@ N *+dialog_con* Support for |:confirm| with console dialog.
N *+dialog_con_gui* Support for |:confirm| with GUI and console dialog.
N *+diff* |vimdiff| and 'diff'
N *+digraphs* |digraphs| *E196*
m *+directx* Win32 GUI only: DirectX and |'renderoptions'|
*+dnd* Support for DnD into the "~ register |quote_~|.
B *+emacs_tags* |emacs-tags| files
N *+eval* expression evaluation |eval.txt|

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
@@ -7816,7 +7816,7 @@ Files: src/buffer.c, src/eval.c, src/ex_docmd.c, src/fileio.c,
Patch 6.1.212
Problem: When Vim was started with "-R" ":new" creates a buffer
'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
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
@@ -1626,10 +1626,10 @@ and merge it back in.
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.
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
allocated by X11 library functions and the memory allocated in alloc_cmdbuff()
to store the ":quit" command.
When compiling with EXITFREE defined and the ccmalloc library, it is possible
to detect memory leaks. Some memory will always be reported as leaked, such
as allocated by X11 library functions and the memory allocated in
alloc_cmdbuff() to store the ":quit" command.
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".
Added backslashes before dashes in the vim.1 manual page to make the appear as
real dashes. (Pierr Habouzit)
Added backslashes before dashes in the vim.1 manual page to make them appear
as real dashes. (Pierr Habouzit)
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.
@@ -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
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`".
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.
Compiler warnings and a few other things.
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,
src/if_ole.idl, src/INSTALLpc.txt, src/Make_mvc.mak,
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
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)
Files: src/term.c

View File

@@ -1042,36 +1042,41 @@ list of buffers. |unlisted-buffer|
a number). Insert a backslash before a space in a buffer
name.
:[N]b[uffer][!] [N] *:b* *:bu* *:buf* *:buffer* *E86*
:[N]b[uffer][!] [+cmd] [N] *:b* *:bu* *:buf* *:buffer* *E86*
Edit buffer [N] from the buffer list. If [N] is not given,
the current buffer remains being edited. See |:buffer-!| for
[!]. This will also edit a buffer that is not in the buffer
list, without setting the 'buflisted' flag.
Also see ||+cmd|.
:[N]b[uffer][!] {bufname}
:[N]b[uffer][!] [+cmd] {bufname}
Edit buffer for {bufname} from the buffer list. See
|:buffer-!| for [!]. This will also edit a buffer that is not
in the buffer list, without setting the 'buflisted' flag.
Also see ||+cmd|.
:[N]sb[uffer] [N] *:sb* *:sbuffer*
:[N]sb[uffer] [+cmd] [N] *:sb* *:sbuffer*
Split window and edit buffer [N] from the buffer list. If [N]
is not given, the current buffer is edited. Respects the
"useopen" setting of 'switchbuf' when splitting. This will
also edit a buffer that is not in the buffer list, without
setting the 'buflisted' flag.
Also see ||+cmd|.
:[N]sb[uffer] {bufname}
:[N]sb[uffer] [+cmd] {bufname}
Split window and edit buffer for {bufname} from the buffer
list. This will also edit a buffer that is not in the buffer
list, without setting the 'buflisted' flag.
Note: If what you want to do is split the buffer, make a copy
under another name, you can do it this way: >
:w foobar | sp #
< Also see ||+cmd|.
:[N]bn[ext][!] [N] *:bn* *:bnext* *E87*
:[N]bn[ext][!] [+cmd] [N] *:bn* *:bnext* *E87*
Go to [N]th next buffer in buffer list. [N] defaults to one.
Wraps around the end of the buffer list.
See |:buffer-!| for [!].
Also see ||+cmd|.
If you are in a help buffer, this takes you to the next help
buffer (if there is one). Similarly, if you are in a normal
(non-help) buffer, this takes you to the next normal buffer.
@@ -1079,55 +1084,61 @@ list of buffers. |unlisted-buffer|
the way when you're browsing code/text buffers. The next three
commands also work like this.
*:sbn* *:sbnext*
:[N]sbn[ext] [N]
:[N]sbn[ext] [+cmd] [N]
Split window and go to [N]th next buffer in buffer list.
Wraps around the end of the buffer list. Uses 'switchbuf'
Also see ||+cmd|.
:[N]bN[ext][!] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88*
:[N]bp[revious][!] [N]
:[N]bN[ext][!] [+cmd] [N] *:bN* *:bNext* *:bp* *:bprevious* *E88*
:[N]bp[revious][!] [+cmd] [N]
Go to [N]th previous buffer in buffer list. [N] defaults to
one. Wraps around the start of the buffer list.
See |:buffer-!| for [!] and 'switchbuf'.
Also see ||+cmd|.
:[N]sbN[ext] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious*
:[N]sbp[revious] [N]
:[N]sbN[ext] [+cmd] [N] *:sbN* *:sbNext* *:sbp* *:sbprevious*
:[N]sbp[revious] [+cmd] [N]
Split window and go to [N]th previous buffer in buffer list.
Wraps around the start of the buffer list.
Uses 'switchbuf'.
Also see ||+cmd|.
*:br* *:brewind*
:br[ewind][!] Go to first buffer in buffer list. If the buffer list is
:br[ewind][!] [+cmd] *:br* *:brewind*
Go to first buffer in buffer list. If the buffer list is
empty, go to the first unlisted buffer.
See |:buffer-!| for [!].
*:bf* *:bfirst*
:bf[irst] Same as ":brewind".
:bf[irst] [+cmd] *:bf* *:bfirst*
Same as |:brewind|.
Also see |+cmd|.
*:sbr* *:sbrewind*
:sbr[ewind] Split window and go to first buffer in buffer list. If the
:sbr[ewind] [+cmd] *:sbr* *:sbrewind*
Split window and go to first buffer in buffer list. If the
buffer list is empty, go to the first unlisted buffer.
Respects the 'switchbuf' option.
Also see |+cmd|.
*:sbf* *:sbfirst*
:sbf[irst] Same as ":sbrewind".
:sbf[irst] [+cmd] *:sbf* *:sbfirst*
Same as ":sbrewind".
*:bl* *:blast*
:bl[ast][!] Go to last buffer in buffer list. If the buffer list is
:bl[ast][!] [+cmd] *:bl* *:blast*
Go to last buffer in buffer list. If the buffer list is
empty, go to the last unlisted buffer.
See |:buffer-!| for [!].
*:sbl* *:sblast*
:sbl[ast] Split window and go to last buffer in buffer list. If the
:sbl[ast] [+cmd] *:sbl* *:sblast*
Split window and go to last buffer in buffer list. If the
buffer list is empty, go to the last unlisted buffer.
Respects 'switchbuf' option.
:[N]bm[odified][!] [N] *:bm* *:bmodified* *E84*
:[N]bm[odified][!] [+cmd] [N] *:bm* *:bmodified* *E84*
Go to [N]th next modified buffer. Note: this command also
finds unlisted buffers. If there is no modified buffer the
command fails.
:[N]sbm[odified] [N] *:sbm* *:sbmodified*
:[N]sbm[odified] [+cmd] [N] *:sbm* *:sbmodified*
Split window and go to [N]th next modified buffer.
Respects 'switchbuf' option.
Note: this command also finds buffers not in the buffer list.

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Jul 23
" Last Change: 2014 Sep 05
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -530,6 +530,9 @@ au BufNewFile,BufRead configure.in,configure.ac setf config
" CUDA Cumpute Unified Device Architecture
au BufNewFile,BufRead *.cu setf cuda
" Dockerfile
au BufNewFile,BufRead Dockerfile setf dockerfile
" WildPackets EtherPeek Decoder
au BufNewFile,BufRead *.dcd setf dcd
@@ -811,6 +814,9 @@ au BufNewFile,BufRead {,.}gitolite.rc,example.gitolite.rc setf perl
" Gnuplot scripts
au BufNewFile,BufRead *.gpi setf gnuplot
" Go (Google)
au BufNewFile,BufRead *.go setf go
" GrADS scripts
au BufNewFile,BufRead *.gs setf grads
@@ -1008,7 +1014,7 @@ au BufNewFile,BufRead *.jgr setf jgraph
au BufNewFile,BufRead *.jov,*.j73,*.jovial setf jovial
" JSON
au BufNewFile,BufRead *.json setf json
au BufNewFile,BufRead *.json,*.jsonp setf json
" Kixtart
au BufNewFile,BufRead *.kix setf kix
@@ -1098,6 +1104,9 @@ au BufNewFile,BufRead *.lou,*.lout setf lout
" Lua
au BufNewFile,BufRead *.lua setf lua
" Luarocks
au BufNewFile,BufRead *.rockspec setf lua
" Linden Scripting Language (Second Life)
au BufNewFile,BufRead *.lsl setf lsl
@@ -1145,7 +1154,7 @@ au BufNewFile,BufRead *.map setf map
au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,README.md setf markdown
" Mason
au BufNewFile,BufRead *.mason,*.mhtml setf mason
au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason
" Matlab or Objective C
au BufNewFile,BufRead *.m call s:FTm()

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

18
runtime/ftplugin/go.vim Normal file
View File

@@ -0,0 +1,18 @@
" Vim filetype plugin file
" Language: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2014 Aug 16
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal formatoptions-=t
setlocal comments=s1:/*,mb:*,ex:*/,://
setlocal commentstring=//\ %s
let b:undo_ftplugin = 'setl fo< com< cms<'
" vim: sw=2 sts=2 et

View File

@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: Vim
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2013 Jun 26
" Last Change: 2014 Sep 07
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -62,9 +62,12 @@ if exists("loaded_matchit")
\ '\<try\>:\<cat\%[ch]\>:\<fina\%[lly]\>:\<endt\%[ry]\>,' .
\ '\<aug\%[roup]\s\+\%(END\>\)\@!\S:\<aug\%[roup]\s\+END\>,' .
\ '(:)'
" Ignore ":syntax region" commands, the 'end' argument clobbers if-endif
let b:match_skip = 'getline(".") =~ "^\\s*sy\\%[ntax]\\s\\+region" ||
\ synIDattr(synID(line("."),col("."),1),"name") =~? "comment\\|string"'
" Ignore syntax region commands and settings, any 'en*' would clobber
" if-endif.
" - set spl=de,en
" - au! FileType javascript syntax region foldBraces start=/{/ end=/}/ …
let b:match_skip = 'synIDattr(synID(line("."),col("."),1),"name")
\ =~? "comment\\|string\\|vimSynReg\\|vimSet"'
endif
let &cpo = s:cpo_save

View File

@@ -1,6 +1,6 @@
" Vim filetype plugin file
" Language: Vroom (vim testing and executable documentation)
" Maintainer: David Barnett (https://github.com/google/vim-ft.vroom)
" Maintainer: David Barnett (https://github.com/google/vim-ft-vroom)
" Last Change: 2014 Jul 23
if exists('b:did_ftplugin')

View File

@@ -148,7 +148,7 @@ function s:StatementIndent( current_indent, prev_lnum )
" Get previous non-blank/non-comment-only line
while 1
let line = substitute( getline(lnum), g:ada#Comment, '', '' )
if line !~ '^\s*$' && line !~ '^\s*#'
break
endif

78
runtime/indent/go.vim Normal file
View File

@@ -0,0 +1,78 @@
" Vim indent file
" Language: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2014 Aug 16
"
" TODO:
" - function invocations split across lines
" - general line splits (line ends in an operator)
if exists('b:did_indent')
finish
endif
let b:did_indent = 1
" C indentation is too far off useful, mainly due to Go's := operator.
" Let's just define our own.
setlocal nolisp
setlocal autoindent
setlocal indentexpr=GoIndent(v:lnum)
setlocal indentkeys+=<:>,0=},0=)
if exists('*GoIndent')
finish
endif
" The shiftwidth() function is relatively new.
" Don't require it to exist.
if exists('*shiftwidth')
function s:sw() abort
return shiftwidth()
endfunction
else
function s:sw() abort
return &shiftwidth
endfunction
endif
function! GoIndent(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), '//.*$', '', '')
let l:thisl = substitute(getline(a:lnum), '//.*$', '', '')
let l:previ = indent(l:prevlnum)
let l:ind = l:previ
if l:prevl =~ '[({]\s*$'
" previous line opened a block
let l:ind += s:sw()
endif
if l:prevl =~# '^\s*\(case .*\|default\):$'
" previous line is part of a switch statement
let l:ind += s:sw()
endif
" TODO: handle if the previous line is a label.
if l:thisl =~ '^\s*[)}]'
" this line closed a block
let l:ind -= s:sw()
endif
" Colons are tricky.
" We want to outdent if it's part of a switch ("case foo:" or "default:").
" We ignore trying to deal with jump labels because (a) they're rare, and
" (b) they're hard to disambiguate from a composite literal key.
if l:thisl =~# '^\s*\(case .*\|default\):$'
let l:ind -= s:sw()
endif
return l:ind
endfunction
" vim: sw=2 sts=2 et

View File

@@ -2,7 +2,7 @@
" Header: "{{{
" Maintainer: Bram Moolenaar
" Original Author: Andy Wokula <anwoku@yahoo.de>
" Last Change: 2014 Jul 04
" Last Change: 2014 Aug 23
" Version: 1.0
" Description: HTML indent script with cached state for faster indenting on a
" range of lines.
@@ -497,7 +497,7 @@ func! s:FreshState(lnum)
" If previous line ended in a closing tag, line up with the opening tag.
if !swendtag && text =~ '</\w\+\s*>\s*$'
call cursor(state.lnum, 99999)
normal F<
normal! F<
let start_lnum = HtmlIndent_FindStartTag()
if start_lnum > 0
let state.baseindent = indent(start_lnum)
@@ -898,7 +898,7 @@ func! HtmlIndent()
" a tag works very differently. Do not do this when the line starts with
" "<", it gets the "htmlTag" ID but we are not inside a tag then.
if curtext !~ '^\s*<'
normal ^
normal! ^
let stack = synstack(v:lnum, col('.')) " assumes there are no tabs
let foundHtmlString = 0
for synid in reverse(stack)

View File

@@ -1,13 +1,168 @@
" Vim indent file
" Language: JSON
" Maintainer: David Barnett <daviebdawg+vim@gmail.com>
" Last Change: 2014 Jul 16
" Mantainer: Eli Parra <eli@elzr.com> https://github.com/elzr/vim-json
" 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')
finish
" 0. Initialization {{{1
" =================
" 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
" JSON is a subset of JavaScript. JavaScript indenting should work fine.
runtime! indent/javascript.vim
let s:cpo_save = &cpo
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

@@ -2,7 +2,7 @@
" Language: Shell Script
" Maintainer: Peter Aronoff <telemachus@arpinum.org>
" Original Author: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2013-11-28
" Latest Revision: 2014-08-22
if exists("b:did_indent")
finish
@@ -91,7 +91,9 @@ function! GetShIndent()
if s:is_case(pine)
let ind = indent(lnum) + s:indent_value('case-labels')
else
let ind -= s:indent_value('case-statements') - s:indent_value('case-breaks')
let ind -= (s:is_case_label(pine, lnum) && s:is_case_ended(pine) ?
\ 0 : s:indent_value('case-statements')) -
\ s:indent_value('case-breaks')
endif
elseif s:is_case_break(line)
let ind -= s:indent_value('case-breaks')

View File

@@ -1,7 +1,7 @@
" Vim indent file
" Language: Vim script
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 Aug 02
" Last Change: 2014 Sep 19
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -37,7 +37,8 @@ function GetVimIndentIntern()
" If the current line doesn't start with '\' and below a line that starts
" with '\', use the indent of the line above it.
if getline(v:lnum) !~ '^\s*\\'
let cur_text = getline(v:lnum)
if cur_text !~ '^\s*\\'
while lnum > 0 && getline(lnum) =~ '^\s*\\'
let lnum = lnum - 1
endwhile
@@ -47,27 +48,30 @@ function GetVimIndentIntern()
if lnum == 0
return 0
endif
let prev_text = getline(lnum)
" Add a 'shiftwidth' after :if, :while, :try, :catch, :finally, :function
" and :else. Add it three times for a line that starts with '\' after
" a line that doesn't (or g:vim_indent_cont if it exists).
let ind = indent(lnum)
if getline(v:lnum) =~ '^\s*\\' && v:lnum > 1 && getline(lnum) !~ '^\s*\\'
if cur_text =~ '^\s*\\' && v:lnum > 1 && prev_text !~ '^\s*\\'
if exists("g:vim_indent_cont")
let ind = ind + g:vim_indent_cont
else
let ind = ind + &sw * 3
endif
elseif getline(lnum) =~ '^\s*aug\%[roup]' && getline(lnum) !~ '^\s*aug\%[roup]\s*!\=\s\+END'
elseif prev_text =~ '^\s*aug\%[roup]' && prev_text !~ '^\s*aug\%[roup]\s*!\=\s\+END'
let ind = ind + &sw
else
let line = getline(lnum)
let i = match(line, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>')
if i >= 0
let ind += &sw
if strpart(line, i, 1) == '|' && has('syntax_items')
\ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
let ind -= &sw
" A line starting with :au does not increment/decrement indent.
if prev_text !~ '^\s*au\%[tocmd]'
let i = match(prev_text, '\(^\||\)\s*\(if\|wh\%[ile]\|for\|try\|cat\%[ch]\|fina\%[lly]\|fu\%[nction]\|el\%[seif]\)\>')
if i >= 0
let ind += &sw
if strpart(prev_text, i, 1) == '|' && has('syntax_items')
\ && synIDattr(synID(lnum, i, 1), "name") =~ '\(Comment\|String\)$'
let ind -= &sw
endif
endif
endif
endif
@@ -75,9 +79,8 @@ function GetVimIndentIntern()
" If the previous line contains an "end" after a pipe, but not in an ":au"
" command. And not when there is a backslash before the pipe.
" And when syntax HL is enabled avoid a match inside a string.
let line = getline(lnum)
let i = match(line, '[^\\]|\s*\(ene\@!\)')
if i > 0 && line !~ '^\s*au\%[tocmd]'
let i = match(prev_text, '[^\\]|\s*\(ene\@!\)')
if i > 0 && prev_text !~ '^\s*au\%[tocmd]'
if !has('syntax_items') || synIDattr(synID(lnum, i + 2, 1), "name") !~ '\(Comment\|String\)$'
let ind = ind - &sw
endif
@@ -86,7 +89,7 @@ function GetVimIndentIntern()
" Subtract a 'shiftwidth' on a :endif, :endwhile, :catch, :finally, :endtry,
" :endfun, :else and :augroup END.
if getline(v:lnum) =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+END\)'
if cur_text =~ '^\s*\(ene\@!\|cat\|fina\|el\|aug\%[roup]\s*!\=\s\+END\)'
let ind = ind - &sw
endif

View File

@@ -1,6 +1,6 @@
" Vim indent file
" Language: Vroom (vim testing and executable documentation)
" Maintainer: David Barnett (https://github.com/google/vim-ft.vroom)
" Maintainer: David Barnett (https://github.com/google/vim-ft-vroom)
" Last Change: 2014 Jul 23
if exists('b:did_indent')

View File

@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2014 Apr 01
" Last Change: 2014 Aug 06
" If there already is an option window, jump to that one.
if bufwinnr("option-window") > 0
@@ -606,6 +606,10 @@ if has("gui")
call append("$", "guiheadroom\troom (in pixels) left above/below the window")
call append("$", " \tset ghr=" . &ghr)
endif
if has("directx")
call append("$", "renderoptions\toptions for text rendering")
call <SID>OptionG("rop", &rop)
endif
call append("$", "guipty\tuse a pseudo-tty for I/O to external commands")
call <SID>BinOptionG("guipty", &guipty)
if has("browse")

View File

@@ -98,10 +98,17 @@ function! s:Highlight_Matching_Pair()
call cursor(c_lnum, c_col - before)
endif
" When not in a string or comment ignore matches inside them.
" Build an expression that detects whether the current cursor position is in
" certain syntax types (string, comment, etc.), for use as searchpairpos()'s
" skip argument.
" We match "escape" for special items, such as lispEscapeSpecial.
let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
\ '=~? "string\\|character\\|singlequote\\|escape\\|comment"'
let s_skip = '!empty(filter(map(synstack(line("."), col(".")), ''synIDattr(v:val, "name")''), ' .
\ '''v:val =~? "string\\|character\\|singlequote\\|escape\\|comment"''))'
" If executing the expression determines that the cursor is currently in
" one of the syntax types, then we want searchpairpos() to find the pair
" within those syntax types (i.e., not skip). Otherwise, the cursor is
" outside of the syntax types and s_skip should keep its value so we skip any
" matching pair inside the syntax types.
execute 'if' s_skip '| let s_skip = 0 | endif'
" Limit the search to lines visible in the window.

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types in scripts
"
" 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
" 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'
set ft=valgrind
" Go docs
elseif s:line1 =~ '^PACKAGE DOCUMENTATION$'
set ft=godoc
" Renderman Interface Bytestream
elseif s:line1 =~ '^##RenderMan'
set ft=rib

View File

@@ -9,35 +9,43 @@
SPELLDIR = ..
FILES = ro_RO.aff ro_RO.dic
all: $SPELLDIR/ro.iso-8859-2.spl $SPELLDIR/ro.utf-8.spl \
$SPELLDIR/ro.cp1250.spl ../README_ro.txt
$SPELLDIR/ro.iso-8859-2.spl : $FILES
:sys env LANG=ro_RO.ISO8859-2 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
all: $SPELLDIR/ro.utf-8.spl \
$SPELLDIR/ro.iso-8859-2.spl \
$SPELLDIR/ro.cp1250.spl \
../README_ro.txt
$SPELLDIR/ro.utf-8.spl : $FILES
:sys env LANG=ro_RO.UTF-8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
:sys env LANG=ro_RO.utf8 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
# Note: this generates conversion errors, because not all characters can be
# represented in iso-8859-2.
$SPELLDIR/ro.iso-8859-2.spl : $FILES
:sys env LANG=ro_RO.iso88592 $VIM -u NONE -e -c "mkspell! $SPELLDIR/ro ro_RO" -c q
# Note: this generates conversion errors, because not all characters can be
# represented in cp1250.
$SPELLDIR/ro.cp1250.spl : $FILES
:sys $VIM -u NONE -e -c "set enc=cp1250" -c "mkspell! $SPELLDIR/ro ro_RO" -c q
../README_ro.txt: README_ro_RO.txt
../README_ro.txt: README
:copy $source $target
#
# Fetching the files from OpenOffice.org.
#
OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
:attr {fetch = $OODIR/%file%} ro_RO.zip
#OODIR = http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries
OODIR = http://sourceforge.net/projects/rospell/files/Romanian%20dictionaries/dict-3.3.10
ZIPFILE = ro_RO.3.3.10.zip
:attr {fetch = $OODIR/%file%} $ZIPFILE
# The files don't depend on the .zip file so that we can delete it.
# Only download the zip file if the targets don't exist.
# This is a bit tricky, since the file name includes the date.
ro_RO.aff ro_RO.dic: {buildcheck=}
:assertpkg unzip patch
:fetch ro_RO.zip
:sys $UNZIP ro_RO.zip
:delete ro_RO.zip
:fetch $ZIPFILE
:sys $UNZIP $ZIPFILE
:delete $ZIPFILE
@if not os.path.exists('ro_RO.orig.aff'):
:copy ro_RO.aff ro_RO.orig.aff
@if not os.path.exists('ro_RO.orig.dic'):
@@ -60,12 +68,12 @@ diff:
check:
:assertpkg unzip diff
:fetch ro_RO.zip
:fetch $ZIPFILE
:mkdir tmp
:cd tmp
@try:
@import stat
:sys $UNZIP ../ro_RO.zip
:sys $UNZIP ../$ZIPFILE
:sys {force} diff ../ro_RO.orig.aff ro_RO.aff >d
@if os.stat('d')[stat.ST_SIZE] > 0:
:copy ro_RO.aff ../ro_RO.new.aff
@@ -75,7 +83,19 @@ check:
@finally:
:cd ..
:delete {r}{f}{q} tmp
:delete ro_RO.zip
:delete $ZIPFILE
# Remove all the downloaded and generated files.
clean:
:delete ro_RO.aff
:delete ro_RO.dic
:delete ro_RO.orig.aff
:delete ro_RO.orig.dic
:delete ro_RO-ante1993.aff
:delete ro_RO-ante1993.dic
:delete COPYING.GPL
:delete COPYING.LGPL
:delete COPYING.MPL
:delete README
# vim: set sts=4 sw=4 :

View File

@@ -1,42 +1,34 @@
*** ro_RO.orig.aff Wed Aug 31 20:34:38 2005
--- ro_RO.aff Wed Aug 31 20:39:57 2005
*** ro_RO.orig.aff 2014-08-29 16:29:21.162457824 +0200
--- ro_RO.aff 2014-09-19 15:29:52.354413307 +0200
***************
*** 3,4 ****
--- 3,8 ----
*** 3,5 ****
TRY iaăâșțîertolncusmpdbgfzvhjxkwyqACDM
! KEY qwertyuiop|asdfghjkl|zxcvbnm
+ FOL <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ LOW <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+ UPP <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
+
PFX E Y 1
***************
*** 12,15 ****
SFX L 0 l u
! SFX L 0 le [^cg] i
! SFX L 0 i [cg] i
SFX L 0 le e
--- 16,19 ----
SFX L 0 l u
! SFX L 0 le [^cg]i
! SFX L 0 i [cg]i
SFX L 0 le e
***************
*** 18,20 ****
SFX U 0 a re
! SFX U 0 i [^i] ii
--- 22,24 ----
SFX U 0 a re
! SFX U 0 i [^i]ii
--- 3,9 ----
TRY iaăâșțîertolncusmpdbgfzvhjxkwyqACDM
! # KEY qwertyuiop|asdfghjkl|zxcvbnm
!
! # ignore extra field (specifies type of word?)
! IGNOREEXTRA
!
***************
*** 38,41 ****
SFX I 0 ului [^ua]
! SFX I a ii [gc] a
! SFX I a ei [^cg] a
--- 42,45 ----
SFX I 0 ului [^ua]
! SFX I a ii [gc]a
! SFX I a ei [^cg]a
*** 1546,1553 ****
SFX q 0 ilor . adj. m. pl. dat.
! SFX q 0 ă
! SFX q 0 a
! SFX q 0 ei
! SFX q 0 e
! SFX q 0 ele
! SFX q 0 elor
PFX q Y 1
--- 1550,1557 ----
SFX q 0 ilor . adj. m. pl. dat.
! SFX q 0 ă .
! SFX q 0 a .
! SFX q 0 ei .
! SFX q 0 e .
! SFX q 0 ele .
! SFX q 0 elor .
PFX q Y 1

View File

@@ -2,7 +2,7 @@
" This file is normally sourced from menu.vim.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2013 Jun 24
" Last Change: 2014 Aug 13
" Define the SetSyn function, used for the Syntax menu entries.
" Set 'filetype' and also 'syntax' if it is manually selected.
@@ -326,6 +326,7 @@ an 50.70.270 &Syntax.M.Messages\ (/var/log) :cal SetSyn("messages")<CR>
an 50.70.280 &Syntax.M.Metafont :cal SetSyn("mf")<CR>
an 50.70.290 &Syntax.M.MetaPost :cal SetSyn("mp")<CR>
an 50.70.300 &Syntax.M.MGL :cal SetSyn("mgl")<CR>
an 50.70.305 &Syntax.M.MIX :cal SetSyn("mix")<CR>
an 50.70.310 &Syntax.M.MMIX :cal SetSyn("mmix")<CR>
an 50.70.320 &Syntax.M.Modconf :cal SetSyn("modconf")<CR>
an 50.70.330 &Syntax.M.Model :cal SetSyn("model")<CR>

View File

@@ -5,6 +5,7 @@
" URL: http://asciidoc.org/
" Licence: GPL (http://www.gnu.org)
" Remarks: Vim 6 or greater
" Last Update: 2014 Aug 29 (see Issue 240)
" Limitations:
"
" - 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 asciidocQuotedDoubleQuoted Label
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 asciidocQuotedMonospaced Identifier
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

View File

@@ -1,176 +1,505 @@
" Vim syntax file
" Language: gnuplot 3.8i.0
" Maintainer: John Hoelzel johnh51@users.sourceforge.net
" Last Change: Mon May 26 02:33:33 UTC 2003
" Filenames: *.gpi *.gih scripts: #!*gnuplot
" URL: http://johnh51.get.to/vim/syntax/gnuplot.vim
"
" Language: gnuplot 4.7.0
" Maintainer: Andrew Rasmussen andyras@users.sourceforge.net
" Original Maintainer: John Hoelzel johnh51@users.sourceforge.net
" Last Change: 2014-02-24
" Filenames: *.gnu *.plt *.gpi *.gih *.gp *.gnuplot scripts: #!*gnuplot
" URL: http://www.vim.org/scripts/script.php?script_id=4873
" Original URL: http://johnh51.get.to/vim/syntax/gnuplot.vim
" thanks to "David Necas (Yeti)" <yeti@physics.muni.cz> for heads up - working on more changes .
" *.gpi = GnuPlot Input - what I use because there is no other guideline. jeh 11/2000
" *.gih = makes using cut/pasting from gnuplot.gih easier ...
" #!*gnuplot = for Linux bash shell scripts of gnuplot commands.
" emacs used a suffix of '<gp?>'
" gnuplot demo files show no preference.
" I will post mail and newsgroup comments on a standard suffix in 'URL' directory.
" thanks to "David Necas (Yeti)" <yeti@physics.muni.cz>
" credit also to Jim Eberle <jim.eberle@fastnlight.com>
" for the script http://www.vim.org/scripts/script.php?script_id=1737
" some shortened names to make demo files look clean... jeh. 11/2000
" demos -> 3.8i ... jeh. 5/2003 - a work in progress...
" added current commands, keywords, variables, todos, macros... amr 2014-02-24
" For vim version 5.x: Clear all syntax items
" For vim version 6.x: Quit when a syntax file was already loaded
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" some shortened names to make demo files look clean... jeh. 11/2000
" demos -> 3.8i ... jeh. 5/2003 - a work in progress...
" ---- Special characters ---- "
" commands
" no harm in just matching any \[char] within double quotes, right?
syn match gnuplotSpecial "\\." contained
" syn match gnuplotSpecial "\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[a-z\\]" contained
syn keyword gnuplotStatement cd call clear exit set unset plot splot help
syn keyword gnuplotStatement load pause quit fit rep[lot] if
syn keyword gnuplotStatement FIT_LIMIT FIT_MAXITER FIT_START_LAMBDA
syn keyword gnuplotStatement FIT_LAMBDA_FACTOR FIT_LOG FIT_SCRIPT
syn keyword gnuplotStatement print pwd reread reset save show test ! functions var
syn keyword gnuplotConditional if
" if is cond + stmt - ok?
" measurements in the units in, cm and pt are special
syn match gnuplotUnit "[0-9]+in"
syn match gnuplotUnit "[0-9]+cm"
syn match gnuplotUnit "[0-9]+pt"
" numbers fm c.vim
" external (shell) commands are special
syn region gnuplotExternal start="!" end="$"
" integer number, or floating point number without a dot and with "f".
" ---- Comments ---- "
syn region gnuplotComment start="#" end="$" contains=gnuplotTodo
" ---- Constants ---- "
" strings
syn region gnuplotString start=+"+ skip=+\\"+ end=+"+ contains=gnuplotSpecial
syn region gnuplotString start="'" end="'"
" built-in variables
syn keyword gnuplotNumber GNUTERM GPVAL_TERM GPVAL_TERMOPTIONS GPVAL_SPLOT
syn keyword gnuplotNumber GPVAL_OUTPUT GPVAL_ENCODING GPVAL_VERSION
syn keyword gnuplotNumber GPVAL_PATCHLEVEL GPVAL_COMPILE_OPTIONS
syn keyword gnuplotNumber GPVAL_MULTIPLOT GPVAL_PLOT GPVAL_VIEW_ZSCALE
syn keyword gnuplotNumber GPVAL_TERMINALS GPVAL_pi GPVAL_NaN
syn keyword gnuplotNumber GPVAL_ERRNO GPVAL_ERRMSG GPVAL_PWD
syn keyword gnuplotNumber pi NaN GPVAL_LAST_PLOT GPVAL_TERM_WINDOWID
syn keyword gnuplotNumber GPVAL_X_MIN GPVAL_X_MAX GPVAL_X_LOG
syn keyword gnuplotNumber GPVAL_DATA_X_MIN GPVAL_DATA_X_MAX GPVAL_Y_MIN
syn keyword gnuplotNumber GPVAL_Y_MAX GPVAL_Y_LOG GPVAL_DATA_Y_MIN
syn keyword gnuplotNumber GPVAL_DATA_Y_MAX GPVAL_X2_MIN GPVAL_X2_MAX
syn keyword gnuplotNumber GPVAL_X2_LOG GPVAL_DATA_X2_MIN GPVAL_DATA_X2_MAX
syn keyword gnuplotNumber GPVAL_Y2_MIN GPVAL_Y2_MAX GPVAL_Y2_LOG
syn keyword gnuplotNumber GPVAL_DATA_Y2_MIN GPVAL_DATA_Y2_MAX GPVAL_Z_MIN
syn keyword gnuplotNumber GPVAL_Z_MAX GPVAL_Z_LOG GPVAL_DATA_Z_MIN
syn keyword gnuplotNumber GPVAL_DATA_Z_MAX GPVAL_CB_MIN GPVAL_CB_MAX
syn keyword gnuplotNumber GPVAL_CB_LOG GPVAL_DATA_CB_MIN GPVAL_DATA_CB_MAX
syn keyword gnuplotNumber GPVAL_T_MIN GPVAL_T_MAX GPVAL_T_LOG GPVAL_U_MIN
syn keyword gnuplotNumber GPVAL_U_MAX GPVAL_U_LOG GPVAL_V_MIN GPVAL_V_MAX
syn keyword gnuplotNumber GPVAL_V_LOG GPVAL_R_MIN GPVAL_R_LOG
syn keyword gnuplotNumber GPVAL_TERM_XMIN GPVAL_TERM_XMAX GPVAL_TERM_YMIN
syn keyword gnuplotNumber GPVAL_TERM_YMAX GPVAL_TERM_XSIZE
syn keyword gnuplotNumber GPVAL_TERM_YSIZE GPVAL_VIEW_MAP GPVAL_VIEW_ROT_X
syn keyword gnuplotNumber GPVAL_VIEW_ROT_Z GPVAL_VIEW_SCALE
" function name variables
syn match gnuplotNumber "GPFUN_[a-zA-Z_]*"
" stats variables
syn keyword gnuplotNumber STATS_records STATS_outofrange STATS_invalid
syn keyword gnuplotNumber STATS_blank STATS_blocks STATS_columns STATS_min
syn keyword gnuplotNumber STATS_max STATS_index_min STATS_index_max
syn keyword gnuplotNumber STATS_lo_quartile STATS_median STATS_up_quartile
syn keyword gnuplotNumber STATS_mean STATS_stddev STATS_sum STATS_sumsq
syn keyword gnuplotNumber STATS_correlation STATS_slope STATS_intercept
syn keyword gnuplotNumber STATS_sumxy STATS_pos_min_y STATS_pos_max_y
syn keyword gnuplotNumber STATS_mean STATS_stddev STATS_mean_x STATS_sum_x
syn keyword gnuplotNumber STATS_stddev_x STATS_sumsq_x STATS_min_x
syn keyword gnuplotNumber STATS_max_x STATS_median_x STATS_lo_quartile_x
syn keyword gnuplotNumber STATS_up_quartile_x STATS_index_min_x
syn keyword gnuplotNumber STATS_index_max_x STATS_mean_y STATS_stddev_y
syn keyword gnuplotNumber STATS_sum_y STATS_sumsq_y STATS_min_y
syn keyword gnuplotNumber STATS_max_y STATS_median_y STATS_lo_quartile_y
syn keyword gnuplotNumber STATS_up_quartile_y STATS_index_min_y
syn keyword gnuplotNumber STATS_index_max_y STATS_correlation STATS_sumxy
" deprecated fit variables
syn keyword gnuplotError FIT_LIMIT FIT_MAXITER FIT_START_LAMBDA
syn keyword gnuplotError FIT_LAMBDA_FACTOR FIT_LOG FIT_SCRIPT
" numbers, from c.vim
" integer number, or floating point number without a dot and with "f".
syn case ignore
syn match gnuplotNumber "\<[0-9]\+\(u\=l\=\|lu\|f\)\>"
" floating point number, with dot, optional exponent
" floating point number, with dot, optional exponent
syn match gnuplotFloat "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
" floating point number, starting with a dot, optional exponent
" floating point number, starting with a dot, optional exponent
syn match gnuplotFloat "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=[fl]\=\>"
" floating point number, without dot, with exponent
" floating point number, without dot, with exponent
syn match gnuplotFloat "\<[0-9]\+e[-+]\=[0-9]\+[fl]\=\>"
" hex number
" hex number
syn match gnuplotNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>"
syn case match
" flag an octal number with wrong digits by not hilighting
" flag an octal number with wrong digits by not highlighting
syn match gnuplotOctalError "\<0[0-7]*[89]"
" plot args
" ---- Identifiers: Functions ---- "
syn keyword gnuplotType u[sing] tit[le] notit[le] wi[th] steps fs[teps]
syn keyword gnuplotType title notitle t
syn keyword gnuplotType with w
syn keyword gnuplotType li[nes] l
" t - too much? w - too much? l - too much?
syn keyword gnuplotType linespoints via
" numerical functions
syn keyword gnuplotFunc abs acos acosh airy arg asin asinh atan atan2
syn keyword gnuplotFunc atanh EllipticK EllipticE EllipticPi besj0 besj1
syn keyword gnuplotFunc besy0 besy1 ceil cos cosh erf erfc exp expint
syn keyword gnuplotFunc floor gamma ibeta inverf igamma imag invnorm int
syn keyword gnuplotFunc lambertw lgamma log log10 norm rand real sgn sin
syn keyword gnuplotFunc sin sinh sqrt tan tanh voigt
" funcs
" string functions
syn keyword gnuplotFunc gprintf sprintf strlen strstrt substr strftime
syn keyword gnuplotFunc strptime system word words
syn keyword gnuplotFunc abs acos acosh arg asin asinh atan atanh atan2
syn keyword gnuplotFunc besj0 besj1 besy0 besy1
syn keyword gnuplotFunc ceil column cos cosh erf erfc exp floor gamma
syn keyword gnuplotFunc ibeta inverf igamma imag invnorm int lgamma
syn keyword gnuplotFunc log log10 norm rand real sgn sin sinh sqrt tan
syn keyword gnuplotFunc lambertw
syn keyword gnuplotFunc tanh valid
syn keyword gnuplotFunc tm_hour tm_mday tm_min tm_mon tm_sec
syn keyword gnuplotFunc tm_wday tm_yday tm_year
" other functions
syn keyword gnuplotFunc column columnhead columnheader defined exists
syn keyword gnuplotFunc hsv2rgb stringcolumn timecolumn tm_hour tm_mday
syn keyword gnuplotFunc tm_min tm_mon tm_sec tm_wday tm_yday tm_year
syn keyword gnuplotFunc time valid value
" set vars
" ---- Statements ---- "
syn keyword gnuplotType xdata timefmt grid noytics ytics fs
syn keyword gnuplotType logscale time notime mxtics nomxtics style mcbtics
syn keyword gnuplotType nologscale
syn keyword gnuplotType axes x1y2 unique acs[plines]
syn keyword gnuplotType size origin multiplot xtics xr[ange] yr[ange] square nosquare ratio noratio
syn keyword gnuplotType binary matrix index every thru sm[ooth]
syn keyword gnuplotType all angles degrees radians
syn keyword gnuplotType arrow noarrow autoscale noautoscale arrowstyle
" autoscale args = x y xy z t ymin ... - too much?
" needs code to: using title vs autoscale t
syn keyword gnuplotType x y z zcb
syn keyword gnuplotType linear cubicspline bspline order level[s]
syn keyword gnuplotType auto disc[rete] incr[emental] from to head nohead
syn keyword gnuplotType graph base both nosurface table out[put] data
syn keyword gnuplotType bar border noborder boxwidth
syn keyword gnuplotType clabel noclabel clip noclip cntrp[aram]
syn keyword gnuplotType contour nocontour
syn keyword gnuplotType dgrid3d nodgrid3d dummy encoding format
" set encoding args not included - yet.
syn keyword gnuplotType function grid nogrid hidden[3d] nohidden[3d] isosample[s] key nokey
syn keyword gnuplotType historysize nohistorysize
syn keyword gnuplotType defaults offset nooffset trianglepattern undefined noundefined altdiagonal bentover noaltdiagonal nobentover
syn keyword gnuplotType left right top bottom outside below samplen spacing width height box nobox linestyle ls linetype lt linewidth lw
syn keyword gnuplotType Left Right autotitles noautotitles enhanced noenhanced
syn keyword gnuplotType isosamples
syn keyword gnuplotType label nolabel logscale nolog[scale] missing center font locale
syn keyword gnuplotType mapping margin bmargin lmargin rmargin tmargin spherical cylindrical cartesian
syn keyword gnuplotType linestyle nolinestyle linetype lt linewidth lw pointtype pt pointsize ps
syn keyword gnuplotType mouse nomouse
syn keyword gnuplotType nooffsets data candlesticks financebars linespoints lp vector nosurface
syn keyword gnuplotType term[inal] linux aed767 aed512 gpic
syn keyword gnuplotType regis tek410x tek40 vttek kc-tek40xx
syn keyword gnuplotType km-tek40xx selanar bitgraph xlib x11 X11
" x11 args
syn keyword gnuplotType aifm cgm dumb fig gif small large size nofontlist winword6 corel dxf emf
syn keyword gnuplotType hpgl
" syn keyword gnuplotType transparent hp2623a hp2648 hp500c pcl5 why jeh
syn keyword gnuplotType hp2623a hp2648 hp500c pcl5
syn match gnuplotType "\<transparent\>"
syn keyword gnuplotType hpljii hpdj hppj imagen mif pbm png svg
syn keyword gnuplotType postscript enhanced_postscript qms table
" postscript editing values?
syn keyword gnuplotType tgif tkcanvas epson-180dpi epson-60dpi
syn keyword gnuplotType epson-lx800 nec-cp6 okidata starc
syn keyword gnuplotType tandy-60dpi latex emtex pslatex pstex epslatex
syn keyword gnuplotType eepic tpic pstricks texdraw mf metafont mpost mp
syn keyword gnuplotType timestamp notimestamp
syn keyword gnuplotType variables version
syn keyword gnuplotType x2data y2data ydata zdata
syn keyword gnuplotType reverse writeback noreverse nowriteback
syn keyword gnuplotType axis mirror autofreq nomirror rotate autofreq norotate
syn keyword gnuplotType update
syn keyword gnuplotType multiplot nomultiplot mytics
syn keyword gnuplotType nomytics mztics nomztics mx2tics nomx2tics
syn keyword gnuplotType my2tics nomy2tics offsets origin output
syn keyword gnuplotType para[metric] nopara[metric] pointsize polar nopolar
syn keyword gnuplotType zrange x2range y2range rrange cbrange
syn keyword gnuplotType trange urange vrange sample[s] size
syn keyword gnuplotType bezier boxerrorbars boxes bargraph bar[s]
syn keyword gnuplotType boxxy[errorbars] csplines dots fsteps histeps impulses
syn keyword gnuplotType line[s] linesp[oints] points poiinttype sbezier splines steps
" w lt lw ls = optional
syn keyword gnuplotType vectors xerr[orbars] xyerr[orbars] yerr[orbars] financebars candlesticks vector
syn keyword gnuplotType errorb[ars] surface
syn keyword gnuplotType filledcurve[s] pm3d x1 x2 y1 y2 xy closed
syn keyword gnuplotType at pi front
syn keyword gnuplotType errorlines xerrorlines yerrorlines xyerrorlines
syn keyword gnuplotType tics ticslevel ticscale time timefmt view
syn keyword gnuplotType xdata xdtics noxdtics ydtics noydtics
syn keyword gnuplotType zdtics nozdtics x2dtics nox2dtics y2dtics noy2dtics
syn keyword gnuplotType xlab[el] ylab[el] zlab[el] cblab[el] x2label y2label xmtics
syn keyword gnuplotType xmtics noxmtics ymtics noymtics zmtics nozmtics
syn keyword gnuplotType x2mtics nox2mtics y2mtics noy2mtics
syn keyword gnuplotType cbdtics nocbdtics cbmtics nocbmtics cbtics nocbtics
syn keyword gnuplotType xtics noxtics ytics noytics
syn keyword gnuplotType ztics noztics x2tics nox2tics
syn keyword gnuplotType y2tics noy2tics zero nozero zeroaxis nozeroaxis
syn keyword gnuplotType xzeroaxis noxzeroaxis yzeroaxis noyzeroaxis
syn keyword gnuplotType x2zeroaxis nox2zeroaxis y2zeroaxis noy2zeroaxis
syn keyword gnuplotType angles one two fill empty solid pattern
syn keyword gnuplotType default
syn keyword gnuplotType scansautomatic flush b[egin] noftriangles implicit
" b too much? - used in demo
syn keyword gnuplotType palette positive negative ps_allcF nops_allcF maxcolors
syn keyword gnuplotType push fontfile pop
syn keyword gnuplotType rgbformulae defined file color model gradient colornames
syn keyword gnuplotType RGB HSV CMY YIQ XYZ
syn keyword gnuplotType colorbox vertical horizontal user bdefault
syn keyword gnuplotType loadpath fontpath decimalsign in out
" common (builtin) variable names
syn keyword gnuplotKeyword x y t u v z s
" comments + strings
syn region gnuplotComment start="#" end="$"
syn region gnuplotComment start=+"+ skip=+\\"+ end=+"+
syn region gnuplotComment start=+'+ end=+'+
" conditionals
syn keyword gnuplotConditional if else
" Define the default highlighting.
" repeats
syn keyword gnuplotRepeat do for while
" operators
syn match gnuplotOperator "[-+*/^|&?:]"
syn match gnuplotOperator "\*\*"
syn match gnuplotOperator "&&"
syn match gnuplotOperator "||"
" Keywords
" keywords for 'fit' command
syn keyword gnuplotKeyword via z x:z x:z:s x:y:z:s
syn keyword gnuplotKeyword x:y:t:z:s x:y:t:u:z:s x:y:t:u:v:z:s
" keywords for 'plot' command
" 'axes' keyword
syn keyword gnuplotKeyword axes x1y1 x1y2 x2y1 x2y2
" 'binary' keyword
syn keyword gnuplotKeyword binary matrix general array record format endian
syn keyword gnuplotKeyword filetype avs edf png scan transpose dx dy dz
syn keyword gnuplotKeyword flipx flipy flipz origin center rotate using
syn keyword gnuplotKeyword perpendicular skip every
" datafile keywords
syn keyword gnuplotKeyword binary nonuniform matrix index every using
syn keyword gnuplotKeyword smooth volatile noautoscale every index
" 'smooth' keywords
syn keyword gnuplotKeyword unique frequency cumulative cnormal kdensity
syn keyword gnuplotKeyword csplines acsplines bezer sbezier
" deprecated 'thru' keyword
syn keyword gnuplotError thru
" 'using' keyword
syn keyword gnuplotKeyword using u xticlabels yticlabels zticlabels
syn keyword gnuplotKeyword x2ticlabels y2ticlabels xtic ytic ztic
" 'errorbars' keywords
syn keyword gnuplotKeyword errorbars xerrorbars yerrorbars xyerrorbars
" 'errorlines' keywords
syn keyword gnuplotKeyword errorlines xerrorlines yerrorlines xyerrorlines
" 'title' keywords
syn keyword gnuplotKeyword title t tit notitle columnheader at beginning
syn keyword gnuplotKeyword end
" 'with' keywords
syn keyword gnuplotKeyword with w linestyle ls linetype lt linewidth
syn keyword gnuplotKeyword lw linecolor lc pointtype pt pointsize ps
syn keyword gnuplotKeyword fill fs nohidden3d nocontours nosurface palette
" styles for 'with'
syn keyword gnuplotKeyword lines l points p linespoints lp surface dots
syn keyword gnuplotKeyword impulses labels vectors steps fsteps histeps
syn keyword gnuplotKeyword errorbars errorlines financebars xerrorbars
syn keyword gnuplotKeyword xerrorlines xyerrorbars yerrorbars yerrorlines
syn keyword gnuplotKeyword boxes boxerrorbars boxxyerrorbars boxplot
syn keyword gnuplotKeyword candlesticks circles ellipses filledcurves
syn keyword gnuplotKeyword histogram image rgbimage rgbalpha pm3d variable
" keywords for 'save' command
syn keyword gnuplotKeyword save functions func variables all var terminal
syn keyword gnuplotKeyword term set
" keywords for 'set/show' command
" set angles
syn keyword gnuplotKeyword angles degrees deg radians rad
" set arrow
syn keyword gnuplotKeyword arrow from to rto length angle arrowstyle as
syn keyword gnuplotKeyword nohead head backhead heads size filled empty
syn keyword gnuplotKeyword nofilled front back linestyle linetype linewidth
" set autoscale
" TODO regexp here
syn keyword gnuplotKeyword autoscale x y z cb x2 y2 zy min max fixmin
syn keyword gnuplotKeyword fixmax fix keepfix noextend
" set bars
syn keyword gnuplotKeyword bars small large fullwidth front back
" set bind
syn keyword gnuplotKeyword bind
" set margins
" TODO regexp
syn keyword gnuplotKeyword margin bmargin lmargin rmargin tmargin
" set border
syn keyword gnuplotKeyword border front back
" set boxwidth
syn keyword gnuplotKeyword boxwidth absolute relative
" deprecated set clabel
syn keyword gnuplotError clabel
" set clip
syn keyword gnuplotKeyword clip points one two
" set cntrlabel
syn keyword gnuplotKeyword cntrlabel format font start interval onecolor
" set cntrparam
syn keyword gnuplotKeyword cntrparam linear cubicspline bspline points
syn keyword gnuplotKeyword order levels auto discrete incremental
" set colorbox
syn keyword gnuplotKeyword colorbox vertical horizontal default user origin
syn keyword gnuplotKeyword size front back noborder bdefault border
" show colornames
syn keyword gnuplotKeyword colornames
" set contour
syn keyword gnuplotKeyword contour base surface both
" set datafile
syn keyword gnuplotKeyword datafile fortran nofpe_trap missing separator
syn keyword gnuplotKeyword whitespace tab comma commentschars binary
" set decimalsign
syn keyword gnuplotKeyword decimalsign locale
" set dgrid3d
syn keyword gnuplotKeyword dgrid3d splines qnorm gauss cauchy exp box hann
syn keyword gnuplotKeyword kdensity
" set dummy
syn keyword gnuplotKeyword dummy
" set encoding
syn keyword gnuplotKeyword encoding default iso_8859_1 iso_8859_15
syn keyword gnuplotKeyword iso_8859_2 iso_8859_9 koi8r koi8u cp437 cp850
syn keyword gnuplotKeyword cp852 cp950 cp1250 cp1251 cp1254 sjis utf8
" set fit
syn keyword gnuplotKeyword fit logfile default quiet noquiet results brief
syn keyword gnuplotKeyword verbose errorvariables noerrorvariables
syn keyword gnuplotKeyword errorscaling noerrorscaling prescale noprescale
syn keyword gnuplotKeyword maxiter none limit limit_abs start-lambda script
syn keyword gnuplotKeyword lambda-factor
" set fontpath
syn keyword gnuplotKeyword fontpath
" set format
syn keyword gnuplotKeyword format
" show functions
syn keyword gnuplotKeyword functions
" set grid
syn keyword gnuplotKeyword grid polar layerdefault xtics ytics ztics x2tics
syn keyword gnuplotKeyword y2tics cbtics mxtics mytics mztics mx2tics
syn keyword gnuplotKeyword my2tics mcbtics xmtics ymtics zmtics x2mtics
syn keyword gnuplotKeyword y2mtics cbmtics noxtics noytics noztics nox2tics
syn keyword gnuplotKeyword noy2tics nocbtics nomxtics nomytics nomztics
syn keyword gnuplotKeyword nomx2tics nomy2tics nomcbtics
" set hidden3d
syn keyword gnuplotKeyword hidden3d offset trianglepattern undefined
syn keyword gnuplotKeyword altdiagonal noaltdiagonal bentover nobentover
syn keyword gnuplotKeyword noundefined
" set historysize
syn keyword gnuplotKeyword historysize
" set isosamples
syn keyword gnuplotKeyword isosamples
" set key
syn keyword gnuplotKeyword key on off inside outside at left right center
syn keyword gnuplotKeyword top bottom vertical horizontal Left Right
syn keyword gnuplotKeyword opaque noopaque reverse noreverse invert maxrows
syn keyword gnuplotKeyword noinvert samplen spacing width height autotitle
syn keyword gnuplotKeyword noautotitle title enhanced noenhanced font
syn keyword gnuplotKeyword textcolor box nobox linetype linewidth maxcols
" set label
syn keyword gnuplotKeyword label left center right rotate norotate by font
syn keyword gnuplotKeyword front back textcolor point nopoint offset boxed
syn keyword gnuplotKeyword hypertext
" set linetype
syn keyword gnuplotKeyword linetype
" set link
syn keyword gnuplotKeyword link via inverse
" set loadpath
syn keyword gnuplotKeyword loadpath
" set locale
syn keyword gnuplotKeyword locale
" set logscale
syn keyword gnuplotKeyword logscale log
" set macros
syn keyword gnuplotKeyword macros
" set mapping
syn keyword gnuplotKeyword mapping cartesian spherical cylindrical
" set mouse
syn keyword gnuplotKeyword mouse doubleclick nodoubleclick zoomcoordinates
syn keyword gnuplotKeyword nozoomcoordinates ruler noruler at polardistance
syn keyword gnuplotKeyword nopolardistance deg tan format clipboardformat
syn keyword gnuplotKeyword mouseformat labels nolabels zoomjump nozoomjump
syn keyword gnuplotKeyword verbose noverbose
" set multiplot
syn keyword gnuplotKeyword multiplot title font layout rowsfirst downwards
syn keyword gnuplotKeyword downwards upwards scale offset
" set object
syn keyword gnuplotKeyword object behind fillcolor fc fs rectangle ellipse
syn keyword gnuplotKeyword circle polygon at center size units xy xx yy to
syn keyword gnuplotKeyword from
" set offsets
syn keyword gnuplotKeyword offsets
" set origin
syn keyword gnuplotKeyword origin
" set output
syn keyword gnuplotKeyword output
" set parametric
syn keyword gnuplotKeyword parametric
" show plot
syn keyword gnuplotKeyword plot add2history
" set pm3d
syn keyword gnuplotKeyword hidden3d interpolate scansautomatic scansforward
syn keyword gnuplotKeyword scansbackward depthorder flush begin center end
syn keyword gnuplotKeyword ftriangles noftriangles clip1in clip4in mean map
syn keyword gnuplotKeyword corners2color geomean harmean rms median min max
syn keyword gnuplotKeyword c1 c2 c3 c4 pm3d at nohidden3d implicit explicit
" set palette
syn keyword gnuplotKeyword palette gray color gamma rgbformulae defined
syn keyword gnuplotKeyword file functions cubehelix start cycles saturation
syn keyword gnuplotKeyword model RGB HSV CMY YIQ XYZ positive negative
syn keyword gnuplotKeyword nops_allcF ps_allcF maxcolors float int gradient
syn keyword gnuplotKeyword fit2rgbformulae rgbformulae
" set pointintervalbox
syn keyword gnuplotKeyword pointintervalbox
" set pointsize
syn keyword gnuplotKeyword pointsize
" set polar
syn keyword gnuplotKeyword polar
" set print
syn keyword gnuplotKeyword print append
" set psdir
syn keyword gnuplotKeyword psdir
" set raxis
syn keyword gnuplotKeyword raxis rrange rtics
" set samples
syn keyword gnuplotKeyword samples
" set size
syn keyword gnuplotKeyword size square nosquare ratio noratio
" set style
syn keyword gnuplotKeyword style function data noborder rectangle arrow
syn keyword gnuplotKeyword default nohead head heads size filled empty
syn keyword gnuplotKeyword nofilled front back boxplot range fraction
syn keyword gnuplotKeyword outliers nooutliers pointtype candlesticks
syn keyword gnuplotKeyword separation labels off auto x x2 sorted unsorted
syn keyword gnuplotKeyword fill empty transparent solid pattern border
syn keyword gnuplotKeyword increment userstyles financebars line default
syn keyword gnuplotKeyword linetype lt linecolor lc linewidth lw pointtype
syn keyword gnuplotKeyword pt pointsize ps pointinterval pi palette circle
syn keyword gnuplotKeyword radius graph screen wedge nowedge ellipse size
syn keyword gnuplotKeyword units xx xy yy histogram line textbox opaque
syn keyword gnuplotKeyword border noborder
" set surface
syn keyword gnuplotKeyword surface implicit explicit
" set table
syn keyword gnuplotKeyword table
" set terminal (list of terminals)
syn keyword gnuplotKeyword terminal term push pop aed512 aed767 aifm aqua
syn keyword gnuplotKeyword be cairo cairolatex canvas cgm context corel
syn keyword gnuplotKeyword debug dumb dxf dxy800a eepic emf emxvga epscairo
syn keyword gnuplotKeyword epslatex epson_180dpi excl fig ggi gif gpic hpgl
syn keyword gnuplotKeyword grass hp2623a hp2648 hp500c hpljii hppj imagen
syn keyword gnuplotKeyword jpeg kyo latex linux lua mf mif mp next openstep
syn keyword gnuplotKeyword pbm pdf pdfcairo pm png pngcairo postscript
syn keyword gnuplotKeyword pslatex pstex pstricks qms qt regis sun svg svga
syn keyword gnuplotKeyword tek40 tek410x texdraw tgif tikz tkcanvas tpic
syn keyword gnuplotKeyword vgagl vws vx384 windows wx wxt x11 xlib
" keywords for 'set terminal'
syn keyword gnuplotKeyword color monochrome dashlength dl eps pdf fontscale
syn keyword gnuplotKeyword standalone blacktext colortext colourtext header
syn keyword gnuplotKeyword noheader mono color solid dashed notransparent
syn keyword gnuplotKeyword crop crop background input rounded butt square
syn keyword gnuplotKeyword size fsize standalone name jsdir defaultsize
syn keyword gnuplotKeyword timestamp notimestamp colour mitered beveled
syn keyword gnuplotKeyword round squared palfuncparam blacktext nec_cp6
syn keyword gnuplotKeyword mppoints inlineimages externalimages defaultfont
syn keyword gnuplotKeyword aspect feed nofeed rotate small tiny standalone
syn keyword gnuplotKeyword oldstyle newstyle level1 leveldefault level3
syn keyword gnuplotKeyword background nobackground solid clip noclip
syn keyword gnuplotKeyword colortext colourtext epson_60dpi epson_lx800
syn keyword gnuplotKeyword okidata starc tandy_60dpi dpu414 nec_cp6 draft
syn keyword gnuplotKeyword medium large normal landscape portrait big
syn keyword gnuplotKeyword inches pointsmax textspecial texthidden
syn keyword gnuplotKeyword thickness depth version acceleration giant
syn keyword gnuplotKeyword delay loop optimize nooptimize pspoints
syn keyword gnuplotKeyword FNT9X17 FNT13X25 interlace nointerlace courier
syn keyword gnuplotKeyword originreset nooriginreset gparrows nogparrows
syn keyword gnuplotKeyword picenvironment nopicenvironment tightboundingbox
syn keyword gnuplotKeyword notightboundingbox charsize gppoints nogppoints
syn keyword gnuplotKeyword fontscale textscale fulldoc nofulldoc standalone
syn keyword gnuplotKeyword preamble header tikzplot tikzarrows notikzarrows
syn keyword gnuplotKeyword cmykimages externalimages noexternalimages
syn keyword gnuplotKeyword polyline vectors magnification psnfss nopsnfss
syn keyword gnuplotKeyword psnfss-version7 prologues a4paper amstex fname
syn keyword gnuplotKeyword fsize server persist widelines interlace
syn keyword gnuplotKeyword truecolor notruecolor defaultplex simplex duplex
syn keyword gnuplotKeyword nofontfiles adobeglyphnames noadobeglyphnames
syn keyword gnuplotKeyword nostandalone metric textrigid animate nopspoints
syn keyword gnuplotKeyword hpdj FNT5X9 roman emtex rgbimages bitmap
syn keyword gnuplotKeyword nobitmap providevars nointerlace add delete
syn keyword gnuplotKeyword auxfile hacktext unit raise palfuncparam
syn keyword gnuplotKeyword noauxfile nohacktext nounit noraise ctrl noctrl
syn keyword gnuplotKeyword close widget fixed dynamic tek40xx vttek
syn keyword gnuplotKeyword kc-tek40xx km-tek40xx bitgraph perltk
syn keyword gnuplotKeyword interactive red green blue interpolate mode
syn keyword gnuplotKeyword position ctrlq replotonresize position noctrlq
syn keyword gnuplotKeyword noreplotonresize
" set termoption
syn keyword gnuplotKeyword termoption font fontscale solid dashed
" set tics
syn keyword gnuplotKeyword tics add axis border mirror nomirror in out
syn keyword gnuplotKeyword scale rotate norotate by offset nooffset left
syn keyword gnuplotKeyword autojustify format font textcolor right center
" deprecated set ticslevel
syn keyword gnuplotError ticslevel ticscale
" set timestamp
syn keyword gnuplotKeyword timestamp top bottom offset font
" set timefmt
syn keyword gnuplotKeyword timefmt
" set title
syn keyword gnuplotKeyword title offset font textcolor tc
" set ranges
syn keyword gnuplotKeyword trange urange vrange
" show variables
syn keyword gnuplotKeyword variables
" show version
syn keyword gnuplotKeyword version
" set view
syn keyword gnuplotKeyword view map equal noequal xy xyz
" set x2data
syn keyword gnuplotKeyword xdata ydata zdata x2data y2data cbdata xdtics
syn keyword gnuplotKeyword ydtics zdtics x2dtics y2dtics cbdtics xzeroaxis
syn keyword gnuplotKeyword yzeroaxis zzeroaxis x2zeroaxis y2zeroaxis
syn keyword gnuplotKeyword cbzeroaxis time geographic
" set label
syn keyword gnuplotKeyword xlabel ylabel zlabel x2label y2label cblabel
syn keyword gnuplotKeyword offset font textcolor by parallel
" set range
syn keyword gnuplotKeyword xrange yrange zrange x2range y2range cbrange
" set xyplane
syn keyword gnuplotKeyword xyplane
" set zeroaxis
" set zero
syn keyword gnuplotKeyword zero
" set zeroaxis
syn keyword gnuplotKeyword zeroaxis
" keywords for 'stats' command
syn keyword gnuplotKeyword nooutput
" keywords for 'test' command
syn keyword gnuplotKeyword terminal palette rgb rbg grb gbr brg bgr
" ---- Macros ---- "
syn region gnuplotMacro start="@" end=" "
" ---- Todos ---- "
syn keyword gnuplotTodo contained TODO FIXME XXX
" ---- Types: gnuplot commands ---- "
" I set the commands as Types to distinguish them visually from keywords for the
" commands. This comes at the end of the syntax file because some commands
" are redundant with keywords. It's probably too much trouble to go and
" create special regions for each redundant keyword/command pair, which means
" that some keywords (e.g. 'p') will be highlighted as commands.
syn keyword gnuplotStatement cd call clear evaluate exit fit help history
syn keyword gnuplotStatement load lower pause plot p print pwd quit raise
syn keyword gnuplotStatement refresh replot rep reread reset save set show
syn keyword gnuplotStatement shell splot spstats system test undefine unset
syn keyword gnuplotStatement update
" ---- Define the default highlighting ---- "
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_gnuplot_syntax_inits")
@@ -181,14 +510,41 @@ if version >= 508 || !exists("did_gnuplot_syntax_inits")
command -nargs=+ HiLink hi def link <args>
endif
HiLink gnuplotStatement Statement
HiLink gnuplotConditional Conditional
" ---- Comments ---- "
HiLink gnuplotComment Comment
" ---- Constants ---- "
HiLink gnuplotString String
HiLink gnuplotNumber Number
HiLink gnuplotFloat Float
" ---- Identifiers ---- "
HiLink gnuplotIdentifier Identifier
" ---- Statements ---- "
HiLink gnuplotConditional Conditional
HiLink gnuplotRepeat Repeat
HiLink gnuplotKeyword Keyword
HiLink gnuplotOperator Operator
" ---- PreProcs ---- "
HiLink gnuplotMacro Macro
" ---- Types ---- "
HiLink gnuplotStatement Type
HiLink gnuplotFunc Identifier
" ---- Specials ---- "
HiLink gnuplotSpecial Special
HiLink gnuplotUnit Special
HiLink gnuplotExternal Special
" ---- Errors ---- "
HiLink gnuplotError Error
HiLink gnuplotOctalError Error
HiLink gnuplotFunc Type
HiLink gnuplotType Type
HiLink gnuplotComment Comment
" ---- Todos ---- "
HiLink gnuplotTodo Todo
delcommand HiLink
endif

208
runtime/syntax/go.vim Normal file
View File

@@ -0,0 +1,208 @@
" Vim syntax file
" Language: Go
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2014 Aug 16
" Options:
" There are some options for customizing the highlighting; the recommended
" settings are the default values, but you can write:
" let OPTION_NAME = 0
" in your ~/.vimrc file to disable particular options. You can also write:
" let OPTION_NAME = 1
" to enable particular options. At present, all options default to on.
"
" - g:go_highlight_array_whitespace_error
" Highlights white space after "[]".
" - g:go_highlight_chan_whitespace_error
" Highlights white space around the communications operator that don't
" follow the standard style.
" - g:go_highlight_extra_types
" Highlights commonly used library types (io.Reader, etc.).
" - g:go_highlight_space_tab_error
" Highlights instances of tabs following spaces.
" - g:go_highlight_trailing_whitespace_error
" Highlights trailing white space.
" Quit when a (custom) syntax file was already loaded
if exists('b:current_syntax')
finish
endif
if !exists('g:go_highlight_array_whitespace_error')
let g:go_highlight_array_whitespace_error = 1
endif
if !exists('g:go_highlight_chan_whitespace_error')
let g:go_highlight_chan_whitespace_error = 1
endif
if !exists('g:go_highlight_extra_types')
let g:go_highlight_extra_types = 1
endif
if !exists('g:go_highlight_space_tab_error')
let g:go_highlight_space_tab_error = 1
endif
if !exists('g:go_highlight_trailing_whitespace_error')
let g:go_highlight_trailing_whitespace_error = 1
endif
syn case match
syn keyword goDirective package import
syn keyword goDeclaration var const type
syn keyword goDeclType struct interface
hi def link goDirective Statement
hi def link goDeclaration Keyword
hi def link goDeclType Keyword
" Keywords within functions
syn keyword goStatement defer go goto return break continue fallthrough
syn keyword goConditional if else switch select
syn keyword goLabel case default
syn keyword goRepeat for range
hi def link goStatement Statement
hi def link goConditional Conditional
hi def link goLabel Label
hi def link goRepeat Repeat
" Predefined types
syn keyword goType chan map bool string error
syn keyword goSignedInts int int8 int16 int32 int64 rune
syn keyword goUnsignedInts byte uint uint8 uint16 uint32 uint64 uintptr
syn keyword goFloats float32 float64
syn keyword goComplexes complex64 complex128
hi def link goType Type
hi def link goSignedInts Type
hi def link goUnsignedInts Type
hi def link goFloats Type
hi def link goComplexes Type
" Treat func specially: it's a declaration at the start of a line, but a type
" elsewhere. Order matters here.
syn match goType /\<func\>/
syn match goDeclaration /^func\>/
" Predefined functions and values
syn keyword goBuiltins append cap close complex copy delete imag len
syn keyword goBuiltins make new panic print println real recover
syn keyword goConstants iota true false nil
hi def link goBuiltins Keyword
hi def link goConstants Keyword
" Comments; their contents
syn keyword goTodo contained TODO FIXME XXX BUG
syn cluster goCommentGroup contains=goTodo
syn region goComment start="/\*" end="\*/" contains=@goCommentGroup,@Spell
syn region goComment start="//" end="$" contains=@goCommentGroup,@Spell
hi def link goComment Comment
hi def link goTodo Todo
" Go escapes
syn match goEscapeOctal display contained "\\[0-7]\{3}"
syn match goEscapeC display contained +\\[abfnrtv\\'"]+
syn match goEscapeX display contained "\\x\x\{2}"
syn match goEscapeU display contained "\\u\x\{4}"
syn match goEscapeBigU display contained "\\U\x\{8}"
syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+
hi def link goEscapeOctal goSpecialString
hi def link goEscapeC goSpecialString
hi def link goEscapeX goSpecialString
hi def link goEscapeU goSpecialString
hi def link goEscapeBigU goSpecialString
hi def link goSpecialString Special
hi def link goEscapeError Error
" Strings and their contents
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
syn region goRawString start=+`+ end=+`+
hi def link goString String
hi def link goRawString String
" Characters; their contents
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
hi def link goCharacter Character
" Regions
syn region goBlock start="{" end="}" transparent fold
syn region goParen start='(' end=')' transparent
" Integers
syn match goDecimalInt "\<\d\+\([Ee]\d\+\)\?\>"
syn match goHexadecimalInt "\<0x\x\+\>"
syn match goOctalInt "\<0\o\+\>"
syn match goOctalError "\<0\o*[89]\d*\>"
hi def link goDecimalInt Integer
hi def link goHexadecimalInt Integer
hi def link goOctalInt Integer
hi def link Integer Number
" Floating point
syn match goFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
syn match goFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
syn match goFloat "\<\d\+[Ee][-+]\d\+\>"
hi def link goFloat Float
" Imaginary literals
syn match goImaginary "\<\d\+i\>"
syn match goImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
syn match goImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
syn match goImaginary "\<\d\+[Ee][-+]\d\+i\>"
hi def link goImaginary Number
" Spaces after "[]"
if go_highlight_array_whitespace_error != 0
syn match goSpaceError display "\(\[\]\)\@<=\s\+"
endif
" Spacing errors around the 'chan' keyword
if go_highlight_chan_whitespace_error != 0
" receive-only annotation on chan type
syn match goSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
" send-only annotation on chan type
syn match goSpaceError display "\(\<chan\)\@<=\s\+\(<-\)\@="
" value-ignoring receives in a few contexts
syn match goSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
endif
" Extra types commonly seen
if go_highlight_extra_types != 0
syn match goExtraType /\<bytes\.\(Buffer\)\>/
syn match goExtraType /\<io\.\(Reader\|Writer\|ReadWriter\|ReadWriteCloser\)\>/
syn match goExtraType /\<reflect\.\(Kind\|Type\|Value\)\>/
syn match goExtraType /\<unsafe\.Pointer\>/
endif
" Space-tab error
if go_highlight_space_tab_error != 0
syn match goSpaceError display " \+\t"me=e-1
endif
" Trailing white space error
if go_highlight_trailing_whitespace_error != 0
syn match goSpaceError display excludenl "\s\+$"
endif
hi def link goExtraType Type
hi def link goSpaceError Error
" Search backwards for a global declaration to start processing the syntax.
"syn sync match goSync grouphere NONE /^\(const\|var\|type\|func\)\>/
" There's a bug in the implementation of grouphere. For now, use the
" following as a more expensive/less precise workaround.
syn sync minlines=500
let b:current_syntax = 'go'
" vim: sw=2 sts=2 et

21
runtime/syntax/godoc.vim Normal file
View File

@@ -0,0 +1,21 @@
" Vim syntax file
" Language: Godoc (generated documentation for go)
" Maintainer: David Barnett (https://github.com/google/vim-ft-go)
" Last Change: 2014 Aug 16
if exists('b:current_syntax')
finish
endif
syn case match
syn match godocTitle "^\([A-Z][A-Z ]*\)$"
command -nargs=+ HiLink hi def link <args>
HiLink godocTitle Title
delcommand HiLink
let b:current_syntax = 'godoc'
" vim: sw=2 sts=2 et

View File

@@ -1,16 +1,143 @@
" Vim syntax file
" Language: JSON
" Maintainer: David Barnett <daviebdawg+vim@gmail.com>
" Last Change: 2014 Jul 16
" Language: JSON
" Maintainer: Eli Parra <eli@elzr.com>
" Last Change: 2014 Aug 23
" Version: 0.12
" For version 5.x: Clear all syntax items.
" For version 6.x and later: Quit when a syntax file was already loaded.
if exists('b:current_syntax')
finish
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let main_syntax = 'json'
endif
" Use JavaScript syntax. JSON is a subset of JavaScript.
runtime! syntax/javascript.vim
unlet b:current_syntax
syntax match jsonNoise /\%(:\|,\)/
let b:current_syntax = 'json'
" NOTE that for the concealing to work your conceallevel should be set to 2
" Syntax: Strings
" Separated into a match and region because a region by itself is always greedy
syn match jsonStringMatch /"\([^"]\|\\\"\)\+"\ze[[:blank:]\r\n]*[,}\]]/ contains=jsonString
if has('conceal')
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ concealends contains=jsonEscape contained
else
syn region jsonString oneline matchgroup=jsonQuote start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=jsonEscape contained
endif
" Syntax: JSON does not allow strings with single quotes, unlike JavaScript.
syn region jsonStringSQError oneline start=+'+ skip=+\\\\\|\\"+ end=+'+
" Syntax: JSON Keywords
" Separated into a match and region because a region by itself is always greedy
syn match jsonKeywordMatch /"\([^"]\|\\\"\)\+"[[:blank:]\r\n]*\:/ contains=jsonKeyword
if has('conceal')
syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ concealends contained
else
syn region jsonKeyword matchgroup=jsonQuote start=/"/ end=/"\ze[[:blank:]\r\n]*\:/ contained
endif
" Syntax: Escape sequences
syn match jsonEscape "\\["\\/bfnrt]" contained
syn match jsonEscape "\\u\x\{4}" contained
" Syntax: Numbers
syn match jsonNumber "-\=\<\%(0\|[1-9]\d*\)\%(\.\d\+\)\=\%([eE][-+]\=\d\+\)\=\>\ze[[:blank:]\r\n]*[,}\]]"
" ERROR WARNINGS **********************************************
if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
" Syntax: Strings should always be enclosed with quotes.
syn match jsonNoQuotesError "\<[[:alpha:]][[:alnum:]]*\>"
syn match jsonTripleQuotesError /"""/
" Syntax: An integer part of 0 followed by other digits is not allowed.
syn match jsonNumError "-\=\<0\d\.\d*\>"
" Syntax: Decimals smaller than one should begin with 0 (so .1 should be 0.1).
syn match jsonNumError "\:\@<=[[:blank:]\r\n]*\zs\.\d\+"
" Syntax: No comments in JSON, see http://stackoverflow.com/questions/244777/can-i-comment-a-json-file
syn match jsonCommentError "//.*"
syn match jsonCommentError "\(/\*\)\|\(\*/\)"
" Syntax: No semicolons in JSON
syn match jsonSemicolonError ";"
" Syntax: No trailing comma after the last element of arrays or objects
syn match jsonTrailingCommaError ",\_s*[}\]]"
" Syntax: Watch out for missing commas between elements
syn match jsonMissingCommaError /\("\|\]\|\d\)\zs\_s\+\ze"/
syn match jsonMissingCommaError /\(\]\|\}\)\_s\+\ze"/ "arrays/objects as values
syn match jsonMissingCommaError /}\_s\+\ze{/ "objects as elements in an array
syn match jsonMissingCommaError /\(true\|false\)\_s\+\ze"/ "true/false as value
endif
" ********************************************** END OF ERROR WARNINGS
" Allowances for JSONP: function call at the beginning of the file,
" parenthesis and semicolon at the end.
" Function name validation based on
" http://stackoverflow.com/questions/2008279/validate-a-javascript-function-name/2008444#2008444
syn match jsonPadding "\%^[[:blank:]\r\n]*[_$[:alpha:]][_$[:alnum:]]*[[:blank:]\r\n]*("
syn match jsonPadding ");[[:blank:]\r\n]*\%$"
" Syntax: Boolean
syn match jsonBoolean /\(true\|false\)\(\_s\+\ze"\)\@!/
" Syntax: Null
syn keyword jsonNull null
" Syntax: Braces
syn region jsonFold matchgroup=jsonBraces start="{" end=/}\(\_s\+\ze\("\|{\)\)\@!/ transparent fold
syn region jsonFold matchgroup=jsonBraces start="\[" end=/]\(\_s\+\ze"\)\@!/ transparent fold
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_json_syn_inits")
if version < 508
let did_json_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink jsonPadding Operator
HiLink jsonString String
HiLink jsonTest Label
HiLink jsonEscape Special
HiLink jsonNumber Number
HiLink jsonBraces Delimiter
HiLink jsonNull Function
HiLink jsonBoolean Boolean
HiLink jsonKeyword Label
if (!exists("g:vim_json_warnings") || g:vim_json_warnings==1)
HiLink jsonNumError Error
HiLink jsonCommentError Error
HiLink jsonSemicolonError Error
HiLink jsonTrailingCommaError Error
HiLink jsonMissingCommaError Error
HiLink jsonStringSQError Error
HiLink jsonNoQuotesError Error
HiLink jsonTripleQuotesError Error
endif
HiLink jsonQuote Quote
HiLink jsonNoise Noise
delcommand HiLink
endif
let b:current_syntax = "json"
if main_syntax == 'json'
unlet main_syntax
endif
" Vim settings
" vim: ts=8 fdm=marker
" MIT License
" Copyright (c) 2013, Jeroen Ruigrok van der Werven, Eli Parra
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
"THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"See https://twitter.com/elzr/status/294964017926119424

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: php PHP 3/4/5
" Maintainer: Jason Woofenden <jason@jasonwoof.com>
" Last Change: Aug 28, 2013
" Last Change: Sep 18, 2014
" URL: https://gitorious.org/jasonwoof/vim-syntax/blobs/master/php.vim
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
@@ -123,7 +123,11 @@ syn keyword phpEnvVar GATEWAY_INTERFACE SERVER_NAME SERVER_SOFTWARE SERVER_PROTO
syn keyword phpIntVar GLOBALS PHP_ERRMSG PHP_SELF HTTP_GET_VARS HTTP_POST_VARS HTTP_COOKIE_VARS HTTP_POST_FILES HTTP_ENV_VARS HTTP_SERVER_VARS HTTP_SESSION_VARS HTTP_RAW_POST_DATA HTTP_STATE_VARS _GET _POST _COOKIE _FILES _SERVER _ENV _SERVER _REQUEST _SESSION contained
" Constants
syn keyword phpCoreConstant PHP_VERSION PHP_OS DEFAULT_INCLUDE_PATH PEAR_INSTALL_DIR PEAR_EXTENSION_DIR PHP_EXTENSION_DIR PHP_BINDIR PHP_LIBDIR PHP_DATADIR PHP_SYSCONFDIR PHP_LOCALSTATEDIR PHP_CONFIG_FILE_PATH PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END E_ERROR E_WARNING E_PARSE E_NOTICE E_CORE_ERROR E_CORE_WARNING E_COMPILE_ERROR E_COMPILE_WARNING E_USER_ERROR E_USER_WARNING E_USER_NOTICE E_ALL contained
syn keyword phpCoreConstant PHP_VERSION PHP_OS DEFAULT_INCLUDE_PATH PEAR_INSTALL_DIR PEAR_EXTENSION_DIR PHP_EXTENSION_DIR PHP_BINDIR PHP_LIBDIR PHP_DATADIR PHP_SYSCONFDIR PHP_LOCALSTATEDIR PHP_CONFIG_FILE_PATH PHP_OUTPUT_HANDLER_START PHP_OUTPUT_HANDLER_CONT PHP_OUTPUT_HANDLER_END contained
" Predefined constants
" Generated by: curl -q http://php.net/manual/en/errorfunc.constants.php | grep -oP 'E_\w+' | sort -u
syn keyword phpCoreConstant E_ALL E_COMPILE_ERROR E_COMPILE_WARNING E_CORE_ERROR E_CORE_WARNING E_DEPRECATED E_ERROR E_NOTICE E_PARSE E_RECOVERABLE_ERROR E_STRICT E_USER_DEPRECATED E_USER_ERROR E_USER_NOTICE E_USER_WARNING E_WARNING contained
syn case ignore
@@ -502,11 +506,6 @@ syn keyword phpStructure trait
" Some of these changes (highlighting isset/unset/echo etc) are not so
" critical, but they make things more colourful. :-)
" highlight constant E_STRICT
syntax case match
syntax keyword phpCoreConstant E_STRICT contained
syntax case ignore
" different syntax highlighting for 'echo', 'print', 'switch', 'die' and 'list' keywords
" to better indicate what they are.
syntax keyword phpDefine echo print contained

View File

@@ -1,7 +1,8 @@
" Vim syntax file
" Language: reStructuredText documentation format
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2013-11-26
" Maintainer: Marshall Ward <marshall.ward@gmail.com>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2014-08-23
if exists("b:current_syntax")
finish
@@ -47,7 +48,7 @@ syn match rstSimpleTableLines contained display
syn cluster rstDirectives contains=rstFootnote,rstCitation,
\ rstHyperlinkTarget,rstExDirective
syn match rstExplicitMarkup '^\.\.\_s'
syn match rstExplicitMarkup '^\s*\.\.\_s'
\ nextgroup=@rstDirectives,rstComment,rstSubstitutionDefinition
let s:ReferenceName = '[[:alnum:]]\+\%([_.-][[:alnum:]]\+\)*'
@@ -99,11 +100,11 @@ function! s:DefineInlineMarkup(name, start, middle, end)
\ ""
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, "'", "'")
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '"', '"')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '(', ')')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '"', '"')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '(', ')')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>')
call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|[/:]\)', '')
@@ -136,23 +137,24 @@ syn match rstStandaloneHyperlink contains=@NoSpell
\ "\<\%(\%(\%(https\=\|file\|ftp\|gopher\)://\|\%(mailto\|news\):\)[^[:space:]'\"<>]\+\|www[[:alnum:]_-]*\.[[:alnum:]_-]\+\.[^[:space:]'\"<>]\+\)[[:alnum:]/]"
syn region rstCodeBlock contained matchgroup=rstDirective
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\s+
\ start=+\%(sourcecode\|code\%(-block\)\=\)::\_s*\n\ze\z(\s\+\)+
\ skip=+^$+
\ end=+^\s\@!+
\ end=+^\z1\@!+
\ contains=@NoSpell
syn cluster rstDirectives add=rstCodeBlock
if !exists('g:rst_syntax_code_list')
let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php', 'python', 'perl']
let g:rst_syntax_code_list = ['vim', 'java', 'cpp', 'lisp', 'php',
\ 'python', 'perl', 'sh']
endif
for code in g:rst_syntax_code_list
unlet! b:current_syntax
exe 'syn include @rst'.code.' syntax/'.code.'.vim'
exe 'syn region rstDirective'.code.' matchgroup=rstDirective fold '
\.'start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\s*$# '
\.'start=#\%(sourcecode\|code\%(-block\)\=\)::\s\+'.code.'\_s*\n\ze\z(\s\+\)# '
\.'skip=#^$# '
\.'end=#^\s\@!# contains=@NoSpell,@rst'.code.' keepend'
\.'end=#^\z1\@!# contains=@NoSpell,@rst'.code
exe 'syn cluster rstDirectives add=rstDirective'.code
endfor

View File

@@ -1,8 +1,9 @@
" SiSU Vim syntax file
" SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
" SiSU Markup: SiSU (sisu-4.0.9)
" Last Change: 2013-02-22
" URL (sisu-4.1.0): <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
" SiSU Maintainer: Ralph Amissah <ralph.amissah@gmail.com>
" SiSU Markup: SiSU (sisu-5.6.7)
" Last Change: 2014-09-14
" URL: <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
" <http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=blob_plain;f=data/sisu/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
"(originally looked at Ruby Vim by Mirko Nasato)
if version < 600
@@ -23,15 +24,14 @@ if !exists("sisu_no_identifiers")
syn match sisu_break contains=@NoSpell " \\\\\( \|$\)\|<br>\|<br />"
syn match sisu_control contains=@NoSpell "^\(-\\\\-\|=\\\\=\|-\.\.-\|<:p[bn]>\)\s*$"
syn match sisu_control contains=@NoSpell "^<:\(bo\|---\)>\s*$"
syn match sisu_marktail contains=@NoSpell "^--[+~-]#\s*$"
syn match sisu_marktail "[~-]#"
syn match sisu_control "\""
syn match sisu_underline "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)"
syn match sisu_number contains=@NoSpell "[0-9a-f]\{32\}\|[0-9a-f]\{64\}"
syn match sisu_link contains=@NoSpell "\(_\?https\?://\|\.\.\/\)\S\+"
syn match sisu_link " \*\~\S\+"
syn match sisu_action "^<:insert\d\+>"
syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^._-]\+\.ss[it]$"
syn match sisu_require contains=@NoSpell "^<<{[a-zA-Z0-9^._-]\+\.ss[it]}$"
syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^./_-]\+\.ss[it]$"
syn match sisu_structure "^:A\~$"
"% "Document Sub Headers:
@@ -44,6 +44,8 @@ if !exists("sisu_no_identifiers")
syn match sisu_sub_header_original "^\s\+:\(publisher\|date\|language\|lang_char\|institution\|nationality\|source\):\s"
syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|language\|italics\|bold\|emphasis\|substitute\|omit\|plaintext_wrap\|texpdf_font_mono\|texpdf_font\|stamp\|promo\|ad\|manpage\|home_button_text\|home_button_image\|cover_image\|footer\):\s"
syn match sisu_sub_header_notes "^\s\+:\(description\|abstract\|comment\|coverage\|relation\|source\|history\|type\|format\|prefix\|prefix_[ab]\|suffix\):\s"
syn match sisu_within_index_ignore "\S\+[:;]\(\s\+\|$\)"
syn match sisu_within_index "[:|;]\|+\d\+"
"% "semantic markers: (ignore)
syn match sisu_sem_marker ";{\|};[a-z._]*[a-z]"
@@ -93,17 +95,25 @@ syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_make matchgroup=sisu_header start="^[@]make:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
"% "Headings:
syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-8]\|:\?[A-C]\)\~\(\S\+\|[^-]\)" end="$"
syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-4]\|:\?[A-D]\)\~\(\S\+\|[^-]\)" end="$"
"% "Block Group Text:
" table
syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table"
" table
syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+table" end="^```\(\s\|$\)"
syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$"
" block, group, poem, alt
syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(block\|group\|poem\|alt\){" end="^}\(block\|group\|poem\|alt\)"
syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(block\|group\|poem\|alt\){" end="^}\1"
syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+\(block\|group\|poem\|alt\)" end="^```\(\s\|$\)"
" box
syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^box\(\.[a-z]\+\)\?{" end="^}box"
syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+\box\(\.[a-z]\+\)\?" end="^```\(\s\|$\)"
" code
syn region sisu_content_alt contains=sisu_error matchgroup=sisu_contain start="^code{" end="^}code"
syn region sisu_content_alt contains=sisu_error,@NoSpell matchgroup=sisu_contain start="^code\(\.[a-z][0-9a-z_]\+\)\?{" end="^}code"
syn region sisu_content_alt contains=sisu_error,@NoSpell matchgroup=sisu_contain start="^```\s\+code\(\.[a-z][0-9a-z_]\+\)\?" end="^```\(\s\|$\)"
" quote
syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_contain start="^```\s\+quote" end="^```\(\s\|$\)"
"% "Endnotes:
" regular endnote or asterisk or plus sign endnote
@@ -138,7 +148,7 @@ syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endn
"% "Font Face Curly Brackets:
"syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_sem start="\S\+:{" end="}:[^<>,.!?:; ]\+" oneline
" book index:
syn region sisu_index matchgroup=sisu_index_block start="^={" end="}"
syn region sisu_index contains=sisu_within_index_ignore,sisu_within_index matchgroup=sisu_index_block start="^={" end="}"
" emphasis:
syn region sisu_bold contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*"
" bold:
@@ -246,6 +256,8 @@ hi def link sisu_index SpecialKey
hi def link sisu_index_block Visual
hi def link sisu_content_endnote Special
hi def link sisu_control Delimiter
hi def link sisu_within_index Delimiter
hi def link sisu_within_index_ignore SpecialKey
hi def link sisu_ocn Include
hi def link sisu_number Number
hi def link sisu_identifier Function

View File

@@ -1,8 +1,8 @@
" Vim syntax file
" Language: TeX
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
" Last Change: Mar 20, 2014
" Version: 81
" Last Change: Sep 09, 2014
" Version: 82
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
"
" Notes: {{{1
@@ -88,6 +88,12 @@ if !exists("g:tex_conceal")
else
let s:tex_conceal= g:tex_conceal
endif
if !exists("g:tex_superscripts")
let g:tex_superscripts= "[0-9a-zA-W.,:;+-<>/()=]"
endif
if !exists("g:tex_subscripts")
let g:tex_subscripts= "[0-9aehijklmnoprstuvx,+-/().]"
endif
" Determine whether or not to use "*.sty" mode {{{1
" The user may override the normal determination by setting
@@ -331,22 +337,22 @@ syn match texSpaceCodeChar "`\\\=.\(\^.\)\==\(\d\|\"\x\{1,6}\|`.\)" contained
if s:tex_fast =~ 'p'
if !exists("g:tex_nospell") || !g:tex_nospell
if g:tex_fold_enabled && has("folding")
syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell
syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup,@Spell
syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup,@Spell
syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup,@Spell
syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup,@Spell
syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell
syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup,@Spell
syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup,@Spell
syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@Spell
syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup,@Spell
syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup,@Spell
else
syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell
syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup,@Spell
syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup,@Spell
syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup,@Spell
syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup,@Spell
syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell
syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup,@Spell
syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup,@Spell
syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup,@Spell
syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@Spell
@@ -355,22 +361,22 @@ if s:tex_fast =~ 'p'
endif
else
if g:tex_fold_enabled && has("folding")
syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup
syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' fold contains=@texFoldGroup,@texDocGroup
syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texPartGroup
syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texChapterGroup
syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSectionGroup
syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup
syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSectionGroup
syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texSubSubSectionGroup
syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup,@texParaGroup
syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' fold contains=@texFoldGroup
syn region texTitle matchgroup=texSection start='\\\%(author\|title\)\>\s*{' end='}' fold contains=@texFoldGroup
syn region texAbstract matchgroup=texSection start='\\begin\s*{\s*abstract\s*}' end='\\end\s*{\s*abstract\s*}' fold contains=@texFoldGroup
else
syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup
syn region texDocZone matchgroup=texSection start='\\begin\s*{\s*document\s*}' end='\\end\s*{\s*document\s*}' contains=@texFoldGroup,@texDocGroup
syn region texPartZone matchgroup=texSection start='\\part\>' end='\ze\s*\\\%(part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texPartGroup
syn region texChapterZone matchgroup=texSection start='\\chapter\>' end='\ze\s*\\\%(chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texChapterGroup
syn region texSectionZone matchgroup=texSection start='\\section\>' end='\ze\s*\\\%(section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSectionGroup
syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup
syn region texSubSectionZone matchgroup=texSection start='\\subsection\>' end='\ze\s*\\\%(\%(sub\)\=section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSectionGroup
syn region texSubSubSectionZone matchgroup=texSection start='\\subsubsection\>' end='\ze\s*\\\%(\%(sub\)\{,2}section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texSubSubSectionGroup
syn region texParaZone matchgroup=texSection start='\\paragraph\>' end='\ze\s*\\\%(paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup,@texParaGroup
syn region texSubParaZone matchgroup=texSection start='\\subparagraph\>' end='\ze\s*\\\%(\%(sub\)\=paragraph\>\|\%(sub\)*section\>\|chapter\>\|part\>\|end\s*{\s*document\s*}\)' contains=@texFoldGroup
@@ -620,7 +626,7 @@ if s:tex_fast =~ 'r'
syn region texRefZone matchgroup=texStatement start="\\\(page\|eq\)ref{" end="}\|%stopzone\>" contains=@texRefGroup
syn region texRefZone matchgroup=texStatement start="\\v\=ref{" end="}\|%stopzone\>" contains=@texRefGroup
syn region texRefOption contained matchgroup=Delimiter start='\[' end=']' contains=@texRefGroup,texRefZone nextgroup=texRefOption,texCite
syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite
syn region texCite contained matchgroup=Delimiter start='{' end='}' contains=@texRefGroup,texRefZone,texCite
endif
syn match texRefZone '\\cite\%([tp]\*\=\)\=' nextgroup=texRefOption,texCite
@@ -1045,8 +1051,11 @@ if has("conceal") && &enc == 'utf-8'
syn region texSubscript matchgroup=Delimiter start='_{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
endif
fun! s:SuperSub(group,leader,pat,cchar)
exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar
exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
if a:pat =~ '^\\' || (a:leader == '\^' && a:pat =~ g:tex_superscripts) || (a:leader == '_' && a:pat =~ g:tex_subscripts)
" call Decho("SuperSub: group<".a:group."> leader<".a:leader."> pat<".a:pat."> cchar<".a:cchar.">")
exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar
exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
endif
endfun
call s:SuperSub('texSuperscript','\^','0','⁰')
call s:SuperSub('texSuperscript','\^','1','¹')
@@ -1170,44 +1179,44 @@ if has("conceal") && &enc == 'utf-8'
let i= i + 1
endfor
endfun
" \` \' \^ \" \~ \. \= \c \H \k \r \u \v
call s:Accents('a','à','á','â','ä','ã','ȧ','ā',' ',' ','ą','å','ă','ǎ')
call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ','Ā',' ',' ','Ą','Å','Ă','Ǎ')
call s:Accents('c',' ','ć','ĉ',' ',' ','ċ',' ','ç',' ',' ',' ',' ','č')
call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ',' ','Ç',' ',' ',' ',' ','Č')
call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď')
call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď')
call s:Accents('e','è','é','ê','ë','ẽ','ė','ē','ȩ',' ','ę',' ','ĕ','ě')
call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ē','Ȩ',' ','Ę',' ','Ĕ','Ě')
call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ',' ','ģ',' ',' ',' ','ğ','ǧ')
call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ',' ','Ģ',' ',' ',' ','Ğ','Ǧ')
call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ')
call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ')
call s:Accents('i','ì','í','î','ï','ĩ','į','ī',' ',' ','į',' ','ĭ','ǐ')
call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ','Ī',' ',' ','Į',' ','Ĭ','Ǐ')
call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ')
call s:Accents('k',' ',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ','ǩ')
call s:Accents('K',' ',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ','Ǩ')
call s:Accents('l',' ','ĺ','ľ',' ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ')
call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ')
call s:Accents('n',' ','ń',' ',' ','ñ',' ',' ','ņ',' ',' ',' ',' ','ň')
call s:Accents('N',' ','Ń',' ',' ','Ñ',' ',' ','Ņ',' ',' ',' ',' ','Ň')
call s:Accents('o','ò','ó','ô','ö','õ','ȯ','ō',' ','ő','ǫ',' ','ŏ','ǒ')
call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ','Ō',' ','Ő','Ǫ',' ','Ŏ','Ǒ')
call s:Accents('r',' ','ŕ',' ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř')
call s:Accents('R',' ','Ŕ',' ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř')
call s:Accents('s',' ','ś','ŝ',' ',' ',' ',' ','ş',' ','ȿ',' ',' ','š')
call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ',' ','Ş',' ',' ',' ',' ','Š')
call s:Accents('t',' ',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť')
call s:Accents('T',' ',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť')
call s:Accents('u','ù','ú','û','ü','ũ',' ','ū',' ','ű','ų','ů','ŭ','ǔ')
call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ','Ū',' ','Ű','Ų','Ů','Ŭ','Ǔ')
call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ',' ','ž')
call s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ',' ','Ž')
" \` \' \^ \" \~ \. \= \c \H \k \r \u \v
call s:Accents('a','à','á','â','ä','ã','ȧ','ā',' ',' ','ą','å','ă','ǎ')
call s:Accents('A','À','Á','Â','Ä','Ã','Ȧ','Ā',' ',' ','Ą','Å','Ă','Ǎ')
call s:Accents('c',' ','ć','ĉ',' ',' ','ċ',' ','ç',' ',' ',' ',' ','č')
call s:Accents('C',' ','Ć','Ĉ',' ',' ','Ċ',' ','Ç',' ',' ',' ',' ','Č')
call s:Accents('d',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ď')
call s:Accents('D',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ď')
call s:Accents('e','è','é','ê','ë','ẽ','ė','ē','ȩ',' ','ę',' ','ĕ','ě')
call s:Accents('E','È','É','Ê','Ë','Ẽ','Ė','Ē','Ȩ',' ','Ę',' ','Ĕ','Ě')
call s:Accents('g',' ','ǵ','ĝ',' ',' ','ġ',' ','ģ',' ',' ',' ','ğ','ǧ')
call s:Accents('G',' ','Ǵ','Ĝ',' ',' ','Ġ',' ','Ģ',' ',' ',' ','Ğ','Ǧ')
call s:Accents('h',' ',' ','ĥ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ȟ')
call s:Accents('H',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','Ȟ')
call s:Accents('i','ì','í','î','ï','ĩ','į','ī',' ',' ','į',' ','ĭ','ǐ')
call s:Accents('I','Ì','Í','Î','Ï','Ĩ','İ','Ī',' ',' ','Į',' ','Ĭ','Ǐ')
call s:Accents('J',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','ǰ')
call s:Accents('k',' ',' ',' ',' ',' ',' ',' ','ķ',' ',' ',' ',' ','ǩ')
call s:Accents('K',' ',' ',' ',' ',' ',' ',' ','Ķ',' ',' ',' ',' ','Ǩ')
call s:Accents('l',' ','ĺ','ľ',' ',' ',' ',' ','ļ',' ',' ',' ',' ','ľ')
call s:Accents('L',' ','Ĺ','Ľ',' ',' ',' ',' ','Ļ',' ',' ',' ',' ','Ľ')
call s:Accents('n',' ','ń',' ',' ','ñ',' ',' ','ņ',' ',' ',' ',' ','ň')
call s:Accents('N',' ','Ń',' ',' ','Ñ',' ',' ','Ņ',' ',' ',' ',' ','Ň')
call s:Accents('o','ò','ó','ô','ö','õ','ȯ','ō',' ','ő','ǫ',' ','ŏ','ǒ')
call s:Accents('O','Ò','Ó','Ô','Ö','Õ','Ȯ','Ō',' ','Ő','Ǫ',' ','Ŏ','Ǒ')
call s:Accents('r',' ','ŕ',' ',' ',' ',' ',' ','ŗ',' ',' ',' ',' ','ř')
call s:Accents('R',' ','Ŕ',' ',' ',' ',' ',' ','Ŗ',' ',' ',' ',' ','Ř')
call s:Accents('s',' ','ś','ŝ',' ',' ',' ',' ','ş',' ','ȿ',' ',' ','š')
call s:Accents('S',' ','Ś','Ŝ',' ',' ',' ',' ','Ş',' ',' ',' ',' ','Š')
call s:Accents('t',' ',' ',' ',' ',' ',' ',' ','ţ',' ',' ',' ',' ','ť')
call s:Accents('T',' ',' ',' ',' ',' ',' ',' ','Ţ',' ',' ',' ',' ','Ť')
call s:Accents('u','ù','ú','û','ü','ũ',' ','ū',' ','ű','ų','ů','ŭ','ǔ')
call s:Accents('U','Ù','Ú','Û','Ü','Ũ',' ','Ū',' ','Ű','Ų','Ů','Ŭ','Ǔ')
call s:Accents('w',' ',' ','ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('W',' ',' ','Ŵ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('y','ỳ','ý','ŷ','ÿ','ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('Y','Ỳ','Ý','Ŷ','Ÿ','Ỹ',' ',' ',' ',' ',' ',' ',' ',' ')
call s:Accents('z',' ','ź',' ',' ',' ','ż',' ',' ',' ',' ',' ',' ','ž')
call s:Accents('Z',' ','Ź',' ',' ',' ','Ż',' ',' ',' ',' ',' ',' ','Ž')
call s:Accents('\\i','ì','í','î','ï','ĩ','į',' ',' ',' ',' ',' ','ĭ',' ')
" \` \' \^ \" \~ \. \= \c \H \k \r \u \v
delfun s:Accents
@@ -1252,7 +1261,7 @@ endif
if did_tex_syntax_inits == 1
let did_tex_syntax_inits= 2
" TeX highlighting groups which should share similar highlighting
if !exists("s:tex_no_error")
if !exists("g:tex_no_error")
if !exists("g:tex_no_math")
HiLink texBadMath texError
HiLink texMathDelimBad texError

View File

@@ -1,6 +1,6 @@
" Vim syntax file
" Language: Vroom (vim testing and executable documentation)
" Maintainer: David Barnett (https://github.com/google/vim-ft.vroom)
" Maintainer: David Barnett (https://github.com/google/vim-ft-vroom)
" Last Change: 2014 Jul 23
" For version 5.x: Clear all syntax items.

View File

@@ -121,7 +121,7 @@ NOTA: A medida que vaya avanzando en este tutor no intente memorizar,
h (izquierda) j (abajo) k (arriba) l (derecha)
2. Para acceder a Vim (desde el símbolo del sistema %) escriba:
vin FILENAME <INTRO>
vim FILENAME <INTRO>
3. Para salir de Vim escriba: <ESC> :q! <INTRO> para eliminar todos
los cambios.

View File

@@ -1029,10 +1029,10 @@ NOTE : Le compl
des Mines du Colorado et reprend des id<69>es fournies par Charles Smith,
Universit<69> d'<27>tat du Colorado. E-mail : bware@mines.colorado.edu.
Modifi<66> pour Vim par Bram Moolenar.
Modifi<66> pour Vim par Bram Moolenaar.
Traduit en fran<61>ais par Adrien Beau, en avril 2001.
Derni<6E>res mises <20> jour par Dominique Pell<6C>.
E-mail : dominique.pelle@gmail.com
Last Change : 2013 May 10
Last Change : 2014 Aug 18
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -1029,10 +1029,10 @@ NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez
des Mines du Colorado et reprend des idées fournies par Charles Smith,
Université d'État du Colorado. E-mail : bware@mines.colorado.edu.
Modifié pour Vim par Bram Moolenar.
Modifié pour Vim par Bram Moolenaar.
Traduit en français par Adrien Beau, en avril 2001.
Dernières mises à jour par Dominique Pellé.
E-mail : dominique.pelle@gmail.com
Last Change : 2013 May 10
Last Change : 2014 Aug 18
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -55,8 +55,7 @@ NOTE:
2. <20><><EFBFBD>Τ<CEA4>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD>: :q! <ENTER>
<20><><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD>Խ<EFBFBD><D4BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD>¸<EFBFBD><C2B8><EFBFBD><EFBFBD><EFBFBD>˥<EFBFBD><CBA5>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
3. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץȤ<EFBFBD><EFBFBD>ФƤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD>ȥꥢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>٤ˤ˥<EFBFBD><EFBFBD>ޥ<EFBFBD><EFBFBD><EFBFBD>
<20>򥿥<EFBFBD><F2A5BFA5>פ<EFBFBD><D7A4>ޤ<EFBFBD><DEA4><EFBFBD>
3. <20><><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD>ȥꥢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>٤Υ<EFBFBD><EFBFBD>ޥ<EFBFBD><EFBFBD>ɤ<EFBFBD><EFBFBD>¹Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
<20><><EFBFBD>Υ<EFBFBD><CEA5>ޥ<EFBFBD><DEA5>ɤ<EFBFBD>: vimtutor <ENTER>
4. <20><><EFBFBD><EFBFBD><EFBFBD>ޤǤΥ<C7A4><CEA5>ƥåפ<C3A5><D7A4>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>С<EFBFBD><D0A1><EFBFBD><EFBFBD>ƥå<C6A5> 1 <20><><EFBFBD><EFBFBD> 3 <20>ޤǤ<DEA4><C7A4><EFBFBD>
@@ -904,7 +903,7 @@ NOTE: 1
** CTRL-D <20><> <TAB> <20>ǥ<EFBFBD><C7A5>ޥ<EFBFBD><DEA5>ɥ饤<C9A5><E9A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B4B0><EFBFBD><EFBFBD> **
1. <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><EFBFBD><EFBFBD>ɤǤʤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD>ǧ<EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD>: :set nocp
1. <20>ߴ<EFBFBD><EFBFBD><EFBFBD>ɤǤʤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD>ǧ<EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD>: :set nocp
2. <20><><EFBFBD>ߤΥǥ<CEA5><C7A5><EFBFBD>ȥ<EFBFBD><C8A5>˺ߤ<CBBA><DFA4>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :!ls <20><> :!dir <20>dz<EFBFBD>ǧ<EFBFBD><C7A7><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
@@ -949,7 +948,7 @@ NOTE:
<20><><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD> Vim <20>Υ<EFBFBD><CEA5><EFBFBD>ȥꥢ<C8A5><EAA5A2><EFBFBD>򽪤<EFBFBD><F2BDAAA4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ñ<EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⽼ʬ<E2BDBC><CAAC>
<20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD><EFBFBD>ˤȡ<CBA4>Vim <20>λ<EFBFBD><CEBB>ij<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τߤ<CEA4><DFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>
Vim <20>ˤϤ<CBA4><CFA4><EFBFBD><EFBFBD><EFBFBD>¿<EFBFBD><C2BF><EFBFBD>Υ<EFBFBD><CEA5>ޥ<EFBFBD><DEA5>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EAA1A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȤϤǤ<CFA4><C7A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>
<20>ʹߤϥ桼<CFA5><E6A1BC><EFBFBD>ޥ˥奢<CBA5><E5A5A2><EFBFBD>򻲾Ȥ<F2BBB2BE><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ":help user-manual"
<20>ʹߤϥ桼<CFA5><E6A1BC><EFBFBD><EFBFBD><EFBFBD>ޥ˥奢<EFBFBD><EFBFBD><EFBFBD>򻲾Ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ":help user-manual"
<20><><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8>γؽ<CEB3><D8BD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
Vim - Vi Improved - by Steve Oualline

View File

@@ -55,8 +55,7 @@ NOTE:
2. <20><><EFBFBD>̂悤<CC82>Ƀ^<5E>C<EFBFBD>v: :q! <ENTER>
<20><><EFBFBD><EFBFBD><EFBFBD>ɂ<EFBFBD><C982><EFBFBD><EFBFBD>ҏW<D28F><57><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>e<EFBFBD><65><EFBFBD>ۑ<EFBFBD><DB91><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɃG<C983>f<EFBFBD>B<EFBFBD>^<5E><><EFBFBD>I<EFBFBD><49><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B
3. <20>V<EFBFBD>F<EFBFBD><EFBFBD><EFBFBD>v<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>v<EFBFBD>g<EFBFBD><EFBFBD><EFBFBD>o<EFBFBD>Ă<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>̃`<60><><EFBFBD>[<5B>g<EFBFBD><67><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>n<EFBFBD>߂<EFBFBD><EFBFBD>ׂɂɃR<EFBFBD>}<7D><><EFBFBD>h
<20><><EFBFBD>^<5E>C<EFBFBD>v<EFBFBD><76><EFBFBD>܂<EFBFBD><DC82>B
3. <20><><EFBFBD>̃`<60><><EFBFBD>[<5B>g<EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n<EFBFBD>߂<EFBFBD><EFBFBD>ׂ̃R<EFBFBD>}<7D><><EFBFBD>h<EFBFBD><68><EFBFBD><EFBFBD><EFBFBD>s<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƁA<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɖ߂<EFBFBD><EFBFBD>܂<EFBFBD><EFBFBD>B
<20><><EFBFBD>̃R<CC83>}<7D><><EFBFBD>h<EFBFBD><68>: vimtutor <ENTER>
4. <20><><EFBFBD><EFBFBD><EFBFBD>܂ł̃X<CC83>e<EFBFBD>b<EFBFBD>v<EFBFBD><76><EFBFBD>o<EFBFBD><6F><EFBFBD><EFBFBD><EFBFBD>M<EFBFBD><4D><EFBFBD>‚<EFBFBD><C282><EFBFBD><EFBFBD>Ȃ<EFBFBD><C882>΁A<CE81>X<EFBFBD>e<EFBFBD>b<EFBFBD>v 1 <20><><EFBFBD><EFBFBD> 3 <20>܂ł<DC82><C582><EFBFBD>
@@ -904,7 +903,7 @@ NOTE: 1
** CTRL-D <20><> <TAB> <20>ŃR<C583>}<7D><><EFBFBD>h<EFBFBD><68><EFBFBD>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E28AAE><EFBFBD><EFBFBD> **
1. <20>R<EFBFBD><EFBFBD><EFBFBD>p<EFBFBD>`<EFBFBD><EFBFBD><EFBFBD>[<5B>h<EFBFBD>łȂ<C582><C882><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>m<EFBFBD>F<EFBFBD><46><EFBFBD>܂<EFBFBD>: :set nocp
1. <20>݊<EFBFBD><EFBFBD><EFBFBD><EFBFBD>[<5B>h<EFBFBD>łȂ<C582><C882><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>m<EFBFBD>F<EFBFBD><46><EFBFBD>܂<EFBFBD>: :set nocp
2. <20><><EFBFBD>݂̃f<CC83>B<EFBFBD><42><EFBFBD>N<EFBFBD>g<EFBFBD><67><EFBFBD>ɍ݂<C98D><DD82>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD> :!ls <20><> :!dir <20>Ŋm<C58A>F<EFBFBD><46><EFBFBD>܂<EFBFBD><DC82>B
@@ -949,7 +948,7 @@ NOTE:
<20><><EFBFBD><EFBFBD><EFBFBD>ɂ<EFBFBD> Vim <20>̃`<60><><EFBFBD>[<5B>g<EFBFBD><67><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>I<EFBFBD><49><EFBFBD><EFBFBD><EFBFBD>܂<EFBFBD><DC82>B<EFBFBD>G<EFBFBD>f<EFBFBD>B<EFBFBD>^<5E><><EFBFBD>ȒP<C892>ɁA<C981><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[<5B><><EFBFBD><EFBFBD>
<20>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>ł<EFBFBD><C582><EFBFBD><EFBFBD><EFBFBD>ɂƁAVim <20>̎<EFBFBD><CC8E>ŠT<C28A>O<EFBFBD>̗v<CC97>_<EFBFBD>݂̂<CC82><DD82>`<60><><EFBFBD><EFBFBD>Ƃ<EFBFBD><C682>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
Vim <20>ɂ͂<C982><CD82><EFBFBD><EFBFBD>ɑ<EFBFBD><C991><EFBFBD><EFBFBD>̃R<CC83>}<7D><><EFBFBD>h<EFBFBD><68><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>őS<C591>Ă<EFBFBD><C482><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƃ͂ł<CD82><C582>܂<EFBFBD><DC82><EFBFBD><EFBFBD>B
<20>ȍ~<7E>̓<EFBFBD><CD83>[<5B>U<EFBFBD>}<7D>j<EFBFBD><6A><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>Q<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ":help user-manual"
<20>ȍ~<7E>̓<EFBFBD><CD83>[<5B>U<EFBFBD>[<5B>}<7D>j<EFBFBD><6A><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>Q<EFBFBD>Ƃ<EFBFBD><C682><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ":help user-manual"
<20><><EFBFBD><EFBFBD><EFBFBD>Ȍ<EFBFBD><C88C>̊w<CC8A>K<EFBFBD>̂<EFBFBD><CC82>߂ɁA<C981><41><EFBFBD>̖{<7B>𐄑E<F0908491><45><EFBFBD>܂<EFBFBD><DC82>B
Vim - Vi Improved - by Steve Oualline

View File

@@ -55,8 +55,7 @@ NOTE: カーソルキーでも移動できます。しかし hjkl に一度慣
2. 次のようにタイプ: :q! <ENTER>
これにより編集した内容を保存せずにエディタが終了します。
3. シェルプロンプトが出てきたら、このチュートリアルを始める為ににコマンド
をタイプします。
3. このチュートリアルを始める為コマンドを実行すると、ここに戻れます。
そのコマンドは: vimtutor <ENTER>
4. これまでのステップを覚え自信がついたならば、ステップ 1 から 3 までを実
@@ -904,7 +903,7 @@ NOTE: 1つの検索コマンドだけ大文字小文字の区別をやめたい
** CTRL-D と <TAB> でコマンドラインを補完する **
1. コンパチモードでないことを確認します: :set nocp
1. 互換モードでないことを確認します: :set nocp
2. 現在のディレクトリに在るファイルを :!ls か :!dir で確認します。
@@ -949,7 +948,7 @@ NOTE: 補完は多くのコマンドで動作します。そして CTRL-D と <T
これにて Vim のチュートリアルを終わります。エディタを簡単に、しかも充分に
使うことができるようにと、Vim の持つ概念の要点のみを伝えようとしました。
Vim にはさらに多くのコマンドがあり、ここで全てを説明することはできません。
以降はユーザマニュアルを参照ください: ":help user-manual"
以降はユーザマニュアルを参照ください: ":help user-manual"
これ以後の学習のために、次の本を推薦します。
Vim - Vi Improved - by Steve Oualline

View File

@@ -572,7 +572,7 @@ Nota: Isso
digite :#,#s/velho/novo/g onde #,# s<>o os n<>meros das duas linhas.
Digite :%s/velho/novo/g para mudar todas as ocorr<72>ncias no arquivo
inteiro.
Digite :%/velho/novo/gc para mudar todas as ocorr<72>ncia no arquivo
Digite :%s/velho/novo/gc para mudar todas as ocorr<72>ncia no arquivo
inteiro, com a op<6F><70>o de confirmar cada
substitui<75><69>o.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -971,7 +971,7 @@ NOTA: A completa
Colorado School of Mines, usando id<69>ias fornecidas por Charles Smith,
Colorado State University. E-mail: bware@mines.colorado.edu.
Modificado para o Vim por Bram Moolenar.
Modificado para o Vim por Bram Moolenaar.
Vers<72>o 1.4 traduzida para o portugu<67>s por Marcelo Drudi Miranda, Escola
Polit<69>cnica da Universidade de S<>o Paulo.

View File

@@ -572,7 +572,7 @@ Nota: Isso é muito útil para corrigir um programa com parênteses não-casados
digite :#,#s/velho/novo/g onde #,# são os números das duas linhas.
Digite :%s/velho/novo/g para mudar todas as ocorrências no arquivo
inteiro.
Digite :%/velho/novo/gc para mudar todas as ocorrência no arquivo
Digite :%s/velho/novo/gc para mudar todas as ocorrência no arquivo
inteiro, com a opção de confirmar cada
substituição.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -971,7 +971,7 @@ NOTA: A completação funciona com muitos comandos. Basta pressionar CTRL-D e
Colorado School of Mines, usando idéias fornecidas por Charles Smith,
Colorado State University. E-mail: bware@mines.colorado.edu.
Modificado para o Vim por Bram Moolenar.
Modificado para o Vim por Bram Moolenaar.
Versão 1.4 traduzida para o português por Marcelo Drudi Miranda, Escola
Politécnica da Universidade de São Paulo.

View File

@@ -55,8 +55,8 @@ NOTE: The cursor keys should also work. But using hjkl you will be able to
2. Type: :q! <ENTER>.
This exits the editor, DISCARDING any changes you have made.
3. When you see the shell prompt, type the command that got you into this
tutor. That would be: vimtutor <ENTER>
3. Get back here by executing the command that got you into this tutor. That
might be: vimtutor <ENTER>
4. If you have these steps memorized and are confident, execute steps
1 through 3 to exit and re-enter the editor.

View File

@@ -843,10 +843,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
<20>P<EFBFBD><50> xuandong@sh163.net <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>N<EFBFBD><4E><EFBFBD>B<EFBFBD><42><EFBFBD>O<EFBFBD>r<EFBFBD>ץ<EFBFBD><D7A5>C
2002<30>~03<30><33>18<31><38> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <linuxrat@gnuchina.org>
<20>ھ<EFBFBD>Bram Molenaar<61><72><EFBFBD>ͦb2002<30>~03<30><33>16<31><EFBFBD>ӫH<D3AB>n<EFBFBD>D<EFBFBD>A<EFBFBD>Nvimtutor1.4<EFBFBD><EFBFBD>Ķ
<20>ھ<EFBFBD>Bram Moolenaar<EFBFBD><EFBFBD><EFBFBD>ͦb2002<EFBFBD>~03<30><33>16<31><EFBFBD>ӫH<D3AB>n<EFBFBD>D<EFBFBD>A<EFBFBD>Nvimtutor1.4<EFBFBD><EFBFBD>Ķ
<20><><EFBFBD>ɯŨ<C9AF>vimtutor1.5<EFBFBD>C
2001<30>~11<31><31>15<31><35> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <linuxrat@gnuchina.org>
<20>Nvimtutor1.4<EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>浹Bram Molenaar<61>MSven Guckes<65>C
<20>Nvimtutor1.4<EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>浹Bram Moolenaar<EFBFBD>MSven Guckes<65>C
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -988,9 +988,9 @@
<20><>л xuandong@sh163.net <20><>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2002<30><32>03<30><33>18<31><38> <20><><EFBFBD><EFBFBD>̩ <linuxrat@gnuchina.org>
<20><><EFBFBD><EFBFBD>Bram Molenaar<61><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2002<30><32>03<30><33>16<31>յ<EFBFBD><D5B5><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>󣬽<EFBFBD>vimtutor1.4<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD>Bram Moolenaar<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2002<EFBFBD><EFBFBD>03<EFBFBD><EFBFBD>16<EFBFBD>յ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>󣬽<EFBFBD>vimtutor1.4<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>vimtutor1.5<EFBFBD><EFBFBD>
2001<30><31>11<31><31>15<31><35> <20><><EFBFBD><EFBFBD>̩ <linuxrat@gnuchina.org>
<20><>vimtutor1.4<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Bram Molenaar<61><72>Sven Guckes<65><73>
<20><>vimtutor1.4<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Bram Moolenaar<EFBFBD><EFBFBD>Sven Guckes<65><73>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -843,10 +843,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
感謝 xuandong@sh163.net 的指正,將兩處錯別字修正。
2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
根據Bram Molenaar先生在2002年03月16日的來信要求將vimtutor1.4中譯
根據Bram Moolenaar先生在2002年03月16日的來信要求將vimtutor1.4中譯
版升級到vimtutor1.5。
2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
將vimtutor1.4中譯版提交給Bram Molenaar和Sven Guckes。
將vimtutor1.4中譯版提交給Bram Moolenaar和Sven Guckes。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -988,9 +988,9 @@
感谢 xuandong@sh163.net 的指正,将两处错别字修正。
2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
根据Bram Molenaar先生在2002年03月16日的来信要求将vimtutor1.4中译
根据Bram Moolenaar先生在2002年03月16日的来信要求将vimtutor1.4中译
版升级到vimtutor1.5。
2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
将vimtutor1.4中译版提交给Bram Molenaar和Sven Guckes。
将vimtutor1.4中译版提交给Bram Moolenaar和Sven Guckes。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -843,10 +843,10 @@ Open up a line above this by typing Shift-O while the cursor is on this line.
感謝 xuandong@sh163.net 的指正,將兩處錯別字修正。
2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
根據Bram Molenaar先生在2002年03月16日的來信要求將vimtutor1.4中譯
根據Bram Moolenaar先生在2002年03月16日的來信要求將vimtutor1.4中譯
版升級到vimtutor1.5。
2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
將vimtutor1.4中譯版提交給Bram Molenaar和Sven Guckes。
將vimtutor1.4中譯版提交給Bram Moolenaar和Sven Guckes。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -192,6 +192,30 @@ To set the environment execute the msvc2010.bat script. You can then build
Vim with Make_mvc.mak.
Targeting Windows XP with new MSVC *new-msvc-windows-xp*
----------------------------------
Beginning with Visual C++ 2010, Microsoft changed the behavior of LINK.EXE
so that it targets Windows 6.0 (Vista) by default. In order to override
this, the target Windows version number needs to be passed to LINK like
follows:
LINK ... /subsystem:console,5.01
Make_mvc.mak now supports a macro SUBSYSTEM_VER to pass the Windows version.
Use lines like follows to target Windows XP (assuming using Visual C++ 2012
under 64-bit Windows):
set WinSdk71=%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.1A
set SDK_INCLUDE_DIR=%WinSdk71%\Include
set INCLUDE=%WinSdk71%\Include;%INCLUDE%
set LIB=%WinSdk71%\Lib;%LIB%
set PATH=%WinSdk71%\Bin;%PATH%
set CL=/D_USING_V110_SDK71_
nmake -f Make_mvc.mak ... WINVER=0x0501 SUBSYSTEM_VER=5.01
The following Visual C++ team blog can serve as a reference page:
http://blogs.msdn.com/b/vcblog/archive/2012/10/08/windows-xp-targeting-with-c-in-visual-studio-2012.aspx
2. MinGW
========

View File

@@ -54,6 +54,8 @@ EXE_dependencies = \
blowfish.obj \
buffer.obj \
charset.obj \
crypt.obj \
crypt_zip.obj \
diff.obj \
digraph.obj \
edit.obj \

View File

@@ -580,6 +580,8 @@ vimobj = \
$(OBJDIR)\blowfish.obj \
$(OBJDIR)\buffer.obj \
$(OBJDIR)\charset.obj \
$(OBJDIR)\crypt.obj \
$(OBJDIR)\crypt_zip.obj \
$(OBJDIR)\diff.obj \
$(OBJDIR)\digraph.obj \
$(OBJDIR)\edit.obj \

View File

@@ -1,6 +1,7 @@
#
# Makefile for VIM on Win32, using Cygnus gcc
# Last updated by Dan Sharp. Last Change: 2013 Dec 11
# Updated by Dan Sharp.
# Last Change: 2014 Aug 10
#
# Also read INSTALLpc.txt!
#
@@ -8,6 +9,7 @@
# Cygwin application use the Makefile (just like on Unix).
#
# GUI no or yes: set to yes if you want the GUI version (yes)
# DIRECTX no or yes: set to yes if you want use DirectWrite (no)
# PERL define to path to Perl dir to get Perl support (not defined)
# PERL_VER define to version of Perl being used (56)
# DYNAMIC_PERL no or yes: set to yes to load the Perl DLL dynamically (yes)
@@ -88,6 +90,10 @@ ifndef ARCH
ARCH = i386
endif
ifndef DIRECTX
DIRECTX = no
endif
ifndef WINVER
WINVER = 0x0500
endif
@@ -469,6 +475,15 @@ endif
endif
##############################
ifeq (yes, $(DIRECTX))
# Only allow DIRECTX for a GUI build.
DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
EXTRA_OBJS += $(OUTDIR)/gui_dwrite.o
EXTRA_LIBS += -ld2d1 -ldwrite
USE_STDCPLUS = yes
endif
##############################
ifdef XPM
# Only allow XPM for a GUI build.
@@ -495,11 +510,7 @@ ifeq (yes, $(OLE))
DEFINES += -DFEAT_OLE
EXTRA_OBJS += $(OUTDIR)/if_ole.o
EXTRA_LIBS += -loleaut32
ifeq (yes, $(STATIC_STDCPLUS))
EXTRA_LIBS += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
else
EXTRA_LIBS += -lstdc++
endif
USE_STDCPLUS = yes
endif
##############################
@@ -513,6 +524,15 @@ MKDIR = mkdir
DIRSLASH = \\
endif
##############################
ifeq (yes, $(USE_STDCPLUS))
ifeq (yes, $(STATIC_STDCPLUS))
EXTRA_LIBS += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
else
EXTRA_LIBS += -lstdc++
endif
endif
#>>>>> end of choices
###########################################################################
@@ -527,6 +547,8 @@ OBJ = \
$(OUTDIR)/blowfish.o \
$(OUTDIR)/buffer.o \
$(OUTDIR)/charset.o \
$(OUTDIR)/crypt.o \
$(OUTDIR)/crypt_zip.o \
$(OUTDIR)/diff.o \
$(OUTDIR)/digraph.o \
$(OUTDIR)/edit.o \
@@ -643,6 +665,9 @@ $(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
$(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL)
$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
$(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o

View File

@@ -29,6 +29,8 @@ SRC = \
blowfish.c \
buffer.c \
charset.c \
crypt.c \
crypt_zip.c \
diff.c \
digraph.c \
edit.c \
@@ -75,6 +77,8 @@ SRC = \
OBJ = o/blowfish.o \
o/buffer.o \
o/charset.o \
o/crypt.o \
o/crypt_zip.o \
o/diff.o \
o/digraph.o \
o/edit.o \
@@ -143,6 +147,10 @@ o/buffer.o: buffer.c $(SYMS)
o/charset.o: charset.c $(SYMS)
o/crypt.o: crypt.c $(SYMS)
o/crypt_zip.o: crypt_zip.c $(SYMS)
o/diff.o: diff.c $(SYMS)
o/digraph.o: digraph.c $(SYMS)

View File

@@ -22,6 +22,8 @@ OBJ = \
obj/blowfish.o \
obj/buffer.o \
obj/charset.o \
obj/crypt.o \
obj/crypt_zip.o \
obj/diff.o \
obj/digraph.o \
obj/edit.o \

View File

@@ -213,6 +213,8 @@ LINK32_OBJS= \
"$(INTDIR)/blowfish.obj" \
"$(INTDIR)/buffer.obj" \
"$(INTDIR)/charset.obj" \
"$(INTDIR)/crypt.obj" \
"$(INTDIR)/crypt_zip.obj" \
"$(INTDIR)/diff.obj" \
"$(INTDIR)/digraph.obj" \
"$(INTDIR)/edit.obj" \
@@ -339,6 +341,14 @@ SOURCE=.\charset.c
# End Source File
# Begin Source File
SOURCE=.\crypt.c
# End Source File
# Begin Source File
SOURCE=.\crypt_zip.c
# End Source File
# Begin Source File
SOURCE=.\diff.c
# End Source File
# Begin Source File

View File

@@ -37,6 +37,8 @@ DEL = $(SHELL) -c rm -f
SRC = blowfish.c \
buffer.c \
charset.c \
crypt.c \
crypt_zip.c \
diff.c \
digraph.c \
edit.c \
@@ -85,6 +87,8 @@ INCL = vim.h feature.h keymap.h macros.h ascii.h term.h structs.h os_amiga.h
OBJ = obj/blowfish.o \
obj/buffer.o \
obj/charset.o \
obj/crypt.o \
obj/crypt_zip.o \
obj/diff.o \
obj/digraph.o \
obj/edit.o \
@@ -131,6 +135,8 @@ OBJ = obj/blowfish.o \
PRO = proto/blowfish.pro \
proto/buffer.pro \
proto/charset.pro \
proto/crypt.pro \
proto/crypt_zip.pro \
proto/diff.pro \
proto/digraph.pro \
proto/edit.pro \
@@ -227,6 +233,12 @@ obj/buffer.o: buffer.c
obj/charset.o: charset.c
$(CCSYM) $@ charset.c
obj/crypt.o: crypt.c
$(CCSYM) $@ crypt.c
obj/crypt_zip.o: crypt_zip.c
$(CCSYM) $@ crypt_zip.c
obj/diff.o: diff.c
$(CCSYM) $@ diff.c

View File

@@ -31,6 +31,8 @@ DEBUG=no
OPTIMIZE=MAXSPEED
# set to yes to make gvim, no for vim
GUI=yes
# set to yes if you want to use DirectWrite (DirectX)
DIRECTX=no
# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
# Set to TINY to make minimal version (few features).
FEATURES=BIG
@@ -456,6 +458,14 @@ endif
endif
endif
# DirectWrite (DirectX)
ifeq ($(DIRECTX),yes)
# Only allow DirectWrite for a GUI build.
ifeq (yes, $(GUI))
DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
endif
endif
# Only allow XPM for a GUI build.
ifeq (yes, $(GUI))
@@ -507,6 +517,8 @@ OBJ = \
$(OUTDIR)/blowfish.o \
$(OUTDIR)/buffer.o \
$(OUTDIR)/charset.o \
$(OUTDIR)/crypt.o \
$(OUTDIR)/crypt_zip.o \
$(OUTDIR)/diff.o \
$(OUTDIR)/digraph.o \
$(OUTDIR)/edit.o \
@@ -593,6 +605,14 @@ OBJ += $(OUTDIR)/netbeans.o
LIB += -lwsock32
endif
endif
ifeq ($(DIRECTX),yes)
# Only allow DIRECTX for a GUI build.
ifeq (yes, $(GUI))
OBJ += $(OUTDIR)/gui_dwrite.o
LIB += -ld2d1 -ldwrite
USE_STDCPLUS = yes
endif
endif
ifdef XPM
# Only allow XPM for a GUI build.
ifeq (yes, $(GUI))
@@ -650,11 +670,7 @@ endif
ifeq (yes, $(OLE))
LIB += -loleaut32
OBJ += $(OUTDIR)/if_ole.o
ifeq (yes, $(STATIC_STDCPLUS))
LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
else
LIB += -lstdc++
endif
USE_STDCPLUS = yes
endif
ifeq (yes, $(MBYTE))
@@ -678,6 +694,14 @@ endif
DEFINES+=-DDYNAMIC_ICONV
endif
ifeq (yes, $(USE_STDCPLUS))
ifeq (yes, $(STATIC_STDCPLUS))
LIB += -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
else
LIB += -lstdc++
endif
endif
all: $(TARGET) vimrun.exe xxd/xxd.exe install.exe uninstal.exe GvimExt/gvimext.dll
vimrun.exe: vimrun.c
@@ -751,6 +775,9 @@ $(OUTDIR)/ex_eval.o: ex_eval.c $(INCL) ex_cmds.h
$(OUTDIR)/gui_w32.o: gui_w32.c gui_w48.c $(INCL)
$(CC) -c $(CFLAGS) gui_w32.c -o $(OUTDIR)/gui_w32.o
$(OUTDIR)/gui_dwrite.o: gui_dwrite.cpp $(INCL) gui_dwrite.h
$(CC) -c $(CFLAGS) gui_dwrite.cpp -o $(OUTDIR)/gui_dwrite.o
$(OUTDIR)/if_cscope.o: if_cscope.c $(INCL) if_cscope.h
$(CC) -c $(CFLAGS) if_cscope.c -o $(OUTDIR)/if_cscope.o

View File

@@ -27,6 +27,8 @@ RM = rm
SRC = blowfish.c \
buffer.c \
charset.c \
crypt.c \
crypt_zip.c \
diff.c \
digraph.c \
edit.c \

View File

@@ -24,6 +24,9 @@
#
# GUI interface: GUI=yes (default is no)
#
# GUI with DirectWrite(DirectX): DIRECTX=yes
# (default is no, requires GUI=yes)
#
# OLE interface: OLE=yes (usually with GUI=yes)
#
# Multibyte support: MBYTE=yes (default is no)
@@ -168,6 +171,9 @@ OBJDIR = .\ObjG
!else
OBJDIR = .\ObjC
!endif
!if "$(DIRECTX)" == "yes"
OBJDIR = $(OBJDIR)X
!endif
!if "$(OLE)" == "yes"
OBJDIR = $(OBJDIR)O
!endif
@@ -292,6 +298,13 @@ NBDEBUG_SRC = nbdebug.c
NETBEANS_LIB = WSock32.lib
!endif
# DirectWrite(DirectX)
!if "$(DIRECTX)" == "yes"
DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
DIRECTX_INCL = gui_dwrite.h
DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj
!endif
!ifndef XPM
# XPM is not set, use the included xpm files, depending on the architecture.
!if "$(CPU)" == "AMD64"
@@ -534,6 +547,8 @@ OBJ = \
$(OUTDIR)\blowfish.obj \
$(OUTDIR)\buffer.obj \
$(OUTDIR)\charset.obj \
$(OUTDIR)\crypt.obj \
$(OUTDIR)\crypt_zip.obj \
$(OUTDIR)\diff.obj \
$(OUTDIR)\digraph.obj \
$(OUTDIR)\edit.obj \
@@ -642,6 +657,16 @@ GUI_LIB = \
SUBSYSTEM = console
!endif
!if "$(SUBSYSTEM_VER)" != ""
SUBSYSTEM = $(SUBSYSTEM),$(SUBSYSTEM_VER)
!endif
!if "$(GUI)" == "yes" && "$(DIRECTX)" == "yes"
CFLAGS = $(CFLAGS) $(DIRECTX_DEFS)
GUI_INCL = $(GUI_INCL) $(DIRECTX_INCL)
GUI_OBJ = $(GUI_OBJ) $(DIRECTX_OBJ)
!endif
# iconv.dll library (dynamically loaded)
!ifndef ICONV
ICONV = yes
@@ -1073,6 +1098,10 @@ $(OUTDIR)/buffer.obj: $(OUTDIR) buffer.c $(INCL)
$(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
$(OUTDIR)/crypt.obj: $(OUTDIR) crypt.c $(INCL)
$(OUTDIR)/crypt_zip.obj: $(OUTDIR) crypt_zip.c $(INCL)
$(OUTDIR)/diff.obj: $(OUTDIR) diff.c $(INCL)
$(OUTDIR)/digraph.obj: $(OUTDIR) digraph.c $(INCL)
@@ -1107,6 +1136,8 @@ $(OUTDIR)/gui_beval.obj: $(OUTDIR) gui_beval.c $(INCL) $(GUI_INCL)
$(OUTDIR)/gui_w32.obj: $(OUTDIR) gui_w32.c gui_w48.c $(INCL) $(GUI_INCL)
$(OUTDIR)/gui_dwrite.obj: $(OUTDIR) gui_dwrite.cpp $(INCL) $(GUI_INCL)
$(OUTDIR)/if_cscope.obj: $(OUTDIR) if_cscope.c $(INCL)
$(OUTDIR)/if_lua.obj: $(OUTDIR) if_lua.c $(INCL)
@@ -1257,6 +1288,8 @@ proto.h: \
proto/blowfish.pro \
proto/buffer.pro \
proto/charset.pro \
proto/crypt.pro \
proto/crypt_zip.pro \
proto/diff.pro \
proto/digraph.pro \
proto/edit.pro \

View File

@@ -42,6 +42,8 @@ OBJ = \
blowfish.o \
buffer.o \
charset.o \
crypt.o \
crypt_zip.o \
diff.o \
digraph.o \
edit.o \
@@ -117,6 +119,8 @@ os_unix.o: os_unix.c $(INCL)
blowfish.o: blowfish.c $(INCL)
buffer.o: buffer.c $(INCL)
charset.o: charset.c $(INCL)
crypt.o: crypt.c $(INCL)
crypt_zip.o: crypt_zip.c $(INCL)
diff.o: diff.c $(INCL)
digraph.o: digraph.c $(INCL)
edit.o: edit.c $(INCL)

View File

@@ -92,6 +92,8 @@ SRC = \
blowfish.c \
buffer.c \
charset.c \
crypt.c \
crypt_zip.c \
diff.c \
digraph.c \
edit.c \
@@ -139,6 +141,8 @@ OBJ = \
blowfish.o \
buffer.o \
charset.o \
crypt.o \
crypt_zip.o \
diff.o \
digraph.o \
edit.o \
@@ -186,6 +190,8 @@ PRO = \
proto/blowfish.pro \
proto/buffer.pro \
proto/charset.pro \
proto/crypt.pro \
proto/crypt_zip.pro \
proto/diff.pro \
proto/digraph.pro \
proto/edit.pro \
@@ -290,6 +296,10 @@ buffer.o: buffer.c
proto/buffer.pro: buffer.c
charset.o: charset.c
proto/charset.pro: charset.c
crypt.o: crypt.c
proto/crypt.pro: crypt.c
crypt_zip.o: crypt_zip.c
proto/crypt_zip.pro: crypt_zip.c
diff.o: diff.c
proto/diff.pro: diff.c
digraph.o: digraph.c

View File

@@ -1431,6 +1431,8 @@ BASIC_SRC = \
blowfish.c \
buffer.c \
charset.c \
crypt.c \
crypt_zip.c \
diff.c \
digraph.c \
edit.c \
@@ -1520,6 +1522,8 @@ OBJ_COMMON = \
objects/buffer.o \
objects/blowfish.o \
objects/charset.o \
objects/crypt.o \
objects/crypt_zip.o \
objects/diff.o \
objects/digraph.o \
objects/edit.o \
@@ -1589,6 +1593,8 @@ PRO_AUTO = \
blowfish.pro \
buffer.pro \
charset.pro \
crypt.pro \
crypt_zip.pro \
diff.pro \
digraph.pro \
edit.pro \
@@ -1753,10 +1759,11 @@ xxd/xxd$(EXEEXT): xxd/xxd.c
languages:
@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
cd $(PODIR); \
CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \
CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix); \
fi
-@if test -n "$(MAKEMO)" -a -f $(PODIR)/Makefile; then \
cd $(PODIR); CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \
cd $(PODIR); \
CC="$(CC)" $(MAKE) prefix=$(DESTDIR)$(prefix) converted; \
fi
# Update the *.po files for changes in the sources. Only run manually.
@@ -1883,8 +1890,14 @@ unittest unittests: $(UNITTEST_TARGETS)
# Run individual test, assuming that Vim was already compiled.
test1 test2 test3 test4 test5 test6 test7 test8 test9 \
test_autoformat_join \
test_breakindent \
test_changelist \
test_eval \
test_insertcount \
test_listlbr \
test_listlbr_utf8 \
test_options \
test_qf_title \
test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 \
test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \
test30 test31 test32 test33 test34 test35 test36 test37 test38 test39 \
@@ -2464,7 +2477,7 @@ lintinstall:
auto/if_perl.c: if_perl.xs
$(PERL) -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $@
$(PERL) $(PERLLIB)/ExtUtils/xsubpp -prototypes -typemap \
$(PERL) $(PERL_XSUBPP) -prototypes -typemap \
$(PERLLIB)/ExtUtils/typemap if_perl.xs >> $@
auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in
@@ -2506,6 +2519,12 @@ objects/buffer.o: buffer.c
objects/charset.o: charset.c
$(CCC) -o $@ charset.c
objects/crypt.o: crypt.c
$(CCC) -o $@ crypt.c
objects/crypt_zip.o: crypt_zip.c
$(CCC) -o $@ crypt_zip.c
objects/diff.o: diff.c
$(CCC) -o $@ diff.c
@@ -2855,6 +2874,14 @@ objects/charset.o: charset.c vim.h auto/config.h feature.h os_unix.h auto/osdef.
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
arabic.h
objects/crypt.o: crypt.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \
arabic.h
objects/crypt_zip.o: crypt_zip.c vim.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h term.h macros.h option.h structs.h \
regexp.h gui.h gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h \
globals.h farsi.h arabic.h
objects/diff.o: diff.c vim.h auto/config.h feature.h os_unix.h auto/osdef.h \
ascii.h keymap.h term.h macros.h option.h structs.h regexp.h gui.h \
gui_beval.h proto/gui_beval.pro ex_cmds.h proto.h globals.h farsi.h \

9
src/auto/configure vendored
View File

@@ -687,6 +687,7 @@ PERL_PRO
PERL_OBJ
PERL_SRC
shrpenv
vi_cv_perl_xsubpp
vi_cv_perllib
vi_cv_path_perl
MZSCHEME_MZC
@@ -5604,6 +5605,14 @@ $as_echo "OK" >&6; }
fi
vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
vi_cv_perl_extutils=unknown_perl_extutils_path
for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do
xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp"
if test -f "$xsubpp_path"; then
vi_cv_perl_xsubpp="$xsubpp_path"
fi
done
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//'`
perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \

View File

@@ -9,17 +9,25 @@
* Blowfish encryption for Vim; in Blowfish cipher feedback mode.
* Contributed by Mohsin Ahmed, http://www.cs.albany.edu/~mosh
* Based on http://www.schneier.com/blowfish.html by Bruce Schneier.
*
* There are two variants:
* - The old one "blowfish" has a flaw which makes it much easier to crack the
* key. To see this, make a text file with one line of 1000 "x" characters
* and write it encrypted. Use "xxd" to inspect the bytes in the file. You
* will see that a block of 8 bytes repeats 8 times.
* - The new one "blowfish2" is better. It uses an 8 byte CFB to avoid the
* repeats.
*/
#include "vim.h"
#if defined(FEAT_CRYPT)
#if defined(FEAT_CRYPT) || defined(PROTO)
#define ARRAY_LENGTH(A) (sizeof(A)/sizeof(A[0]))
#define BF_BLOCK 8
#define BF_BLOCK_MASK 7
#define BF_CFB_LEN (8*(BF_BLOCK))
#define BF_MAX_CFB_LEN (8 * BF_BLOCK)
typedef union {
UINT32_T ul[2];
@@ -37,14 +45,26 @@ typedef union {
# endif
#endif
static void bf_e_block __ARGS((UINT32_T *p_xl, UINT32_T *p_xr));
static void bf_e_cblock __ARGS((char_u *block));
static int bf_check_tables __ARGS((UINT32_T a_ipa[18], UINT32_T a_sbi[4][256], UINT32_T val));
/* The state of encryption, referenced by cryptstate_T. */
typedef struct {
UINT32_T pax[18]; /* P-array */
UINT32_T sbx[4][256]; /* S-boxes */
int randbyte_offset;
int update_offset;
char_u cfb_buffer[BF_MAX_CFB_LEN]; /* up to 64 bytes used */
int cfb_len; /* size of cfb_buffer actually used */
} bf_state_T;
static void bf_e_block __ARGS((bf_state_T *state, UINT32_T *p_xl, UINT32_T *p_xr));
static void bf_e_cblock __ARGS((bf_state_T *state, char_u *block));
static int bf_check_tables __ARGS((UINT32_T pax[18], UINT32_T sbx[4][256], UINT32_T val));
static int bf_self_test __ARGS((void));
static void bf_key_init __ARGS((bf_state_T *state, char_u *password, char_u *salt, int salt_len));
static void bf_cfb_init __ARGS((bf_state_T *state, char_u *seed, int seed_len));
/* Blowfish code */
static UINT32_T pax[18];
static UINT32_T ipa[18] = {
static UINT32_T pax_init[18] = {
0x243f6a88u, 0x85a308d3u, 0x13198a2eu,
0x03707344u, 0xa4093822u, 0x299f31d0u,
0x082efa98u, 0xec4e6c89u, 0x452821e6u,
@@ -53,8 +73,7 @@ static UINT32_T ipa[18] = {
0xb5470917u, 0x9216d5d9u, 0x8979fb1bu
};
static UINT32_T sbx[4][256];
static UINT32_T sbi[4][256] = {
static UINT32_T sbx_init[4][256] = {
{0xd1310ba6u, 0x98dfb5acu, 0x2ffd72dbu, 0xd01adfb7u,
0xb8e1afedu, 0x6a267e96u, 0xba7c9045u, 0xf12c7f99u,
0x24a19947u, 0xb3916cf7u, 0x0801f2e2u, 0x858efc16u,
@@ -314,33 +333,40 @@ static UINT32_T sbi[4][256] = {
}
};
#define F1(i) \
xl ^= pax[i]; \
xr ^= ((sbx[0][xl >> 24] + \
sbx[1][(xl & 0xFF0000) >> 16]) ^ \
sbx[2][(xl & 0xFF00) >> 8]) + \
sbx[3][xl & 0xFF];
xl ^= bfs->pax[i]; \
xr ^= ((bfs->sbx[0][xl >> 24] + \
bfs->sbx[1][(xl & 0xFF0000) >> 16]) ^ \
bfs->sbx[2][(xl & 0xFF00) >> 8]) + \
bfs->sbx[3][xl & 0xFF];
#define F2(i) \
xr ^= pax[i]; \
xl ^= ((sbx[0][xr >> 24] + \
sbx[1][(xr & 0xFF0000) >> 16]) ^ \
sbx[2][(xr & 0xFF00) >> 8]) + \
sbx[3][xr & 0xFF];
xr ^= bfs->pax[i]; \
xl ^= ((bfs->sbx[0][xr >> 24] + \
bfs->sbx[1][(xr & 0xFF0000) >> 16]) ^ \
bfs->sbx[2][(xr & 0xFF00) >> 8]) + \
bfs->sbx[3][xr & 0xFF];
static void
bf_e_block(p_xl, p_xr)
bf_e_block(bfs, p_xl, p_xr)
bf_state_T *bfs;
UINT32_T *p_xl;
UINT32_T *p_xr;
{
UINT32_T temp, xl = *p_xl, xr = *p_xr;
UINT32_T temp;
UINT32_T xl = *p_xl;
UINT32_T xr = *p_xr;
F1(0) F2(1) F1(2) F2(3) F1(4) F2(5) F1(6) F2(7)
F1(8) F2(9) F1(10) F2(11) F1(12) F2(13) F1(14) F2(15)
xl ^= pax[16];
xr ^= pax[17];
F1(0) F2(1)
F1(2) F2(3)
F1(4) F2(5)
F1(6) F2(7)
F1(8) F2(9)
F1(10) F2(11)
F1(12) F2(13)
F1(14) F2(15)
xl ^= bfs->pax[16];
xr ^= bfs->pax[17];
temp = xl;
xl = xr;
xr = temp;
@@ -348,22 +374,6 @@ bf_e_block(p_xl, p_xr)
*p_xr = xr;
}
#if 0 /* not used */
static void
bf_d_block(p_xl, p_xr)
UINT32_T *p_xl;
UINT32_T *p_xr;
{
UINT32_T temp, xl = *p_xl, xr = *p_xr;
F1(17) F2(16) F1(15) F2(14) F1(13) F2(12) F1(11) F2(10)
F1(9) F2(8) F1(7) F2(6) F1(5) F2(4) F1(3) F2(2)
xl ^= pax[1];
xr ^= pax[0];
temp = xl; xl = xr; xr = temp;
*p_xl = xl; *p_xr = xr;
}
#endif
#ifdef WORDS_BIGENDIAN
# define htonl2(x) \
@@ -374,7 +384,8 @@ bf_d_block(p_xl, p_xr)
#endif
static void
bf_e_cblock(block)
bf_e_cblock(bfs, block)
bf_state_T *bfs;
char_u *block;
{
block8 bk;
@@ -382,35 +393,22 @@ bf_e_cblock(block)
memcpy(bk.uc, block, 8);
htonl2(bk.ul[0]);
htonl2(bk.ul[1]);
bf_e_block(&bk.ul[0], &bk.ul[1]);
bf_e_block(bfs, &bk.ul[0], &bk.ul[1]);
htonl2(bk.ul[0]);
htonl2(bk.ul[1]);
memcpy(block, bk.uc, 8);
}
#if 0 /* not used */
void
bf_d_cblock(block)
char_u *block;
{
block8 bk;
memcpy(bk.uc, block, 8);
htonl2(bk.ul[0]); htonl2(bk.ul[1]);
bf_d_block(&bk.ul[0], &bk.ul[1]);
htonl2(bk.ul[0]); htonl2(bk.ul[1]);
memcpy(block, bk.uc, 8);
}
#endif
/*
* Initialize the crypt method using "password" as the encryption key and
* "salt[salt_len]" as the salt.
*/
void
bf_key_init(password, salt, salt_len)
char_u *password;
char_u *salt;
int salt_len;
static void
bf_key_init(bfs, password, salt, salt_len)
bf_state_T *bfs;
char_u *password;
char_u *salt;
int salt_len;
{
int i, j, keypos = 0;
unsigned u;
@@ -418,7 +416,7 @@ bf_key_init(password, salt, salt_len)
char_u *key;
int keylen;
/* Process the key 1000 times.
/* Process the key 1001 times.
* See http://en.wikipedia.org/wiki/Key_strengthening. */
key = sha256_key(password, salt, salt_len);
for (i = 0; i < 1000; i++)
@@ -437,52 +435,54 @@ bf_key_init(password, salt, salt_len)
key[i] = u;
}
mch_memmove(sbx, sbi, 4 * 4 * 256);
/* Use "key" to initialize the P-array ("pax") and S-boxes ("sbx") of
* Blowfish. */
mch_memmove(bfs->sbx, sbx_init, 4 * 4 * 256);
for (i = 0; i < 18; ++i)
{
val = 0;
for (j = 0; j < 4; ++j)
val = (val << 8) | key[keypos++ % keylen];
pax[i] = ipa[i] ^ val;
bfs->pax[i] = pax_init[i] ^ val;
}
data_l = data_r = 0;
for (i = 0; i < 18; i += 2)
{
bf_e_block(&data_l, &data_r);
pax[i + 0] = data_l;
pax[i + 1] = data_r;
bf_e_block(bfs, &data_l, &data_r);
bfs->pax[i + 0] = data_l;
bfs->pax[i + 1] = data_r;
}
for (i = 0; i < 4; ++i)
{
for (j = 0; j < 256; j += 2)
{
bf_e_block(&data_l, &data_r);
sbx[i][j + 0] = data_l;
sbx[i][j + 1] = data_r;
bf_e_block(bfs, &data_l, &data_r);
bfs->sbx[i][j + 0] = data_l;
bfs->sbx[i][j + 1] = data_r;
}
}
}
/*
* BF Self test for corrupted tables or instructions
* Blowfish self-test for corrupted tables or instructions.
*/
static int
bf_check_tables(a_ipa, a_sbi, val)
UINT32_T a_ipa[18];
UINT32_T a_sbi[4][256];
bf_check_tables(pax, sbx, val)
UINT32_T pax[18];
UINT32_T sbx[4][256];
UINT32_T val;
{
int i, j;
UINT32_T c = 0;
for (i = 0; i < 18; i++)
c ^= a_ipa[i];
c ^= pax[i];
for (i = 0; i < 4; i++)
for (j = 0; j < 256; j++)
c ^= a_sbi[i][j];
c ^= sbx[i][j];
return c == val;
}
@@ -520,6 +520,10 @@ bf_self_test()
int err = 0;
block8 bk;
UINT32_T ui = 0xffffffffUL;
bf_state_T state;
vim_memset(&state, 0, sizeof(bf_state_T));
state.cfb_len = BF_MAX_CFB_LEN;
/* We can't simply use sizeof(UINT32_T), it would generate a compiler
* warning. */
@@ -528,21 +532,21 @@ bf_self_test()
EMSG(_("E820: sizeof(uint32_t) != 4"));
}
if (!bf_check_tables(ipa, sbi, 0x6ffa520a))
if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a))
err++;
bn = ARRAY_LENGTH(bf_test_data);
for (i = 0; i < bn; i++)
{
bf_key_init((char_u *)(bf_test_data[i].password),
bf_key_init(&state, (char_u *)(bf_test_data[i].password),
bf_test_data[i].salt,
(int)STRLEN(bf_test_data[i].salt));
if (!bf_check_tables(pax, sbx, bf_test_data[i].keysum))
if (!bf_check_tables(state.pax, state.sbx, bf_test_data[i].keysum))
err++;
/* Don't modify bf_test_data[i].plaintxt, self test is idempotent. */
memcpy(bk.uc, bf_test_data[i].plaintxt, 8);
bf_e_cblock(bk.uc);
bf_e_cblock(&state, bk.uc);
if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0)
{
if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0)
@@ -554,43 +558,43 @@ bf_self_test()
return err > 0 ? FAIL : OK;
}
/* Cipher feedback mode. */
static int randbyte_offset = 0;
static int update_offset = 0;
static char_u cfb_buffer[BF_CFB_LEN]; /* 64 bytes */
/*
* CFB: Cipher Feedback Mode.
*/
/*
* Initialize with seed "iv[iv_len]".
* Initialize with seed "seed[seed_len]".
*/
void
bf_cfb_init(iv, iv_len)
char_u *iv;
int iv_len;
static void
bf_cfb_init(bfs, seed, seed_len)
bf_state_T *bfs;
char_u *seed;
int seed_len;
{
int i, mi;
randbyte_offset = update_offset = 0;
vim_memset(cfb_buffer, 0, BF_CFB_LEN);
if (iv_len > 0)
bfs->randbyte_offset = bfs->update_offset = 0;
vim_memset(bfs->cfb_buffer, 0, bfs->cfb_len);
if (seed_len > 0)
{
mi = iv_len > BF_CFB_LEN ? iv_len : BF_CFB_LEN;
mi = seed_len > bfs->cfb_len ? seed_len : bfs->cfb_len;
for (i = 0; i < mi; i++)
cfb_buffer[i % BF_CFB_LEN] ^= iv[i % iv_len];
bfs->cfb_buffer[i % bfs->cfb_len] ^= seed[i % seed_len];
}
}
#define BF_CFB_UPDATE(c) { \
cfb_buffer[update_offset] ^= (char_u)c; \
if (++update_offset == BF_CFB_LEN) \
update_offset = 0; \
#define BF_CFB_UPDATE(bfs, c) { \
bfs->cfb_buffer[bfs->update_offset] ^= (char_u)c; \
if (++bfs->update_offset == bfs->cfb_len) \
bfs->update_offset = 0; \
}
#define BF_RANBYTE(t) { \
if ((randbyte_offset & BF_BLOCK_MASK) == 0) \
bf_e_cblock(&cfb_buffer[randbyte_offset]); \
t = cfb_buffer[randbyte_offset]; \
if (++randbyte_offset == BF_CFB_LEN) \
randbyte_offset = 0; \
#define BF_RANBYTE(bfs, t) { \
if ((bfs->randbyte_offset & BF_BLOCK_MASK) == 0) \
bf_e_cblock(bfs, &(bfs->cfb_buffer[bfs->randbyte_offset])); \
t = bfs->cfb_buffer[bfs->randbyte_offset]; \
if (++bfs->randbyte_offset == bfs->cfb_len) \
bfs->randbyte_offset = 0; \
}
/*
@@ -598,90 +602,69 @@ bf_cfb_init(iv, iv_len)
* "from" and "to" can be equal to encrypt in place.
*/
void
bf_crypt_encode(from, len, to)
crypt_blowfish_encode(state, from, len, to)
cryptstate_T *state;
char_u *from;
size_t len;
char_u *to;
{
bf_state_T *bfs = state->method_state;
size_t i;
int ztemp, t;
for (i = 0; i < len; ++i)
{
ztemp = from[i];
BF_RANBYTE(t);
BF_CFB_UPDATE(ztemp);
BF_RANBYTE(bfs, t);
BF_CFB_UPDATE(bfs, ztemp);
to[i] = t ^ ztemp;
}
}
/*
* Decrypt "ptr[len]" in place.
* Decrypt "from[len]" into "to[len]".
*/
void
bf_crypt_decode(ptr, len)
char_u *ptr;
long len;
crypt_blowfish_decode(state, from, len, to)
cryptstate_T *state;
char_u *from;
size_t len;
char_u *to;
{
char_u *p;
bf_state_T *bfs = state->method_state;
size_t i;
int t;
for (p = ptr; p < ptr + len; ++p)
for (i = 0; i < len; ++i)
{
BF_RANBYTE(t);
*p ^= t;
BF_CFB_UPDATE(*p);
BF_RANBYTE(bfs, t);
to[i] = from[i] ^ t;
BF_CFB_UPDATE(bfs, to[i]);
}
}
/*
* Initialize the encryption keys and the random header according to
* the given password.
*/
void
bf_crypt_init_keys(passwd)
char_u *passwd; /* password string with which to modify keys */
crypt_blowfish_init(state, key, salt, salt_len, seed, seed_len)
cryptstate_T *state;
char_u* key;
char_u* salt;
int salt_len;
char_u* seed;
int seed_len;
{
char_u *p;
bf_state_T *bfs = (bf_state_T *)alloc_clear(sizeof(bf_state_T));
for (p = passwd; *p != NUL; ++p)
{
BF_CFB_UPDATE(*p);
}
}
state->method_state = bfs;
static int save_randbyte_offset;
static int save_update_offset;
static char_u save_cfb_buffer[BF_CFB_LEN];
static UINT32_T save_pax[18];
static UINT32_T save_sbx[4][256];
/* "blowfish" uses a 64 byte buffer, causing it to repeat 8 byte groups 8
* times. "blowfish2" uses a 8 byte buffer to avoid repeating. */
bfs->cfb_len = state->method_nr == CRYPT_M_BF ? BF_MAX_CFB_LEN : BF_BLOCK;
/*
* Save the current crypt state. Can only be used once before
* bf_crypt_restore().
*/
void
bf_crypt_save()
{
save_randbyte_offset = randbyte_offset;
save_update_offset = update_offset;
mch_memmove(save_cfb_buffer, cfb_buffer, BF_CFB_LEN);
mch_memmove(save_pax, pax, 4 * 18);
mch_memmove(save_sbx, sbx, 4 * 4 * 256);
}
if (blowfish_self_test() == FAIL)
return;
/*
* Restore the current crypt state. Can only be used after
* bf_crypt_save().
*/
void
bf_crypt_restore()
{
randbyte_offset = save_randbyte_offset;
update_offset = save_update_offset;
mch_memmove(cfb_buffer, save_cfb_buffer, BF_CFB_LEN);
mch_memmove(pax, save_pax, 4 * 18);
mch_memmove(sbx, save_sbx, 4 * 4 * 256);
bf_key_init(bfs, key, salt, salt_len);
bf_cfb_init(bfs, seed, seed_len);
}
/*

View File

@@ -28,9 +28,9 @@
#include "vim.h"
#if defined(FEAT_CMDL_COMPL) || defined(FEAT_LISTCMDS) || defined(FEAT_EVAL) || defined(FEAT_PERL)
static char_u *buflist_match __ARGS((regprog_T *prog, buf_T *buf));
static char_u *buflist_match __ARGS((regprog_T *prog, buf_T *buf, int ignore_case));
# define HAVE_BUFLIST_MATCH
static char_u *fname_match __ARGS((regprog_T *prog, char_u *name));
static char_u *fname_match __ARGS((regprog_T *prog, char_u *name, int ignore_case));
#endif
static void buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
@@ -2001,6 +2001,7 @@ free_buf_options(buf, free_p_ff)
#ifdef FEAT_LISP
clear_string_option(&buf->b_p_lw);
#endif
clear_string_option(&buf->b_p_bkc);
}
/*
@@ -2282,7 +2283,7 @@ buflist_findpat(pattern, pattern_end, unlisted, diffmode, curtab_only)
#ifdef FEAT_DIFF
&& (!diffmode || diff_mode_buf(buf))
#endif
&& buflist_match(prog, buf) != NULL)
&& buflist_match(prog, buf, FALSE) != NULL)
{
if (curtab_only)
{
@@ -2396,7 +2397,7 @@ ExpandBufnames(pat, num_file, file, options)
{
if (!buf->b_p_bl) /* skip unlisted buffers */
continue;
p = buflist_match(prog, buf);
p = buflist_match(prog, buf, p_wic);
if (p != NULL)
{
if (round == 1)
@@ -2444,16 +2445,17 @@ ExpandBufnames(pat, num_file, file, options)
* Check for a match on the file name for buffer "buf" with regprog "prog".
*/
static char_u *
buflist_match(prog, buf)
buflist_match(prog, buf, ignore_case)
regprog_T *prog;
buf_T *buf;
int ignore_case; /* when TRUE ignore case, when FALSE use 'fic' */
{
char_u *match;
/* First try the short file name, then the long file name. */
match = fname_match(prog, buf->b_sfname);
match = fname_match(prog, buf->b_sfname, ignore_case);
if (match == NULL)
match = fname_match(prog, buf->b_ffname);
match = fname_match(prog, buf->b_ffname, ignore_case);
return match;
}
@@ -2463,9 +2465,10 @@ buflist_match(prog, buf)
* Return "name" when there is a match, NULL when not.
*/
static char_u *
fname_match(prog, name)
fname_match(prog, name, ignore_case)
regprog_T *prog;
char_u *name;
int ignore_case; /* when TRUE ignore case, when FALSE use 'fic' */
{
char_u *match = NULL;
char_u *p;
@@ -2474,7 +2477,8 @@ fname_match(prog, name)
if (name != NULL)
{
regmatch.regprog = prog;
regmatch.rm_ic = p_fic; /* ignore case when 'fileignorecase' is set */
/* Ignore case when 'fileignorecase' or the argument is set. */
regmatch.rm_ic = p_fic || ignore_case;
if (vim_regexec(&regmatch, name, (colnr_T)0))
match = name;
else

View File

@@ -1195,10 +1195,7 @@ win_lbr_chartabsize(wp, line, s, col, headp)
if (wp->w_p_bri)
added += get_breakindent_win(wp, line);
if (tab_corr)
size += (added / wp->w_buffer->b_p_ts) * wp->w_buffer->b_p_ts;
else
size += added;
size += added;
if (col != 0)
added = 0;
}

View File

@@ -48,11 +48,12 @@ MZSCHEME_SRC = @MZSCHEME_SRC@
MZSCHEME_OBJ = @MZSCHEME_OBJ@
MZSCHEME_CFLAGS = @MZSCHEME_CFLAGS@
MZSCHEME_PRO = @MZSCHEME_PRO@
MZSCHEME_EXTRA = @MZSCHEME_EXTRA@
MZSCHEME_EXTRA = @MZSCHEME_EXTRA@
MZSCHEME_MZC = @MZSCHEME_MZC@
PERL = @vi_cv_path_perl@
PERLLIB = @vi_cv_perllib@
PERL_XSUBPP = @vi_cv_perl_xsubpp@
PERL_LIBS = @PERL_LIBS@
SHRPENV = @shrpenv@
PERL_SRC = @PERL_SRC@

View File

@@ -933,6 +933,14 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
fi
vi_cv_perllib=`$vi_cv_path_perl -MConfig -e 'print $Config{privlibexp}'`
AC_SUBST(vi_cv_perllib)
vi_cv_perl_extutils=unknown_perl_extutils_path
for extutils_rel_path in ExtUtils vendor_perl/ExtUtils; do
xsubpp_path="$vi_cv_perllib/$extutils_rel_path/xsubpp"
if test -f "$xsubpp_path"; then
vi_cv_perl_xsubpp="$xsubpp_path"
fi
done
AC_SUBST(vi_cv_perl_xsubpp)
dnl Remove "-fno-something", it breaks using cproto.
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'`

585
src/crypt.c Normal file
View File

@@ -0,0 +1,585 @@
/* vi:set ts=8 sts=4 sw=4:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
/*
* crypt.c: Generic encryption support.
*/
#include "vim.h"
#if defined(FEAT_CRYPT) || defined(PROTO)
/*
* Optional encryption support.
* Mohsin Ahmed, mosh@sasi.com, 1998-09-24
* Based on zip/crypt sources.
* Refactored by David Leadbeater, 2014.
*
* NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
* most countries. There are a few exceptions, but that still should not be a
* problem since this code was originally created in Europe and India.
*
* Blowfish addition originally made by Mohsin Ahmed,
* http://www.cs.albany.edu/~mosh 2010-03-14
* Based on blowfish by Bruce Schneier (http://www.schneier.com/blowfish.html)
* and sha256 by Christophe Devine.
*/
typedef struct {
char *name; /* encryption name as used in 'cryptmethod' */
char *magic; /* magic bytes stored in file header */
int salt_len; /* length of salt, or 0 when not using salt */
int seed_len; /* length of seed, or 0 when not using salt */
int works_inplace; /* encryption/decryption can be done in-place */
int whole_undofile; /* whole undo file is encrypted */
/* Optional function pointer for a self-test. */
int (* self_test_fn)();
/* Function pointer for initializing encryption/decription. */
void (* init_fn)(cryptstate_T *state, char_u *key,
char_u *salt, int salt_len, char_u *seed, int seed_len);
/* Function pointers for encoding/decoding from one buffer into another.
* Optional, however, these or the _buffer ones should be configured. */
void (*encode_fn)(cryptstate_T *state, char_u *from, size_t len,
char_u *to);
void (*decode_fn)(cryptstate_T *state, char_u *from, size_t len,
char_u *to);
/* Function pointers for encoding and decoding, can buffer data if needed.
* Optional (however, these or the above should be configured). */
long (*encode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len,
char_u **newptr);
long (*decode_buffer_fn)(cryptstate_T *state, char_u *from, size_t len,
char_u **newptr);
/* Function pointers for in-place encoding and decoding, used for
* crypt_*_inplace(). "from" and "to" arguments will be equal.
* These may be the same as decode_fn and encode_fn above, however an
* algorithm may implement them in a way that is not interchangeable with
* the crypt_(en|de)code() interface (for example because it wishes to add
* padding to files).
* This method is used for swap and undo files which have a rigid format.
*/
void (*encode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len,
char_u *p2);
void (*decode_inplace_fn)(cryptstate_T *state, char_u *p1, size_t len,
char_u *p2);
} cryptmethod_T;
/* index is method_nr of cryptstate_T, CRYPT_M_* */
static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = {
/* PK_Zip; very weak */
{
"zip",
"VimCrypt~01!",
0,
0,
TRUE,
FALSE,
NULL,
crypt_zip_init,
crypt_zip_encode, crypt_zip_decode,
NULL, NULL,
crypt_zip_encode, crypt_zip_decode,
},
/* Blowfish/CFB + SHA-256 custom key derivation; implementation issues. */
{
"blowfish",
"VimCrypt~02!",
8,
8,
TRUE,
FALSE,
blowfish_self_test,
crypt_blowfish_init,
crypt_blowfish_encode, crypt_blowfish_decode,
NULL, NULL,
crypt_blowfish_encode, crypt_blowfish_decode,
},
/* Blowfish/CFB + SHA-256 custom key derivation; fixed. */
{
"blowfish2",
"VimCrypt~03!",
8,
8,
TRUE,
TRUE,
blowfish_self_test,
crypt_blowfish_init,
crypt_blowfish_encode, crypt_blowfish_decode,
NULL, NULL,
crypt_blowfish_encode, crypt_blowfish_decode,
},
};
#define CRYPT_MAGIC_LEN 12 /* cannot change */
static char crypt_magic_head[] = "VimCrypt~";
/*
* Return int value for crypt method name.
* 0 for "zip", the old method. Also for any non-valid value.
* 1 for "blowfish".
* 2 for "blowfish2".
*/
int
crypt_method_nr_from_name(name)
char_u *name;
{
int i;
for (i = 0; i < CRYPT_M_COUNT; ++i)
if (STRCMP(name, cryptmethods[i].name) == 0)
return i;
return 0;
}
/*
* Get the crypt method used for a file from "ptr[len]", the magic text at the
* start of the file.
* Returns -1 when no encryption used.
*/
int
crypt_method_nr_from_magic(ptr, len)
char *ptr;
int len;
{
int i;
if (len < CRYPT_MAGIC_LEN)
return -1;
for (i = 0; i < CRYPT_M_COUNT; i++)
if (memcmp(ptr, cryptmethods[i].magic, CRYPT_MAGIC_LEN) == 0)
return i;
i = (int)STRLEN(crypt_magic_head);
if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0)
EMSG(_("E821: File is encrypted with unknown method"));
return -1;
}
/*
* Return TRUE if the crypt method for "method_nr" can be done in-place.
*/
int
crypt_works_inplace(state)
cryptstate_T *state;
{
return cryptmethods[state->method_nr].works_inplace;
}
/*
* Get the crypt method for buffer "buf" as a number.
*/
int
crypt_get_method_nr(buf)
buf_T *buf;
{
return crypt_method_nr_from_name(*buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
}
/*
* Return TRUE when the buffer uses an encryption method that encrypts the
* whole undo file, not only the text.
*/
int
crypt_whole_undofile(method_nr)
int method_nr;
{
return cryptmethods[method_nr].whole_undofile;
}
/*
* Get crypt method specifc length of the file header in bytes.
*/
int
crypt_get_header_len(method_nr)
int method_nr;
{
return CRYPT_MAGIC_LEN
+ cryptmethods[method_nr].salt_len
+ cryptmethods[method_nr].seed_len;
}
/*
* Set the crypt method for buffer "buf" to "method_nr" using the int value as
* returned by crypt_method_nr_from_name().
*/
void
crypt_set_cm_option(buf, method_nr)
buf_T *buf;
int method_nr;
{
free_string_option(buf->b_p_cm);
buf->b_p_cm = vim_strsave((char_u *)cryptmethods[method_nr].name);
}
/*
* If the crypt method for the current buffer has a self-test, run it and
* return OK/FAIL.
*/
int
crypt_self_test()
{
int method_nr = crypt_get_method_nr(curbuf);
if (cryptmethods[method_nr].self_test_fn == NULL)
return OK;
return cryptmethods[method_nr].self_test_fn();
}
/*
* Allocate a crypt state and initialize it.
*/
cryptstate_T *
crypt_create(method_nr, key, salt, salt_len, seed, seed_len)
int method_nr;
char_u *key;
char_u *salt;
int salt_len;
char_u *seed;
int seed_len;
{
cryptstate_T *state = (cryptstate_T *)alloc((int)sizeof(cryptstate_T));
state->method_nr = method_nr;
cryptmethods[method_nr].init_fn(state, key, salt, salt_len, seed, seed_len);
return state;
}
/*
* Allocate a crypt state from a file header and initialize it.
* Assumes that header contains at least the number of bytes that
* crypt_get_header_len() returns for "method_nr".
*/
cryptstate_T *
crypt_create_from_header(method_nr, key, header)
int method_nr;
char_u *key;
char_u *header;
{
char_u *salt = NULL;
char_u *seed = NULL;
int salt_len = cryptmethods[method_nr].salt_len;
int seed_len = cryptmethods[method_nr].seed_len;
if (salt_len > 0)
salt = header + CRYPT_MAGIC_LEN;
if (seed_len > 0)
seed = header + CRYPT_MAGIC_LEN + salt_len;
return crypt_create(method_nr, key, salt, salt_len, seed, seed_len);
}
/*
* Read the crypt method specific header data from "fp".
* Return an allocated cryptstate_T or NULL on error.
*/
cryptstate_T *
crypt_create_from_file(fp, key)
FILE *fp;
char_u *key;
{
int method_nr;
int header_len;
char magic_buffer[CRYPT_MAGIC_LEN];
char_u *buffer;
cryptstate_T *state;
if (fread(magic_buffer, CRYPT_MAGIC_LEN, 1, fp) != 1)
return NULL;
method_nr = crypt_method_nr_from_magic(magic_buffer, CRYPT_MAGIC_LEN);
if (method_nr < 0)
return NULL;
header_len = crypt_get_header_len(method_nr);
if ((buffer = alloc(header_len)) == NULL)
return NULL;
mch_memmove(buffer, magic_buffer, CRYPT_MAGIC_LEN);
if (header_len > CRYPT_MAGIC_LEN
&& fread(buffer + CRYPT_MAGIC_LEN,
header_len - CRYPT_MAGIC_LEN, 1, fp) != 1)
{
vim_free(buffer);
return NULL;
}
state = crypt_create_from_header(method_nr, key, buffer);
vim_free(buffer);
return state;
}
/*
* Allocate a cryptstate_T for writing and initialize it with "key".
* Allocates and fills in the header and stores it in "header", setting
* "header_len". The header may include salt and seed, depending on
* cryptmethod. Caller must free header.
* Returns the state or NULL on failure.
*/
cryptstate_T *
crypt_create_for_writing(method_nr, key, header, header_len)
int method_nr;
char_u *key;
char_u **header;
int *header_len;
{
int len = crypt_get_header_len(method_nr);
char_u *salt = NULL;
char_u *seed = NULL;
int salt_len = cryptmethods[method_nr].salt_len;
int seed_len = cryptmethods[method_nr].seed_len;
cryptstate_T *state;
*header_len = len;
*header = alloc(len);
if (*header == NULL)
return NULL;
mch_memmove(*header, cryptmethods[method_nr].magic, CRYPT_MAGIC_LEN);
if (salt_len > 0 || seed_len > 0)
{
if (salt_len > 0)
salt = *header + CRYPT_MAGIC_LEN;
if (seed_len > 0)
seed = *header + CRYPT_MAGIC_LEN + salt_len;
/* TODO: Should this be crypt method specific? (Probably not worth
* it). sha2_seed is pretty bad for large amounts of entropy, so make
* that into something which is suitable for anything. */
sha2_seed(salt, salt_len, seed, seed_len);
}
state = crypt_create(method_nr, key, salt, salt_len, seed, seed_len);
if (state == NULL)
{
vim_free(*header);
*header = NULL;
}
return state;
}
/*
* Free the crypt state.
*/
void
crypt_free_state(state)
cryptstate_T *state;
{
vim_free(state->method_state);
vim_free(state);
}
/*
* Encode "from[len]" and store the result in a newly allocated buffer, which
* is stored in "newptr".
* Return number of bytes in "newptr", 0 for need more or -1 on error.
*/
long
crypt_encode_alloc(state, from, len, newptr)
cryptstate_T *state;
char_u *from;
size_t len;
char_u **newptr;
{
cryptmethod_T *method = &cryptmethods[state->method_nr];
if (method->encode_buffer_fn != NULL)
/* Has buffer function, pass through. */
return method->encode_buffer_fn(state, from, len, newptr);
if (len == 0)
/* Not buffering, just return EOF. */
return (long)len;
*newptr = alloc((long)len);
if (*newptr == NULL)
return -1;
method->encode_fn(state, from, len, *newptr);
return (long)len;
}
/*
* Decrypt "ptr[len]" and store the result in a newly allocated buffer, which
* is stored in "newptr".
* Return number of bytes in "newptr", 0 for need more or -1 on error.
*/
long
crypt_decode_alloc(state, ptr, len, newptr)
cryptstate_T *state;
char_u *ptr;
long len;
char_u **newptr;
{
cryptmethod_T *method = &cryptmethods[state->method_nr];
if (method->decode_buffer_fn != NULL)
/* Has buffer function, pass through. */
return method->decode_buffer_fn(state, ptr, len, newptr);
if (len == 0)
/* Not buffering, just return EOF. */
return len;
*newptr = alloc(len);
if (*newptr == NULL)
return -1;
method->decode_fn(state, ptr, len, *newptr);
return len;
}
/*
* Encrypting "from[len]" into "to[len]".
*/
void
crypt_encode(state, from, len, to)
cryptstate_T *state;
char_u *from;
size_t len;
char_u *to;
{
cryptmethods[state->method_nr].encode_fn(state, from, len, to);
}
/*
* decrypting "from[len]" into "to[len]".
*/
void
crypt_decode(state, from, len, to)
cryptstate_T *state;
char_u *from;
size_t len;
char_u *to;
{
cryptmethods[state->method_nr].decode_fn(state, from, len, to);
}
/*
* Simple inplace encryption, modifies "buf[len]" in place.
*/
void
crypt_encode_inplace(state, buf, len)
cryptstate_T *state;
char_u *buf;
size_t len;
{
cryptmethods[state->method_nr].encode_inplace_fn(state, buf, len, buf);
}
/*
* Simple inplace decryption, modifies "buf[len]" in place.
*/
void
crypt_decode_inplace(state, buf, len)
cryptstate_T *state;
char_u *buf;
size_t len;
{
cryptmethods[state->method_nr].decode_inplace_fn(state, buf, len, buf);
}
/*
* Free an allocated crypt key. Clear the text to make sure it doesn't stay
* in memory anywhere.
*/
void
crypt_free_key(key)
char_u *key;
{
char_u *p;
if (key != NULL)
{
for (p = key; *p != NUL; ++p)
*p = 0;
vim_free(key);
}
}
/*
* Ask the user for a crypt key.
* When "store" is TRUE, the new key is stored in the 'key' option, and the
* 'key' option value is returned: Don't free it.
* When "store" is FALSE, the typed key is returned in allocated memory.
* Returns NULL on failure.
*/
char_u *
crypt_get_key(store, twice)
int store;
int twice; /* Ask for the key twice. */
{
char_u *p1, *p2 = NULL;
int round;
for (round = 0; ; ++round)
{
cmdline_star = TRUE;
cmdline_row = msg_row;
p1 = getcmdline_prompt(NUL, round == 0
? (char_u *)_("Enter encryption key: ")
: (char_u *)_("Enter same key again: "), 0, EXPAND_NOTHING,
NULL);
cmdline_star = FALSE;
if (p1 == NULL)
break;
if (round == twice)
{
if (p2 != NULL && STRCMP(p1, p2) != 0)
{
MSG(_("Keys don't match!"));
crypt_free_key(p1);
crypt_free_key(p2);
p2 = NULL;
round = -1; /* do it again */
continue;
}
if (store)
{
set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL);
crypt_free_key(p1);
p1 = curbuf->b_p_key;
}
break;
}
p2 = p1;
}
/* since the user typed this, no need to wait for return */
if (msg_didout)
msg_putchar('\n');
need_wait_return = FALSE;
msg_didout = FALSE;
crypt_free_key(p2);
return p1;
}
/*
* Append a message to IObuff for the encryption/decryption method being used.
*/
void
crypt_append_msg(buf)
buf_T *buf;
{
if (crypt_get_method_nr(buf) == 0)
STRCAT(IObuff, _("[crypted]"));
else
{
STRCAT(IObuff, "[");
STRCAT(IObuff, *buf->b_p_cm == NUL ? p_cm : buf->b_p_cm);
STRCAT(IObuff, "]");
}
}
#endif /* FEAT_CRYPT */

158
src/crypt_zip.c Normal file
View File

@@ -0,0 +1,158 @@
/* vi:set ts=8 sts=4 sw=4:
*
* VIM - Vi IMproved by Bram Moolenaar
*
* Do ":help uganda" in Vim to read copying and usage conditions.
* Do ":help credits" in Vim to see a list of people who contributed.
* See README.txt for an overview of the Vim source code.
*/
/*
* crypt_zip.c: Zip encryption support.
*/
#include "vim.h"
#if defined(FEAT_CRYPT) || defined(PROTO)
/*
* Optional encryption support.
* Mohsin Ahmed, mosh@sasi.com, 98-09-24
* Based on zip/crypt sources.
*
* NOTE FOR USA: Since 2000 exporting this code from the USA is allowed to
* most countries. There are a few exceptions, but that still should not be a
* problem since this code was originally created in Europe and India.
*/
/* Need a type that should be 32 bits. 64 also works but wastes space. */
# if VIM_SIZEOF_INT >= 4
typedef unsigned int u32_T; /* int is at least 32 bits */
# else
typedef unsigned long u32_T; /* long should be 32 bits or more */
# endif
/* The state of encryption, referenced by cryptstate_T. */
typedef struct {
u32_T keys[3];
} zip_state_T;
static void make_crc_tab __ARGS((void));
static u32_T crc_32_table[256];
/*
* Fill the CRC table, if not done already.
*/
static void
make_crc_tab()
{
u32_T s, t, v;
static int done = FALSE;
if (done)
return;
for (t = 0; t < 256; t++)
{
v = t;
for (s = 0; s < 8; s++)
v = (v >> 1) ^ ((v & 1) * (u32_T)0xedb88320L);
crc_32_table[t] = v;
}
done = TRUE;
}
#define CRC32(c, b) (crc_32_table[((int)(c) ^ (b)) & 0xff] ^ ((c) >> 8))
/*
* Return the next byte in the pseudo-random sequence.
*/
#define DECRYPT_BYTE_ZIP(keys, t) { \
short_u temp = (short_u)keys[2] | 2; \
t = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff); \
}
/*
* Update the encryption keys with the next byte of plain text.
*/
#define UPDATE_KEYS_ZIP(keys, c) { \
keys[0] = CRC32(keys[0], (c)); \
keys[1] += keys[0] & 0xff; \
keys[1] = keys[1] * 134775813L + 1; \
keys[2] = CRC32(keys[2], (int)(keys[1] >> 24)); \
}
/*
* Initialize for encryption/decryption.
*/
void
crypt_zip_init(state, key, salt, salt_len, seed, seed_len)
cryptstate_T *state;
char_u *key;
char_u *salt UNUSED;
int salt_len UNUSED;
char_u *seed UNUSED;
int seed_len UNUSED;
{
char_u *p;
zip_state_T *zs;
zs = (zip_state_T *)alloc(sizeof(zip_state_T));
state->method_state = zs;
make_crc_tab();
zs->keys[0] = 305419896L;
zs->keys[1] = 591751049L;
zs->keys[2] = 878082192L;
for (p = key; *p != NUL; ++p)
{
UPDATE_KEYS_ZIP(zs->keys, (int)*p);
}
}
/*
* Encrypt "from[len]" into "to[len]".
* "from" and "to" can be equal to encrypt in place.
*/
void
crypt_zip_encode(state, from, len, to)
cryptstate_T *state;
char_u *from;
size_t len;
char_u *to;
{
zip_state_T *zs = state->method_state;
size_t i;
int ztemp, t;
for (i = 0; i < len; ++i)
{
ztemp = from[i];
DECRYPT_BYTE_ZIP(zs->keys, t);
UPDATE_KEYS_ZIP(zs->keys, ztemp);
to[i] = t ^ ztemp;
}
}
/*
* Decrypt "from[len]" into "to[len]".
*/
void
crypt_zip_decode(state, from, len, to)
cryptstate_T *state;
char_u *from;
size_t len;
char_u *to;
{
zip_state_T *zs = state->method_state;
size_t i;
short_u temp;
for (i = 0; i < len; ++i)
{
temp = (short_u)zs->keys[2] | 2;
temp = (int)(((unsigned)(temp * (temp ^ 1U)) >> 8) & 0xff);
UPDATE_KEYS_ZIP(zs->keys, to[i] = from[i] ^ temp);
}
}
#endif /* FEAT_CRYPT */

View File

@@ -4035,7 +4035,7 @@ expand_by_function(type, base)
goto theend;
}
curwin->w_cursor = pos; /* restore the cursor position */
check_cursor();
validate_cursor();
if (!equalpos(curwin->w_cursor, pos))
{
EMSG(_(e_compldel));
@@ -5273,7 +5273,7 @@ ins_complete(c)
return FAIL;
}
curwin->w_cursor = pos; /* restore the cursor position */
check_cursor();
validate_cursor();
if (!equalpos(curwin->w_cursor, pos))
{
EMSG(_(e_compldel));
@@ -6131,6 +6131,12 @@ internal_format(textwidth, second_indent, flags, format_only, c)
int no_leader = FALSE;
int do_comments = (flags & INSCHAR_DO_COM);
#endif
#ifdef FEAT_LINEBREAK
int has_lbr = curwin->w_p_lbr;
/* make sure win_lbr_chartabsize() counts correctly */
curwin->w_p_lbr = FALSE;
#endif
/*
* When 'ai' is off we don't want a space under the cursor to be
@@ -6483,6 +6489,9 @@ internal_format(textwidth, second_indent, flags, format_only, c)
if (save_char != NUL) /* put back space after cursor */
pchar_cursor(save_char);
#ifdef FEAT_LINEBREAK
curwin->w_p_lbr = has_lbr;
#endif
if (!format_only && haveto_redraw)
{
update_topline();
@@ -6768,13 +6777,19 @@ stop_arrow()
{
if (arrow_used)
{
Insstart = curwin->w_cursor; /* new insertion starts here */
if (Insstart.col > Insstart_orig.col && !ins_need_undo)
/* Don't update the original insert position when moved to the
* right, except when nothing was inserted yet. */
update_Insstart_orig = FALSE;
Insstart_textlen = (colnr_T)linetabsize(ml_get_curline());
if (u_save_cursor() == OK)
{
arrow_used = FALSE;
ins_need_undo = FALSE;
}
Insstart = curwin->w_cursor; /* new insertion starts here */
Insstart_textlen = (colnr_T)linetabsize(ml_get_curline());
ai_col = 0;
#ifdef FEAT_VREPLACE
if (State & VREPLACE_FLAG)
@@ -8389,7 +8404,7 @@ ins_esc(count, cmdchar, nomove)
(void)start_redo_ins();
if (cmdchar == 'r' || cmdchar == 'v')
stuffReadbuff(ESC_STR); /* no ESC in redo buffer */
stuffRedoReadbuff(ESC_STR); /* no ESC in redo buffer */
++RedrawingDisabled;
disabled_redraw = TRUE;
return FALSE; /* repeat the insert */

View File

@@ -554,6 +554,7 @@ static void f_getcharmod __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getcmdline __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getcmdpos __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getcmdtype __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getcmdwintype __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getcwd __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getfontname __ARGS((typval_T *argvars, typval_T *rettv));
static void f_getfperm __ARGS((typval_T *argvars, typval_T *rettv));
@@ -2944,6 +2945,23 @@ set_var_lval(lp, endp, rettv, copy, op)
;
else if (lp->ll_range)
{
listitem_T *ll_li = lp->ll_li;
int ll_n1 = lp->ll_n1;
/*
* Check whether any of the list items is locked
*/
for (ri = rettv->vval.v_list->lv_first; ri != NULL; )
{
if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name))
return;
ri = ri->li_next;
if (ri == NULL || (!lp->ll_empty2 && lp->ll_n2 == ll_n1))
break;
ll_li = ll_li->li_next;
++ll_n1;
}
/*
* Assign the List values to the list items.
*/
@@ -3645,6 +3663,17 @@ do_unlet_var(lp, name_end, forceit)
else if (lp->ll_range)
{
listitem_T *li;
listitem_T *ll_li = lp->ll_li;
int ll_n1 = lp->ll_n1;
while (ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= ll_n1))
{
li = ll_li->li_next;
if (tv_check_lock(ll_li->li_tv.v_lock, lp->ll_name))
return FAIL;
ll_li = li;
++ll_n1;
}
/* Delete a range of List items. */
while (lp->ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= lp->ll_n1))
@@ -7984,6 +8013,7 @@ static struct fst
{"getcmdline", 0, 0, f_getcmdline},
{"getcmdpos", 0, 0, f_getcmdpos},
{"getcmdtype", 0, 0, f_getcmdtype},
{"getcmdwintype", 0, 0, f_getcmdwintype},
{"getcurpos", 0, 0, f_getcurpos},
{"getcwd", 0, 0, f_getcwd},
{"getfontname", 0, 1, f_getfontname},
@@ -11502,6 +11532,26 @@ f_getcmdtype(argvars, rettv)
}
}
/*
* "getcmdwintype()" function
*/
static void
f_getcmdwintype(argvars, rettv)
typval_T *argvars UNUSED;
typval_T *rettv;
{
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
#ifdef FEAT_CMDWIN
rettv->vval.v_string = alloc(2);
if (rettv->vval.v_string != NULL)
{
rettv->vval.v_string[0] = cmdwin_type;
rettv->vval.v_string[1] = NUL;
}
#endif
}
/*
* "getcwd()" function
*/
@@ -12021,7 +12071,8 @@ f_gettabvar(argvars, rettv)
typval_T *argvars;
typval_T *rettv;
{
tabpage_T *tp;
win_T *oldcurwin;
tabpage_T *tp, *oldtabpage;
dictitem_T *v;
char_u *varname;
int done = FALSE;
@@ -12033,13 +12084,23 @@ f_gettabvar(argvars, rettv)
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
if (tp != NULL && varname != NULL)
{
/* look up the variable */
v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 0, varname, FALSE);
if (v != NULL)
/* Set tp to be our tabpage, temporarily. Also set the window to the
* first window in the tabpage, otherwise the window is not valid. */
if (switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin, tp, TRUE)
== OK)
{
copy_tv(&v->di_tv, rettv);
done = TRUE;
/* look up the variable */
/* Let gettabvar({nr}, "") return the "t:" dictionary. */
v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, FALSE);
if (v != NULL)
{
copy_tv(&v->di_tv, rettv);
done = TRUE;
}
}
/* restore previous notion of curwin */
restore_win(oldcurwin, oldtabpage, TRUE);
}
if (!done && argvars[2].v_type != VAR_UNKNOWN)
@@ -12174,22 +12235,24 @@ getwinvar(argvars, rettv, off)
{
/* Set curwin to be our win, temporarily. Also set the tabpage,
* otherwise the window is not valid. */
switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE);
if (*varname == '&') /* window-local-option */
if (switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK)
{
if (get_option_tv(&varname, rettv, 1) == OK)
done = TRUE;
}
else
{
/* Look up the variable. */
/* Let getwinvar({nr}, "") return the "w:" dictionary. */
v = find_var_in_ht(&win->w_vars->dv_hashtab, 'w', varname, FALSE);
if (v != NULL)
if (*varname == '&') /* window-local-option */
{
copy_tv(&v->di_tv, rettv);
done = TRUE;
if (get_option_tv(&varname, rettv, 1) == OK)
done = TRUE;
}
else
{
/* Look up the variable. */
/* Let getwinvar({nr}, "") return the "w:" dictionary. */
v = find_var_in_ht(&win->w_vars->dv_hashtab, 'w',
varname, FALSE);
if (v != NULL)
{
copy_tv(&v->di_tv, rettv);
done = TRUE;
}
}
}
@@ -12442,6 +12505,9 @@ f_has(argvars, rettv)
#ifdef FEAT_DIGRAPHS
"digraphs",
#endif
#ifdef FEAT_DIRECTX
"directx",
#endif
#ifdef FEAT_DND
"dnd",
#endif
@@ -17190,34 +17256,33 @@ setwinvar(argvars, rettv, off)
if (win != NULL && varname != NULL && varp != NULL)
{
#ifdef FEAT_WINDOWS
if (switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == FAIL)
return;
if (switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == OK)
#endif
if (*varname == '&')
{
long numval;
char_u *strval;
int error = FALSE;
++varname;
numval = get_tv_number_chk(varp, &error);
strval = get_tv_string_buf_chk(varp, nbuf);
if (!error && strval != NULL)
set_option_value(varname, numval, strval, OPT_LOCAL);
}
else
{
winvarname = alloc((unsigned)STRLEN(varname) + 3);
if (winvarname != NULL)
if (*varname == '&')
{
STRCPY(winvarname, "w:");
STRCPY(winvarname + 2, varname);
set_var(winvarname, varp, TRUE);
vim_free(winvarname);
long numval;
char_u *strval;
int error = FALSE;
++varname;
numval = get_tv_number_chk(varp, &error);
strval = get_tv_string_buf_chk(varp, nbuf);
if (!error && strval != NULL)
set_option_value(varname, numval, strval, OPT_LOCAL);
}
else
{
winvarname = alloc((unsigned)STRLEN(varname) + 3);
if (winvarname != NULL)
{
STRCPY(winvarname, "w:");
STRCPY(winvarname + 2, varname);
set_var(winvarname, varp, TRUE);
vim_free(winvarname);
}
}
}
#ifdef FEAT_WINDOWS
restore_win(save_curwin, save_curtab, TRUE);
#endif
@@ -17357,16 +17422,38 @@ item_compare(s1, s2)
const void *s2;
{
sortItem_T *si1, *si2;
typval_T *tv1, *tv2;
char_u *p1, *p2;
char_u *tofree1, *tofree2;
char_u *tofree1 = NULL, *tofree2 = NULL;
int res;
char_u numbuf1[NUMBUFLEN];
char_u numbuf2[NUMBUFLEN];
si1 = (sortItem_T *)s1;
si2 = (sortItem_T *)s2;
p1 = tv2string(&si1->item->li_tv, &tofree1, numbuf1, 0);
p2 = tv2string(&si2->item->li_tv, &tofree2, numbuf2, 0);
tv1 = &si1->item->li_tv;
tv2 = &si2->item->li_tv;
/* tv2string() puts quotes around a string and allocates memory. Don't do
* that for string variables. Use a single quote when comparing with a
* non-string to do what the docs promise. */
if (tv1->v_type == VAR_STRING)
{
if (tv2->v_type != VAR_STRING || item_compare_numeric)
p1 = (char_u *)"'";
else
p1 = tv1->vval.v_string;
}
else
p1 = tv2string(tv1, &tofree1, numbuf1, 0);
if (tv2->v_type == VAR_STRING)
{
if (tv1->v_type != VAR_STRING || item_compare_numeric)
p2 = (char_u *)"'";
else
p2 = tv2->vval.v_string;
}
else
p2 = tv2string(tv2, &tofree2, numbuf2, 0);
if (p1 == NULL)
p1 = (char_u *)"";
if (p2 == NULL)
@@ -17386,8 +17473,8 @@ item_compare(s1, s2)
res = n1 == n2 ? 0 : n1 > n2 ? 1 : -1;
}
/* When the result would be zero, compare the pointers themselves. Makes
* the sort stable. */
/* When the result would be zero, compare the item indexes. Makes the
* sort stable. */
if (res == 0 && !item_compare_keep_zero)
res = si1->idx > si2->idx ? 1 : -1;
@@ -18519,6 +18606,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
int err = FALSE;
FILE *fd;
list_T *list = NULL;
int flags = SHELL_SILENT;
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
@@ -18550,13 +18638,16 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
}
else
{
size_t len;
p = get_tv_string_buf_chk(&argvars[1], buf);
if (p == NULL)
{
fclose(fd);
goto errret; /* type error; errmsg already given */
}
if (fwrite(p, STRLEN(p), 1, fd) != 1)
len = STRLEN(p);
if (len > 0 && fwrite(p, len, 1, fd) != 1)
err = TRUE;
}
if (fclose(fd) != 0)
@@ -18568,6 +18659,11 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
}
}
/* Omit SHELL_COOKED when invoked with ":silent". Avoids that the shell
* echoes typeahead, that messes up the display. */
if (!msg_silent)
flags += SHELL_COOKED;
if (retlist)
{
int len;
@@ -18577,8 +18673,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
char_u *end;
int i;
res = get_cmd_output(get_tv_string(&argvars[0]), infile,
SHELL_SILENT | SHELL_COOKED, &len);
res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, &len);
if (res == NULL)
goto errret;
@@ -18619,8 +18714,7 @@ get_cmd_output_as_rettv(argvars, rettv, retlist)
}
else
{
res = get_cmd_output(get_tv_string(&argvars[0]), infile,
SHELL_SILENT | SHELL_COOKED, NULL);
res = get_cmd_output(get_tv_string(&argvars[0]), infile, flags, NULL);
#ifdef USE_CR
/* translate <CR> into <NL> */
if (res != NULL)

View File

@@ -4011,11 +4011,19 @@ ex_append(eap)
eap->nextcmd = p;
}
else
{
int save_State = State;
/* Set State to avoid the cursor shape to be set to INSERT mode
* when getline() returns. */
State = CMDLINE;
theline = eap->getline(
#ifdef FEAT_EVAL
eap->cstack->cs_looplevel > 0 ? -1 :
#endif
NUL, eap->cookie, indent);
State = save_State;
}
lines_left = Rows - 1;
if (theline == NULL)
break;
@@ -5514,7 +5522,15 @@ ex_global(eap)
smsg((char_u *)_("Pattern not found: %s"), pat);
}
else
{
#ifdef FEAT_CLIPBOARD
start_global_changes();
#endif
global_exe(cmd);
#ifdef FEAT_CLIPBOARD
end_global_changes();
#endif
}
ml_clearmarked(); /* clear rest of the marks */
vim_regfree(regmatch.regprog);
@@ -5883,6 +5899,26 @@ erret:
vim_free(tag);
}
/*
* ":helpclose": Close one help window
*/
void
ex_helpclose(eap)
exarg_T *eap UNUSED;
{
#if defined(FEAT_WINDOWS)
win_T *win;
FOR_ALL_WINDOWS(win)
{
if (win->w_buffer->b_help)
{
win_close(win, FALSE);
return;
}
}
#endif
}
#if defined(FEAT_MULTI_LANG) || defined(PROTO)
/*

View File

@@ -132,9 +132,9 @@ EX(CMD_augroup, "augroup", ex_autocmd,
EX(CMD_aunmenu, "aunmenu", ex_menu,
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
EX(CMD_buffer, "buffer", ex_buffer,
BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR),
EX(CMD_bNext, "bNext", ex_bprevious,
BANG|RANGE|NOTADR|COUNT|TRLBAR),
BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_ball, "ball", ex_buffer_all,
RANGE|NOTADR|COUNT|TRLBAR),
EX(CMD_badd, "badd", ex_edit,
@@ -146,19 +146,19 @@ EX(CMD_behave, "behave", ex_behave,
EX(CMD_belowright, "belowright", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_bfirst, "bfirst", ex_brewind,
BANG|RANGE|NOTADR|TRLBAR),
BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
EX(CMD_blast, "blast", ex_blast,
BANG|RANGE|NOTADR|TRLBAR),
BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
EX(CMD_bmodified, "bmodified", ex_bmodified,
BANG|RANGE|NOTADR|COUNT|TRLBAR),
BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_bnext, "bnext", ex_bnext,
BANG|RANGE|NOTADR|COUNT|TRLBAR),
BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_botright, "botright", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM),
EX(CMD_bprevious, "bprevious", ex_bprevious,
BANG|RANGE|NOTADR|COUNT|TRLBAR),
BANG|RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_brewind, "brewind", ex_brewind,
BANG|RANGE|NOTADR|TRLBAR),
BANG|RANGE|NOTADR|EDITCMD|TRLBAR),
EX(CMD_break, "break", ex_break,
TRLBAR|SBOXOK|CMDWIN),
EX(CMD_breakadd, "breakadd", ex_breakadd,
@@ -417,6 +417,8 @@ EX(CMD_gvim, "gvim", ex_gui,
BANG|FILES|EDITCMD|ARGOPT|TRLBAR|CMDWIN),
EX(CMD_help, "help", ex_help,
BANG|EXTRA|NOTRLCOM),
EX(CMD_helpclose, "helpclose", ex_helpclose,
RANGE|NOTADR|COUNT|TRLBAR),
EX(CMD_helpfind, "helpfind", ex_helpfind,
EXTRA|NOTRLCOM),
EX(CMD_helpgrep, "helpgrep", ex_helpgrep,
@@ -812,23 +814,23 @@ EX(CMD_sandbox, "sandbox", ex_wrongmodifier,
EX(CMD_saveas, "saveas", ex_write,
BANG|DFLALL|FILE1|ARGOPT|CMDWIN|TRLBAR),
EX(CMD_sbuffer, "sbuffer", ex_buffer,
BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|TRLBAR),
BANG|RANGE|NOTADR|BUFNAME|BUFUNL|COUNT|EXTRA|EDITCMD|TRLBAR),
EX(CMD_sbNext, "sbNext", ex_bprevious,
RANGE|NOTADR|COUNT|TRLBAR),
RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sball, "sball", ex_buffer_all,
RANGE|NOTADR|COUNT|TRLBAR),
RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sbfirst, "sbfirst", ex_brewind,
TRLBAR),
EDITCMD|TRLBAR),
EX(CMD_sblast, "sblast", ex_blast,
TRLBAR),
EDITCMD|TRLBAR),
EX(CMD_sbmodified, "sbmodified", ex_bmodified,
RANGE|NOTADR|COUNT|TRLBAR),
RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sbnext, "sbnext", ex_bnext,
RANGE|NOTADR|COUNT|TRLBAR),
RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sbprevious, "sbprevious", ex_bprevious,
RANGE|NOTADR|COUNT|TRLBAR),
RANGE|NOTADR|COUNT|EDITCMD|TRLBAR),
EX(CMD_sbrewind, "sbrewind", ex_brewind,
TRLBAR),
EDITCMD|TRLBAR),
EX(CMD_scriptnames, "scriptnames", ex_scriptnames,
TRLBAR|CMDWIN),
EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding,

View File

@@ -2464,6 +2464,9 @@ ex_listdo(eap)
* great speed improvement. */
save_ei = au_event_disable(",Syntax");
#endif
#ifdef FEAT_CLIPBOARD
start_global_changes();
#endif
if (eap->cmdidx == CMD_windo
|| eap->cmdidx == CMD_tabdo
@@ -2591,6 +2594,9 @@ ex_listdo(eap)
curbuf->b_fname, TRUE, curbuf);
}
#endif
#ifdef FEAT_CLIPBOARD
end_global_changes();
#endif
}
/*
@@ -2750,8 +2756,8 @@ source_runtime(name, all)
* used.
* Returns OK when at least one match found, FAIL otherwise.
*
* If "name" is NULL calls callback for each entry in runtimepath. Cookie is
* passed by reference in this case, setting it to NULL indicates that callback
* If "name" is NULL calls callback for each entry in runtimepath. Cookie is
* passed by reference in this case, setting it to NULL indicates that callback
* has done its job.
*/
int

View File

@@ -2143,6 +2143,26 @@ do_one_cmd(cmdlinep, sourcing,
/* Find the command and let "p" point to after it. */
p = find_command(&ea, NULL);
#ifdef FEAT_AUTOCMD
/* If this looks like an undefined user command and there are CmdUndefined
* autocommands defined, trigger the matching autocommands. */
if (p != NULL && ea.cmdidx == CMD_SIZE && !ea.skip
&& ASCII_ISUPPER(*ea.cmd)
&& has_cmdundefined())
{
int ret;
p = ea.cmd;
while (ASCII_ISALNUM(*p))
++p;
p = vim_strnsave(ea.cmd, (int)(p - ea.cmd));
ret = apply_autocmds(EVENT_CMDUNDEFINED, p, p, TRUE, NULL);
vim_free(p);
if (ret && !aborting())
p = find_command(&ea, NULL);
}
#endif
#ifdef FEAT_USR_CMDS
if (p == NULL)
{
@@ -5115,6 +5135,8 @@ ex_buffer(eap)
goto_buffer(eap, DOBUF_CURRENT, FORWARD, 0);
else
goto_buffer(eap, DOBUF_FIRST, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
}
}
@@ -5127,6 +5149,8 @@ ex_bmodified(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
}
/*
@@ -5138,6 +5162,8 @@ ex_bnext(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
}
/*
@@ -5151,6 +5177,8 @@ ex_bprevious(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
}
/*
@@ -5164,6 +5192,8 @@ ex_brewind(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
}
/*
@@ -5175,6 +5205,8 @@ ex_blast(eap)
exarg_T *eap;
{
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
if (eap->do_ecmd_cmd != NULL)
do_cmdline_cmd(eap->do_ecmd_cmd);
}
#endif
@@ -11506,8 +11538,7 @@ ex_match(eap)
ex_X(eap)
exarg_T *eap UNUSED;
{
if (get_crypt_method(curbuf) == 0 || blowfish_self_test() == OK)
(void)get_crypt_key(TRUE, TRUE);
(void)crypt_get_key(TRUE, TRUE);
}
#endif
@@ -11534,6 +11565,10 @@ ex_folddo(eap)
{
linenr_T lnum;
#ifdef FEAT_CLIPBOARD
start_global_changes();
#endif
/* First set the marks for all lines closed/open. */
for (lnum = eap->line1; lnum <= eap->line2; ++lnum)
if (hasFolding(lnum, NULL, NULL) == (eap->cmdidx == CMD_folddoclosed))
@@ -11542,5 +11577,8 @@ ex_folddo(eap)
/* Execute the command on the marked lines. */
global_exe(eap->arg);
ml_clearmarked(); /* clear rest of the marks */
#ifdef FEAT_CLIPBOARD
end_global_changes();
#endif
}
#endif

View File

@@ -759,11 +759,14 @@ getcmdline(firstc, count, indent)
#ifdef FEAT_CMDWIN
if (c == cedit_key || c == K_CMDWIN)
{
/*
* Open a window to edit the command line (and history).
*/
c = ex_window();
some_key_typed = TRUE;
if (ex_normal_busy == 0 && got_int == FALSE)
{
/*
* Open a window to edit the command line (and history).
*/
c = ex_window();
some_key_typed = TRUE;
}
}
# ifdef FEAT_DIGRAPHS
else
@@ -6363,6 +6366,9 @@ ex_window()
#ifdef FEAT_RIGHTLEFT
int save_cmdmsg_rl = cmdmsg_rl;
#endif
#ifdef FEAT_FOLDING
int save_KeyTyped;
#endif
/* Can't do this recursively. Can't do it when typing a password. */
if (cmdwin_type != 0
@@ -6497,8 +6503,19 @@ ex_window()
RedrawingDisabled = i;
# ifdef FEAT_AUTOCMD
# ifdef FEAT_FOLDING
save_KeyTyped = KeyTyped;
# endif
/* Trigger CmdwinLeave autocommands. */
apply_autocmds(EVENT_CMDWINLEAVE, typestr, typestr, FALSE, curbuf);
# ifdef FEAT_FOLDING
/* Restore KeyTyped in case it is modified by autocommands */
KeyTyped = save_KeyTyped;
# endif
# endif
/* Restore the command line info. */

View File

@@ -24,20 +24,6 @@
#define BUFSIZE 8192 /* size of normal write buffer */
#define SMBUFSIZE 256 /* size of emergency write buffer */
#ifdef FEAT_CRYPT
/* crypt_magic[0] is pkzip crypt, crypt_magic[1] is sha2+blowfish */
static char *crypt_magic[] = {"VimCrypt~01!", "VimCrypt~02!"};
static char crypt_magic_head[] = "VimCrypt~";
# define CRYPT_MAGIC_LEN 12 /* must be multiple of 4! */
/* For blowfish, after the magic header, we store 8 bytes of salt and then 8
* bytes of seed (initialisation vector). */
static int crypt_salt_len[] = {0, 8};
static int crypt_seed_len[] = {0, 8};
#define CRYPT_SALT_LEN_MAX 8
#define CRYPT_SEED_LEN_MAX 8
#endif
/* Is there any system that doesn't have access()? */
#define USE_MCH_ACCESS
@@ -55,7 +41,6 @@ static char_u *readfile_charconvert __ARGS((char_u *fname, char_u *fenc, int *fd
static void check_marks_read __ARGS((void));
#endif
#ifdef FEAT_CRYPT
static int crypt_method_from_magic __ARGS((char *ptr, int len));
static char_u *check_for_cryptkey __ARGS((char_u *cryptkey, char_u *ptr, long *sizep, off_t *filesizep, int newfile, char_u *fname, int *did_ask));
#endif
#ifdef UNIX
@@ -116,6 +101,9 @@ struct bw_info
#ifdef HAS_BW_FLAGS
int bw_flags; /* FIO_ flags */
#endif
#ifdef FEAT_CRYPT
buf_T *bw_buffer; /* buffer being written */
#endif
#ifdef FEAT_MBYTE
char_u bw_rest[CONV_RESTLEN]; /* not converted bytes */
int bw_restlen; /* nr of bytes in bw_rest[] */
@@ -250,7 +238,6 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
#ifdef FEAT_CRYPT
char_u *cryptkey = NULL;
int did_ask_for_key = FALSE;
int crypt_method_used;
#endif
#ifdef FEAT_PERSISTENT_UNDO
context_sha256_T sha_ctx;
@@ -966,13 +953,6 @@ retry:
#endif
}
#ifdef FEAT_CRYPT
if (cryptkey != NULL)
/* Need to reset the state, but keep the key, don't want to ask for it
* again. */
crypt_pop_state();
#endif
/*
* When retrying with another "fenc" and the first time "fileformat"
* will be reset.
@@ -1174,6 +1154,15 @@ retry:
&& !read_buffer);
if (read_undo_file)
sha256_start(&sha_ctx);
#endif
#ifdef FEAT_CRYPT
if (curbuf->b_cryptstate != NULL)
{
/* Need to free the state, but keep the key, don't want to ask for
* it again. */
crypt_free_state(curbuf->b_cryptstate);
curbuf->b_cryptstate = NULL;
}
#endif
}
@@ -1339,6 +1328,76 @@ retry:
size = read_eintr(fd, ptr, size);
}
#ifdef FEAT_CRYPT
/*
* At start of file: Check for magic number of encryption.
*/
if (filesize == 0 && size > 0)
cryptkey = check_for_cryptkey(cryptkey, ptr, &size,
&filesize, newfile, sfname,
&did_ask_for_key);
/*
* Decrypt the read bytes. This is done before checking for
* EOF because the crypt layer may be buffering.
*/
if (cryptkey != NULL && size > 0)
{
if (crypt_works_inplace(curbuf->b_cryptstate))
{
crypt_decode_inplace(curbuf->b_cryptstate, ptr, size);
}
else
{
char_u *newptr = NULL;
int decrypted_size;
decrypted_size = crypt_decode_alloc(
curbuf->b_cryptstate, ptr, size, &newptr);
/* If the crypt layer is buffering, not producing
* anything yet, need to read more. */
if (size > 0 && decrypted_size == 0)
continue;
if (linerest == 0)
{
/* Simple case: reuse returned buffer (may be
* NULL, checked later). */
new_buffer = newptr;
}
else
{
long_u new_size;
/* Need new buffer to add bytes carried over. */
new_size = (long_u)(decrypted_size + linerest + 1);
new_buffer = lalloc(new_size, FALSE);
if (new_buffer == NULL)
{
do_outofmem_msg(new_size);
error = TRUE;
break;
}
mch_memmove(new_buffer, buffer, linerest);
if (newptr != NULL)
mch_memmove(new_buffer + linerest, newptr,
decrypted_size);
}
if (new_buffer != NULL)
{
vim_free(buffer);
buffer = new_buffer;
new_buffer = NULL;
line_start = buffer;
ptr = buffer + linerest;
}
size = decrypted_size;
}
}
#endif
if (size <= 0)
{
if (size < 0) /* read error */
@@ -1403,21 +1462,6 @@ retry:
}
#endif
}
#ifdef FEAT_CRYPT
/*
* At start of file: Check for magic number of encryption.
*/
if (filesize == 0)
cryptkey = check_for_cryptkey(cryptkey, ptr, &size,
&filesize, newfile, sfname,
&did_ask_for_key);
/*
* Decrypt the read bytes.
*/
if (cryptkey != NULL && size > 0)
crypt_decode(ptr, size);
#endif
}
skip_read = FALSE;
@@ -1430,10 +1474,9 @@ retry:
*/
if ((filesize == 0
# ifdef FEAT_CRYPT
|| (filesize == (CRYPT_MAGIC_LEN
+ crypt_salt_len[use_crypt_method]
+ crypt_seed_len[use_crypt_method])
&& cryptkey != NULL)
|| (cryptkey != NULL
&& filesize == crypt_get_header_len(
crypt_get_method_nr(curbuf)))
# endif
)
&& (fio_flags == FIO_UCSBOM
@@ -2262,15 +2305,15 @@ failed:
save_file_ff(curbuf); /* remember the current file format */
#ifdef FEAT_CRYPT
crypt_method_used = use_crypt_method;
if (cryptkey != NULL)
if (curbuf->b_cryptstate != NULL)
{
crypt_pop_state();
if (cryptkey != curbuf->b_p_key)
free_crypt_key(cryptkey);
/* don't set cryptkey to NULL, it's used below as a flag that
* encryption was used */
crypt_free_state(curbuf->b_cryptstate);
curbuf->b_cryptstate = NULL;
}
if (cryptkey != NULL && cryptkey != curbuf->b_p_key)
crypt_free_key(cryptkey);
/* Don't set cryptkey to NULL, it's used below as a flag that
* encryption was used. */
#endif
#ifdef FEAT_MBYTE
@@ -2457,10 +2500,7 @@ failed:
#ifdef FEAT_CRYPT
if (cryptkey != NULL)
{
if (crypt_method_used == 1)
STRCAT(IObuff, _("[blowfish]"));
else
STRCAT(IObuff, _("[crypted]"));
crypt_append_msg(curbuf);
c = TRUE;
}
#endif
@@ -2489,9 +2529,7 @@ failed:
#ifdef FEAT_CRYPT
if (cryptkey != NULL)
msg_add_lines(c, (long)linecnt, filesize
- CRYPT_MAGIC_LEN
- crypt_salt_len[use_crypt_method]
- crypt_seed_len[use_crypt_method]);
- crypt_get_header_len(crypt_get_method_nr(curbuf)));
else
#endif
msg_add_lines(c, (long)linecnt, filesize);
@@ -2881,33 +2919,6 @@ check_marks_read()
#endif
#if defined(FEAT_CRYPT) || defined(PROTO)
/*
* Get the crypt method used for a file from "ptr[len]", the magic text at the
* start of the file.
* Returns -1 when no encryption used.
*/
static int
crypt_method_from_magic(ptr, len)
char *ptr;
int len;
{
int i;
for (i = 0; i < (int)(sizeof(crypt_magic) / sizeof(crypt_magic[0])); i++)
{
if (len < (CRYPT_MAGIC_LEN + crypt_salt_len[i] + crypt_seed_len[i]))
continue;
if (memcmp(ptr, crypt_magic[i], CRYPT_MAGIC_LEN) == 0)
return i;
}
i = (int)STRLEN(crypt_magic_head);
if (len >= i && memcmp(ptr, crypt_magic_head, i) == 0)
EMSG(_("E821: File is encrypted with unknown method"));
return -1;
}
/*
* Check for magic number used for encryption. Applies to the current buffer.
* If found, the magic number is removed from ptr[*sizep] and *sizep and
@@ -2924,7 +2935,7 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
char_u *fname; /* file name to display */
int *did_ask; /* flag: whether already asked for key */
{
int method = crypt_method_from_magic((char *)ptr, *sizep);
int method = crypt_method_nr_from_magic((char *)ptr, *sizep);
int b_p_ro = curbuf->b_p_ro;
if (method >= 0)
@@ -2933,9 +2944,8 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
* Avoids accidentally overwriting the file with garbage. */
curbuf->b_p_ro = TRUE;
set_crypt_method(curbuf, method);
if (method > 0)
(void)blowfish_self_test();
/* Set the cryptmethod local to the buffer. */
crypt_set_cm_option(curbuf, method);
if (cryptkey == NULL && !*did_ask)
{
if (*curbuf->b_p_key)
@@ -2948,7 +2958,7 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
* Happens when retrying to detect encoding. */
smsg((char_u *)_(need_key_msg), fname);
msg_scroll = TRUE;
cryptkey = get_crypt_key(newfile, FALSE);
cryptkey = crypt_get_key(newfile, FALSE);
*did_ask = TRUE;
/* check if empty key entered */
@@ -2963,24 +2973,18 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
if (cryptkey != NULL)
{
int seed_len = crypt_seed_len[method];
int salt_len = crypt_salt_len[method];
int header_len;
crypt_push_state();
use_crypt_method = method;
if (method == 0)
crypt_init_keys(cryptkey);
else
{
bf_key_init(cryptkey, ptr + CRYPT_MAGIC_LEN, salt_len);
bf_cfb_init(ptr + CRYPT_MAGIC_LEN + salt_len, seed_len);
}
curbuf->b_cryptstate = crypt_create_from_header(
method, cryptkey, ptr);
crypt_set_cm_option(curbuf, method);
/* Remove cryptmethod specific header from the text. */
header_len = crypt_get_header_len(method);
*filesizep += header_len;
*sizep -= header_len;
mch_memmove(ptr, ptr + header_len, (size_t)*sizep);
/* Remove magic number from the text */
*filesizep += CRYPT_MAGIC_LEN + salt_len + seed_len;
*sizep -= CRYPT_MAGIC_LEN + salt_len + seed_len;
mch_memmove(ptr, ptr + CRYPT_MAGIC_LEN + salt_len + seed_len,
(size_t)*sizep);
/* Restore the read-only flag. */
curbuf->b_p_ro = b_p_ro;
}
@@ -2992,85 +2996,6 @@ check_for_cryptkey(cryptkey, ptr, sizep, filesizep, newfile, fname, did_ask)
return cryptkey;
}
/*
* Check for magic number used for encryption. Applies to the current buffer.
* If found and decryption is possible returns OK;
*/
int
prepare_crypt_read(fp)
FILE *fp;
{
int method;
char_u buffer[CRYPT_MAGIC_LEN + CRYPT_SALT_LEN_MAX
+ CRYPT_SEED_LEN_MAX + 2];
if (fread(buffer, CRYPT_MAGIC_LEN, 1, fp) != 1)
return FAIL;
method = crypt_method_from_magic((char *)buffer,
CRYPT_MAGIC_LEN +
CRYPT_SEED_LEN_MAX +
CRYPT_SALT_LEN_MAX);
if (method < 0 || method != get_crypt_method(curbuf))
return FAIL;
crypt_push_state();
if (method == 0)
crypt_init_keys(curbuf->b_p_key);
else
{
int salt_len = crypt_salt_len[method];
int seed_len = crypt_seed_len[method];
if (fread(buffer, salt_len + seed_len, 1, fp) != 1)
return FAIL;
bf_key_init(curbuf->b_p_key, buffer, salt_len);
bf_cfb_init(buffer + salt_len, seed_len);
}
return OK;
}
/*
* Prepare for writing encrypted bytes for buffer "buf".
* Returns a pointer to an allocated header of length "*lenp".
* When out of memory returns NULL.
* Otherwise calls crypt_push_state(), call crypt_pop_state() later.
*/
char_u *
prepare_crypt_write(buf, lenp)
buf_T *buf;
int *lenp;
{
char_u *header;
int seed_len = crypt_seed_len[get_crypt_method(buf)];
int salt_len = crypt_salt_len[get_crypt_method(buf)];
char_u *salt;
char_u *seed;
header = alloc_clear(CRYPT_MAGIC_LEN + CRYPT_SALT_LEN_MAX
+ CRYPT_SEED_LEN_MAX + 2);
if (header != NULL)
{
crypt_push_state();
use_crypt_method = get_crypt_method(buf); /* select zip or blowfish */
vim_strncpy(header, (char_u *)crypt_magic[use_crypt_method],
CRYPT_MAGIC_LEN);
if (use_crypt_method == 0)
crypt_init_keys(buf->b_p_key);
else
{
/* Using blowfish, add salt and seed. */
salt = header + CRYPT_MAGIC_LEN;
seed = salt + salt_len;
sha2_seed(salt, salt_len, seed, seed_len);
bf_key_init(buf->b_p_key, salt, salt_len);
bf_cfb_init(seed, seed_len);
}
}
*lenp = CRYPT_MAGIC_LEN + salt_len + seed_len;
return header;
}
#endif /* FEAT_CRYPT */
#ifdef UNIX
@@ -3224,9 +3149,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
int write_undo_file = FALSE;
context_sha256_T sha_ctx;
#endif
#ifdef FEAT_CRYPT
int crypt_method_used;
#endif
unsigned int bkc = get_bkc_value(buf);
if (fname == NULL || *fname == NUL) /* safety check */
return FAIL;
@@ -3261,6 +3184,9 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
# ifdef USE_ICONV
write_info.bw_iconv_fd = (iconv_t)-1;
# endif
#endif
#ifdef FEAT_CRYPT
write_info.bw_buffer = buf;
#endif
/* After writing a file changedtick changes but we don't want to display
@@ -3722,10 +3648,10 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
struct stat st;
#endif
if ((bkc_flags & BKC_YES) || append) /* "yes" */
if ((bkc & BKC_YES) || append) /* "yes" */
backup_copy = TRUE;
#if defined(UNIX) || defined(WIN32)
else if ((bkc_flags & BKC_AUTO)) /* "auto" */
else if ((bkc & BKC_AUTO)) /* "auto" */
{
int i;
@@ -3813,7 +3739,7 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
/*
* Break symlinks and/or hardlinks if we've been asked to.
*/
if ((bkc_flags & BKC_BREAKSYMLINK) || (bkc_flags & BKC_BREAKHARDLINK))
if ((bkc & BKC_BREAKSYMLINK) || (bkc & BKC_BREAKHARDLINK))
{
# ifdef UNIX
int lstat_res;
@@ -3821,24 +3747,24 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
lstat_res = mch_lstat((char *)fname, &st);
/* Symlinks. */
if ((bkc_flags & BKC_BREAKSYMLINK)
if ((bkc & BKC_BREAKSYMLINK)
&& lstat_res == 0
&& st.st_ino != st_old.st_ino)
backup_copy = FALSE;
/* Hardlinks. */
if ((bkc_flags & BKC_BREAKHARDLINK)
if ((bkc & BKC_BREAKHARDLINK)
&& st_old.st_nlink > 1
&& (lstat_res != 0 || st.st_ino == st_old.st_ino))
backup_copy = FALSE;
# else
# if defined(WIN32)
/* Symlinks. */
if ((bkc_flags & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname))
if ((bkc & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname))
backup_copy = FALSE;
/* Hardlinks. */
if ((bkc_flags & BKC_BREAKHARDLINK) && mch_is_hard_link(fname))
if ((bkc & BKC_BREAKHARDLINK) && mch_is_hard_link(fname))
backup_copy = FALSE;
# endif
# endif
@@ -4505,17 +4431,17 @@ restore_backup:
#ifdef FEAT_CRYPT
if (*buf->b_p_key != NUL && !filtering)
{
char_u *header;
int header_len;
char_u *header;
int header_len;
header = prepare_crypt_write(buf, &header_len);
if (header == NULL)
buf->b_cryptstate = crypt_create_for_writing(crypt_get_method_nr(buf),
buf->b_p_key, &header, &header_len);
if (buf->b_cryptstate == NULL || header == NULL)
end = 0;
else
{
/* Write magic number, so that Vim knows that this file is
* encrypted when reading it again. This also undergoes utf-8 to
* ucs-2/4 conversion when needed. */
/* Write magic number, so that Vim knows how this file is
* encrypted when reading it back. */
write_info.bw_buf = header;
write_info.bw_len = header_len;
write_info.bw_flags = FIO_NOCONVERT;
@@ -4769,12 +4695,13 @@ restore_backup:
mch_set_acl(wfname, acl);
#endif
#ifdef FEAT_CRYPT
crypt_method_used = use_crypt_method;
if (wb_flags & FIO_ENCRYPTED)
crypt_pop_state();
if (buf->b_cryptstate != NULL)
{
crypt_free_state(buf->b_cryptstate);
buf->b_cryptstate = NULL;
}
#endif
#if defined(FEAT_MBYTE) && defined(FEAT_EVAL)
if (wfname != fname)
{
@@ -4924,10 +4851,7 @@ restore_backup:
#ifdef FEAT_CRYPT
if (wb_flags & FIO_ENCRYPTED)
{
if (crypt_method_used == 1)
STRCAT(IObuff, _("[blowfish]"));
else
STRCAT(IObuff, _("[crypted]"));
crypt_append_msg(buf);
c = TRUE;
}
#endif
@@ -5740,8 +5664,26 @@ buf_write_bytes(ip)
#endif /* FEAT_MBYTE */
#ifdef FEAT_CRYPT
if (flags & FIO_ENCRYPTED) /* encrypt the data */
crypt_encode(buf, len, buf);
if (flags & FIO_ENCRYPTED)
{
/* Encrypt the data. Do it in-place if possible, otherwise use an
* allocated buffer. */
if (crypt_works_inplace(ip->bw_buffer->b_cryptstate))
{
crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len);
}
else
{
char_u *outbuf;
len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, &outbuf);
if (len == 0)
return OK; /* Crypt layer is buffering, will flush later. */
wlen = write_eintr(ip->bw_fd, outbuf, len);
vim_free(outbuf);
return (wlen < len) ? FAIL : OK;
}
}
#endif
wlen = write_eintr(ip->bw_fd, buf, len);
@@ -7700,6 +7642,7 @@ static struct event_name
{"BufWriteCmd", EVENT_BUFWRITECMD},
{"CmdwinEnter", EVENT_CMDWINENTER},
{"CmdwinLeave", EVENT_CMDWINLEAVE},
{"CmdUndefined", EVENT_CMDUNDEFINED},
{"ColorScheme", EVENT_COLORSCHEME},
{"CompleteDone", EVENT_COMPLETEDONE},
{"CursorHold", EVENT_CURSORHOLD},
@@ -9067,6 +9010,9 @@ win_found:
curwin = aco->save_curwin;
curbuf = curwin->w_buffer;
/* In case the autocommand move the cursor to a position that that
* not exist in curbuf. */
check_cursor();
}
}
}
@@ -9218,6 +9164,24 @@ has_insertcharpre()
return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL);
}
/*
* Return TRUE when there is an CmdUndefined autocommand defined.
*/
int
has_cmdundefined()
{
return (first_autopat[(int)EVENT_CMDUNDEFINED] != NULL);
}
/*
* Return TRUE when there is an FuncUndefined autocommand defined.
*/
int
has_funcundefined()
{
return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL);
}
static int
apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
event_T event;

View File

@@ -678,6 +678,17 @@ stuffReadbuff(s)
add_buff(&readbuf1, s, -1L);
}
/*
* Append string "s" to the redo stuff buffer.
* CSI and K_SPECIAL must already have been escaped.
*/
void
stuffRedoReadbuff(s)
char_u *s;
{
add_buff(&readbuf2, s, -1L);
}
void
stuffReadbuffLen(s, len)
char_u *s;

View File

@@ -105,10 +105,6 @@ EXTERN int exec_from_reg INIT(= FALSE); /* executing register */
EXTERN int screen_cleared INIT(= FALSE); /* screen has been cleared */
#ifdef FEAT_CRYPT
EXTERN int use_crypt_method INIT(= 0);
#endif
/*
* When '$' is included in 'cpoptions' option set:
* When a change command is given that deletes only part of a line, a dollar
@@ -533,6 +529,8 @@ EXTERN int clip_autoselect_plus INIT(= FALSE);
EXTERN int clip_autoselectml INIT(= FALSE);
EXTERN int clip_html INIT(= FALSE);
EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
EXTERN int clip_did_set_selection INIT(= TRUE);
EXTERN int clip_unnamed_saved INIT(= 0);
#endif
/*
@@ -1336,9 +1334,6 @@ EXTERN HWND clientWindow INIT(= 0);
#if defined(UNIX) || defined(VMS)
EXTERN int term_is_xterm INIT(= FALSE); /* xterm-like 'term' */
#endif
#if defined(UNIX)
EXTERN int xterm_conflict_mouse INIT(= FALSE);
#endif
#ifdef BACKSLASH_IN_FILENAME
EXTERN char psepc INIT(= '\\'); /* normal path separator character */

Some files were not shown because too many files have changed in this diff Show More