Merge branch 'vim'

Conflicts:
	src/auto/configure
	src/buffer.c
	src/configure.in
	src/if_python.c
	src/option.c
This commit is contained in:
Bjorn Winckler
2012-11-04 10:32:28 +01:00
120 changed files with 9384 additions and 13102 deletions
+2
View File
@@ -32,6 +32,7 @@ src/auto/pathdef.c
*.suo
*.res
*.RES
src/if_perl.c
src/pathdef.c
src/Obj*/pathdef.c
gvimext.dll
@@ -43,6 +44,7 @@ gvimext.lib
*.mo
*.swp
*~
src/po/vim.pot
# Generated by "make test"
src/po/*.ck
+66
View File
@@ -1983,3 +1983,69 @@ fdac34e3afa5f0dea26dba5e96932e3b9a0be50a v7-3-643
fb7c028dcac7555fee78096813e3846d157cc91b v7-3-644
1810ee914648ef3e16a8cf866299a32c4a9a00cb v7-3-645
e70485d3f81df4d72cb40d6fa4ad4218cf1e8392 v7-3-646
29fe4e5c1db17a62b16a95fdda84f08cd05c27b5 v7-3-647
76c099d45772a233982c39a29510d89eaa4d5a1c v7-3-648
063765c3cebbd6040dc091b8c1ba28739fef9118 v7-3-649
a638ae0f1b0cc41d8d753d79503238f11215f3ea v7-3-650
ece544e85821a6118da55dad1538ea4c3625bd1c v7-3-651
5edf3c51aa93110e57fcd0428c30e5bed149df34 v7-3-652
fd0c7452fa51118d8f6557b34b4cc96e830ef6c7 v7-3-653
73557eda70271b49015265b7147562b63a7a094d v7-3-654
0d3238b54963c4b1358a1f33221f75e067c1613f v7-3-655
a2f61b2b8e770bb8d233ce50c8c7508508578a8b v7-3-656
3958b0e672d676a310d756bff1b9c629a7b0142f v7-3-657
15cdcb8ddcfb848c929cc37e239d5da8fe48a8d9 v7-3-658
e75da4a3225d48e59ee321411134cf9999348b7d v7-3-659
8fdadfccd184b7de73811a3a18dc8815b7eb3434 v7-3-660
5e909c379a1e87491bfa95ba1a37b39d0725933b v7-3-661
87afa95a2992a31b1937def0e1db4a193b0ab32f v7-3-662
2a200527131fac8f50487790ec201badbccdaf0e v7-3-663
f86619764a1e0338ef9e14c653a5909847304b8b v7-3-664
35939e1e25ff5a3862b83248f8039971c81936d0 v7-3-665
1e22adc6176ec07f52102f383a9c3c414d43f9c2 v7-3-666
cd36c0fed43e63a94d6e87b5c5c0b4d95628da27 v7-3-667
dde6d0216a08a5554f3c351e519134c386d14232 v7-3-668
2b3b7b48370848149c8b831b2b7aee9b7f4f88bb v7-3-669
2bf8c00741f7f07d9b58596764236a92eaeca862 v7-3-670
530f5a9030315f984e096794938c61f9d3562e22 v7-3-671
fd6ef931aa77239804860b74ed2362b29c1a6d4a v7-3-672
ca1c025079b11c98363e11576d903af756a593fc v7-3-673
4da6003f0f0eee0f3908f8627af6d13a94c10cc6 v7-3-674
9963f7a9b41b555a0660288dd94df44b6dee7c2e v7-3-675
5309996ddcedd7e2dcc8c46624348405290b8940 v7-3-676
8115f449a574bc146f75449161f1757aaa5bbb66 v7-3-677
de253f606048a2862a338190b071e5e3c7de7a41 v7-3-678
dd0f25ede9a8322b5b638961835cc4743cd479a2 v7-3-679
52acec46b75ecf24d044982d4cc067ef7890e7d6 v7-3-680
a2fe24ec6a0d06d0af286b9fee9e307c33f27cca v7-3-681
8eb5b61161b4c56b378ec829e360204102d22db4 v7-3-682
0f5ee262963528ddccfa1f54b83696f939d21b53 v7-3-683
1cc37b8cfaa1c670e442e2f9444feeb1820228bc v7-3-684
34aa94a421b7a03a71013ddbb92937dbaf83b1aa v7-3-685
ba9c9d0c4ff4cf56c3c5d2dec2da71decbbe9f6a v7-3-686
0545dab1517f8ce2b8319c02572e4bb357567034 v7-3-687
2696da84d37093da0dea419878e4241385eb515b v7-3-688
3c072c1cb87372f3ebd345463abbc451e80143e2 v7-3-689
caa0ca9ad06cb515b7e6d2e4410e03802b58e167 v7-3-690
7f10daa706bb6ed0c39f1d2905cd78368a98d19f v7-3-691
337a4368fd2b68b9822b94e595d77b4d6773bfa4 v7-3-692
fd96b3cc88ed71d4c4d24c6ac67c9d3a68ae6e6b v7-3-693
8235ccf121bb241f8105d0ba6e1c92e9f8b04555 v7-3-694
cd6c420e31d6843fa1231e1cf7a3d9eff0ad4e07 v7-3-695
447c688b82eb4a5eb7cd0e16521094b77160fd0f v7-3-696
7c72b5f7ada1f4a028315aa50f8739e0e83c2e74 v7-3-697
b5b892472ecb1a10cce1709e41700b264b6485d2 v7-3-698
4ffb6f9b58e0b51923fe6a71e6af158b6e3f7864 v7-3-699
c656847932d33b5d68394ae1ea3153dbdba4d3ff v7-3-700
48af8656094539f8f71dc51e0a6aa14d48ddffd0 v7-3-701
916b5c11a13e9978c85f9742546e70d614116883 v7-3-702
f69321485951a3c9bd0e9e7484a1901b94cae726 v7-3-703
be8ad9c9b973a4d87b9bcfee2b6a8de1f6d3e071 v7-3-704
0aa74f2f50a8333fd5544f5d4b383132be41704c v7-3-705
d0ae72c2f5f94e2483ab0979eec652b1289679a8 v7-3-706
d24d309c365fc5c6a9324a6183d7b927d9f5132f v7-3-707
64427849c1582299f2af389c6225eead529f0329 v7-3-708
fb7dec372910b61478abdd7f79871724153ebfdd v7-3-709
906eb5c0ef129b6876fa9c6c5a13e44807f7a503 v7-3-710
2a7b2943be22c27edb3c0334423c1b17275f18fb v7-3-711
557ef119999ea687ccb84eddca295755c24989da v7-3-712
+12 -2
View File
@@ -261,6 +261,7 @@ SRC_DOS = \
src/Make_mvc.mak \
src/Make_w16.mak \
src/bigvim.bat \
src/bigvim64.bat \
src/msvcsetup.bat \
src/msvc2008.bat \
src/msvc2010.bat \
@@ -352,6 +353,7 @@ SRC_DOS_BIN = \
src/xpm/COPYRIGHT \
src/xpm/README.txt \
src/xpm/include/*.h \
src/xpm/x64/lib/libXpm.a \
src/xpm/x64/lib/libXpm.lib \
src/xpm/x86/lib/libXpm.a \
src/xpm/x86/lib/libXpm.lib \
@@ -691,9 +693,17 @@ LANG_GEN = \
runtime/tutor/Makefile \
runtime/tutor/tutor.utf-8 \
runtime/tutor/tutor.?? \
runtime/tutor/tutor.??.* \
runtime/tutor/tutor.??.utf-8 \
runtime/tutor/tutor.??.euc \
runtime/tutor/tutor.??.sjis \
runtime/tutor/tutor.??.iso9 \
runtime/tutor/tutor.??.big5 \
runtime/tutor/tutor.??.cp1250 \
runtime/tutor/tutor.??.cp1251 \
runtime/tutor/tutor.??.cp737 \
runtime/tutor/tutor.??_??.utf-8 \
runtime/tutor/tutor.bar \
runtime/tutor/tutor.bar.* \
runtime/tutor/tutor.bar.utf-8 \
runtime/spell/README.txt \
runtime/spell/??/*.diff \
runtime/spell/??/main.aap \
+4 -1
View File
@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.3. Last change: 2012 Jul 10
*autocmd.txt* For Vim version 7.3. Last change: 2012 Sep 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -263,8 +263,10 @@ Name triggered by ~
Startup and exit
|VimEnter| after doing all the startup stuff
|GUIEnter| after starting the GUI successfully
|GUIFailed| after starting the GUI failed
|TermResponse| after the terminal response to |t_RV| is received
|QuitPre| when using `:quit`, before deciding whether to quit
|VimLeavePre| before exiting Vim, before writing the viminfo file
|VimLeave| before exiting Vim, after writing the viminfo file
@@ -312,6 +314,7 @@ Name triggered by ~
|SessionLoadPost| after loading a session file
|MenuPopup| just before showing the popup menu
|CompleteDone| after Insert mode completion is done
|User| to be used in combination with ":doautocmd"
+2 -2
View File
@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 7.3. Last change: 2012 Jun 20
*cmdline.txt* For Vim version 7.3. Last change: 2012 Oct 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -217,7 +217,7 @@ CTRL-\ e {expr} *c_CTRL-\_e*
:return cmd
:endfunc
< This doesn't work recursively, thus not when already editing
an expression.
an expression. But it is possible to use in a mapping.
*c_CTRL-Y*
CTRL-Y When there is a modeless selection, copy the selection into
+6 -6
View File
@@ -1,4 +1,4 @@
*diff.txt* For Vim version 7.3. Last change: 2012 Aug 08
*diff.txt* For Vim version 7.3. Last change: 2012 Sep 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -86,16 +86,16 @@ diff mode. You could use a construct like this: >
While already in Vim you can start diff mode in three ways.
*E98*
:diffsplit {filename} *:diffs* *:diffsplit*
:diffs[plit] {filename} *:diffs* *:diffsplit*
Open a new window on the file {filename}. The options are set
as for "vimdiff" for the current and the newly opened window.
Also see 'diffexpr'.
*:difft* *:diffthis*
:diffthis Make the current window part of the diff windows. This sets
:difft[his] Make the current window part of the diff windows. This sets
the options like for "vimdiff".
:diffpatch {patchfile} *E816* *:diffp* *:diffpatch*
:diffp[atch] {patchfile} *E816* *:diffp* *:diffpatch*
Use the current buffer, patch it with the diff found in
{patchfile} and open a buffer on the result. The options are
set as for "vimdiff".
@@ -123,9 +123,9 @@ Since the option values are remembered with the buffer, you can edit another
file for a moment and come back to the same file and be in diff mode again.
*:diffo* *:diffoff*
:diffoff Switch off diff mode for the current window.
:diffo[ff] Switch off diff mode for the current window.
:diffoff! Switch off diff mode for the current window and in all windows
:diffo[ff]! Switch off diff mode for the current window and in all windows
in the current tab page where 'diff' is set.
The ":diffoff" command resets the relevant options to their default value.
+31 -12
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.3. Last change: 2012 Aug 02
*eval.txt* For Vim version 7.3. Last change: 2012 Oct 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -91,8 +91,8 @@ For boolean operators Numbers are used. Zero is FALSE, non-zero is TRUE.
Note that in the command >
:if "foo"
"foo" is converted to 0, which means FALSE. To test for a non-empty string,
use strlen(): >
:if strlen("foo")
use empty(): >
:if !empty("foo")
< *E745* *E728* *E703* *E729* *E730* *E731*
List, Dictionary and Funcref types are not automatically converted.
@@ -759,7 +759,7 @@ of a |List| is different from the original |List|. When using "is" without
a |List| or a |Dictionary| it is equivalent to using "equal", using "isnot"
equivalent to using "not equal". Except that a different type means the
values are different: "4 == '4'" is true, "4 is '4'" is false and "0 is []" is
false and not a error. "is#"/"isnot#" and "is?"/"isnot?" can be used to match
false and not an error. "is#"/"isnot#" and "is?"/"isnot?" can be used to match
and ignore case.
When comparing a String with a Number, the String is converted to a Number,
@@ -1932,6 +1932,7 @@ setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
shellescape( {string} [, {special}])
String escape {string} for use as shell
command argument
shiftwidth() Number effective value of 'shiftwidth'
simplify( {filename}) String simplify filename as much as possible
sin( {expr}) Float sine of {expr}
sinh( {expr}) Float hyperbolic sine of {expr}
@@ -3754,10 +3755,10 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()*
Like |input()|, but when the GUI is running and text dialogs
are supported, a dialog window pops up to input the text.
Example: >
:let n = inputdialog("value for shiftwidth", &sw)
:if n != ""
: let &sw = n
:endif
:let n = inputdialog("value for shiftwidth", shiftwidth())
:if n != ""
: let &sw = n
:endif
< When the dialog is cancelled {cancelreturn} is returned. When
omitted an empty string is returned.
Hitting <Enter> works like pressing the OK button. Hitting
@@ -4635,8 +4636,8 @@ pyeval({expr}) *pyeval()*
Numbers and strings are returned as they are (strings are
copied though).
Lists are represented as Vim |List| type.
Dictionaries are represented as Vim |Dictionary| type with
keys converted to strings.
Dictionaries are represented as Vim |Dictionary| type,
non-string keys result in error.
{only available when compiled with the |+python| feature}
*E726* *E727*
@@ -5253,8 +5254,9 @@ setreg({regname}, {value} [,{options}])
If {options} contains no register settings, then the default
is to use character mode unless {value} ends in a <NL>.
Setting the '=' register is not possible.
Returns zero for success, non-zero for failure.
Setting the '=' register is not possible, but you can use >
:let @= = var_expr
< Returns zero for success, non-zero for failure.
Examples: >
:call setreg(v:register, @*)
@@ -5330,6 +5332,23 @@ shellescape({string} [, {special}]) *shellescape()*
:call system("chmod +w -- " . shellescape(expand("%")))
shiftwidth() *shiftwidth()*
Returns the effective value of 'shiftwidth'. This is the
'shiftwidth' value unless it is zero, in which case it is the
'tabstop' value. To be backwards compatible in indent
plugins, use this: >
if exists('*shiftwidth')
func s:sw()
return shiftwidth()
endfunc
else
func s:sw()
return &sw
endfunc
endif
< And then use s:sw() instead of &sw.
simplify({filename}) *simplify()*
Simplify the file name as much as possible without changing
the meaning. Shortcuts (on MS-Windows) or symbolic links (on
+1 -1
View File
@@ -93,7 +93,7 @@ Details
This is also the keymap when 'keymap=hebrew' is set. The advantage of
'keymap' is that it works properly when using UTF8, e.g. it inserts the
correct characters; 'hkmap' does not. The 'keymap' keyboard can also
insert niqud and te`amim. To see what those mappings are,look at the
insert niqud and te`amim. To see what those mappings are, look at the
keymap file 'hebrew.vim' etc.
+21 -1
View File
@@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 7.3. Last change: 2012 Aug 02
*if_pyth.txt* For Vim version 7.3. Last change: 2012 Sep 23
VIM REFERENCE MANUAL by Paul Moore
@@ -159,6 +159,26 @@ vim.bindeval(str) *python-bindeval*
vimlist or vimdictionary python type that are connected to original
list or dictionary. Thus modifications to these objects imply
modifications of the original.
Additionally, vimlist and vimdictionary type have read-write
`.locked` attribute that returns
Value Meaning ~
zero Variable is not locked
vim.VAR_LOCKED Variable is locked, but can be unlocked
vim.VAR_FIXED Variable is locked and can't be unlocked
integer constants. If variable is not fixed, you can do
`var.locked=True` to lock it and `var.locked=False` to unlock.
There is no recursive locking like |:lockvar|! does. There is also
no way to lock a specific key or check whether it is locked (in any
case these locks are ignored by anything except |:let|: |extend()|
does not care, neither does python interface).
Vimdictionary type also supports `.scope` attribute which is one of
Value Meaning ~
zero Dictionary is not a scope one
vim.VAR_DEF_SCOPE Function-local or global scope dictionary
vim.VAR_SCOPE Other scope dictionary
2. if expression evaluates to a function reference, then it returns
callable vimfunction object. Use self keyword argument to assign
|self| object for dictionary functions.
+2 -2
View File
@@ -1,4 +1,4 @@
*indent.txt* For Vim version 7.3. Last change: 2011 Sep 02
*indent.txt* For Vim version 7.3. Last change: 2012 Aug 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -540,7 +540,7 @@ The examples below assume a 'shiftwidth' of 4.
*cino-star*
*N Vim searches for unclosed comments at most N lines away. This
limits the time needed to search for the start of a comment.
If your /* */ comments stop indenting afer N lines this is the
If your /* */ comments stop indenting after N lines this is the
value you will want to change.
(default 70 lines).
+3 -1
View File
@@ -1,4 +1,4 @@
*intro.txt* For Vim version 7.3. Last change: 2011 May 15
*intro.txt* For Vim version 7.3. Last change: 2012 Sep 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -394,6 +394,8 @@ CTRL-{char} {char} typed as a control character; that is, typing {char}
*quotecommandquote*
"command" A reference to a command that you can type is enclosed in
double quotes.
`command` New style command, this distinguishes it from other
quoted text and strings.
*key-notation* *key-codes* *keycodes*
These names for keys are used in the documentation. They can also be used
+8 -1
View File
@@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 7.3. Last change: 2012 Jun 06
*mbyte.txt* For Vim version 7.3. Last change: 2012 Oct 06
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -1085,6 +1085,13 @@ Since the mapping is defined with |:lnoremap| the resulting quote will not be
used for the start of another character.
The "accents" keymap uses this. *keymap-accents*
The first column can also be in |<>| form:
<C-c> Ctrl-C
<A-c> Alt-c
<A-C> Alt-C
Note that the Alt mappings may not work, depending on your keyboard and
terminal.
Although it's possible to have more than one character in the second column,
this is unusual. But you can use various ways to specify the character: >
A a literal character
+5 -3
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.3. Last change: 2012 Aug 15
*options.txt* For Vim version 7.3. Last change: 2012 Oct 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -761,7 +761,7 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
When on and 'termbidi' is off, the required visual character
corrections that need to take place for displaying the Arabic language
take affect. Shaping, in essence, gets enabled; the term is a broad
take effect. Shaping, in essence, gets enabled; the term is a broad
one which encompasses:
a) the changing/morphing of characters based on their location
within a word (initial, medial, final and stand-alone).
@@ -6234,7 +6234,8 @@ A jump table for the options with a short description can be found at |Q_op|.
local to buffer
Number of spaces to use for each step of (auto)indent. Used for
|'cindent'|, |>>|, |<<|, etc.
When zero the 'ts' value will be used.
When zero the 'ts' value will be used. Use the |shiftwidth()|
function to get the effective shiftwidth value.
*'shortmess'* *'shm'*
'shortmess' 'shm' string (Vim default "filnxtToO", Vi default: "",
@@ -6498,6 +6499,7 @@ A jump table for the options with a short description can be found at |Q_op|.
of 8, while being able to edit like it is set to 'sts'. However,
commands like "x" still work on the actual characters.
When 'sts' is zero, this feature is off.
When 'sts' is negative, the value of 'shiftwidth' is used.
'softtabstop' is set to 0 when the 'paste' option is set.
See also |ins-expandtab|. When 'expandtab' is not set, the number of
spaces is minimized by using <Tab>s.
+1
View File
@@ -7641,6 +7641,7 @@ shell_error-variable eval.txt /*shell_error-variable*
shellescape() eval.txt /*shellescape()*
shift intro.txt /*shift*
shift-left-right change.txt /*shift-left-right*
shiftwidth() eval.txt /*shiftwidth()*
short-name-changed version4.txt /*short-name-changed*
showing-menus gui.txt /*showing-menus*
sign-commands sign.txt /*sign-commands*
+95 -15
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.3. Last change: 2012 Aug 15
*todo.txt* For Vim version 7.3. Last change: 2012 Oct 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,46 +38,114 @@ Go through more coverity reports.
Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10)
Checking runtime scripts: Thilo Six, 2012 Jun 6.
GTK: problem with 'L' in 'guioptions' changing the window width.
(Aaron Cornelius, 2012 Feb 6)
Checking runtime scripts: Thilo Six, 2012 Jun 6.
Patch to fix undofile hash computed when not necessary. (Christian Brabandt,
2012 Oct 16, update Oct 18)
Patch to fix repeating "cgn". (Christian Brabandt, 2012 Oct 16)
Update Oct 17.
Javascript file where indent gets stuck on: GalaxyMaster, 2012 May 3.
Updated French and Esperanto files. (Dominique Pelle, 2012 Aug 19)
When showing diffs filler lines may be hidden at first.
Patch by Christian Brabandt, 2012 Sep 6. Update Oct 11.
Patch for memory leaks on exception. (ZyX, 2012 Sep 9)
The CompleteDone autocommand needs some info passed to it:
- The word that was selected (empty if abandoned complete)
- Type of completion: tag, omnifunc, user func.
Unwanted file name escaping: ":echo input('file:' , '', 'file')"
And use file name completion on a file with spaces. (Frederic Hardy, 2009 Mar
23)
Patch by Christian Brabandt, 2012 Oct 18. Update Oct 19.
mouse_sgr is not ordered alphabetically in :version output.
Docs list mouse_urxvt as normal feature, should be big. (Hayaki Saito, 2012
Aug 16)
":gundo" command: global undo. Undoes changes spread over multiple files in
the order they were made. Also ":gredo". Both with a count. Useful when
tests fail after making changes and you forgot in which files.
Patch to make updating tabline faster. (Arseny Kapoulkine, 2012 Oct 3)
Crash with vimdiff. (Don Cruickshank, 2012 Sep 23)
Win32: use 'guifontwide' for IME composition. (Taro Muraoka, 2012 Sep 30)
Update Oct 2.
Patch to make multibyte input work on Win32 console when codepage differs from
'encoding'. (Ken Takata, 2012 Sep 29)
It's possible to defined an input() function that overrides the built-in one.
(ZyX, 2012 Sep 28)
Win32: When a directory name contains an exclamation mark, completion doesn't
complete the contents of the directory. No escaping for the "!"? (Jan
Stocker, 2012 Jan 5)
Patch to support 'u' in interactive substitute. (Christian Brabandt, 2012 Sep
28) With tests: Oct 9.
Patch for IME handling, adds 'imactivatefunc' and 'imstatusfunc' option.
(Yukihiro Nakadaira, 2012 Aug 16)
Patch to improve IME handling. (Yasuhiro Matsumoto, 2012 Jul 18)
Issue 54: document behavior of -complete, also expands arg.
New syntax files for apt. (quidame, 2012 Sep 21)
Patch for if_lua. (Luis Carvalho, 2012 Aug 26, update Aug 29, another Aug 30,
then Sep 1, reminder Oct 14)
Issue 72: 'autochdir' causes problems for :vimgrep.
:setlocal does not work in the sandbox, but :set does. Both should work in a
similar way (not setting some options). (Michael Henry, 2012 Oct 20)
In the ATTENTION message about an existing swap file, mention the name of the
process that is running. It might actually be some other program, e.g. after
a reboot.
MS-Windows: Crash opening very long file name starting with "\\".
(Christian Brock, 2012 Jun 29)
Win32: patch for current directory, "loading iof conv". (Ken Takata, 2012 Sep
15)
It's probably a good idea to make a negative value for 'sts' use the value of
'sw'. Patch by So8res, Oct 3 2012
Syntax update problem in one buffer opened in two windows, bottom window is
not correctly updated. (Paul Harris, 2012 Feb 27)
Patch to add assignments in cscope. (Uli Meis, Estabrooks, 2012 Sep 1)
Alternate patch by Gary Johnson, Sep 4.
Patch to add getsid(). (Tyru, 2011 Oct 2) Do we want this? Update Oct 4.
Or use expand('<sid>')?
Patch to improve IME handling. (Yasuhiro Matsumoto, 2012 Jul 18)
Patch for :tabcloseleft, after closing a tab go to left tab. (William Bowers,
2012 Aug 4)
Patch for Tab behavior with 'conceal'. (Dominique Pelle, 2012 Mar 18)
Patch to test functionality of 'conceal' with tabs. (Simon Ruderich, 2012 Sep
5) Update with screencol() and screenrow() functions: Sep 7.
Crash in autocmd that unloads buffers in a BufUnload event. (Andrew Pimlott,
2012 Aug 11) Disallow :new when BufUnload is being handled?
MS-Windows ACL support doesn't work well. Patch from Ken Takata, 2012 Aug 29.
Update Aug 31.
MS-Windows resizing problems:
- Windows window on screen positioning: Patch by Yukihiro Nakadaira, 2012 Jun
20. Uses getWindowRect() instead of GetWindowPlacement()
@@ -94,6 +162,13 @@ The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O.
Suggestion for another map. (Philip Mat, 2012 Jun 18)
But use "gi" instead of "a". Or use CTRL-\ CTRL-O.
Patch to support user name completion on MS-Windows. (Yasuhiro Matsumoto, 2012
Aug 16)
Have an option for spell checking to not mark any Chinese, Japanese or other
double-width characters as error. Or perhaps all characters above 256.
(Bill Sun) Helps a lot for mixed Asian and latin text.
URXVT:
- will get stuck if byte sequence does not containe expected semicolon.
- Use urxvt mouse support also in xterm. Explanations:
@@ -108,17 +183,24 @@ Do give the prompt? Quit with an error?
Patch for 'backupcopy' default behavior for symlinks on Windows. (David Pope,
2012 Mar 21, update Mar 31)
With fix for memory leak: Ken Takata, 2012 Aug 24
Another update Sep 24.
Patch to list user digraphs. (Christian Brabandt, 2012 Apr 14)
Patch for input method status. (Hirohito Higashi, 2012 Apr 18)
Patch to print the result of a :python command. (Maxim Philippov
<philippovmi@gmail.com>, 2012 Aug 16) Update Aug 17.
Problem with winfixheight and resizing. (Yukihiro Nakadaira, 2011 Sep 17)
Patch Sep 18.
Patch for IME problems. Remove hacking code for old IM. (Yukihiro Nakadaira,
2012 Jul 20)
/[^\n] does match at a line break. Expected to do the same as /.
Patch for has('unnamedplus') docs. (Tony Mechelynck, 2011 Sep 27)
And one for gui_x11.txt.
@@ -162,9 +244,6 @@ Patch to add ":py3do". (Lilydjwg, 2012 Apr 7)
Plugin for Modeleasy. (Massimiliano Tripoli, 2011 Nov 29)
When using remote-silent the -R flag is not passed on. (Axel Bender, 2012 May
31)
Updated syntax file for ssh_config, maintainer doesn't respond.
(Leonard Ehrenfried, 2011 Sep 26)
@@ -682,10 +761,6 @@ Now that colnr_T is int instead of unsigned, more type casts can be removed.
'delcombine' does not work for the command line. (Tony Mechelynck, 2009 Jul
20)
Unwanted file name escaping: ":echo input('file:' , '', 'file')"
And use file name completion on a file with spaces. (Frederic Hardy, 2009 Mar
23)
Don't load macmap.vim on startup, turn it into a plugin. (Ron Aaron,
2009 Apr 7) Reminder Apr 14.
@@ -725,10 +800,6 @@ Support a 'systemencoding' option (for Unix). It specifies the encoding of
file names. (Kikuchan, 2010 Oct 5). Useful on a latin1 or double-byte Asian
system when 'encoding' is "utf-8".
Win32: A --remote command that has a directory name starting with a ( doesn't
work, the backslash is removed, assuming that it escapes the (. (Valery
Kondakoff, 2009 May 13)
Win32 GUI: Changing manifest helps for dpi changes (Joe Castro, 2009 Mar 27)
Win32 GUI: last message from startup doesn't show up when there is an echoerr
@@ -914,6 +985,15 @@ escaping characters where the backslash is not removed later. Asked Chris for
an alternate solution, also for src/ex_getln.c.
This also fails when the file or directory name contains "%". (Thoml, 2008
July 7)
Using --remote-silent while the current directory has a # in the name does not
work, the # needs to be escaped. (Tramblay Bruno, 2012 Sep 15)
When using remote-silent the -R flag is not passed on. (Axel Bender, 2012 May
31)
Win32: A --remote command that has a directory name starting with a ( doesn't
work, the backslash is removed, assuming that it escapes the (. (Valery
Kondakoff, 2009 May 13)
Problem with 'langmap' being used on the rhs of a mapping. (Nikolai Weibull,
2008 May 14)
+3 -3
View File
@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 7.3. Last change: 2012 Mar 16
*usr_41.txt* For Vim version 7.3. Last change: 2012 Oct 13
VIM USER MANUAL - by Bram Moolenaar
@@ -1581,7 +1581,7 @@ Here the comment part will be ignored. However, Vim will try to unmap
RESTORING THE VIEW
Sometimes you want to make a change and go back to where cursor was.
Sometimes you want to make a change and go back to where the cursor was.
Restoring the relative position would also be nice, so that the same line
appears at the top of the window.
This example yanks the current line, puts it above the first line in the
@@ -1681,7 +1681,7 @@ in your plugin file!
HEADER
You will probably add new corrections to the plugin and soon have several
versions laying around. And when distributing this file, people will want to
versions lying around. And when distributing this file, people will want to
know who wrote this wonderful plugin and where they can send remarks.
Therefore, put a header at the top of your plugin: >
+1 -1
View File
@@ -66,7 +66,7 @@ position.
lines as used for the last Visual operation, but at
the current cursor position, multiplied by [count].
When the previous Visual operation was on a block both
the width and height of the block are multipiled by
the width and height of the block are multiplied by
[count].
When there was no previous Visual operation [count]
characters are selected. This is like moving the
+16 -2
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 Aug 02
" Last Change: 2012 Oct 05
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -128,6 +128,11 @@ au BufNewFile,BufRead .asoundrc,*/usr/share/alsa/alsa.conf,*/etc/asound.conf set
" Arc Macro Language
au BufNewFile,BufRead *.aml setf aml
" APT config file
au BufNewFile,BufRead apt.conf setf aptconf
au BufNewFile,BufRead */.aptitude/config setf aptconf
au BufNewFile,BufRead */etc/apt/apt.conf.d/{[-_[:alnum:]]\+,[-_.[:alnum:]]\+.conf} setf aptconf
" Arch Inventory file
au BufNewFile,BufRead .arch-inventory,=tagging-method setf arch
@@ -633,6 +638,9 @@ au BufNewFile,BufRead *.dsl setf dsl
" DTD (Document Type Definition for XML)
au BufNewFile,BufRead *.dtd setf dtd
" DTS/DSTI (device tree files)
au BufNewFile,BufRead *.dts,*.dtsi setf dts
" EDIF (*.edf,*.edif,*.edn,*.edo)
au BufNewFile,BufRead *.ed\(f\|if\|n\|o\) setf edif
@@ -1558,7 +1566,7 @@ au BufNewFile,BufRead *.reg
au BufNewFile,BufRead *.rib setf rib
" Rexx
au BufNewFile,BufRead *.rexx,*.rex,*.jrexx,*.rxj,*.orx setf rexx
au BufNewFile,BufRead *.rex,*.orx,*.rxo,*.rxj,*.jrexx,*.rexxj,*.rexx,*.testGroup,*.testUnit setf rexx
" R (Splus)
if has("fname_case")
@@ -1772,6 +1780,10 @@ func! SetFileTypeSH(name)
" Some .sh scripts contain #!/bin/tcsh.
call SetFileTypeShell("tcsh")
return
elseif a:name =~ '\<zsh\>'
" Some .sh scripts contain #!/bin/zsh.
call SetFileTypeShell("zsh")
return
elseif a:name =~ '\<ksh\>'
let b:is_kornshell = 1
if exists("b:is_bash")
@@ -1872,6 +1884,8 @@ au BufNewFile,BufRead *.st setf st
au BufNewFile,BufRead *.cls
\ if getline(1) =~ '^%' |
\ setf tex |
\ elseif getline(1)[0] == '#' && getline(1) =~ 'rexx' |
\ setf rexx |
\ else |
\ setf st |
\ endif
+3 -3
View File
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: generic Changelog file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2011-05-02
" Latest Revision: 2012-08-23
" Variables:
" g:changelog_timeformat (deprecated: use g:changelog_dateformat instead) -
" description: the timeformat used in ChangeLog entries.
@@ -106,10 +106,10 @@ if &filetype == 'changelog'
function! s:passwd_field(line, field)
let fields = split(a:line, ':', 1)
if len(fields) < field
if len(fields) < a:field
return ""
endif
return fields[field - 1]
return fields[a:field - 1]
endfunction
function! s:capitalize(word)
+30 -25
View File
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Zimbu
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 May 18
" Last Change: 2012 Sep 08
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -34,7 +34,7 @@ setlocal errorformat^=%f\ line\ %l\ col\ %c:\ %m,ERROR:\ %m
" When the matchit plugin is loaded, this makes the % command skip parens and
" braces in comments.
let b:match_words = '\(^\s*\)\@<=\(MODULE\|CLASS\|INTERFACE\|BITS\|ENUM\|SHARED\|FUNC\|REPLACE\|DEFINE\|PROC\|EQUAL\|MAIN\|IF\|GENERATE_IF\|WHILE\|REPEAT\|WITH\|DO\|FOR\|SWITCH\|TRY\)\>\|{\s*$:\(^\s*\)\@<=\(ELSE\|ELSEIF\|GENERATE_ELSE\|GENERATE_ELSEIF\|CATCH\|FINALLY\)\>:\(^\s*\)\@<=}\|\<UNTIL\>'
let b:match_words = '\(^\s*\)\@<=\(MODULE\|CLASS\|INTERFACE\|BITS\|ENUM\|SHARED\|FUNC\|REPLACE\|DEFINE\|PROC\|EQUAL\|MAIN\|IF\|GENERATE_IF\|WHILE\|REPEAT\|WITH\|DO\|FOR\|SWITCH\|TRY\)\>\|{\s*$:\(^\s*\)\@<=\(ELSE\|ELSEIF\|GENERATE_ELSE\|GENERATE_ELSEIF\|CATCH\|FINALLY\)\>:\(^\s*\)\@<=\(}\|\<UNTIL\>\)'
let b:match_skip = 's:comment\|string\|zimbuchar'
@@ -43,12 +43,36 @@ setlocal et sts=2 sw=2
" Does replace when a dot, space or closing brace is typed.
func! GCUpperDot(what)
let col = col(".") - strlen(a:what)
if v:char != ' ' && v:char != "\r" && v:char != "\x1b" && v:char != '.' && v:char != ')' && v:char != '}'
if v:char != ' ' && v:char != "\r" && v:char != "\x1b" && v:char != '.' && v:char != ')' && v:char != '}' && v:char != ','
" no space or dot after the typed text
let g:got_char = v:char
return a:what
endif
return GCUpperCommon(a:what)
endfunc
" Does not replace when a dot is typed.
func! GCUpper(what)
if v:char != ' ' && v:char != "\r" && v:char != "\x1b" && v:char != ')' && v:char != ','
" no space or other "terminating" character after the typed text
let g:got_char = v:char
return a:what
endif
return GCUpperCommon(a:what)
endfunc
" Only replaces when a space is typed.
func! GCUpperSpace(what)
if v:char != ' '
" no space after the typed text
let g:got_char = v:char
return a:what
endif
return GCUpperCommon(a:what)
endfunc
func! GCUpperCommon(what)
let col = col(".") - strlen(a:what)
if col > 1 && getline('.')[col - 2] != ' '
" no space before the typed text
let g:got_char = 999
@@ -64,34 +88,15 @@ func! GCUpperDot(what)
return toupper(a:what)
endfunc
" Does not replace when a dot is typed.
func! GCUpper(what)
if v:char != ' ' && v:char != "\r" && v:char != "\x1b" && v:char != ')'
" no space after the typed text
let g:got_char = v:char
return a:what
endif
return GCUpperDot(a:what)
endfunc
" Only replaces when a space is typed.
func! GCUpperSpace(what)
if v:char != ' '
" no space after the typed text
let g:got_char = v:char
return a:what
endif
return GCUpperDot(a:what)
endfunc
iabbr <buffer> <expr> alias GCUpperSpace("alias")
iabbr <buffer> <expr> arg GCUpperDot("arg")
iabbr <buffer> <expr> bad GCUpper("bad")
iabbr <buffer> <expr> break GCUpper("break")
iabbr <buffer> <expr> case GCUpperSpace("case")
iabbr <buffer> <expr> catch GCUpperSpace("catch")
iabbr <buffer> <expr> check GCUpperDot("check")
iabbr <buffer> <expr> class GCUpperSpace("class")
iabbr <buffer> <expr> interface GCUpperSpace("interface")
iabbr <buffer> <expr> implements GCUpperSpace("implements")
iabbr <buffer> <expr> shared GCUpperSpace("shared")
iabbr <buffer> <expr> continue GCUpper("continue")
iabbr <buffer> <expr> default GCUpper("default")
+2 -2
View File
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Zimbu
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2011 Jun 19
" Last Change: 2012 Sep 08
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -101,7 +101,7 @@ func GetZimbuIndent(lnum)
endwhile
endif
if prevline =~ '^\s*\(IF\|\|ELSEIF\|ELSE\|GENERATE_IF\|\|GENERATE_ELSEIF\|GENERATE_ELSE\|WHILE\|REPEAT\|TRY\|CATCH\|FINALLY\|FOR\|DO\|SWITCH\|CASE\|DEFAULT\|FUNC\|VIRTUAL\|ABSTRACT\|DEFINE\|REPLACE\|FINAL\|PROC\|MAIN\|NEW\|ENUM\|CLASS\|BITS\|MODULE\|SHARED\)\>'
if prevline =~ '^\s*\(IF\|\|ELSEIF\|ELSE\|GENERATE_IF\|\|GENERATE_ELSEIF\|GENERATE_ELSE\|WHILE\|REPEAT\|TRY\|CATCH\|FINALLY\|FOR\|DO\|SWITCH\|CASE\|DEFAULT\|FUNC\|VIRTUAL\|ABSTRACT\|DEFINE\|REPLACE\|FINAL\|PROC\|MAIN\|NEW\|ENUM\|CLASS\|INTERFACE\|BITS\|MODULE\|SHARED\)\>'
let plindent += &sw
endif
if thisline =~ '^\s*\(}\|ELSEIF\>\|ELSE\>\|CATCH\|FINALLY\|GENERATE_ELSEIF\>\|GENERATE_ELSE\>\|UNTIL\>\)'
+8 -3
View File
@@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2011 Mar 22
" Last Change: 2012 Oct 21
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
" in all modes and avoid side effects from mappings defined by the user.
@@ -486,6 +486,10 @@ if has("spell")
let enc = &enc
endif
if !exists("g:menutrans_set_lang_to")
let g:menutrans_set_lang_to = 'Set language to'
endif
let found = 0
let s = globpath(&rtp, "spell/*." . enc . ".spl")
if s != ""
@@ -493,8 +497,9 @@ if has("spell")
for f in split(s, "\n")
let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "")
if nm != "en" && nm !~ '/'
let _nm = nm
let found += 1
let menuname = '&Tools.&Spelling.Set\ language\ to\ "' . nm . '"'
let menuname = '&Tools.&Spelling.' . escape(g:menutrans_set_lang_to, "\\. \t|") . '\ "' . nm . '"'
exe 'an 40.335.' . n . ' ' . menuname . ' :set spl=' . nm . ' spell<CR>'
let s:undo_spellang += ['aun ' . menuname]
endif
@@ -504,7 +509,7 @@ if has("spell")
if found == 0
echomsg "Could not find other spell files"
elseif found == 1
echomsg "Found spell file " . nm
echomsg "Found spell file " . _nm
else
echomsg "Found " . found . " more spell files"
endif
+3 -2
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types in scripts
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2010 Sep 22
" Last change: 2012 Aug 30
" 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
@@ -198,7 +198,8 @@ else
" - "=== ", line of "=", "---", "+++ " (SVK diff)
" - "=== ", "--- ", "+++ " (bzr diff, common case)
" - "=== (removed|added|renamed|modified)" (bzr diff, alternative)
elseif s:line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\)'
" - "# HG changeset patch" in first line (Mercurial export format)
elseif s:line1 =~ '^\(diff\>\|Only in \|\d\+\(,\d\+\)\=[cda]\d\+\>\|# It was generated by makepatch \|Index:\s\+\f\+\r\=$\|===== \f\+ \d\+\.\d\+ vs edited\|==== //\f\+#\d\+\|# HG changeset patch\)'
\ || (s:line1 =~ '^--- ' && s:line2 =~ '^+++ ')
\ || (s:line1 =~ '^\* looking for ' && s:line2 =~ '^\* comparing to ')
\ || (s:line1 =~ '^\*\*\* ' && s:line2 =~ '^--- ')
+112 -52
View File
@@ -1,8 +1,9 @@
" Vim ABAP syntax file
" Language: SAP - ABAP/R4
" Revision: 1.0
" Maintainer: Marius Piedallu van Wyk <marius@e.co.za>
" Last Change: 2006 Apr 13
" Revision: 2.0
" Maintainer: Marius Piedallu van Wyk <lailoken@gmail.com>
" Last Change: 2012 Oct 12
" Comment: Thanks to EPI-USE Labs for all your assistance. :)
" For version < 6.0: Clear all syntax items
" For version >= 6.0: Quit when a syntax file was already loaded
@@ -16,73 +17,126 @@ endif
syn case ignore
" Symbol Operators
syn match abapSymbolOperator "[+\-/=<>$]"
syn match abapSymbolOperator "\*"
syn match abapSymbolOperator "[<>]="
syn match abapSymbolOperator "<>"
syn match abapSymbolOperator "\*\*"
syn match abapSymbolOperator "[()]"
syn match abapSymbolOperator "[:,\.]"
syn match abapSymbolOperator "\W+\W"
syn match abapSymbolOperator "\W-\W"
syn match abapSymbolOperator "\W/\W"
syn match abapSymbolOperator "\W%\W"
syn match abapSymbolOperator "\W=\W"
syn match abapSymbolOperator "\W<\W"
syn match abapSymbolOperator "\W>\W"
syn match abapSymbolOperator "\W\*\W"
syn match abapSymbolOperator "\W[<>]=\W"
syn match abapSymbolOperator "\W<>\W"
syn match abapSymbolOperator "\W\*\*\W"
syn match abapSymbolOperator "\[\]"
syn match abapSymbolOperator "->\*\?"
syn match abapSymbolOperator "=>"
syn match abapSymbolOperator "[()~:,\.&$]"
" Literals
syn region abapString matchgroup=abapString start="'" end="'" contains=abapStringEscape
syn match abapStringEscape contained "''"
syn region abapCharString matchgroup=abapCharString start="'" end="'" contains=abapCharStringEscape
syn match abapCharStringEscape contained "''"
syn match abapNumber "-\=\<\d\+\>"
syn region abapString matchgroup=abapString start="`" end="`" contains=abapStringEscape
syn match abapStringEscape contained "``"
syn match abapNumber "\-\=\<\d\+\>"
syn region abapHex matchgroup=abapHex start="X'" end="'"
if version >= 600
setlocal iskeyword=-,48-57,_,A-Z,a-z
setlocal iskeyword=48-57,_,A-Z,a-z,/
else
set iskeyword=-,48-57,_,A-Z,a-z
set iskeyword=48-57,_,A-Z,a-z,/
endif
syn match abapNamespace "/\w\+/"
" multi-word statements
syn match abapComplexStatement "\(WITH\W\+\(HEADER\W\+LINE\|FRAME\|KEY\)\|WITH\)"
syn match abapComplexStatement "NO\W\+STANDARD\W\+PAGE\W\+HEADING"
syn match abapComplexStatement "\(EXIT\W\+FROM\W\+STEP\W\+LOOP\|EXIT\)"
syn match abapComplexStatement "\(BEGIN\W\+OF\W\+\(BLOCK\|LINE\)\|BEGIN\W\+OF\)"
syn match abapComplexStatement "\(END\W\+OF\W\+\(BLOCK\|LINE\)\|END\W\+OF\)"
syn match abapComplexStatement "NO\W\+INTERVALS"
syn match abapComplexStatement "RESPECTING\W\+BLANKS"
syn match abapComplexStatement "SEPARATED\W\+BY"
syn match abapComplexStatement "\(USING\W\+\(EDIT\W\+MASK\)\|USING\)"
syn match abapComplexStatement "\(WHERE\W\+\(LINE\)\)"
syn match abapComplexStatement "RADIOBUTTON\W\+GROUP"
syn match abapComplexStatement "REF\W\+TO"
syn match abapComplexStatement "\(PUBLIC\|PRIVATE\|PROTECTED\)\(\W\+SECTION\)\?"
syn match abapComplexStatement "DELETING\W\+\(TRAILING\|LEADING\)"
syn match abapComplexStatement "\(ALL\W\+OCCURRENCES\)\|\(\(FIRST\|LAST\)\W\+OCCURRENCE\)"
syn match abapComplexStatement "INHERITING\W\+FROM"
" hyphenated-word statements
syn match abapComplexStatement "LINE-COUNT"
syn match abapComplexStatement "ADD-CORRESPONDING"
syn match abapComplexStatement "AUTHORITY-CHECK"
syn match abapComplexStatement "BREAK-POINT"
syn match abapComplexStatement "CLASS-DATA"
syn match abapComplexStatement "CLASS-METHODS"
syn match abapComplexStatement "CLASS-METHOD"
syn match abapComplexStatement "DIVIDE-CORRESPONDING"
syn match abapComplexStatement "EDITOR-CALL"
syn match abapComplexStatement "END-OF-DEFINITION"
syn match abapComplexStatement "END-OF-PAGE"
syn match abapComplexStatement "END-OF-SELECTION"
syn match abapComplexStatement "FIELD-GROUPS"
syn match abapComplexStatement "FIELD-SYMBOLS"
syn match abapComplexStatement "FUNCTION-POOL"
syn match abapComplexStatement "MOVE-CORRESPONDING"
syn match abapComplexStatement "MULTIPLY-CORRESPONDING"
syn match abapComplexStatement "NEW-LINE"
syn match abapComplexStatement "NEW-PAGE"
syn match abapComplexStatement "NEW-SECTION"
syn match abapComplexStatement "PRINT-CONTROL"
syn match abapComplexStatement "RP-PROVIDE-FROM-LAST"
syn match abapComplexStatement "SELECT-OPTIONS"
syn match abapComplexStatement "SELECTION-SCREEN"
syn match abapComplexStatement "START-OF-SELECTION"
syn match abapComplexStatement "SUBTRACT-CORRESPONDING"
syn match abapComplexStatement "SYNTAX-CHECK"
syn match abapComplexStatement "SYNTAX-TRACE"
syn match abapComplexStatement "TOP-OF-PAGE"
syn match abapComplexStatement "TYPE-POOL"
syn match abapComplexStatement "TYPE-POOLS"
syn match abapComplexStatement "LINE-SIZE"
syn match abapComplexStatement "LINE-COUNT"
syn match abapComplexStatement "MESSAGE-ID"
syn match abapComplexStatement "DISPLAY-MODE"
syn match abapComplexStatement "READ\(-ONLY\)\?"
" ABAP statements
syn keyword abapStatement ADD ADD-CORRESPONDING ASSIGN AT AUTHORITY-CHECK
syn keyword abapStatement BACK BREAK-POINT
syn keyword abapStatement CALL CASE CHECK CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY
syn keyword abapStatement DATA DEFINE DELETE DESCRIBE DETAIL DIVIDE DIVIDE-CORRESPONDING DO
syn keyword abapStatement EDITOR-CALL ELSE ELSEIF END-OF-DEFINITION END-OF-PAGE END-OF-SELECTION ENDAT ENDCASE ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDLOOP ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDWHILE EXEC EXPORT EXPORTING EXTRACT
syn keyword abapStatement FETCH FIELD-GROUPS FIELD-SYMBOLS FIELDS FORM FORMAT FREE FUNCTION FUNCTION-POOL
syn keyword abapStatement ADD ALIAS ALIASES ASSERT ASSIGN ASSIGNING AT
syn keyword abapStatement BACK BOUND
syn keyword abapStatement CALL CASE CATCH CHECK CLASS CLEAR CLOSE CNT COLLECT COMMIT COMMUNICATION COMPUTE CONCATENATE CONDENSE CONSTANTS CONTINUE CONTROLS CONVERT CREATE CURRENCY
syn keyword abapStatement DATA DEFINE DEFINITION DEFERRED DELETE DESCRIBE DETAIL DIVIDE DO
syn keyword abapStatement ELSE ELSEIF ENDAT ENDCASE ENDCLASS ENDDO ENDEXEC ENDFORM ENDFUNCTION ENDIF ENDIFEND ENDINTERFACE ENDLOOP ENDMETHOD ENDMODULE ENDON ENDPROVIDE ENDSELECT ENDTRY ENDWHILE EVENT EVENTS EXEC EXIT EXPORT EXPORTING EXTRACT
syn keyword abapStatement FETCH FIELDS FORM FORMAT FREE FROM FUNCTION
syn keyword abapStatement GENERATE GET
syn keyword abapStatement HIDE
syn keyword abapStatement IF IMPORT IMPORTING INDEX INFOTYPES INITIALIZATION INPUT INSERT
syn keyword abapStatement LEAVE LIKE LOAD LOCAL LOOP
syn keyword abapStatement MESSAGE MODIFY MODULE MOVE MOVE-CORRESPONDING MULTIPLY MULTIPLY-CORRESPONDING
syn keyword abapStatement NEW-LINE NEW-PAGE NEW-SECTION
syn keyword abapStatement ON OVERLAY
syn keyword abapStatement PACK PARAMETERS PERFORM POSITION PRINT-CONTROL PROGRAM PROVIDE PUT
syn keyword abapStatement RAISE RANGES READ RECEIVE REFRESH REJECT REPLACE REPORT RESERVE RESTORE ROLLBACK RP-PROVIDE-FROM-LAST
syn keyword abapStatement SCAN SCROLL SEARCH SELECT SELECT-OPTIONS SELECTION-SCREEN SET SHIFT SKIP SORT SPLIT START-OF-SELECTION STATICS STOP SUBMIT SUBTRACT SUBTRACT-CORRESPONDING SUM SUMMARY SUPPRESS SYNTAX-CHECK SYNTAX-TRACE
syn keyword abapStatement TABLES TOP-OF-PAGE TRANSFER TRANSLATE TYPE TYPE-POOL TYPE-POOLS TYPES
syn keyword abapStatement UNPACK UPDATE
syn keyword abapStatement IF IMPORT IMPORTING INDEX INFOTYPES INITIAL INITIALIZATION INTERFACE INTERFACES INPUT INSERT IMPLEMENTATION IS
syn keyword abapStatement LEAVE LIKE LINE LOAD LOCAL LOOP
syn keyword abapStatement MESSAGE METHOD METHODS MODIFY MODULE MOVE MULTIPLY
syn keyword abapStatement ON OVERLAY OPTIONAL OTHERS
syn keyword abapStatement PACK PARAMETERS PERFORM POSITION PROGRAM PROVIDE PUT
syn keyword abapStatement RAISE RANGES RECEIVE REDEFINITION REFERENCE REFRESH REJECT REPLACE REPORT RESERVE RESTORE RETURNING ROLLBACK
syn keyword abapStatement SCAN SCROLL SEARCH SELECT SET SHIFT SKIP SORT SORTED SPLIT STANDARD STATICS STEP STOP SUBMIT SUBTRACT SUM SUMMARY SUPPRESS
syn keyword abapStatement TABLES TIMES TRANSFER TRANSLATE TRY TYPE TYPES
syn keyword abapStatement UNASSIGN ULINE UNPACK UPDATE
syn keyword abapStatement WHEN WHILE WINDOW WRITE
" More statemets
syn keyword abapStatement OCCURS STRUCTURE OBJECT PROPERTY
syn keyword abapStatement CASTING APPEND RAISING VALUE COLOR
syn keyword abapStatement LINE-SIZE LINE-COUNT MESSAGE-ID
syn keyword abapStatement CHANGING EXCEPTIONS DEFAULT CHECKBOX COMMENT
syn keyword abapStatement ID NUMBER FOR DISPLAY-MODE TITLE OUTPUT
" More multi-word statements
syn match abapStatement "\(\W\|^\)\(WITH\W\+\(HEADER\W\+LINE\|FRAME\|KEY\)\|WITH\)\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)NO\W\+STANDARD\W\+PAGE\W\+HEADING\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)\(EXIT\W\+FROM\W\+STEP\W\+LOOP\|EXIT\)\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)\(BEGIN\W\+OF\W\+\(BLOCK\|LINE\)\|BEGIN\W\+OF\)\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)\(END\W\+OF\W\+\(BLOCK\|LINE\)\|END\W\+OF\)\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)IS\W\+INITIAL\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)NO\W\+INTERVALS\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)SEPARATED\W\+BY\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)\(USING\W\+\(EDIT\W\+MASK\)\|USING\)\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)\(WHERE\W\+\(LINE\)\)\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)RADIOBUTTON\W\+GROUP\(\W\|$\)"ms=s+1,me=e-1
syn match abapStatement "\(\W\|^\)REF\W\+TO\(\W\|$\)"ms=s+1,me=e-1
syn keyword abapStatement CHANGING EXCEPTION EXCEPTIONS DEFAULT CHECKBOX COMMENT
syn keyword abapStatement ID NUMBER FOR TITLE OUTPUT
" Special ABAP specific tables:
syn match abapSpecial "\(\W\|^\)\(sy\|\(p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)\(\W\|$\)"ms=s+1,me=e-1
syn match abapSpecialTables "\(sy\|\(p\|pa\)\d\d\d\d\|t\d\d\d.\|innnn\)-"me=e-1 contained
syn match abapSpecial "\(\W\|^\)\w\+-\(\w\+-\w\+\|\w\+\)"ms=s+1 contains=abapSpecialTables
syn match abapSpecial "\(\W\|^\)\w\+-\(\w\+-\w\+\|\w\+\)"ms=s+1 contains=abapSpecialTables,abapStatement,abapComplexStatement
" Pointer
syn match abapSpecial "<\w\+>"
@@ -94,7 +148,7 @@ syn keyword abapSpecial TRUE FALSE NULL SPACE
syn region abapInclude start="include" end="." contains=abapComment
" Types
syn keyword abapTypes c n i p f d t x
syn keyword abapTypes c n i p f d t x string xstring decfloat16 decfloat34
" Atritmitic operators
syn keyword abapOperator abs sign ceil floor trunc frac acos asin atan cos sin tan
@@ -107,7 +161,7 @@ syn keyword abapOperator strlen xstrlen charlen numofchar dbmaxlen
syn keyword abapOperator lines
" Table operators (SELECT operators)
syn keyword abapOperator INTO FROM WHERE GROUP BY HAVING ORDER BY SINGLE
syn keyword abapOperator INTO WHERE GROUP BY HAVING ORDER BY SINGLE
syn keyword abapOperator APPENDING CORRESPONDING FIELDS OF TABLE
syn keyword abapOperator LEFT RIGHT OUTER INNER JOIN AS CLIENT SPECIFIED BYPASSING BUFFER UP TO ROWS CONNECTING
syn keyword abapOperator EQ NE LT LE GT GE NOT AND OR XOR IN LIKE BETWEEN
@@ -119,6 +173,7 @@ syn match abapError "\.\."
syn region abapComment start="^\*" end="$" contains=abapTodo
syn match abapComment "\".*" contains=abapTodo
syn keyword abapTodo contained TODO NOTE
syn match abapTodo "\#EC\W\+\w\+"
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
@@ -134,13 +189,18 @@ if version >= 508 || !exists("did_abap_syntax_inits")
HiLink abapError Error
HiLink abapComment Comment
HiLink abapInclude Include
HiLink abapStatement Statement
HiLink abapComplexStatement Statement
HiLink abapSpecial Special
HiLink abapNamespace Special
HiLink abapSpecialTables PreProc
HiLink abapSymbolOperator abapOperator
HiLink abapOperator Operator
HiLink abapStatement Statement
HiLink abapCharString String
HiLink abapString String
HiLink abapFloat Float
HiLink abapTypes Type
HiLink abapSymbol Structure
HiLink abapNumber Number
HiLink abapHex Number
+493
View File
@@ -0,0 +1,493 @@
" Vim syntax file
" Language: APT config file
" Maintainer: Yann Amar <quidame@poivron.org>
" Last Change: 2012 Oct 06
" For version 5.x: Clear all syntax items
" For version 6.x and 7.x: Quit when a syntax file was already loaded
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
let main_syntax = 'aptconf'
endif
let s:cpo_save = &cpo
set cpo&vim
" Errors:
" Catch all that is not overridden by next rules/items:
syn match aptconfError display '[^[:blank:]]'
syn match aptconfError display '^[^[:blank:]][^:{]*'
" Options:
" Define a general regular expression for the options that are not defined
" later as keywords. Following apt.conf(5), we know that options are case
" insensitive, and can contain alphanumeric characters and '/-:._+'; we
" assume that there can not be consecutive colons (::) which is used as
" syntax operator; we also assume that an option name can not start or end
" by a colon.
syn case ignore
syn match aptconfRegexpOpt '[-[:alnum:]/.+_]\+\(:[-[:alnum:]/.+_]\+\)*' contained display
" Keywords:
setlocal iskeyword+=/,-,.,_,+
"setlocal iskeyword+=: is problematic, because of the '::' separator
" Incomplete keywords will be treated differently than completely bad strings:
syn keyword aptconfGroupIncomplete
\ a[cquire] a[ptitude] d[ebtags] d[ebug] d[ir] d[pkg] d[select]
\ o[rderlist] p[ackagemanager] p[kgcachegen] q[uiet] r[pm]
\ u[nattended-upgrade]
" Only the following keywords can be used at toplevel (to begin an option):
syn keyword aptconfGroup
\ acquire apt aptitude debtags debug dir dpkg dselect
\ orderlist packagemanager pkgcachegen quiet rpm
\ unattended-upgrade
" Possible options for each group:
" Acquire: {{{
syn keyword aptconfAcquire contained
\ cdrom Check-Valid-Until CompressionTypes ForceHash ftp gpgv
\ GzipIndexes http https Languages Max-ValidTime Min-ValidTime PDiffs
\ Queue-Mode Retries Source-Symlinks
syn keyword aptconfAcquireCDROM contained
\ AutoDetect CdromOnly Mount UMount
syn keyword aptconfAcquireCompressionTypes contained
\ bz2 lzma gz Order
syn keyword aptconfAcquireFTP contained
\ Passive Proxy ProxyLogin Timeout
syn keyword aptconfAcquireHTTP contained
\ AllowRedirect Dl-Limit Max-Age No-Cache No-Store Pipeline-Depth
\ Proxy Timeout User-Agent
syn keyword aptconfAcquireHTTPS contained
\ CaInfo CaPath CrlFile IssuerCert SslCert SslForceVersion SslKey
\ Verify-Host Verify-Peer
syn keyword aptconfAcquireMaxValidTime contained
\ Debian Debian-Security
syn keyword aptconfAcquirePDiffs contained
\ FileLimit SizeLimit
syn cluster aptconfAcquire_ contains=aptconfAcquire,
\ aptconfAcquireCDROM,aptconfAcquireCompressionTypes,aptconfAcquireFTP,
\ aptconfAcquireHTTP,aptconfAcquireHTTPS,aptconfAcquireMaxValidTime,
\ aptconfAcquirePDiffs
" }}}
" Apt: {{{
syn keyword aptconfApt contained
\ Architecture Architectures Archive Authentication AutoRemove
\ Build-Essential Cache Cache-Grow Cache-Limit Cache-Start CDROM
\ Changelogs Clean-Installed Compressor Default-Release
\ Force-LoopBreak Get Ignore-Hold Immediate-Configure
\ Install-Recommends Install-Suggests Keep-Fds List-Cleanup
\ NeverAutoRemove Never-MarkAuto-Sections Periodic Status-Fd Update
syn keyword aptconfAptAuthentication contained
\ TrustCDROM
syn keyword aptconfAptAutoRemove contained
\ RecommendsImportant SuggestsImportant
syn keyword aptconfAptCache contained
\ AllNames AllVersions Generate GivenOnly Important Installed NamesOnly
\ RecurseDepends ShowFull
syn keyword aptconfAptCDROM contained
\ Fast NoAct NoMount Rename
syn keyword aptconfAptChangelogs contained
\ Server
syn keyword aptconfAptCompressor contained
\ bzip2 gzip lzma xz
syn keyword aptconfAptCompressorAll contained
\ Binary CompressArg Cost Extension Name UncompressArg
syn keyword aptconfAptGet contained
\ AllowUnauthenticated Arch-Only Assume-No Assume-Yes AutomaticRemove
\ Build-Dep-Automatic Compile Diff-Only Download Download-Only Dsc-Only
\ Fix-Broken Fix-Missing Force-Yes HideAutoRemove Host-Architecture
\ List-Cleanup Only-Source Print-URIs Purge ReInstall Remove
\ Show-Upgraded Show-User-Simulation-Note Show-Versions Simulate
\ Tar-Only Trivial-Only Upgrade
syn keyword aptconfAptPeriodic contained
\ AutocleanInterval BackupArchiveInterval BackupLevel
\ Download-Upgradeable-Packages MaxAge MaxSize MinAge
\ Unattended-Upgrade Update-Package-Lists Verbose
syn keyword aptconfAptUpdate contained
\ Pre-Invoke Post-Invoke Post-Invoke-Success
syn cluster aptconfApt_ contains=aptconfApt,
\ aptconfAptAuthentication,aptconfAptAutoRemove,aptconfAptCache,
\ aptconfAptCDROM,aptconfAptChangelogs,aptconfAptCompressor,
\ aptconfAptCompressorAll,aptconfAptGet,aptconfAptPeriodic,
\ aptconfAptUpdate
" }}}
" Aptitude: {{{
syn keyword aptconfAptitude contained
\ Allow-Null-Upgrade Always-Use-Safe-Resolver Autoclean-After-Update
\ Auto-Install Auto-Fix-Broken Cmdline Debtags-Binary
\ Debtags-Update-Options Delete-Unused Delete-Unused-Pattern
\ Display-Planned-Action Forget-New-On-Install Forget-New-On-Update
\ Get-Root-Command Ignore-Old-Tmp Ignore-Recommends-Important
\ Keep-Recommends Keep-Suggests Keep-Unused-Pattern LockFile Log
\ Logging Parse-Description-Bullets Pkg-Display-Limit ProblemResolver
\ Purge-Unused Recommends-Important Safe-Resolver Screenshot Sections
\ Simulate Spin-Interval Suggests-Important Suppress-Read-Only-Warning
\ Theme Track-Dselect-State UI Warn-Not-Root
syn keyword aptconfAptitudeCmdline contained
\ Always-Prompt Assume-Yes Disable-Columns Download-Only Fix-Broken
\ Ignore-Trust-Violations Package-Display-Format Package-Display-Width
\ Progress Request-Strictness Resolver-Debug Resolver-Dump
\ Resolver-Show-Steps Safe-Upgrade Show-Deps Show-Size-Changes
\ Show-Versions Show-Why Simulate Verbose Version-Display-Format
\ Versions-Group-By Versions-Show-Package-Names Visual-Preview
\ Why-Display-Mode
syn keyword aptconfAptitudeCmdlineProgress contained
\ Percent-On-Right Retain-Completed
syn keyword aptconfAptitudeCmdlineSafeUpgrade contained
\ No-New-Installs
syn keyword aptconfAptitudeLogging contained
\ File Levels
syn keyword aptconfAptitudeProblemResolver contained
\ Allow-Break-Holds BreakHoldScore Break-Hold-Level BrokenScore
\ DefaultResolutionScore Discard-Null-Solution
\ EssentialRemoveScore ExtraScore FullReplacementScore FutureHorizon
\ Hints ImportantScore Infinity InstallScore Keep-All-Level KeepScore
\ NonDefaultScore Non-Default-Level OptionalScore PreserveAutoScore
\ PreserveManualScore RemoveScore Remove-Essential-Level Remove-Level
\ RequiredScore ResolutionScore Safe-Level SolutionCost StandardScore
\ StepLimit StepScore Trace-Directory Trace-File
\ UndoFullReplacementScore UnfixedSoftScore UpgradeScore
syn keyword aptconfAptitudeSafeResolver contained
\ No-New-Installs No-New-Upgrades Show-Resolver-Actions
syn keyword aptconfAptitudeScreenshot contained
\ Cache-Max IncrementalLoadLimit
syn keyword aptconfAptitudeSections contained
\ Descriptions Top-Sections
syn keyword aptconfAptitudeUI contained
\ Advance-On-Action Auto-Show-Reasons Default-Grouping
\ Default-Package-View Default-Preview-Grouping Default-Sorting
\ Description-Visible-By-Default Exit-On-Last-Close Fill-Text
\ Flat-View-As-First-View HelpBar Incremental-Search InfoAreaTabs
\ KeyBindings MenuBar-Autohide Minibuf-Download-Bar Minibuf-Prompts
\ New-package-Commands Package-Display-Format Package-Header-Format
\ Package-Status-Format Pause-After-Download Preview-Limit
\ Prompt-On-Exit Styles ViewTabs
syn keyword aptconfAptitudeUIStyles contained
\ Bullet ChangeLogNewerVersion Default DepBroken DisabledMenuEntry
\ DownloadHit DownloadProgress EditLine Error Header HighlightedMenuBar
\ HighlightedMenuEntry MediaChange MenuBar MenuBorder MenuEntry
\ MineBomb MineBorder MineFlag MineNumber1 MineNumber2 MineNumber3
\ MineNumber4 MineNumber5 MineNumber6 MineNumber7 MineNumber8
\ MultiplexTab MultiplexTabHighlighted PkgBroken PkgBrokenHighlighted
\ PkgIsInstalled PkgIsInstalledHighlighted PkgNotInstalled
\ PkgNotInstalledHighlighted PkgToDowngrade PkgToDowngradeHighlighted
\ PkgToHold PkgToHoldHighlighted PkgToInstall PkgToInstallHighlighted
\ PkgToRemove PkgToRemoveHighlighted PkgToUpgrade
\ PkgToUpgradeHighlighted Progress SolutionActionApproved
\ SolutionActionRejected Status TreeBackground TrustWarning
syn keyword aptconfAptitudeUIStylesElements contained
\ bg clear fg flip set
syn cluster aptconfAptitude_ contains=aptconfAptitude,
\ aptconfAptitudeCmdline,aptconfAptitudeCmdlineProgress,
\ aptconfAptitudeCmdlineSafeUpgrade,aptconfAptitudeLogging,
\ aptconfAptitudeProblemResolver,aptconfAptitudeSafeResolver,
\ aptconfAptitudeScreenshot,aptconfAptitudeSections,aptconfAptitudeUI,
\ aptconfAptitudeUIStyles,aptconfAptitudeUIStylesElements
" }}}
" DebTags: {{{
syn keyword aptconfDebTags contained
\ Vocabulary
syn cluster aptconfDebTags_ contains=aptconfDebTags
" }}}
" Debug: {{{
syn keyword aptconfDebug contained
\ Acquire aptcdrom BuildDeps Hashes IdentCdrom Nolocking
\ pkgAcquire pkgAutoRemove pkgCacheGen pkgDepCache pkgDPkgPM
\ pkgDPkgProgressReporting pkgInitialize pkgOrderList
\ pkgPackageManager pkgPolicy pkgProblemResolver sourceList
syn keyword aptconfDebugAcquire contained
\ cdrom Ftp gpgv Http Https netrc
syn keyword aptconfDebugPkgAcquire contained
\ Auth Diffs RRed Worker
syn keyword aptconfDebugPkgDepCache contained
\ AutoInstall Marker
syn keyword aptconfDebugPkgProblemResolver contained
\ ShowScores
syn cluster aptconfDebug_ contains=aptconfDebug,
\ aptconfDebugAcquire,aptconfDebugPkgAcquire,aptconfDebugPkgDepCache,
\ aptconfDebugPkgProblemResolver
" }}}
" Dir: {{{
syn keyword aptconfDir contained
\ Aptitude Bin Cache Etc Ignore-Files-Silently Log Media Parts RootDir
\ State
syn keyword aptconfDirAptitude contained
\ state
syn keyword aptconfDirBin contained
\ apt-get apt-cache dpkg dpkg-buildpackage dpkg-source gpg gzip Methods
\ solvers
syn keyword aptconfDirCache contained
\ Archives Backup pkgcache srcpkgcache
syn keyword aptconfDirEtc contained
\ Main Netrc Parts Preferences PreferencesParts SourceList SourceParts
\ VendorList VendorParts Trusted TrustedParts
syn keyword aptconfDirLog contained
\ History Terminal
syn keyword aptconfDirMedia contained
\ MountPath
syn keyword aptconfDirState contained
\ cdroms extended_states Lists mirrors status
syn cluster aptconfDir_ contains=aptconfDir,
\ aptconfDirAptitude,aptconfDirBin,aptconfDirCache,aptconfDirEtc,
\ aptconfDirLog,aptconfDirMedia,aptconfDirState
" }}}
" DPkg: {{{
syn keyword aptconfDPkg contained
\ Build-Options Chroot-Directory ConfigurePending FlushSTDIN MaxArgs
\ MaxBytes NoTriggers options Pre-Install-Pkgs Pre-Invoke Post-Invoke
\ Run-Directory StopOnError Tools TriggersPending
syn keyword aptconfDPkgTools contained
\ Options Version
syn cluster aptconfDPkg_ contains=aptconfDPkg,
\ aptconfDPkgOrderList,aptconfDPkgOrderListScore,aptconfDPkgTools
" }}}
" DSelect: {{{
syn keyword aptconfDSelect contained
\ CheckDir Clean Options PromptAfterUpdate UpdateOptions
syn cluster aptconfDSelect_ contains=aptconfDSelect
" }}}
" OrderList: {{{
syn keyword aptconfOrderList contained
\ Score
syn keyword aptconfOrderListScore contained
\ Delete Essential Immediate PreDepends
syn cluster aptconfOrderList_ contains=aptconfOrderList,
\ aptconfOrderListScore
" }}}
" PackageManager: {{{
syn keyword aptconfPackageManager contained
\ Configure
syn cluster aptconfPackageManager_ contains=aptconfPackageManager
" }}}
" PkgCacheGen: {{{
syn keyword aptconfPkgCacheGen contained
\ Essential
syn cluster aptconfPkgCacheGen_ contains=aptconfPkgCacheGen
" }}}
" Quiet: {{{
syn keyword aptconfQuiet contained
\ NoUpdate
syn cluster aptconfQuiet_ contains=aptconfQuiet
" }}}
" Rpm: {{{
syn keyword aptconfRpm contained
\ Post-Invoke Pre-Invoke
syn cluster aptconfRpm_ contains=aptconfRpm
" }}}
" Unattened Upgrade: {{{
syn keyword aptconfUnattendedUpgrade contained
\ AutoFixInterruptedDpkg Automatic-Reboot InstallOnShutdown Mail
\ MailOnlyOnError MinimalSteps Origins-Pattern Package-Blacklist
\ Remove-Unused-Dependencies
syn cluster aptconfUnattendedUpgrade_ contains=aptconfUnattendedUpgrade
" }}}
syn case match
" Now put all the keywords (and 'valid' options) in a single cluster:
syn cluster aptconfOptions contains=aptconfRegexpOpt,
\ @aptconfAcquire_,@aptconfApt_,@aptconfAptitude_,@aptconfDebTags_,
\ @aptconfDebug_,@aptconfDir_,@aptconfDPkg_,@aptconfDSelect_,
\ @aptconfOrderList_,@aptconfPackageManager_,@aptconfPkgCacheGen_,
\ @aptconfQuiet_,@aptconfRpm_,@aptconfUnattendedUpgrade_
" Syntax:
syn match aptconfSemiColon ';'
syn match aptconfDoubleColon '::'
syn match aptconfCurlyBraces '[{}]'
syn region aptconfValue start='"' end='"' oneline display
syn region aptconfInclude matchgroup=aptconfOperator start='{' end='}' contains=ALLBUT,aptconfGroup,aptconfGroupIncomplete,@aptconfCommentSpecial
syn region aptconfInclude matchgroup=aptconfOperator start='::' end='{'me=s-1 contains=@aptconfOptions,aptconfError display
syn region aptconfInclude matchgroup=aptconfOperator start='::' end='::\|\s'me=s-1 oneline contains=@aptconfOptions,aptconfError display
" Basic Syntax Errors: XXX avoid to generate false positives !!!
"
" * Invalid comment format (seems to not cause errors, but...):
syn match aptconfAsError display '^#.*'
"
" * When a semicolon is missing after a double-quoted string:
" There are some cases (for example in the Dir group of options, but not only)
" where this syntax is valid. So we don't treat it as a strict error.
syn match aptconfAsError display '"[^"]*"[^;]'me=e-1
syn match aptconfAsError display '"[^"]*"$'
"
" * When double quotes are missing around a value (before a semicolon):
" This omission has no effect if the value is a single string (without blank
" characters). But apt.conf(5) says that quotes are required, and this item
" avoids to match unquoted keywords.
syn match aptconfAsError display '\s[^"[:blank:]]*[^}"];'me=e-1
"
" * When only one double quote is missing around a value (before a semicolon):
" No comment for that: it must be highly visible.
syn match aptconfError display '\(\s\|;\)"[^"[:blank:]]\+;'me=e-1
syn match aptconfError display '\(\s\|;\)[^"[:blank:]]\+";'me=e-1
"
" * When space is missing between option and (quoted) value:
" TODO (partially implemented)
syn match aptconfError display '::[^[:blank:]]*"'
" Special Actions:
syn match aptconfAction '^#\(clear\|include\)\>'
syn region aptconfAction matchgroup=aptconfAction start='^#clear\>' end=';'me=s-1 oneline contains=aptconfGroup,aptconfDoubleColon,@aptconfOptions
syn region aptconfAction matchgroup=aptconfAction start='^#include\>' end=';'me=s-1 oneline contains=aptconfRegexpOpt
" Comments:
syn keyword aptconfTodo TODO FIXME NOTE XXX contained
syn cluster aptconfCommentSpecial contains=@Spell,aptconfTodo
syn match aptconfComment '//.*' contains=@aptconfCommentSpecial
syn region aptconfComment start='/\*' end='\*/' contains=@aptconfCommentSpecial
" Highlight Definitions:
hi def link aptconfTodo Todo
hi def link aptconfError Error
hi def link aptconfComment Comment
hi def link aptconfOperator Operator
hi def link aptconfAction PreProc
hi def link aptconfOption Type
hi def link aptconfValue String
hi def link aptconfRegexpOpt Normal
hi def link aptconfAsError Special
hi def link aptconfSemiColon aptconfOperator
hi def link aptconfDoubleColon aptconfOperator
hi def link aptconfCurlyBraces aptconfOperator
hi def link aptconfGroupIncomplete Special
hi def link aptconfGroup aptconfOption
hi def link aptconfAcquire aptconfOption
hi def link aptconfAcquireCDROM aptconfOption
hi def link aptconfAcquireCompressionTypes aptconfOption
hi def link aptconfAcquireFTP aptconfOption
hi def link aptconfAcquireHTTP aptconfOption
hi def link aptconfAcquireHTTPS aptconfOption
hi def link aptconfAcquireMaxValidTime aptconfOption
hi def link aptconfAcquirePDiffs aptconfOption
hi def link aptconfApt aptconfOption
hi def link aptconfAptAuthentication aptconfOption
hi def link aptconfAptAutoRemove aptconfOption
hi def link aptconfAptCache aptconfOption
hi def link aptconfAptCDROM aptconfOption
hi def link aptconfAptChangelogs aptconfOption
hi def link aptconfAptCompressor aptconfOption
hi def link aptconfAptCompressorAll aptconfOption
hi def link aptconfAptGet aptconfOption
hi def link aptconfAptPeriodic aptconfOption
hi def link aptconfAptUpdate aptconfOption
hi def link aptconfAptitude aptconfOption
hi def link aptconfAptitudeCmdline aptconfOption
hi def link aptconfAptitudeCmdlineProgress aptconfOption
hi def link aptconfAptitudeCmdlineSafeUpgrade aptconfOption
hi def link aptconfAptitudeLogging aptconfOption
hi def link aptconfAptitudeProblemResolver aptconfOption
hi def link aptconfAptitudeSafeResolver aptconfOption
hi def link aptconfAptitudeScreenshot aptconfOption
hi def link aptconfAptitudeSections aptconfOption
hi def link aptconfAptitudeUI aptconfOption
hi def link aptconfAptitudeUIStyles aptconfOption
hi def link aptconfAptitudeUIStylesElements aptconfOption
hi def link aptconfDebTags aptconfOption
hi def link aptconfDebug aptconfOption
hi def link aptconfDebugAcquire aptconfOption
hi def link aptconfDebugPkgAcquire aptconfOption
hi def link aptconfDebugPkgDepCache aptconfOption
hi def link aptconfDebugPkgProblemResolver aptconfOption
hi def link aptconfDir aptconfOption
hi def link aptconfDirAptitude aptconfOption
hi def link aptconfDirBin aptconfOption
hi def link aptconfDirCache aptconfOption
hi def link aptconfDirEtc aptconfOption
hi def link aptconfDirLog aptconfOption
hi def link aptconfDirMedia aptconfOption
hi def link aptconfDirState aptconfOption
hi def link aptconfDPkg aptconfOption
hi def link aptconfDPkgTools aptconfOption
hi def link aptconfDSelect aptconfOption
hi def link aptconfOrderList aptconfOption
hi def link aptconfOrderListScore aptconfOption
hi def link aptconfPackageManager aptconfOption
hi def link aptconfPkgCacheGen aptconfOption
hi def link aptconfQuiet aptconfOption
hi def link aptconfRpm aptconfOption
hi def link aptconfUnattendedUpgrade aptconfOption
let b:current_syntax = "aptconf"
let &cpo = s:cpo_save
unlet s:cpo_save
+6 -1
View File
@@ -2,7 +2,7 @@
" Language: ASN.1
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/asn.vim
" Last Change: 2001 Apr 26
" Last Change: 2012 Oct 05
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -12,6 +12,9 @@ elseif exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" keyword definitions
syn keyword asnExternal DEFINITIONS BEGIN END IMPORTS EXPORTS FROM
syn match asnExternal "\<IMPLICIT\s\+TAGS\>"
@@ -76,6 +79,8 @@ if version >= 508 || !exists("did_asn_syn_inits")
delcommand HiLink
endif
let &cpo = s:cpo_save
unlet s:cpo_save
let b:current_syntax = "asn"
" vim: ts=8
+66 -66
View File
@@ -1,25 +1,25 @@
" Vim syntax file
" Language: CL
" (pronounced alphabetically, and NOT known as Clever)
" (CL was created by Multibase, http://www.mbase.com.au)
" Language: CL
" (pronounced alphabetically, and NOT known as Clever)
" (CL was created by Multibase, http://www.mbase.com.au)
" Filename extensions: *.ent
" *.eni
" *.eni
" Maintainer: Philip Uren <philuSPAX@ieee.org> Remove SPAX spam block
" Version: 4
" Last Change: May 11 2012
" Version: 5
" Last Change: Aug 16 2012
" 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
syntax clear
elseif exists("b:current_syntax")
finish
finish
endif
if version >= 600
setlocal iskeyword=@,48-57,_,-,
setlocal iskeyword=@,48-57,_,-,
else
set iskeyword=@,48-57,_,-,
set iskeyword=@,48-57,_,-,
endif
syn case ignore
@@ -27,87 +27,87 @@ syn case ignore
syn sync lines=300
"If/else/elsif/endif and while/wend mismatch errors
syn match clifError "\<wend\>"
syn match clifError "\<elsif\>"
syn match clifError "\<else\>"
syn match clifError "\<endif\>"
syn match clifError "\<wend\>"
syn match clifError "\<elsif\>"
syn match clifError "\<else\>"
syn match clifError "\<endif\>"
syn match clSpaceError "\s\+$"
syn match clSpaceError "\s\+$"
" If and while regions
syn region clLoop transparent matchgroup=clWhile start="\<while\>" matchgroup=clWhile end="\<wend\>" contains=ALLBUT,clBreak,clProcedure
syn region clIf transparent matchgroup=clConditional start="\<if\>" matchgroup=clConditional end="\<endif\>" contains=ALLBUT,clBreak,clProcedure
syn region clLoop transparent matchgroup=clWhile start="\<while\>" matchgroup=clWhile end="\<wend\>" contains=ALLBUT,clBreak,clProcedure
syn region clIf transparent matchgroup=clConditional start="\<if\>" matchgroup=clConditional end="\<endif\>" contains=ALLBUT,clBreak,clProcedure
" Make those TODO notes and debugging stand out!
syn keyword clTodo contained TODO BUG DEBUG FIX
syn match clNeedsWork contained "NEED[S]*\s\s*WORK"
syn keyword clDebug contained debug
syn keyword clTodo contained TODO BUG DEBUG FIX
syn match clNeedsWork contained "NEED[S]*\s\s*WORK"
syn keyword clDebug contained debug
syn match clComment "#.*$" contains=clTodo,clNeedsWork
syn region clProcedure oneline start="^\s*[{}]" end="$"
syn match clInclude "^\s*include\s.*"
syn match clComment "#.*$" contains=clTodo,clNeedsWork,@Spell
syn region clProcedure oneline start="^\s*[{}]" end="$"
syn match clInclude "^\s*include\s.*"
" We don't put "debug" in the clSetOptions;
" we contain it in clSet so we can make it stand out.
syn keyword clSetOptions transparent aauto abort align convert E fill fnum goback hangup justify null_exit output rauto rawprint rawdisplay repeat skip tab trim
syn match clSet "^\s*set\s.*" contains=clSetOptions,clDebug
syn keyword clSetOptions transparent aauto abort align convert E fill fnum goback hangup justify null_exit output rauto rawprint rawdisplay repeat skip tab trim
syn match clSet "^\s*set\s.*" contains=clSetOptions,clDebug
syn match clPreProc "^\s*#P.*"
syn match clPreProc "^\s*#P.*"
syn keyword clConditional else elsif
syn keyword clWhile continue endloop
syn keyword clConditional else elsif
syn keyword clWhile continue endloop
" 'break' needs to be a region so we can sync on it above.
syn region clBreak oneline start="^\s*break" end="$"
syn region clBreak oneline start="^\s*break" end="$"
syn match clOperator "[!;|)(:.><+*=-]"
syn match clOperator "[!;|)(:.><+*=-]"
syn match clNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
syn match clNumber "\<\d\+\(u\=l\=\|lu\|f\)\>"
syn region clString matchgroup=clQuote start=+"+ end=+"+ skip=+\\"+
syn region clString matchgroup=clQuote start=+'+ end=+'+ skip=+\\'+
syn region clString matchgroup=clQuote start=+"+ end=+"+ skip=+\\"+ contains=@Spell
syn region clString matchgroup=clQuote start=+'+ end=+'+ skip=+\\'+ contains=@Spell
syn keyword clReserved ERROR EXIT INTERRUPT LOCKED LREPLY MODE MCOL MLINE MREPLY NULL REPLY V1 V2 V3 V4 V5 V6 V7 V8 V9 ZERO BYPASS GOING_BACK AAUTO ABORT ABORT ALIGN BIGE CONVERT FNUM GOBACK HANGUP JUSTIFY NEXIT OUTPUT RAUTO RAWDISPLAY RAWPRINT REPEAT SKIP TAB TRIM LCOUNT PCOUNT PLINES SLINES SCOLS MATCH LMATCH
syn keyword clReserved ERROR EXIT INTERRUPT LOCKED LREPLY MODE MCOL MLINE MREPLY NULL REPLY V1 V2 V3 V4 V5 V6 V7 V8 V9 ZERO BYPASS GOING_BACK AAUTO ABORT ABORT ALIGN BIGE CONVERT FNUM GOBACK HANGUP JUSTIFY NEXIT OUTPUT RAUTO RAWDISPLAY RAWPRINT REPEAT SKIP TAB TRIM LCOUNT PCOUNT PLINES SLINES SCOLS MATCH LMATCH
syn keyword clFunction asc asize chr name random slen srandom day getarg getcgi getenv lcase scat sconv sdel skey smult srep substr sword trim ucase match
syn keyword clFunction asc asize chr name random slen srandom day getarg getcgi getenv lcase scat sconv sdel skey smult srep substr sword trim ucase match
syn keyword clStatement clear clear_eol clear_eos close copy create unique with where empty define define ldefine delay_form delete escape exit_block exit_do exit_process field fork format get getfile getnext getprev goto head join maintain message no_join on_eop on_key on_exit on_delete openin openout openapp pause popenin popenout popenio print put range read redisplay refresh restart_block screen select sleep text unlock write and not or do
syn keyword clStatement clear clear_eol clear_eos close copy create unique with where empty define define ldefine delay_form delete escape exit_block exit_do exit_process field fork format get getfile getnext getprev goto head join maintain message no_join on_eop on_key on_exit on_delete openin openout openapp pause popenin popenout popenio print put range read redisplay refresh restart_block screen select sleep text unlock write and not or do
" 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_cl_syntax_inits")
if version < 508
let did_cl_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
if version >= 508 || !exists("did_cl_syntax_inits")
if version < 508
let did_cl_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink clifError Error
HiLink clSpaceError Error
HiLink clWhile Repeat
HiLink clConditional Conditional
HiLink clDebug Debug
HiLink clNeedsWork Todo
HiLink clTodo Todo
HiLink clComment Comment
HiLink clProcedure Procedure
HiLink clBreak Procedure
HiLink clInclude Include
HiLink clSetOption Statement
HiLink clSet Identifier
HiLink clPreProc PreProc
HiLink clOperator Operator
HiLink clNumber Number
HiLink clString String
HiLink clQuote Delimiter
HiLink clReserved Identifier
HiLink clFunction Function
HiLink clStatement Statement
HiLink clifError Error
HiLink clSpaceError Error
HiLink clWhile Repeat
HiLink clConditional Conditional
HiLink clDebug Debug
HiLink clNeedsWork Todo
HiLink clTodo Todo
HiLink clComment Comment
HiLink clProcedure Procedure
HiLink clBreak Procedure
HiLink clInclude Include
HiLink clSetOption Statement
HiLink clSet Identifier
HiLink clPreProc PreProc
HiLink clOperator Operator
HiLink clNumber Number
HiLink clString String
HiLink clQuote Delimiter
HiLink clReserved Identifier
HiLink clFunction Function
HiLink clStatement Statement
delcommand HiLink
delcommand HiLink
endif
let b:current_syntax = "cl"
" vim: ts=8 sw=4
" vim: ts=8 sw=8
+297 -90
View File
@@ -1,10 +1,12 @@
" Vim syntax file
" Language: Cascading Style Sheets
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/css.vim
" Last Change: 2011 Dec 14
" CSS2 by Nikolai Weibull
" Full CSS2, HTML4 support by Yeti
" Language: Cascading Style Sheets
" Previous Contributor List:
" Claudio Fleiner <claudio@fleiner.com> (Maintainer)
" Yeti (Add full CSS2, HTML4 support)
" Nikolai Weibull (Add CSS2 support)
" Maintainer: Jules Wang <w.jq0722@gmail.com>
" URL: https://github.com/JulesWang/css.vim
" Last Change: 2012 Dec 15
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -17,8 +19,12 @@ endif
let main_syntax = 'css'
endif
let s:cpo_save = &cpo
set cpo&vim
syn case ignore
" All HTML4 tags
syn keyword cssTagName abbr acronym address applet area a b base
syn keyword cssTagName basefont bdo big blockquote body br button
syn keyword cssTagName caption center cite code col colgroup dd del
@@ -27,32 +33,51 @@ syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i
syn keyword cssTagName iframe img input ins isindex kbd label legend li
syn keyword cssTagName link map menu meta noframes noscript ol optgroup
syn keyword cssTagName option p param pre q s samp script select small
syn keyword cssTagName span strike strong style sub sup tbody td
syn keyword cssTagName span strike strong style sub sup table tbody td
syn keyword cssTagName textarea tfoot th thead title tr tt ul u var
syn match cssTagName "\<table\>"
syn keyword cssTagName object
" HTML5 new tags 5*6=30
syn keyword cssTagName article aside audio bdi canvas command
syn keyword cssTagName datalist details embed figcaption figure footer
syn keyword cssTagName header hgroup keygen mark meter nav
syn keyword cssTagName output progress rt rp ruby section
syn keyword cssTagName source summary time track video wbr
" Tags not supported in HTML5
syn keyword cssDeprecated acronym applet basefont big center dir
syn keyword cssDeprecated font frame frameset noframes strike tt
"syn match cssTagName "\<table\>"
syn match cssTagName "\*"
syn match cssTagName "@page\>" nextgroup=cssDefinition
syn match cssSelectorOp "[+>.]"
syn match cssSelectorOp2 "[~|]\?=" contained
" selectors
syn match cssSelectorOp "[,>+]"
syn match cssSelectorOp2 "[~|^$*]\?=" contained
" FIXME: add HTML5 attribute
syn region cssAttributeSelector matchgroup=cssSelectorOp start="\[" end="]" transparent contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ
" .class and #id
syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+"
try
syn match cssIdentifier "#[A-Za-zÀ-ÿ_@][A-Za-zÀ-ÿ0-9_@-]*"
catch /^.*/
syn match cssIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*"
endtry
syn match cssTagName "@page\>" nextgroup=cssDefinition
" FIXME: use cssVendor here
syn match cssTagName "@\(-\(webkit\|moz\|o\|ms\)-\)\=keyframes\>" nextgroup=cssDefinition
syn match cssMedia "@media\>" nextgroup=cssMediaType skipwhite skipnl
syn keyword cssMediaType contained screen print aural braile embosed handheld projection ty tv all nextgroup=cssMediaComma,cssMediaBlock skipwhite skipnl
syn match cssMediaComma "," nextgroup=cssMediaType skipwhite skipnl
"syn match cssMediaComma "," nextgroup=cssMediaType skipwhite skipnl
syn region cssMediaBlock transparent matchgroup=cssBraces start='{' end='}' contains=cssTagName,cssError,cssComment,cssDefinition,cssURL,cssUnicodeEscape,cssIdentifier
syn match cssValueInteger contained "[-+]\=\d\+"
syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\="
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\)"
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\)"
syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)"
syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)"
syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)"
@@ -66,27 +91,115 @@ syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start=
syn match cssUnicodeRange contained "U+[0-9A-Fa-f?]\+"
syn match cssUnicodeRange contained "U+\x\+-\x\+"
" The 16 basic color names
syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
" 130 more color names
syn keyword cssColor contained aliceblue antiquewhite aquamarine azure
syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood
syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan
syn match cssColor contained /dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)/
syn match cssColor contained /dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)/
syn match cssColor contained /darkslate\(blue\|gray\|grey\)/
syn match cssColor contained /dark\(turquoise\|violet\)/
syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick
syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold
syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink
syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen
syn keyword cssColor contained lemonchiffon limegreen linen magenta
syn match cssColor contained /light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)/
syn match cssColor contained /light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)/
syn match cssColor contained /light\(slategray\|slategrey\|steelblue\)/
syn match cssColor contained /medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)/
syn match cssColor contained /medium\(slateblue\|springgreen\|turquoise\|violetred\)/
syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite
syn keyword cssColor contained oldlace olivedrab orange orangered orchid
syn match cssColor contained /pale\(goldenrod\|green\|turquoise\|violetred\)/
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
syn keyword cssColor contained slategray slategrey snow springgreen steelblue tan
syn keyword cssColor contained thistle tomato turquoise violet wheat
syn keyword cssColor contained whitesmoke yellowgreen
" FIXME: These are actually case-insentivie too, but (a) specs recommend using
" mixed-case (b) it's hard to highlight the word `Background' correctly in
" all situations
syn case match
syn keyword cssColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background
syn case ignore
syn match cssImportant contained "!\s*important\>"
syn match cssColor contained "\<transparent\>"
syn match cssColor contained "\<white\>"
syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>"
syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>"
"syn match cssColor contained "\<rgb\s*(\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*,\s*\d\+\(\.\d*\)\=%\=\s*)"
syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" oneline keepend
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\)\s*(" end=")" oneline keepend
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\)\s*(" end=")" oneline keepend
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\)\s*(" end=")" oneline keepend
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear\|radial\)-gradient\s*(" end=")" oneline keepend
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y|\Z\)\=\|translate\(3d\|X\|Y|\Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y|\Z\)\=\|perspective\)\s*(" end=")" oneline keepend
syn match cssImportant contained "!\s*important\>"
syn keyword cssCommonAttr contained auto none inherit
" Prop and Attr
" Reference: http://www.w3schools.com/cssref/default.asp
syn keyword cssCommonAttr contained auto none inherit all
syn keyword cssCommonAttr contained top bottom
syn keyword cssCommonAttr contained medium normal
syn match cssAnimationProp contained "\<animation\(-\(name\|duration\|timing-function\|delay\|iteration-cout\|play-state\)\)\=\>"
syn keyword cssAnimationAttr contained infinite alternate paused running
" bugfix: escape linear-gradient
syn match cssAnimationAttr contained "\<linear\(-gradient\)\@!\>"
syn match cssAnimationAttr contained "\<ease\(-\(in-out\|out\|in\)\)\=\>"
syn match cssBackgroundProp contained "\<background\(-\(color\|image\|attachment\|position\|clip\|origin\|size\)\)\=\>"
syn keyword cssBackgroundAttr contained center fixed over contain
syn match cssBackgroundAttr contained "\<no-repeat\>"
syn match cssBackgroundAttr contained "\<repeat\(-[xy]\)\=\>"
syn match cssBackgroundAttr contained "\<\(border\|content\|padding\)-box\>"
syn match cssBorderOutlineProp contained "\<border\(-\(top\|right\|bottom\|left\)\)\=\(-\(width\|color\|style\)\)\=\>"
syn match cssBorderOutlineProp contained "\<outline\(-\(width\|style\|color\)\)\=\>"
syn match cssBorderOutlineProp contained "\<border-\(top\|bottom\)-\(left\|right\)\(-radius\)\=\>"
syn match cssBorderOutlineProp contained "\<border-image\(-\(outset\|repeat\|slice\|source\|width\)\)\=\>"
syn match cssBorderOutlineProp contained "\<border-radius\>"
syn keyword cssBorderOutlineAttr contained thin thick medium
syn keyword cssBorderOutlineAttr contained dotted dashed solid double groove ridge inset outset
syn keyword cssBorderOutlineAttr contained hidden visible scroll collapse
syn keyword cssBorderOutlineAttr contained stretch round
syn match cssBoxProp contained "\<overflow\(-\(x\|y\|style\)\)\=\>"
syn match cssBoxProp contained "\<rotation\(-point\)=\>"
syn keyword cssBoxAttr contained visible hidden scroll auto
syn match cssBoxAttr contained "\<no-\(display\|content\)\>"
syn keyword cssColorProp contained opacity
syn match cssColorProp contained "\<color-profile\>"
syn match cssColorProp contained "\<rendering-intent\>"
syn match cssDimensionProp contained "\<\(min\|max\)-\(width\|height\)\>"
syn keyword cssDimensionProp contained height
syn keyword cssDimensionProp contained width
" shadow and sizing are in other property groups
syn match cssFlexibleBoxProp contained "\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>"
syn keyword cssFlexibleBoxAttr contained start end center baseline stretch
syn keyword cssFlexibleBoxAttr contained normal reverse
syn keyword cssFlexibleBoxAttr contained single mulitple
syn keyword cssFlexibleBoxAttr contained horizontal
" bugfix: escape vertial-align
syn match cssFlexibleBoxAttr contained "\<vertical\(-align\)\@!\>"
syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
syn match cssFontProp contained "\<font\(-\(family\|style\|variant\|weight\|size\(-adjust\)\=\|stretch\)\)\=\>"
syn match cssFontAttr contained "\<\(sans-\)\=\<serif\>"
syn match cssFontAttr contained "\<small\(-\(caps\|caption\)\)\=\>"
@@ -95,67 +208,92 @@ syn match cssFontAttr contained "\<message-box\>"
syn match cssFontAttr contained "\<status-bar\>"
syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\|status-bar\)-\)\=\(condensed\|expanded\)\>"
syn keyword cssFontAttr contained cursive fantasy monospace italic oblique
syn keyword cssFontAttr contained bold bolder lighter larger smaller
syn keyword cssFontAttr contained icon menu
syn match cssFontAttr contained "\<caption\>"
syn keyword cssFontAttr contained large smaller larger
syn keyword cssFontAttr contained narrower wider
syn keyword cssFontAttr contained bold bolder light lighter larger smaller
syn keyword cssFontAttr contained icon menu caption
syn keyword cssFontAttr contained large smaller larger narrower wider
syn keyword cssFontAttr contained Courier Arial Georgia Times
syn keyword cssColorProp contained color
syn match cssColorProp contained "\<background\(-\(color\|image\|attachment\|position\)\)\=\>"
syn keyword cssColorAttr contained center scroll fixed
syn match cssColorAttr contained "\<repeat\(-[xy]\)\=\>"
syn match cssColorAttr contained "\<no-repeat\>"
syn keyword cssGeneratedContentProp contained content quotes crop
syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
syn match cssGeneratedContentProp contained "\<move-to\>"
syn match cssGeneratedContentProp contained "\<page-policy\>"
syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>"
syn match cssGridProp contained "\<grid-\(columns\|rows\)\>"
syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>"
syn match cssListProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>"
syn match cssListAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>"
syn match cssListAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>"
syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>"
syn keyword cssListAttr contained disc circle square hebrew armenian georgian
syn keyword cssListAttr contained inside outside
syn match cssMarginProp contained "\<margin\(-\(top\|right\|bottom\|left\)\)\=\>"
syn match cssMultiColumnProp contained "\<column\(-\(\break-\(after\|before\)\|count\|gap\|rule\(-\(color\|style\|width\)\)\=\)\|span\|width\)\=\>"
syn match cssPaddingProp contained "\<padding\(-\(top\|right\|bottom\|left\)\)\=\>"
syn keyword cssPositioningProp contained bottom clear clip display float left
syn keyword cssPositioningProp contained position right top visibility
syn match cssPositioningProp contained "\<z-index\>"
syn keyword cssPositioningAttr contained block inline compact
syn match cssPositioningAttr contained "\<table\(-\(row-gorup\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>"
syn keyword cssPositioningAttr contained left right both
syn match cssPositioningAttr contained "\<list-item\>"
syn match cssPositioningAttr contained "\<inline-\(block\|table\)\>"
syn keyword cssPositioningAttr contained static relative absolute fixed
syn match cssPrintProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
syn keyword cssPrintProp contained orphans widows
syn keyword cssPrintAttr contained landscape portrait crop cross always avoid
syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\)\>"
syn keyword cssTableAttr contained fixed collapse separate show hide once always
syn keyword cssTextProp contained color direction
syn match cssTextProp "\<\(\(word\|letter\)-spacing\|text\(-\(decoration\|transform\|align\|index\|shadow\)\)\=\|vertical-align\|unicode-bidi\|line-height\)\>"
syn match cssTextProp contained "\<text-\(justify\|\outline\|overflow\|warp\|align-last\)\>"
syn match cssTextProp contained "\<word-\(break\|\wrap\)\>"
syn match cssTextProp contained "\<white-space\>"
syn match cssTextProp contained "\<hanging-punctuation\>"
syn match cssTextProp contained "\<punctuation-trim\>"
syn match cssTextAttr contained "\<line-through\>"
syn match cssTextAttr contained "\<text-indent\>"
syn match cssTextAttr contained "\<\(text-\)\=\(top\|bottom\)\>"
syn keyword cssTextAttr contained ltr rtl embed nowrap
syn keyword cssTextAttr contained underline overline blink sub super middle
syn keyword cssTextAttr contained capitalize uppercase lowercase center justify baseline sub super
syn keyword cssTextAttr contained capitalize uppercase lowercase
syn keyword cssTextAttr contained center justify baseline sub super
syn match cssTextAttr contained "\<pre\(-\(line\|wrap\)\)\=\>"
syn match cssTextAttr contained "\<\(allow\|force\)-end\>"
syn keyword cssTextAttr contained start end adjacent
syn match cssTextAttr contained "\<inter-\(word\|ideographic\|cluster\)\>"
syn keyword cssTextAttr contained distribute kashida first last
syn keyword cssTextAttr contained clip ellipsis unrestricted suppress
syn match cssTextAttr contained "\<break-all\>"
syn match cssTextAttr contained "\<break-word\>"
syn keyword cssTextAttr contained hyphenate
syn match cssBoxProp contained "\<\(margin\|padding\|border\)\(-\(top\|right\|bottom\|left\)\)\=\>"
syn match cssBoxProp contained "\<border-\(\(\(top\|right\|bottom\|left\)-\)\=\(width\|color\|style\)\)\=\>"
syn match cssBoxProp contained "\<\(width\|z-index\)\>"
syn match cssBoxProp contained "\<\(min\|max\)-\(width\|height\)\>"
syn keyword cssBoxProp contained width height float clear overflow clip visibility
syn keyword cssBoxAttr contained thin thick both
syn keyword cssBoxAttr contained dotted dashed solid double groove ridge inset outset
syn keyword cssBoxAttr contained hidden visible scroll collapse
syn keyword cssGeneratedContentProp contained content quotes
syn match cssGeneratedContentProp contained "\<counter-\(reset\|increment\)\>"
syn match cssGeneratedContentProp contained "\<list-style\(-\(type\|position\|image\)\)\=\>"
syn match cssGeneratedContentAttr contained "\<\(no-\)\=\(open\|close\)-quote\>"
syn match cssAuralAttr contained "\<lower\>"
syn match cssGeneratedContentAttr contained "\<\(lower\|upper\)-\(roman\|alpha\|greek\|latin\)\>"
syn match cssGeneratedContentAttr contained "\<\(hiragana\|katakana\)\(-iroha\)\=\>"
syn match cssGeneratedContentAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic\)\>"
syn keyword cssGeneratedContentAttr contained disc circle square hebrew armenian georgian
syn keyword cssGeneratedContentAttr contained inside outside
syn match cssTransformProp contained "\<transform\(-\(origin\|style\)\)\=\>"
syn match cssTransformProp contained "\<perspective\(-origin\)\=\>"
syn match cssTransformProp contained "\<backface-visibility\>"
syn match cssPagingProp contained "\<page\(-break-\(before\|after\|inside\)\)\=\>"
syn keyword cssPagingProp contained size marks inside orphans widows
syn keyword cssPagingAttr contained landscape portrait crop cross always avoid
syn keyword cssUIProp contained cursor
syn match cssUIProp contained "\<outline\(-\(width\|style\|color\)\)\=\>"
syn match cssUIAttr contained "\<[ns]\=[ew]\=-resize\>"
syn keyword cssUIAttr contained default crosshair pointer move wait help
syn keyword cssUIAttr contained thin thick
syn keyword cssUIAttr contained dotted dashed solid double groove ridge inset outset
syn keyword cssUIAttr contained invert
syn match cssRenderAttr contained "\<marker\>"
syn match cssRenderProp contained "\<\(display\|marker-offset\|unicode-bidi\|white-space\|list-item\|run-in\|inline-table\)\>"
syn keyword cssRenderProp contained position top bottom direction
syn match cssRenderProp contained "\<\(left\|right\)\>"
syn keyword cssRenderAttr contained block inline compact
syn match cssRenderAttr contained "\<table\(-\(row-gorup\|\(header\|footer\)-group\|row\|column\(-group\)\=\|cell\|caption\)\)\=\>"
syn keyword cssRenderAttr contained static relative absolute fixed
syn keyword cssRenderAttr contained ltr rtl embed bidi-override pre nowrap
syn match cssRenderAttr contained "\<bidi-override\>"
syn match cssTransitionProp contained "\<transition\(-\(delay\|duration\|property\|timing-function\)\)\=\>"
syn match cssUIProp contained "\<nav-\(down\|index\|left\|right\|up\)\=\>"
syn match cssUIProp contained "\<outline-offset\>"
syn match cssUIProp contained "\<box-sizing\>"
syn keyword cssUIProp contained appearance icon resize
syn keyword cssUIAttr contained window button menu field
syn match cssAuralProp contained "\<\(pause\|cue\)\(-\(before\|after\)\)\=\>"
syn match cssAuralProp contained "\<\(play-during\|speech-rate\|voice-family\|pitch\(-range\)\=\|speak\(-\(punctuation\|numerals\)\)\=\)\>"
@@ -171,30 +309,54 @@ syn keyword cssAuralAttr contained below level above higher
syn match cssAuralAttr contained "\<\(x-\)\=\(slow\|fast\)\>"
syn keyword cssAuralAttr contained faster slower
syn keyword cssAuralAttr contained male female child code digits continuous
syn match cssAuralAttr contained "\<lower\>"
" cursor
syn keyword cssUIProp contained cursor
syn match cssUIAttr contained "\<[ns]\=[ew]\=-resize\>"
syn keyword cssUIAttr contained crosshair default help move pointer
syn keyword cssUIAttr contained progress wait
" FIXME: I could not find them in reference
syn keyword cssUIAttr contained invert maker size zoom
syn match cssRenderAttr contained "\<run-in\>"
syn match cssRenderAttr contained "\<text-rendering\>"
syn match cssRenderAttr contained "\<font-smoothing\>"
syn match cssRenderProp contained "\<marker-offset\>"
syn match cssRenderAttr contained "\<bidi-override\>"
syn match cssTableProp contained "\<\(caption-side\|table-layout\|border-collapse\|border-spacing\|empty-cells\|speak-header\)\>"
syn keyword cssTableAttr contained fixed collapse separate show hide once always
" FIXME: This allows cssMediaBlock before the semicolon, which is wrong.
syn region cssInclude start="@import" end=";" contains=cssComment,cssURL,cssUnicodeEscape,cssMediaType
syn match cssBraces contained "[{}]"
syn match cssError contained "{@<>"
syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape
syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=css.*Attr,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition
syn match cssBraceError "}"
" Pseudo class
syn match cssPseudoClass ":[A-Za-z0-9_-]*" contains=cssPseudoClassId,cssUnicodeEscape
syn keyword cssPseudoClassId contained link visited active hover focus before after left right
syn keyword cssPseudoClassId link visited active hover focus before after left right lang
syn match cssPseudoClassId contained "\<first\(-\(line\|letter\|child\)\)\=\>"
syn region cssPseudoClassLang matchgroup=cssPseudoClassId start=":lang(" end=")" oneline
" FIXME: handle functions.
"syn region cssPseudoClassLang matchgroup=cssPseudoClassId start="lang(" end=")"
syn match cssPseudoClassId contained "\<\(last\|only\|nth\|nth-last\)-child\>"
syn match cssPseudoClassId contained "\<\(first\|last\|only\|nth\|nth-last\)-of-type\>"
syn keyword cssPseudoClassId root empty target enable disabled checked not invalid
syn match cssPseudoClassId contained "::\(-moz-\)\=selection"
" Comment
syn region cssComment start="/\*" end="\*/" contains=@Spell
syn region cssComment start="//" skip="\\$" end="$" keepend contains=@Spell
syn match cssUnicodeEscape "\\\x\{1,6}\s\?"
syn match cssSpecialCharQQ +\\"+ contained
syn match cssSpecialCharQ +\\'+ contained
syn region cssStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cssUnicodeEscape,cssSpecialCharQQ
syn region cssStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cssUnicodeEscape,cssSpecialCharQ
syn match cssClassName "\.[A-Za-z][A-Za-z0-9_-]\+"
" Vendor Prefix
syn match cssVendor contained "\(-\(webkit\|moz\|o\|ms\)-\)"
if main_syntax == "css"
syn sync minlines=10
@@ -212,31 +374,75 @@ if version >= 508 || !exists("did_css_syn_inits")
endif
HiLink cssComment Comment
HiLink cssVendor Comment
HiLink cssTagName Statement
HiLink cssDeprecated Error
HiLink cssSelectorOp Special
HiLink cssSelectorOp2 Special
HiLink cssFontProp StorageClass
HiLink cssColorProp StorageClass
HiLink cssTextProp StorageClass
HiLink cssAnimationProp StorageClass
HiLink cssBackgroundProp StorageClass
HiLink cssBorderOutlineProp StorageClass
HiLink cssBoxProp StorageClass
HiLink cssRenderProp StorageClass
HiLink cssColorProp StorageClass
HiLink cssContentForPagedMediaProp StorageClass
HiLink cssDimensionProp StorageClass
HiLink cssFlexibleBoxProp StorageClass
HiLink cssFontProp StorageClass
HiLink cssGeneratedContentProp StorageClass
HiLink cssGridProp StorageClass
HiLink cssHyerlinkProp StorageClass
HiLink cssLineboxProp StorageClass
HiLink cssListProp StorageClass
HiLink cssMarginProp StorageClass
HiLink cssMarqueeProp StorageClass
HiLink cssMultiColumnProp StorageClass
HiLink cssPaddingProp StorageClass
HiLink cssPagedMediaProp StorageClass
HiLink cssPositioningProp StorageClass
HiLink cssPrintProp StorageClass
HiLink cssRubyProp StorageClass
HiLink cssSpeechProp StorageClass
HiLink cssTableProp StorageClass
HiLink cssTextProp StorageClass
HiLink cssTransformProp StorageClass
HiLink cssTransitionProp StorageClass
HiLink cssUIProp StorageClass
HiLink cssAuralProp StorageClass
HiLink cssRenderProp StorageClass
HiLink cssGeneratedContentProp StorageClass
HiLink cssPagingProp StorageClass
HiLink cssTableProp StorageClass
HiLink cssUIProp StorageClass
HiLink cssFontAttr Type
HiLink cssColorAttr Type
HiLink cssTextAttr Type
HiLink cssAnimationAttr Type
HiLink cssBackgroundAttr Type
HiLink cssBorderOutlineAttr Type
HiLink cssBoxAttr Type
HiLink cssRenderAttr Type
HiLink cssAuralAttr Type
HiLink cssColorAttr Type
HiLink cssContentForPagedMediaAttr Type
HiLink cssDimensionAttr Type
HiLink cssFlexibleBoxAttr Type
HiLink cssFontAttr Type
HiLink cssGeneratedContentAttr Type
HiLink cssPagingAttr Type
HiLink cssGridAttr Type
HiLink cssHyerlinkAttr Type
HiLink cssLineboxAttr Type
HiLink cssListAttr Type
HiLink cssMarginAttr Type
HiLink cssMarqueeAttr Type
HiLink cssMultiColumnAttr Type
HiLink cssPaddingAttr Type
HiLink cssPagedMediaAttr Type
HiLink cssPositioningAttr Type
HiLink cssPrintAttr Type
HiLink cssRubyAttr Type
HiLink cssSpeechAttr Type
HiLink cssTableAttr Type
HiLink cssTextAttr Type
HiLink cssTransformAttr Type
HiLink cssTransitionAttr Type
HiLink cssUIAttr Type
HiLink cssAuralAttr Type
HiLink cssRenderAttr Type
HiLink cssCommonAttr Type
HiLink cssPseudoClassId PreProc
HiLink cssPseudoClassLang Constant
HiLink cssValueLength Number
@@ -277,6 +483,7 @@ if main_syntax == 'css'
unlet main_syntax
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
+3 -2
View File
@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2011 Dec 09
" Last Change: 2012 Jun 06
" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debcontrol.vim
" Standard syntax initialization
@@ -45,7 +45,7 @@ syn match debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"
syn match debcontrolEmail "<.\{-}>"
" #-Comments
syn match debcontrolComment "^#.*$"
syn match debcontrolComment "^#.*$" contains=@Spell
syn case ignore
@@ -69,6 +69,7 @@ syn region debcontrolStrictField start="^\%(XS-\)\=DM-Upload-Allowed" end="$" co
" Catch-all for the other legal fields
syn region debcontrolField start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Essential\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\):" end="$" contains=debcontrolKey,debcontrolVariable,debcontrolEmail oneline
syn region debcontrolMultiField start="^\%(Build-\%(Conflicts\|Depends\)\%(-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Provides\|Replaces\|Conflicts\|Enhances\|Breaks\|Uploaders\|Description\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment
syn region debcontrolMultiFieldSpell start="^\%(Description\):" skip="^ " end="^$"me=s-1 end="^[^ #]"me=s-1 contains=debcontrolKey,debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell
" Associate our matches and regions with pretty colours
if version >= 508 || !exists("did_debcontrol_syn_inits")
+26
View File
@@ -0,0 +1,26 @@
" Vim syntax file
" Language: dts/dtsi (device tree files)
" Maintainer: Daniel Mack <vim@zonque.org>
" Last Change: 2012 Oct 04
if exists("b:current_syntax")
finish
endif
syntax region dtsComment start="/\*" end="\*/"
syntax match dtsReference "&[[:alpha:][:digit:]_]\+"
syntax region dtsBinaryProperty start="\[" end="\]"
syntax match dtsStringProperty "\".*\""
syntax match dtsKeyword "/.*/"
syntax match dtsLabel "^[[:space:]]*[[:alpha:][:digit:]_]\+:"
syntax region dtsCellProperty start="<" end=">" contains=dtsReference,dtsBinaryProperty,dtsStringProperty,dtsComment
syntax region dtsCommentInner start="/\*" end="\*/"
hi def link dtsCellProperty Number
hi def link dtsBinaryProperty Number
hi def link dtsStringProperty String
hi def link dtsKeyword Include
hi def link dtsLabel Label
hi def link dtsReference Macro
hi def link dtsComment Comment
hi def link dtsCommentInner Comment
+9 -4
View File
@@ -2,7 +2,7 @@
" Language: GDB command files
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/gdb.vim
" Last Change: 2009 May 25
" Last Change: 2012 Oct 05
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -12,6 +12,9 @@ elseif exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
syn keyword gdbInfo contained address architecture args breakpoints catch common copying dcache
syn keyword gdbInfo contained display files float frame functions handle line
syn keyword gdbInfo contained locals program registers scope set sharedlibrary signals
@@ -32,7 +35,7 @@ syn match gdbFuncDef "\<define\>.*"
syn match gdbStatmentContainer "^\s*\S\+" contains=gdbStatement,gdbFuncDef
syn match gdbStatement "^\s*info" nextgroup=gdbInfo skipwhite skipempty
" some commonly used abreviations
" some commonly used abbreviations
syn keyword gdbStatement c disp undisp disas p
syn region gdbDocument matchgroup=gdbFuncDef start="\<document\>.*$" matchgroup=gdbFuncDef end="^end\s*$"
@@ -65,12 +68,12 @@ syn match gdbSet "\<input-radix\>"
syn match gdbSet "\<demangle-style\>"
syn match gdbSet "\<output-radix\>"
syn match gdbComment "^\s*#.*"
syn match gdbComment "^\s*#.*" contains=@Spell
syn match gdbVariable "\$\K\k*"
" Strings and constants
syn region gdbString start=+"+ skip=+\\\\\|\\"+ end=+"+
syn region gdbString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell
syn match gdbCharacter "'[^']*'" contains=gdbSpecialChar,gdbSpecialCharError
syn match gdbCharacter "'\\''" contains=gdbSpecialChar
syn match gdbCharacter "'[^\\]'"
@@ -108,4 +111,6 @@ endif
let b:current_syntax = "gdb"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
+7 -7
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: hg (Mercurial) commit file
" Maintainer: Ken Takata <kentkt at csc dot jp>
" Last Change: 2012 Aug 2
" Last Change: 2012 Aug 23
" Filenames: hg-editor-*.txt
" License: VIM License
" URL: https://github.com/k-takata/hg-vim
@@ -10,12 +10,12 @@ if exists("b:current_syntax")
finish
endif
syn match hgcommitComment "^HG:.*$"
syn match hgcommitUser "^HG: user: \zs.*$" contained containedin=hgcommitComment
syn match hgcommitBranch "^HG: branch \zs.*$" contained containedin=hgcommitComment
syn match hgcommitAdded "^HG: \zsadded .*$" contained containedin=hgcommitComment
syn match hgcommitChanged "^HG: \zschanged .*$" contained containedin=hgcommitComment
syn match hgcommitRemoved "^HG: \zsremoved .*$" contained containedin=hgcommitComment
syn match hgcommitComment "^HG:.*$" contains=@NoSpell
syn match hgcommitUser "^HG: user: \zs.*$" contains=@NoSpell contained containedin=hgcommitComment
syn match hgcommitBranch "^HG: branch \zs.*$" contains=@NoSpell contained containedin=hgcommitComment
syn match hgcommitAdded "^HG: \zsadded .*$" contains=@NoSpell contained containedin=hgcommitComment
syn match hgcommitChanged "^HG: \zschanged .*$" contains=@NoSpell contained containedin=hgcommitComment
syn match hgcommitRemoved "^HG: \zsremoved .*$" contains=@NoSpell contained containedin=hgcommitComment
hi def link hgcommitComment Comment
hi def link hgcommitUser String
+16 -9
View File
@@ -2,7 +2,7 @@
" Language: HTML
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/html.vim
" Last Change: 2006 Jun 19
" Last Change: 2012 Oct 05
" Please check :help html.vim for some comments and a description of the options
@@ -17,6 +17,9 @@ if !exists("main_syntax")
let main_syntax = 'html'
endif
let s:cpo_save = &cpo
set cpo&vim
" don't use standard HiLink, it will not work with included syntax files
if version < 508
command! -nargs=+ HtmlHiLink hi link <args>
@@ -37,7 +40,7 @@ syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,ja
syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc
syn match htmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@htmlPreproc
syn region htmlEndTag start=+</+ end=+>+ contains=htmlTagN,htmlTagError
syn region htmlTag start=+<[^/]+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
syn region htmlTag start=+<[^/]+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
syn match htmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
syn match htmlTagN contained +</\s*[-a-zA-Z0-9]\++hs=s+2 contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster
syn match htmlTagError contained "[^>]<"ms=s+1
@@ -98,11 +101,11 @@ syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
" Comments (the real ones or the old netscape ones)
if exists("html_wrong_comments")
syn region htmlComment start=+<!--+ end=+--\s*>+
syn region htmlComment start=+<!--+ end=+--\s*>+ contains=@Spell
else
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError
syn region htmlComment start=+<!+ end=+>+ contains=htmlCommentPart,htmlCommentError,@Spell
syn match htmlCommentError contained "[^><!]"
syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc
syn region htmlCommentPart contained start=+--+ end=+--\s*+ contains=@htmlPreProc,@Spell
endif
syn region htmlComment start=+<!DOCTYPE+ keepend end=+>+
@@ -147,7 +150,8 @@ if !exists("html_no_rendering")
syn region htmlItalicUnderlineBold contained start="<b\>" end="</b>"me=e-4 contains=@htmlTop
syn region htmlItalicUnderlineBold contained start="<strong\>" end="</strong>"me=e-9 contains=@htmlTop
syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc
syn match htmlLeadingSpace "^\s\+" contained
syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc
syn region htmlH1 start="<h1\>" end="</h1>"me=e-5 contains=@htmlTop
syn region htmlH2 start="<h2\>" end="</h2>"me=e-5 contains=@htmlTop
syn region htmlH3 start="<h3\>" end="</h3>"me=e-5 contains=@htmlTop
@@ -164,8 +168,8 @@ if main_syntax != 'java' || exists("java_javascript")
" JAVA SCRIPT
syn include @htmlJavaScript syntax/javascript.vim
unlet b:current_syntax
syn region javaScript start=+<script[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
syn region htmlScriptTag contained start=+<script+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
syn region javaScript start=+<script\_[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
syn region htmlScriptTag contained start=+<script+ end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
HtmlHiLink htmlScriptTag htmlTag
" html events (i.e. arguments that include javascript commands)
@@ -189,7 +193,7 @@ if main_syntax != 'java' || exists("java_vb")
" VB SCRIPT
syn include @htmlVbScript syntax/vb.vim
unlet b:current_syntax
syn region javaScript start=+<script [^>]*language *=[^>]*vbscript[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
syn region javaScript start=+<script \_[^>]*language *=\_[^>]*vbscript\_[^>]*>+ keepend end=+</script>+me=s-1 contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
endif
syn cluster htmlJavaScript add=@htmlPreproc
@@ -246,6 +250,7 @@ if version >= 508 || !exists("did_html_syn_inits")
HtmlHiLink htmlItalicBoldUnderline htmlBoldUnderlineItalic
HtmlHiLink htmlItalicUnderlineBold htmlBoldUnderlineItalic
HtmlHiLink htmlLink Underlined
HtmlHiLink htmlLeadingSpace None
if !exists("html_my_rendering")
hi def htmlBold term=bold cterm=bold gui=bold
hi def htmlBoldUnderline term=bold,underline cterm=bold,underline gui=bold,underline
@@ -289,4 +294,6 @@ if main_syntax == 'html'
unlet main_syntax
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
+11 -4
View File
@@ -1,7 +1,8 @@
" Vim syntax file " Language: Java
" Vim syntax file
" Language: Java
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/java.vim
" Last Change: 2011 Dec 30
" Last Change: 2012 Oct 05
" Please check :help java.vim for comments on some of the options available.
@@ -17,6 +18,9 @@ if !exists("main_syntax")
syn region javaFold start="{" end="}" transparent fold
endif
let s:cpo_save = &cpo
set cpo&vim
" don't use standard HiLink, it will not work with included syntax files
if version < 508
command! -nargs=+ JavaHiLink hi link <args>
@@ -26,7 +30,8 @@ endif
" some characters that cannot be in a java program (outside a string)
syn match javaError "[\\@`]"
syn match javaError "<<<\|\.\.\|=>\|<>\|||=\|&&=\|[^-]->\|\*\/"
syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|[^-]->\|\*\/"
syn match javaOK "\.\.\."
" use separate name so that it can be deleted in javacc.vim
@@ -161,7 +166,7 @@ if !exists("java_ignore_javadoc") && main_syntax != 'jsp'
syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaTodo,@Spell
syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags,javaDocSeeTag
syn region javaDocTags contained start="{@\(link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
syn region javaDocTags contained start="{@\(code\|link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}"
syn match javaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam
syn match javaDocParam contained "\s\S\+"
syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>"
@@ -341,5 +346,7 @@ if main_syntax == 'java'
endif
let b:spell_options="contained"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
+7 -2
View File
@@ -2,7 +2,7 @@
" Language: JavaCC, a Java Compiler Compiler written by JavaSoft
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/javacc.vim
" Last Change: 2001 Jun 20
" Last Change: 2012 Oct 05
" Uses java.vim, and adds a few special things for JavaCC Parser files.
" Those files usually have the extension *.jj
@@ -15,6 +15,9 @@ elseif exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" source the java.vim file
if version < 600
source <sfile>:p:h/java.vim
@@ -44,7 +47,7 @@ syn keyword javaccPackages options DEBUG_PARSER DEBUG_LOOKAHEAD DEBUG_TOKEN_MANA
syn keyword javaccPackages COMMON_TOKEN_ACTION IGNORE_CASE CHOICE_AMBIGUITY_CHECK
syn keyword javaccPackages OTHER_AMBIGUITY_CHECK STATIC LOOKAHEAD ERROR_REPORTING
syn keyword javaccPackages USER_TOKEN_MANAGER USER_CHAR_STREAM JAVA_UNICODE_ESCAPE
syn keyword javaccPackages UNICODE_INPUT
syn keyword javaccPackages UNICODE_INPUT JDK_VERSION
syn match javaccPackages "PARSER_END([^)]*)"
syn match javaccPackages "PARSER_BEGIN([^)]*)"
syn match javaccSpecToken "<EOF>"
@@ -73,5 +76,7 @@ if version >= 508 || !exists("did_css_syn_inits")
endif
let b:current_syntax = "javacc"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
+6 -1
View File
@@ -7,7 +7,7 @@
" (ss) repaired several quoting and grouping glitches
" (ss) fixed regex parsing issue with multiple qualifiers [gi]
" (ss) additional factoring of keywords, globals, and members
" Last Change: 2010 Mar 25
" Last Change: 2012 Oct 05
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -23,6 +23,9 @@ if !exists("main_syntax")
let main_syntax = 'javascript'
endif
let s:cpo_save = &cpo
set cpo&vim
" Drop fold if it set but vim doesn't support it.
if version < 600 && exists("javaScript_fold")
unlet javaScript_fold
@@ -131,5 +134,7 @@ let b:current_syntax = "javascript"
if main_syntax == 'javascript'
unlet main_syntax
endif
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
+10 -4
View File
@@ -2,7 +2,7 @@
" Language: Makefile
" Maintainer: Claudio Fleiner <claudio@fleiner.com>
" URL: http://www.fleiner.com/vim/syntax/make.vim
" Last Change: 2008 Aug 04
" Last Change: 2012 Oct 05
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -12,6 +12,10 @@ elseif exists("b:current_syntax")
finish
endif
let s:cpo_save = &cpo
set cpo&vim
" some special characters
syn match makeSpecial "^\s*[@+-]\+"
syn match makeNextLine "\\\n\s*"
@@ -25,8 +29,8 @@ syn match makeOverride "^ *override"
hi link makeOverride makeStatement
hi link makeExport makeStatement
" Koehler: catch unmatched define/endef keywords. endef only matches it is by itself on a line
syn region makeDefine start="^\s*define\s" end="^\s*endef\s*$" contains=makeStatement,makeIdent,makePreCondit,makeDefine
" catch unmatched define/endef keywords. endef only matches it is by itself on a line, possibly followed by a commend
syn region makeDefine start="^\s*define\s" end="^\s*endef\s*\(#.*\)\?$" contains=makeStatement,makeIdent,makePreCondit,makeDefine
" Microsoft Makefile specials
syn case ignore
@@ -48,8 +52,8 @@ syn match makeConfig "@[A-Za-z0-9_]\+@"
" make targets
" syn match makeSpecTarget "^\.\(SUFFIXES\|PHONY\|DEFAULT\|PRECIOUS\|IGNORE\|SILENT\|EXPORT_ALL_VARIABLES\|KEEP_STATE\|LIBPATTERNS\|NOTPARALLEL\|DELETE_ON_ERROR\|INTERMEDIATE\|POSIX\|SECONDARY\)\>"
syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource
syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:$"me=e-1 nextgroup=makeSource
syn match makeImplicit "^\.[A-Za-z0-9_./\t -]\+\s*:[^=]"me=e-2 nextgroup=makeSource
syn region makeTarget transparent matchgroup=makeTarget start="^[A-Za-z0-9_./$()%-][A-Za-z0-9_./\t $()%-]*:\{1,2}[^:=]"rs=e-1 end=";"re=e-1,me=e-1 end="[^\\]$" keepend contains=makeIdent,makeSpecTarget,makeNextLine skipnl nextGroup=makeCommands
syn match makeTarget "^[A-Za-z0-9_./$()%*@-][A-Za-z0-9_./\t $()%*@-]*::\=\s*$" contains=makeIdent,makeSpecTarget skipnl nextgroup=makeCommands,makeCommandError
@@ -134,4 +138,6 @@ endif
let b:current_syntax = "make"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
+58 -58
View File
@@ -3,20 +3,20 @@
" Filename extensions: *.p (collides with Pascal),
" *.i (collides with assembler)
" *.w (collides with cweb)
" Maintainer: Philip Uren <philuSPAX@ieee.org> Remove SPAX spam block
" Contributors: Chris Ruprecht <chris@ruprecht.org>
" Philip Uren <philu@computer.org>
" Mikhail Kuperblum <mikhail@whasup.com>
" John Florian <jflorian@voyager.net>
" Version: 11
" Last Change: May 11 2012
" Maintainer: Philip Uren <philuSPAX@ieee.org> Remove SPAX spam block
" Contributors: Chris Ruprecht <chris@ruprecht.org>
" Philip Uren <philu@computer.org>
" Mikhail Kuperblum <mikhail@whasup.com>
" John Florian <jflorian@voyager.net>
" Version: 12
" Last Change: Aug 16 2012
" For version 5.x: Clear all syntax item
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
syntax clear
elseif exists("b:current_syntax")
finish
finish
endif
let s:cpo_save = &cpo
@@ -34,7 +34,7 @@ set expandtab
syn case ignore
" Progress Blocks of code and mismatched "end." errors.
syn match ProgressEndError "\<end\>"
syn match ProgressEndError "\<end\>"
syn region ProgressDoBlock transparent matchgroup=ProgressDo start="\<do\>" matchgroup=ProgressDo end="\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
syn region ProgressForBlock transparent matchgroup=ProgressFor start="\<for\>" matchgroup=ProgressFor end="\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
syn region ProgressRepeatBlock transparent matchgroup=ProgressRepeat start="\<repeat\>" matchgroup=ProgressRepeat end="\<end\>" contains=ALLBUT,ProgressProcedure,ProgressFunction
@@ -44,20 +44,20 @@ syn region ProgressCaseBlock transparent matchgroup=ProgressCase start="\<case\>
" and they could go in ProgressReserved,
" but I found it more helpful to highlight them in a different color.
syn keyword ProgressConditional if else then when otherwise
syn keyword ProgressFor each where
syn keyword ProgressFor each where
" Make those TODO and debugging notes stand out!
syn keyword ProgressTodo contained TODO BUG FIX
syn keyword ProgressDebug contained DEBUG
syn keyword ProgressTodo contained TODO BUG FIX
syn keyword ProgressDebug contained DEBUG
syn keyword ProgressDebug debugger
" If you like to highlight the whole line of
" the start and end of procedures
" to make the whole block of code stand out:
syn match ProgressProcedure "^\s*procedure.*"
syn match ProgressProcedure "^\s*end\s\s*procedure.*"
syn match ProgressFunction "^\s*function.*"
syn match ProgressFunction "^\s*end\s\s*function.*"
syn match ProgressProcedure "^\s*procedure.*"
syn match ProgressProcedure "^\s*end\s\s*procedure.*"
syn match ProgressFunction "^\s*function.*"
syn match ProgressFunction "^\s*end\s\s*function.*"
" ... otherwise use this:
" syn keyword ProgressFunction procedure function
@@ -99,14 +99,14 @@ syn keyword ProgressReserved window-maxim[ized] window-minim[ized] window-normal
" Strings. Handles embedded quotes.
" Note that, for some reason, Progress doesn't use the backslash, "\"
" as the escape character; it uses tilde, "~".
syn region ProgressString matchgroup=ProgressQuote start=+"+ end=+"+ skip=+\~'\|\~\~+
syn region ProgressString matchgroup=ProgressQuote start=+'+ end=+'+ skip=+\~'\|\~\~+
syn region ProgressString matchgroup=ProgressQuote start=+"+ end=+"+ skip=+\~'\|\~\~+ contains=@Spell
syn region ProgressString matchgroup=ProgressQuote start=+'+ end=+'+ skip=+\~'\|\~\~+ contains=@Spell
syn match ProgressIdentifier "\<[a-zA-Z_][a-zA-Z0-9_]*\>()"
" syn match ProgressDelimiter "()"
syn match ProgressMatrixDelimiter "[][]"
syn match ProgressMatrixDelimiter "[][]"
" If you prefer you can highlight the range:
"syn match ProgressMatrixDelimiter "[\d\+\.\.\d\+]"
@@ -114,7 +114,7 @@ syn match ProgressNumber "\<\-\=\d\+\(u\=l\=\|lu\|f\)\>"
syn match ProgressByte "\$[0-9a-fA-F]\+"
" More values: Logicals, and Progress's unknown value, ?.
syn match ProgressNumber "?"
syn match ProgressNumber "?"
syn keyword ProgressNumber true false yes no
" If you don't like tabs:
@@ -123,9 +123,9 @@ syn match ProgressShowTab "\t"
" If you don't like white space on the end of lines, uncomment this:
" syn match ProgressSpaceError "\s\+$"
syn region ProgressComment start="/\*" end="\*/" contains=ProgressComment,ProgressTodo,ProgressDebug
syn region ProgressInclude start="^[ ]*[{]" end="[}]" contains=ProgressPreProc,ProgressOperator,ProgressString,ProgressComment
syn region ProgressPreProc start="&" end="\>" contained
syn region ProgressComment start="/\*" end="\*/" contains=ProgressComment,ProgressTodo,ProgressDebug,@Spell
syn region ProgressInclude start="^[ ]*[{]" end="[}]" contains=ProgressPreProc,ProgressOperator,ProgressString,ProgressComment
syn region ProgressPreProc start="&" end="\>" contained
" This next line works reasonably well.
" syn match ProgressOperator "[!;|)(:.><+*=-]"
@@ -277,7 +277,7 @@ syn keyword ProgressOperator write-fragment write-message write-processing-instr
syn keyword ProgressOperator xml-data-type xml-node-name xml-node-type xml-schema-pat[h] xml-suppress-namespace-processing y y-of year year-offset yes-no
syn keyword ProgressOperator yes-no-cancel
syn keyword ProgressType char[acter] int[eger] int64 dec[imal] log[ical] da[te] datetime datetime-tz
syn keyword ProgressType char[acter] int[eger] int64 dec[imal] log[ical] da[te] datetime datetime-tz
syn sync lines=800
@@ -285,40 +285,40 @@ syn sync lines=800
" 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_progress_syntax_inits")
if version < 508
let did_progress_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
if version < 508
let did_progress_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
" The default methods for highlighting. Can be overridden later.
HiLink ProgressByte Number
HiLink ProgressCase Repeat
HiLink ProgressComment Comment
HiLink ProgressConditional Conditional
HiLink ProgressDebug Debug
HiLink ProgressDo Repeat
HiLink ProgressEndError Error
HiLink ProgressFor Repeat
HiLink ProgressFunction Procedure
HiLink ProgressIdentifier Identifier
HiLink ProgressInclude Include
HiLink ProgressMatrixDelimiter Identifier
HiLink ProgressNumber Number
HiLink ProgressOperator Operator
HiLink ProgressPreProc PreProc
HiLink ProgressProcedure Procedure
HiLink ProgressQuote Delimiter
HiLink ProgressRepeat Repeat
HiLink ProgressReserved Statement
HiLink ProgressSpaceError Error
HiLink ProgressString String
HiLink ProgressTodo Todo
HiLink ProgressType Statement
HiLink ProgressShowTab Error
" The default methods for highlighting. Can be overridden later.
HiLink ProgressByte Number
HiLink ProgressCase Repeat
HiLink ProgressComment Comment
HiLink ProgressConditional Conditional
HiLink ProgressDebug Debug
HiLink ProgressDo Repeat
HiLink ProgressEndError Error
HiLink ProgressFor Repeat
HiLink ProgressFunction Procedure
HiLink ProgressIdentifier Identifier
HiLink ProgressInclude Include
HiLink ProgressMatrixDelimiter Identifier
HiLink ProgressNumber Number
HiLink ProgressOperator Operator
HiLink ProgressPreProc PreProc
HiLink ProgressProcedure Procedure
HiLink ProgressQuote Delimiter
HiLink ProgressRepeat Repeat
HiLink ProgressReserved Statement
HiLink ProgressSpaceError Error
HiLink ProgressString String
HiLink ProgressTodo Todo
HiLink ProgressType Statement
HiLink ProgressShowTab Error
delcommand HiLink
delcommand HiLink
endif
let b:current_syntax = "progress"
@@ -326,4 +326,4 @@ let b:current_syntax = "progress"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8 sw=4
" vim: ts=8 sw=8
+60 -27
View File
@@ -1,14 +1,8 @@
" Vim syntax file
" Language: Rexx
" Maintainer: Thomas Geulig <geulig@nentec.de>
" Last Change: 2005 Dez 9, added some <http://www.ooRexx.org>-coloring,
" line comments, do *over*, messages, directives,
" highlighting classes, methods, routines and requires
" 2007 Oct 17, added support for new ooRexx 3.2 features
" Rony G. Flatscher <rony.flatscher@wu-wien.ac.at>
"
" Last Change: 2012 Sep 14, added support for new ooRexx 4.0 features
" URL: http://www.geulig.de/vim/rexx.vim
"
" Special Thanks to Dan Sharp <dwsharp@hotmail.com> and Rony G. Flatscher
" <Rony.Flatscher@wu-wien.ac.at> for comments and additions
@@ -54,7 +48,7 @@ syn match rexxKeyword contained "\<use\>\s*\(strict\s*\)\?\<arg\>"
syn match rexxRegularCallSignal contained "\<\(call\|signal\)\s\(\s*on\>\|\s*off\>\)\@!\(\k\+\ze\|\ze(\)\(\s*\|;\|$\|(\)"
syn region rexxLabel contained start="\<\(call\|signal\)\>\s*\zs\(\k*\|(\)" end="\ze\(\s*\|;\|$\|(\)" containedin=rexxRegularCallSignal
syn match rexxExceptionHandling contained "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>.*\(;\|$\)"
syn match rexxExceptionHandling contained "\<\(call\|signal\)\>\s\+\<\(on\|off\)\>.*\(;\|$\)" contains=rexxComment
" hilite label given after keyword "name"
syn match rexxLabel "name\s\+\zs\k\+\ze" containedin=rexxExceptionHandling
@@ -74,13 +68,14 @@ syn match rexxConditional "\<\(then\|else\|when\|otherwise\)\(\s*\|;\|\_$\|\)\>"
syn match rexxLoopKeywords "\<\(to\|by\|for\|until\|while\|over\)\>" containedin=doLoopSelectLabelRegion
" must be after Conditional phrases!
syn match doLoopSelectLabelRegion "\<\(do\|loop\|select\)\>\s\+\(label\s\+\)\?\(\s\+\k\+\s\+\zs\<over\>\)\?\k*\(\s\+forever\)\?\(\s\|;\|$\)"
syn match doLoopSelectLabelRegion "\<\(do\|loop\|select\)\>\s\+\(label\s\+\)\?\(\s\+\k\+\s\+\zs\<over\>\)\?\k*\(\s\+forever\)\?\(\s\|;\|$\)" contains=doLoopSelectLabelRegion,rexxStartValueAssignment,rexxLoopKeywords
" color label's name
syn match rexxLabel2 "\<\(do\|loop\|select\)\>\s\+label\s\+\zs\k*\ze" containedin=doLoopSelectLabelRegion
" make sure control variable is normal
syn match rexxControlVariable "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\s\+\<over\>" containedin=doLoopSelectLabelRegion
" TODO: re-activate ?
"rgf syn match rexxControlVariable "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\s\+\<over\>" containedin=doLoopSelectLabelRegion
" make sure control variable assignment is normal
syn match rexxStartValueAssignment "\<\(do\|loop\)\>\(\s\+label\s\+\k*\)\?\s\+\zs.*\ze\(=.*\)\?\s\+\<to\>" containedin=doLoopSelectLabelRegion
@@ -96,7 +91,8 @@ syn match rexxGuard "\(^\|;\|:\)\s*\<guard\>\s\+\<\(on\|off\)\>"
syn match rexxTrace "\(^\|;\|:\)\s*\<trace\>\s\+\<\K\k*\>"
" Raise statement
syn match rexxRaise "\(^\|;\|:\)\s\+\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2
" syn match rexxRaise "\(^\|;\|:\)\s\+\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2
syn match rexxRaise "\(^\|;\|:\)\s*\<raise\>\s*\<\(propagate\|error\|failure\|syntax\|user\)\>\?" contains=rexxRaise2
syn match rexxRaise2 "\<\(additional\|array\|description\|exit\|propagate\|return\)\>" containedin=rexxRaise
" Forward statement
@@ -142,19 +138,36 @@ syn keyword rexxSpecialVariable sigl rc result self super
syn keyword rexxSpecialVariable .environment .error .input .local .methods .output .rs .stderr .stdin .stdout .stdque
" Constants
syn keyword rexxConst .true .false .nil .endOfLine .line
syn keyword rexxConst .true .false .nil .endOfLine .line .context
" Rexx numbers
" int like number
syn match rexxNumber '\d\+' contained
syn match rexxNumber '[-+]\s*\d\+' contained
" Floating point number with decimal
syn match rexxNumber '\d\+\.\d*' contained
syn match rexxNumber '[-+]\s*\d\+\.\d*' contained
" Floating point like number with E
syn match rexxNumber '[-+]\s*\d*[eE][\-+]\d\+' contained
syn match rexxNumber '\d*[eE][\-+]\d\+' contained
" Floating point like number with E and decimal point (+,-)
syn match rexxNumber '[-+]\s*\d*\.\d*[eE][\-+]\d\+' contained
syn match rexxNumber '\d*\.\d*[eE][\-+]\d\+' contained
syn match rexxNumber "\(-\|+\)\?\s*\zs\<\(\d\+\.\?\|\d*\.\d\+\(E\(+\|-\)\d\{2,2}\)\?\)\?\>"
" ooRexx builtin classes (as of version 3.2.0, fall 2007), first define dot to be o.k. in keywords
syn keyword rexxBuiltinClass .Alarm .ArgUtil .Array .Bag .CaselessColumnComparator
syn keyword rexxBuiltinClass .CaselessComparator .CaselessDescendingComparator .CircularQueue
syn keyword rexxBuiltinClass .Class .Collection .ColumnComparator .Comparable .Comparator
syn keyword rexxBuiltinClass .DateTime .DescendingComparator .Directory .InputOutputStream
syn keyword rexxBuiltinClass .DateTime .DescendingComparator .Directory .File .InputOutputStream
syn keyword rexxBuiltinClass .InputStream .InvertingComparator .List .MapCollection
syn keyword rexxBuiltinClass .Message .Method .Monitor .MutableBuffer .Object
syn keyword rexxBuiltinClass .OrderedCollection .OutputStream .Properties .Queue
syn keyword rexxBuiltinClass .Relation .RexxQueue .Set .SetCollection .Stem .Stream
syn keyword rexxBuiltinClass .OrderedCollection .OutputStream .Package .Properties .Queue
syn keyword rexxBuiltinClass .RegularExpression .Relation .RexxContext .RexxQueue .Routine
syn keyword rexxBuiltinClass .Set .SetCollection .Stem .Stream
syn keyword rexxBuiltinClass .StreamSupplier .String .Supplier .Table .TimeSpan
" Windows-only classes
@@ -163,7 +176,8 @@ syn keyword rexxBuiltinClass .CategoryDialog .CheckBox .CheckList .ComboBox .Dia
syn keyword rexxBuiltinClass .DialogExtensions .DlgArea .DlgAreaU .DynamicDialog
syn keyword rexxBuiltinClass .EditControl .InputBox .IntegerBox .ListBox .ListChoice
syn keyword rexxBuiltinClass .ListControl .MenuObject .MessageExtensions .MultiInputBox
syn keyword rexxBuiltinClass .MultiListChoice .PasswordBox .PlainBaseDialog .PlainUserDialog
syn keyword rexxBuiltinClass .MultiListChoice .OLEObject .OLEVariant
syn keyword rexxBuiltinClass .PasswordBox .PlainBaseDialog .PlainUserDialog
syn keyword rexxBuiltinClass .ProgressBar .ProgressIndicator .PropertySheet .RadioButton
syn keyword rexxBuiltinClass .RcDialog .ResDialog .ScrollBar .SingleSelection .SliderControl
syn keyword rexxBuiltinClass .StateIndicator .StaticControl .TabControl .TimedMessage
@@ -171,22 +185,34 @@ syn keyword rexxBuiltinClass .TreeControl .UserDialog .VirtualKeyCodes .WindowBa
syn keyword rexxBuiltinClass .WindowExtensions .WindowObject .WindowsClassesBase .WindowsClipboard
syn keyword rexxBuiltinClass .WindowsEventLog .WindowsManager .WindowsProgramManager .WindowsRegistry
" BSF4ooRexx classes
syn keyword rexxBuiltinClass .BSF .bsf.dialog .bsf_proxy
syn keyword rexxBuiltinClass .UNO .UNO_ENUM .UNO_CONSTANTS .UNO_PROPERTIES
" ooRexx directives, ---rgf location important, otherwise directives in top of file not matched!
syn region rexxClassDirective start="::\s*class\s*"ms=e+1 end="\ze\(\s\|;\|$\)"
syn region rexxMethodDirective start="::\s*method\s*"ms=e+1 end="\ze\(\s\|;\|$\)"
syn region rexxRequiresDirective start="::\s*requires\s*"ms=e+1 end="\ze\(\s\|;\|$\)"
syn region rexxRoutineDirective start="::\s*routine\s*"ms=e+1 end="\ze\(\s\|;\|$\)"
syn region rexxAttributeDirective start="::\s*attribute\s*"ms=e+1 end="\ze\(\s\|;\|$\)"
" rgf, 2012-09-09
syn region rexxOptionsDirective start="::\s*options\s*"ms=e+1 end="\ze\(\s\|;\|$\)"
syn region rexxConstantDirective start="::\s*constant\s*"ms=e+1 end="\ze\(\s\|;\|$\)"
syn region rexxDirective start="\(^\|;\)\s*::\s*\w\+" end="\($\|;\)" contains=rexxString,rexxNumber,rexxComment,rexxLineComment,rexxClassDirective,rexxMethodDirective,rexxRoutineDirective,rexxRequiresDirective,rexxAttributeDirective,rexxOptionsDirective,rexxConstantDirective keepend
syn match rexxOptionsDirective2 "\<\(digits\|form\|fuzz\|trace\)\>" containedin = rexxOptionsDirective3
syn region rexxOptionsDirective3 start="\(^\|;\)\s*::\s*options\s"ms=e+1 end="\($\|;\)" contains=rexxString,rexxNumber,rexxVariable,rexxComment,rexxLineComment containedin = rexxDirective
syn region rexxDirective start="\(^\|;\)\s*::\s*\w\+" end="\($\|;\)" contains=rexxString,rexxComment,rexxLineComment,rexxClassDirective,rexxMethodDirective,rexxRoutineDirective,rexxRequiresDirective,rexxAttributeDirective keepend
syn region rexxVariable start="\zs\<\(\.\)\@!\K\k\+\>\ze\s*\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)" end="\(\_$\|.\)"me=e-1
syn match rexxVariable "\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)\s*\zs\K\k*\ze"
syn match rexxVariable "\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)\s*\zs\K\k*\ze"
" rgf, 2007-07-22: unfortunately, the entire region is colored (not only the
" patterns), hence useless (vim 7.0)! (syntax-docs hint that that should work)
" attempt: just colorize the parenthesis in matching colors, keep content
" transparent to keep the formatting already done to it!
" TODO: test on 7.3
" syn region par1 matchgroup=par1 start="(" matchgroup=par1 end=")" transparent contains=par2
" syn region par2 matchgroup=par2 start="(" matchgroup=par2 end=")" transparent contains=par3 contained
" syn region par3 matchgroup=par3 start="(" matchgroup=par3 end=")" transparent contains=par4 contained
@@ -200,11 +226,11 @@ syn match rexxVariable "\(=\|,\|)\|%\|\]\|\\\||\|&\|+=\|-=\|<\|>\)\s*\zs\K\k*\ze
" syn region par4 matchgroup=par4 start="(" end=")" contains=par5 contained
" syn region par5 matchgroup=par5 start="(" end=")" contains=par1 contained
hi par1 ctermfg=red guifg=red
hi par2 ctermfg=blue guifg=blue
hi par3 ctermfg=darkgreen guifg=darkgreen
hi par4 ctermfg=darkyellow guifg=darkyellow
hi par5 ctermfg=darkgrey guifg=darkgrey
hi par1 ctermfg=red guifg=red "guibg=grey
hi par2 ctermfg=blue guifg=blue "guibg=grey
hi par3 ctermfg=darkgreen guifg=darkgreen "guibg=grey
hi par4 ctermfg=darkyellow guifg=darkyellow "guibg=grey
hi par5 ctermfg=darkgrey guifg=darkgrey "guibg=grey
" line continuation (trailing comma or single dash)
syn sync linecont "\(,\|-\ze-\@!\)\ze\s*\(--.*\|\/\*.*\)*$"
@@ -214,7 +240,7 @@ syn sync linecont "\(,\|-\ze-\@!\)\ze\s*\(--.*\|\/\*.*\)*$"
" endif
" exec "syn sync ccomment rexxComment minlines=" . rexx_minlines
" always scan from start, PCs are powerful enough for that in 2007 !
" always scan from start, PCs have long become to be powerful enough for that
exec "syn sync fromstart"
" Define the default highlighting.
@@ -236,7 +262,7 @@ if version >= 508 || !exists("did_rexx_syn_inits")
HiLink endIterateLeaveLabelRegion rexxKeyword
HiLink rexxLoopKeywords rexxKeyword " Todo
HiLink rexxNumber Normal
HiLink rexxNumber Normal "DiffChange
" HiLink rexxIdentifier DiffChange
HiLink rexxRegularCallSignal Statement
@@ -249,7 +275,7 @@ if version >= 508 || !exists("did_rexx_syn_inits")
HiLink rexxCommentError rexxError
HiLink rexxError Error
HiLink rexxKeyword Statement
HiLink rexxKeywordStatements Statement
HiLink rexxKeywordStatements Statement
HiLink rexxFunction Function
HiLink rexxString String
@@ -271,6 +297,13 @@ if version >= 508 || !exists("did_rexx_syn_inits")
HiLink rexxRequiresDirective Include
HiLink rexxRoutineDirective rexxFunction
" rgf, 2012-09-09
HiLink rexxOptionsDirective rexxFunction
HiLink rexxOptionsDirective2 rexxOptionsDirective
HiLink rexxOptionsDirective3 Normal " rexxOptionsDirective
HiLink rexxConstantDirective rexxFunction
HiLink rexxConst Constant
HiLink rexxTypeSpecifier Type
HiLink rexxBuiltinClass rexxTypeSpecifier
+3 -1
View File
@@ -1,6 +1,6 @@
" Vim syntax support file
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 Feb 11
" Last Change: 2012 Sep 25
" This file sets up for syntax highlighting.
" It is loaded from "syntax.vim" and "manual.vim".
@@ -46,6 +46,8 @@ fun! s:SynSet()
echohl None
endif
let s = &filetype
elseif s == "OFF"
let s = ""
endif
if s != ""
+1 -1
View File
@@ -658,7 +658,7 @@ NOTE: If you were to exit Vim and start it again with vim TEST , the file
4. Type w TEST , where TEST is a filename that does not exist yet. Verify
that you see :'<,'>w TEST before you press <ENTER>.
5. Vim will write the selected lines to the file TEST. Use :!dir or !ls
5. Vim will write the selected lines to the file TEST. Use :!dir or :!ls
to see it. Do not remove it yet! We will use it in the next lesson.
NOTE: Pressing v starts Visual selection. You can move the cursor around
+1 -1
View File
@@ -645,7 +645,7 @@ RIMARKO: Ĉiuj : komandoj devas finiĝi per tajpo de <Enenklavo>
3. Nun tajpu: :w TESTO (kie TESTO estas la elektita dosiernomo)
4. Tio konservas la tutan dosieron (instruilon de Vim) kun la nomo TESTO.
Por kontroli tion, tajpu :!dir aŭ !ls denove por vidigi vian
Por kontroli tion, tajpu :!dir aŭ :!ls denove por vidigi vian
dosierujon.
RIMARKO: Se vi volus eliri el Vim kaj restartigi ĝin denove per vim TESTO,
+1 -1
View File
@@ -707,7 +707,7 @@ NOTE : Si vous quittez Vim et le red
Vérifiez que vous voyez :'<,'>w TEST avant de d'appuyer sur <Entrée>.
5. Vim va enregistrer les lignes sélectionnées dans le fichier TEST.
Utilisez :!dir ou !ls pour le voir. Ne l'effacez pas encore !
Utilisez :!dir ou :!ls pour le voir. Ne l'effacez pas encore !
Nous allons l'utiliser dans la leçon suivante.
NOTE : L'appui de v démarre la sélection Visuelle. Vous pouvez déplacer le
+1 -1
View File
@@ -707,7 +707,7 @@ NOTE : Si vous quittez Vim et le redémarrez de nouveau avec le fichier TEST,
Vérifiez que vous voyez :'<,'>w TEST avant de d'appuyer sur <Entrée>.
5. Vim va enregistrer les lignes sélectionnées dans le fichier TEST.
Utilisez :!dir ou !ls pour le voir. Ne l'effacez pas encore !
Utilisez :!dir ou :!ls pour le voir. Ne l'effacez pas encore !
Nous allons l'utiliser dans la leçon suivante.
NOTE : L'appui de v démarre la sélection Visuelle. Vous pouvez déplacer le
+1 -1
View File
@@ -659,7 +659,7 @@ NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST ,
Provjerite da zaista piše :'<,'>w TEST
prije nego što pritisnite <ENTER>.
5. Vim æe spremiti oznaèeni tekst u TEST. Provjerite sa :!dir ili !ls .
5. Vim æe spremiti oznaèeni tekst u TEST. Provjerite sa :!dir ili :!ls .
Nemojte je još brisati! Koristiti će te je u sljedećoj lekciji.
NAPOMENA: Tipka v započinje Vizualno označavanje. Možete pomicati kursor
+1 -1
View File
@@ -659,7 +659,7 @@ NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST ,
Provjerite da zaista piše :'<,'>w TEST
prije nego što pritisnite <ENTER>.
5. Vim æe spremiti oznaèeni tekst u TEST. Provjerite sa :!dir ili !ls .
5. Vim æe spremiti oznaèeni tekst u TEST. Provjerite sa :!dir ili :!ls .
Nemojte je još brisati! Koristiti će te je u sljedećoj lekciji.
NAPOMENA: Tipka v započinje Vizualno označavanje. Možete pomicati kursor
+1 -1
View File
@@ -659,7 +659,7 @@ NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST ,
Provjerite da zaista piše :'<,'>w TEST
prije nego što pritisnite <ENTER>.
5. Vim će spremiti označeni tekst u TEST. Provjerite sa :!dir ili !ls .
5. Vim će spremiti označeni tekst u TEST. Provjerite sa :!dir ili :!ls .
Nemojte je još brisati! Koristiti će te je u sljedećoj lekciji.
NAPOMENA: Tipka v započinje Vizualno označavanje. Možete pomicati kursor
+6 -6
View File
@@ -117,7 +117,7 @@ NOTE:
レッスン 1.5: テキスト編集 - 追加
** テキスト追加するには A を押しましょう **
** テキスト追加するには A を押しましょう **
1. 以下の ---> と示された最初の行にカーソルを移動しましょう。
カーソルがその文字上にあってもかまいません。
@@ -232,7 +232,7 @@ NOTE: <ESC>
レッスン 2.3: オペレータとモーション
多くのコマンドはオペレータとモーションからテキストに変更を加ます。
多くのコマンドはオペレータとモーションからテキストに変更を加ます。
削除コマンド d のオペレータは次の様になっています:
d モーション
@@ -259,7 +259,7 @@ NOTE:
1. 以下の ---> と示された行の先頭にカーソルを移動します。
2. 2dw をタイプして単語2つ分移動します。
2. 2dw をタイプして単語2つ分削除します。
3. 3e をタイプして3つ目の単語の終端に移動します。
@@ -326,8 +326,8 @@ NOTE:
** 最後のコマンドを取り消すには u を押します。U は行全体の取消です。 **
1. 以下の ---> と示された行にカーソルを移動し、最初の間違いにカーソ
を移動しましょう。
1. 以下の ---> と示された行にカーソルを移動し、最初の間違いにカーソ
を移動しましょう。
2. x をタイプしていらない先頭の文字を削除しましょう。
3. さぁ、u をタイプして最後に実行したコマンドを取り消しましょう。
4. 今度は、x を使用して誤りを全て修正しましょう。
@@ -633,7 +633,7 @@ Note:
3. では :w TEST とタイプしましょう (TEST は、選んだファイル名です)。
4. これによりファイル全体が TEST という名前で保存されます。
もう一度 :!dir もしくは !ls とタイプして確認してみましょう。
もう一度 :!dir もしくは :!ls とタイプして確認してみましょう。
Note: ここで Vim を終了し、ファイル名 TEST と共に起動すると、保存した時の
チュートリアルの複製ができ上がるはずです。
+6 -6
View File
@@ -117,7 +117,7 @@ NOTE:
レッスン 1.5: テキスト編集 - 追加
** テキスト追加するには A を押しましょう **
** テキスト追加するには A を押しましょう **
1. 以下の ---> と示された最初の行にカーソルを移動しましょう。
カーソルがその文字上にあってもかまいません。
@@ -232,7 +232,7 @@ NOTE: <ESC>
レッスン 2.3: オペレータとモーション
多くのコマンドはオペレータとモーションからテキストに変更を加ます。
多くのコマンドはオペレータとモーションからテキストに変更を加ます。
削除コマンド d のオペレータは次の様になっています:
d モーション
@@ -259,7 +259,7 @@ NOTE:
1. 以下の ---> と示された行の先頭にカーソルを移動します。
2. 2dw をタイプして単語2つ分移動します。
2. 2dw をタイプして単語2つ分削除します。
3. 3e をタイプして3つ目の単語の終端に移動します。
@@ -326,8 +326,8 @@ NOTE:
** 最後のコマンドを取り消すには u を押します。U は行全体の取消です。 **
1. 以下の ---> と示された行にカーソルを移動し、最初の間違いにカーソ
を移動しましょう。
1. 以下の ---> と示された行にカーソルを移動し、最初の間違いにカーソ
を移動しましょう。
2. x をタイプしていらない先頭の文字を削除しましょう。
3. さぁ、u をタイプして最後に実行したコマンドを取り消しましょう。
4. 今度は、x を使用して誤りを全て修正しましょう。
@@ -633,7 +633,7 @@ Note:
3. では :w TEST とタイプしましょう (TEST は、選んだファイル名です)。
4. これによりファイル全体が TEST という名前で保存されます。
もう一度 :!dir もしくは !ls とタイプして確認してみましょう。
もう一度 :!dir もしくは :!ls とタイプして確認してみましょう。
Note: ここで Vim を終了し、ファイル名 TEST と共に起動すると、保存した時の
チュートリアルの複製ができ上がるはずです。
+6 -6
View File
@@ -117,7 +117,7 @@ NOTE: 全てのレッスンを通じて、覚えようとするのではなく
レッスン 1.5: テキスト編集 - 追加
** テキスト追加するには A を押しましょう **
** テキスト追加するには A を押しましょう **
1. 以下の ---> と示された最初の行にカーソルを移動しましょう。
カーソルがその文字上にあってもかまいません。
@@ -232,7 +232,7 @@ NOTE: <ESC> キーを押すとノーマルモードに移行します。その
レッスン 2.3: オペレータとモーション
多くのコマンドはオペレータとモーションからテキストに変更を加ます。
多くのコマンドはオペレータとモーションからテキストに変更を加ます。
削除コマンド d のオペレータは次の様になっています:
d モーション
@@ -259,7 +259,7 @@ NOTE: 冒険したい人は、ノーマルモードにてコマンドなしに
1. 以下の ---> と示された行の先頭にカーソルを移動します。
2. 2dw をタイプして単語2つ分移動します。
2. 2dw をタイプして単語2つ分削除します。
3. 3e をタイプして3つ目の単語の終端に移動します。
@@ -326,8 +326,8 @@ NOTE: オペレータ d とモーションの間にカウントを使った場
** 最後のコマンドを取り消すには u を押します。U は行全体の取消です。 **
1. 以下の ---> と示された行にカーソルを移動し、最初の間違いにカーソ
を移動しましょう。
1. 以下の ---> と示された行にカーソルを移動し、最初の間違いにカーソ
を移動しましょう。
2. x をタイプしていらない先頭の文字を削除しましょう。
3. さぁ、u をタイプして最後に実行したコマンドを取り消しましょう。
4. 今度は、x を使用して誤りを全て修正しましょう。
@@ -633,7 +633,7 @@ Note: 全ての : コマンドは <ENTER> を押して終了しなければな
3. では :w TEST とタイプしましょう (TEST は、選んだファイル名です)。
4. これによりファイル全体が TEST という名前で保存されます。
もう一度 :!dir もしくは !ls とタイプして確認してみましょう。
もう一度 :!dir もしくは :!ls とタイプして確認してみましょう。
Note: ここで Vim を終了し、ファイル名 TEST と共に起動すると、保存した時の
チュートリアルの複製ができ上がるはずです。
+1 -1
View File
@@ -551,7 +551,7 @@ cw
** 파일의 일부를 저장하려면, :#,# w FILENAME 하십시오. **
1. 다시 한번, :!dir 이나 !ls 를 입력하여 디렉토리의 목록을 받아온 후
1. 다시 한번, :!dir 이나 :!ls 를 입력하여 디렉토리의 목록을 받아온 후
TEST 같은 적합한 이름을 선택합니다.
2. 커서를 이 페이지의 처음으로 옮긴 후, Ctrl-g 를 입력하여 그 줄의 줄번호를
+1 -1
View File
@@ -551,7 +551,7 @@ cw 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있
** 파일의 일부를 저장하려면, :#,# w FILENAME 하십시오. **
1. 다시 한번, :!dir 이나 !ls 를 입력하여 디렉토리의 목록을 받아온 후
1. 다시 한번, :!dir 이나 :!ls 를 입력하여 디렉토리의 목록을 받아온 후
TEST 같은 적합한 이름을 선택합니다.
2. 커서를 이 페이지의 처음으로 옮긴 후, Ctrl-g 를 입력하여 그 줄의 줄번호를
+1 -1
View File
@@ -658,7 +658,7 @@ Merk: Hvis du n
4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller
at du ser :'<,'>w TEST før du trykker Enter.
5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller !ls
5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls
for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon.
MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for
+1 -1
View File
@@ -658,7 +658,7 @@ Merk: Hvis du nå hadde avsluttet Vim og startet på nytt igjen med «vim TEST»
4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller
at du ser :'<,'>w TEST før du trykker Enter.
5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller !ls
5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls
for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon.
MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for
+1 -1
View File
@@ -658,7 +658,7 @@ Merk: Hvis du n
4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller
at du ser :'<,'>w TEST før du trykker Enter.
5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller !ls
5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls
for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon.
MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for
+1 -1
View File
@@ -658,7 +658,7 @@ Merk: Hvis du nå hadde avsluttet Vim og startet på nytt igjen med «vim TEST»
4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller
at du ser :'<,'>w TEST før du trykker Enter.
5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller !ls
5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls
for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon.
MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for
+1 -1
View File
@@ -671,7 +671,7 @@ Pozn
4. Napíš w TEST , kde TEST je meno súboru, ktorý zatial neexistuje.
Skontroluj, e vidíš :'<,'>w TEST predtým než stlačíš Enter.
5. Vim zapí¹e oznaèené riadky do súboru TEST. Pou¾i :!dir alebo !ls
5. Vim zapí¹e oznaèené riadky do súboru TEST. Pou¾i :!dir alebo :!ls
pre overenie. Zatial ho ešte nemaž! Použijeme ho v ďalšej lekcii.
POZNÁMKA: Stlačením klávesy v sa spustí vizuálne označovanie.
+1 -1
View File
@@ -671,7 +671,7 @@ Pozn
4. Napíš w TEST , kde TEST je meno súboru, ktorý zatial neexistuje.
Skontroluj, e vidíš :'<,'>w TEST predtým než stlačíš Enter.
5. Vim zapíše oznaèené riadky do súboru TEST. Použi :!dir alebo !ls
5. Vim zapíše oznaèené riadky do súboru TEST. Použi :!dir alebo :!ls
pre overenie. Zatial ho ešte nemaž! Použijeme ho v ďalšej lekcii.
POZNÁMKA: Stlačením klávesy v sa spustí vizuálne označovanie.
+1 -1
View File
@@ -671,7 +671,7 @@ Poznámka: že ak ukončíš prácu s editorom Vim a znovu ho spustíš príkazo
4. Napíš w TEST , kde TEST je meno súboru, ktorý zatial neexistuje.
Skontroluj, e vidíš :'<,'>w TEST predtým než stlačíš Enter.
5. Vim zapíše označené riadky do súboru TEST. Použi :!dir alebo !ls
5. Vim zapíše označené riadky do súboru TEST. Použi :!dir alebo :!ls
pre overenie. Zatial ho ešte nemaž! Použijeme ho v ďalšej lekcii.
POZNÁMKA: Stlačením klávesy v sa spustí vizuálne označovanie.
+1 -1
View File
@@ -658,7 +658,7 @@ NOTE: If you were to exit Vim and start it again with vim TEST , the file
4. Type w TEST , where TEST is a filename that does not exist yet. Verify
that you see :'<,'>w TEST before you press <ENTER>.
5. Vim will write the selected lines to the file TEST. Use :!dir or !ls
5. Vim will write the selected lines to the file TEST. Use :!dir or :!ls
to see it. Do not remove it yet! We will use it in the next lesson.
NOTE: Pressing v starts Visual selection. You can move the cursor around
+8 -2
View File
@@ -1,7 +1,7 @@
" Vim tutor support file
" Author: Eduardo F. Amatria <eferna1@platea.pntic.mec.es>
" Maintainer: Bram Moolenaar
" Last Change: 2008 Jul 21
" Last Change: 2012 Sep 21
" This Vim script is used for detecting if a translation of the
" tutor file exist, i.e., a tutor.xx file, where xx is the language.
@@ -72,14 +72,20 @@ if s:ext =~? '\.ko'
endif
endif
" The Chinese tutor is available in two encodings, guess which one to use
" The Chinese tutor is available in three encodings, guess which one to use
" This segment is from the above lines and modified by
" Mendel L Chan <beos@turbolinux.com.cn> for Chinese vim tutorial
" When 'encoding' is utf-8, choose between China (simplified) and Taiwan
" (traditional) based on the language, suggested by Alick Zhao.
if s:ext =~? '\.zh'
if &enc =~ 'big5\|cp950'
let s:ext = ".zh.big5"
elseif &enc != 'utf-8'
let s:ext = ".zh.euc"
elseif s:ext =~? 'zh_tw' || (exists("s:lang") && s:lang =~? 'zh_tw')
let s:ext = ".zh_tw"
else
let s:ext = ".zh_cn"
endif
endif
+487 -342
View File
File diff suppressed because it is too large Load Diff
+996
View File
@@ -0,0 +1,996 @@
===============================================================================
= 欢 迎 阅 读 《 V I M 教 程 》 —— 版本 1.7 =
===============================================================================
Vim 是一个具有很多命令的功能非常强大的编辑器。限于篇幅,在本教程当中
就不详细介绍了。本教程的设计目标是讲述一些必要的基本命令,而掌握好这
些命令,您就能够很容易地将 Vim 当作一个通用编辑器来使用了。
完成本教程的内容大约需要25-30分钟,取决于您训练的时间。
注意:
每一节的命令操作将会更改本文。推荐您复制本文的一个副本,然后在副本上
进行训练(如果您是通过"vimtutor"来启动教程的,那么本文就已经是副本了)。
切记一点:本教程的设计思路是在使用中进行学习的。也就是说,您需要通过
执行命令来学习它们本身的正确用法。如果您只是阅读而不操作,那么您可能
会很快遗忘这些命令的!
好了,现在请确定您的Shift-Lock(大小写锁定键)还没有按下,然后按键盘上
的字母键 j 足够多次来移动光标,直到第一节的内容能够完全充满屏幕。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第一讲第一节:移动光标
** 要移动光标,请依照说明分别按下 h、j、k、l 键。 **
^
k 提示: h 的键位于左边,每次按下就会向左移动。
< h l > l 的键位于右边,每次按下就会向右移动。
j j 键看起来很象一支尖端方向朝下的箭头。
v
1. 请随意在屏幕内移动光标,直至您觉得舒服为止。
2. 按下下行键(j),直到出现光标重复下行。
---> 现在您应该已经学会如何移动到下一讲吧。
3. 现在请使用下行键,将光标移动到第一讲第二节。
提示:如果您不敢确定您所按下的字母,请按下<ESC>键回到正常(Normal)模式。
然后再次从键盘输入您想要的命令。
提示:光标键应当也能正常工作的。但是使用hjkl键,在习惯之后您就能够更快
地在屏幕内四处移动光标。真的是这样!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第一讲第二节:VIM的进入和退出
!! 特别提示:敬请阅读本一节的完整内容,然后再执行以下所讲解的命令。
1. 按<ESC>键(这是为了确保您处在正常模式)。
2. 然后输入: :q! <回车>
这种方式的退出编辑器会丢弃您进入编辑器以来所做的改动。
3. 如果您看到了命令行提示符,请输入能够带您回到本教程的命令,那就是:
vimtutor <回车>
4. 如果您自信已经牢牢记住了这些步骤的话,请从步骤1执行到步骤3退出,然
后再次进入编辑器。
提示: :q! <回车> 会丢弃您所做的任何改动。几讲之后您将学会如何保存改动到文件。
5. 将光标下移到第一讲第三节。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第一讲第三节:文本编辑之删除
** 在正常(Normal)模式下,可以按下 x 键来删除光标所在位置的字符。**
1. 请将光标移动到本节中下面标记有 ---> 的那一行。
2. 为了修正输入错误,请将光标移至准备删除的字符的位置处。
3. 然后按下 x 键将错误字符删除掉。
4. 重复步骤2到步骤4,直到句子修正为止。
---> The ccow jumpedd ovverr thhe mooon.
5. 好了,该行已经修正了,下面是第一讲第四节。
特别提示:在浏览本教程时,不要强行记忆。记住一点:在使用中学习。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第一讲第四节:文本编辑之插入
** 在正常模式下,可以按下 i 键来插入文本。**
1. 请将光标移动到本节中下面标记有 ---> 的第一行。
2. 为了使得第一行内容雷同于第二行,请将光标移至文本第一个准备插入字符
的位置。
3. 然后按下 i 键,接着输入必要的文本字符。
4. 每个错误修正完毕后,请按下 <ESC> 键返回正常模式。
重复步骤2至步骤4以便修正句子。
---> There is text misng this .
---> There is some text missing from this line.
5. 如果您对文本插入操作已经很满意,请接着阅读下面的第一讲第五节。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第一讲第五节:文本编辑之添加
** 按 A 键以添加文本。 **
1. 移动光标到下面第一个标记有 ---> 的一行。
光标放在那一行的哪个字符上并不重要。
2. 按 A 键输入必要的添加内容。
3. 文本添加完毕后,按 <ESC> 键回到正常模式。
4. 移动光标到下面第二个标记有 ---> 的一行。重复步骤2和步骤3以改正这个句子。
---> There is some text missing from th
There is some text missing from this line.
---> There is also some text miss
There is also some text missing here.
5. 当您对添加文本操作感到满意时,请继续学习第一讲第六节。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第一讲第六节:编辑文件
** 使用 :wq 以保存文件并退出。 **
特别提示:在执行以下步骤之前,请先读完整个小节!
1. 如您在第一讲第二节中所做的那样退出本教程: :q!
或者,如果您可以访问另一个终端,请在那里执行以下操作。
2. 在 shell 的提示符下输入命令: vim tutor <回车>
'vim'是启动 Vim 编辑器的命令,'tutor'是您希望编辑的文件的名字。
请使用一个可以改动的文件。
3. 使用您在前面的教程中学到的命令插入删除文本。
4. 保存改动过的文件并退出 Vim,按这些键: :wq <回车>
5. 如果您在步骤1中已经退出 vimtutor,请重启 vimtutor 移动到下面的小结一节。
6. 阅读完以上步骤,弄懂它们的意义,然后在实践中进行练习。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第一讲小结
1. 光标在屏幕文本中的移动既可以用箭头键,也可以使用 hjkl 字母键。
h (左移) j (下行) k (上行) l (右移)
2. 欲进入 Vim 编辑器(从命令行提示符),请输入:vim 文件名 <回车>
3. 欲退出 Vim 编辑器,请输入 <ESC> :q! <回车> 放弃所有改动。
或者输入 <ESC> :wq <回车> 保存改动。
4. 在正常模式下删除光标所在位置的字符,请按: x
5. 欲插入或添加文本,请输入:
i 输入欲插入文本 <ESC> 在光标前插入文本
A 输入欲添加文本 <ESC> 在一行后添加文本
特别提示:按下 <ESC> 键会带您回到正常模式或者撤消一个不想输入或部分完整
的命令。
好了,第一讲到此结束。下面接下来继续第二讲的内容。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第二讲第一节:删除类命令
** 输入 dw 可以从光标处删除至一个单词的末尾。**
1. 请按下 <ESC> 键确保您处于正常模式。
2. 请将光标移动到本节中下面标记有 ---> 的那一行。
3. 请将光标移至准备要删除的单词的起始处。
4. 接着输入 dw 删除掉该单词。
特别提示:当您输入时,字母 d 会同时出现在屏幕的最后一行。Vim 在等待您输入
字母 w。如果您看到的是除 d 外的其他字符,那表明您按错了;请按下 <ESC> 键,
然后重新再来。
---> There are a some words fun that don't belong paper in this sentence.
5. 重复步骤3和步骤4,直至句子修正完毕。接着继续第二讲第二节内容。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第二讲第二节:更多删除类命令
** 输入 d$ 从当前光标删除到行末。**
1. 请按下 <ESC> 键确保您处于正常模式。
2. 请将光标移动到本节中下面标记有 ---> 的那一行。
3. 请将光标移动到该行的尾部(也就是在第一个点号‘.’后面)。
4. 然后输入 d$ 从光标处删至当前行尾部。
---> Somebody typed the end of this line twice. end of this line twice.
5. 请继续学习第二讲第三节就知道是怎么回事了。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第二讲第三节:关于命令和对象
许多改变文本的命令都由一个操作符和一个动作构成。
使用删除操作符 d 的删除命令的格式如下:
d motion
其中:
d - 删除操作符。
motion - 操作符的操作对象(在下面列出)。
一个简短的动作列表:
w - 从当前光标当前位置直到下一个单词起始处,不包括它的第一个字符。
e - 从当前光标当前位置直到单词末尾,包括最后一个字符。
$ - 从当前光标当前位置直到当前行末。
因此输入 de 会从当前光标位置删除到单词末尾。
特别提示:
对于勇于探索者,请在正常模式下面仅按代表相应动作的键而不使用操作符,您
将看到光标的移动正如上面的对象列表所代表的一样。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第二讲第四节:使用计数指定动作
** 在动作前输入数字会使它重复那么多次。 **
1. 移动光标到下面标记有 ---> 的一行的开始。
2. 输入 2w 使光标向前移动两个单词。
3. 输入 3e 使光标向前移动到第三个单词的末尾。
4. 输入 0 (数字零) 移动光标到行首。
5. 重复步骤2和步骤3,尝试不同的数字。
---> This is just a line with words you can move around in.
6. 请继续学习第二讲第五节。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第二讲第五节:使用计数以删除更多
** 使用操作符时输入数字可以使它重复那么多次。 **
上面已经提到过删除操作符和动作的组合,您可以在组合中动作之前插入一个数字以
删除更多:
d number(数字) motion
1. 移动光标到下面标记有 ---> 的一行中第一个大写字母单词上。
2. 输入 d2w 以删除两个大写字母单词。
3. 重复步骤1和步骤2,使用不同的数字使得用一个命令就能删除全部相邻的大写字母
单词
---> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第二讲第六节:操作整行
** 输入 dd 可以删除整一个当前行。 **
鉴于整行删除的高频度,Vi 的设计者决定要简化整行删除操作,您仅需要在同一行上
击打两次 d 就可以删除掉光标所在的整行了。
1. 请将光标移动到本节中下面的短句段落中的第二行。
2. 输入 dd 删除该行。
3. 然后移动到第四行。
4. 接着输入 2dd 删除两行。
---> 1) Roses are red,
---> 2) Mud is fun,
---> 3) Violets are blue,
---> 4) I have a car,
---> 5) Clocks tell time,
---> 6) Sugar is sweet
---> 7) And so are you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第二讲第七节:撤消类命令
** 输入 u 来撤消最后执行的命令,输入 U 来撤消对整行的修改。 **
1. 请将光标移动到本节中下面标记有 ---> 的那一行,并将其置于第一个错误
处。
2. 输入 x 删除第一个不想保留的字母。
3. 然后输入 u 撤消最后执行的(一次)命令。
4. 这次要使用 x 修正本行的所有错误。
5. 现在输入一个大写的 U ,恢复到该行的原始状态。
6. 接着多次输入 u 以撤消 U 以及更前的命令。
7. 然后多次输入 CTRL-R (先按下 CTRL 键不放开,接着按 R 键),这样就
可以重做被撤消的命令,也就是撤消掉撤消命令。
---> Fiix the errors oon thhis line and reeplace them witth undo.
8. 这些都是非常有用的命令。下面是第二讲的小结了。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第二讲小结
1. 欲从当前光标删除至下一个单词,请输入:dw
2. 欲从当前光标删除至当前行末尾,请输入:d$
3. 欲删除整行,请输入:dd
4. 欲重复一个动作,请在它前面加上一个数字:2w
5. 在正常模式下修改命令的格式是:
operator [number] motion
其中:
operator - 操作符,代表要做的事情,比如 d 代表删除
[number] - 可以附加的数字,代表动作重复的次数
motion - 动作,代表在所操作的文本上的移动,例如 w 代表单词(word),
$ 代表行末等等。
6. 欲移动光标到行首,请按数字0键:0
7. 欲撤消以前的操作,请输入:u (小写的u)
欲撤消在一行中所做的改动,请输入:U (大写的U)
欲撤消以前的撤消命令,恢复以前的操作结果,请输入:CTRL-R
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第三讲第一节:置入类命令
** 输入 p 将最后一次删除的内容置入光标之后。 **
1. 请将光标移动到本节中下面第一个标记有 ---> 的一行。
2. 输入 dd 将该行删除,这样会将该行保存到 Vim 的一个寄存器中。
3. 接着将光标移动到 c) 一行,即准备置入的位置的上方。记住:是上方哦。
4. 然后在正常模式下(<ESC>键进入)输入 p 将该行粘贴置入。
5. 重复步骤2至步骤4,将所有的行依序放置到正确的位置上。
---> d) Can you learn too?
---> b) Violets are blue,
---> c) Intelligence is learned,
---> a) Roses are red,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第三讲第二节:替换类命令
** 输入 r 和一个字符替换光标所在位置的字符。**
1. 请将光标移动到本节中下面标记有 ---> 的第一行。
2. 请移动光标到第一个出错的位置。
3. 接着输入 r 和要替换成的字符,这样就能将错误替换掉了。
4. 重复步骤2和步骤3,直到第一行已经修改完毕。
---> Whan this lime was tuoed in, someone presswd some wrojg keys!
---> When this line was typed in, someone pressed some wrong keys!
5. 然后我们继续学习第三讲第三节。
特别提示:切记您要在使用中学习,而不是在记忆中学习。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第三讲第三节:更改类命令
** 要改变文本直到一个单词的末尾,请输入 ce **
1. 请将光标移动到本节中下面标记有 ---> 的第一行。
2. 接着把光标放在单词 lubw 的字母 u 的位置那里。
3. 然后输入 cw 以及正确的单词(在本例中是输入 ine )。
4. 最后按 <ESC> 键,然后光标定位到下一个错误第一个准备更改的字母处。
5. 重复步骤3和步骤4,直到第一个句子完全雷同第二个句子。
---> This lubw has a few wptfd that mrrf changing usf the change operator.
---> This line has a few words that need changing using the change operator.
提示:请注意 ce 命令不仅仅是删除了一个单词,它也让您进入插入模式了。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第三讲第四节:使用c更改更多
** 更改类操作符可以与删除中使用的同样的动作配合使用。 **
1. 更改类操作符的工作方式跟删除类是一致的。操作格式是:
c [number] motion
2. 动作参数(motion)也是一样的,比如 w 代表单词,$代表行末等等。
3. 请将光标移动到本节中下面标记有 ---> 的第一行。
4. 接着将光标移动到第一个错误处。
5. 然后输入 c$ 使得该行剩下的部分更正得同第二行一样。最后按 <ESC> 键。
---> The end of this line needs some help to make it like the second.
---> The end of this line needs to be corrected using the c$ command.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第三讲小结
1. 要重新置入已经删除的文本内容,请按小写字母 p 键。该操作可以将已删除
的文本内容置于光标之后。如果最后一次删除的是一个整行,那么该行将置
于当前光标所在行的下一行。
2. 要替换光标所在位置的字符,请输入小写的 r 和要替换掉原位置字符的新字
符即可。
3. 更改类命令允许您改变从当前光标所在位置直到动作指示的位置中间的文本。
比如输入 ce 可以替换当前光标到单词的末尾的内容;输入 c$ 可以替换当
前光标到行末的内容。
4. 更改类命令的格式是:
c [number] motion
现在我们继续学习下一讲。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第四讲第一节:定位及文件状态
** 输入 CTRL-G 显示当前编辑文件中当前光标所在行位置以及文件状态信息。
输入大写 G 则直接跳转到文件中的某一指定行。**
提示:切记要先通读本节内容,之后才可以执行以下步骤!!!
1. 按下 CTRL 键不放开然后按 g 键。我们称这个键组合为 CTRL-G。
您会看到页面最底部出现一个状态信息行,显示的内容是当前编辑的文件名
和文件中光标位置。请记住行号,它会在步骤3中用到。
提示:您也许会在屏幕的右下角看到光标位置,这会在 'ruler' 选项设置时发生
(参见 :help 'ruler')
2. 输入大写 G 可以使得当前光标直接跳转到文件最后一行。
输入 gg 可以使得当前光标直接跳转到文件第一行。
3. 输入您曾停留的行号,然后输入大写 G。这样就可以返回到您第一次按下
CTRL-G 时所在的行了。
4. 如果您觉得没问题的话,请执行步骤1至步骤3的操作进行练习。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第四讲第二节:搜索类命令
** 输入 / 加上一个字符串可以用以在当前文件中查找该字符串。**
1. 在正常模式下输入 / 字符。您此时会注意到该字符和光标都会出现在屏幕底
部,这跟 : 命令是一样的。
2. 接着输入 errroor <回车>。那个errroor就是您要查找的字符串。
3. 要查找同上一次的字符串,只需要按 n 键。要向相反方向查找同上一次的字
符串,请输入大写 N 即可。
4. 如果您想逆向查找字符串,请使用 ? 代替 / 进行。
5. 要回到您之前的位置按 CTRL-O (按住 Ctrl 键不放同时按下字母 o)。重复按可以
回退更多步。CTRL-I 会跳转到较新的位置。
---> "errroor" is not the way to spell error; errroor is an error.
提示:如果查找已经到达文件末尾,查找会自动从文件头部继续查找,除非
'wrapscan' 选项被复位。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第四讲第三节:配对括号的查找
** 输入 % 可以查找配对的括号 )、]、}。**
1. 把光标放在本节下面标记有 --> 那一行中的任何一个 (、[ 或 { 处。
2. 接着按 % 字符。
3. 此时光标的位置应当是在配对的括号处。
4. 再次按 % 就可以跳回配对的第一个括号处。
5. 移动光标到另一个 (、)、[、]、{ 或 } 处,按 % 查看其所作所为。
---> This ( is a test line with ('s, ['s ] and {'s } in it. ))
提示:在程序调试时,这个功能用来查找不配对的括号是很有用的。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第四讲第四节:替换命令
** 输入 :s/old/new/g 可以替换 old 为 new。**
1. 请将光标移动到本节中下面标记有 ---> 的那一行。
2. 输入 :s/thee/the <回车> 。请注意该命令只改变光标所在行的第一个匹配
串。
3. 输入 :s/thee/the/g 则是替换全行的匹配串,该行中所有的 "thee" 都会被
改变。
---> thee best time to see thee flowers is in thee spring.
4. 要替换两行之间出现的每个匹配串,请
输入 :#,#s/old/new/g 其中 #,# 代表的是替换操作的若干行中
首尾两行的行号。
输入 :%s/old/new/g 则是替换整个文件中的每个匹配串。
输入 :%s/old/new/gc 会找到整个文件中的每个匹配串,并且对每个匹配串
提示是否进行替换。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第四讲小结
1. CTRL-G 用于显示当前光标所在位置和文件状态信息。
G 用于将光标跳转至文件最后一行。
先敲入一个行号然后输入大写 G 则是将光标移动至该行号代表的行。
gg 用于将光标跳转至文件第一行。
2. 输入 / 然后紧随一个字符串是在当前所编辑的文档中正向查找该字符串。
输入 ? 然后紧随一个字符串则是在当前所编辑的文档中反向查找该字符串。
完成一次查找之后按 n 键是重复上一次的命令,可在同一方向上查
找下一个匹配字符串所在;或者按大写 N 向相反方向查找下一匹配字符串所在。
CTRL-O 带您跳转回较旧的位置,CTRL-I 则带您到较新的位置。
3. 如果光标当前位置是括号(、)、[、]、{、},按 % 会将光标移动到配对的括号上。
4. 在一行内替换头一个字符串 old 为新的字符串 new,请输入 :s/old/new
在一行内替换所有的字符串 old 为新的字符串 new,请输入 :s/old/new/g
在两行内替换所有的字符串 old 为新的字符串 new,请输入 :#,#s/old/new/g
在文件内替换所有的字符串 old 为新的字符串 new,请输入 :%s/old/new/g
进行全文替换时询问用户确认每个替换需添加 c 标志 :%s/old/new/gc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第五讲第一节:在 VIM 内执行外部命令的方法
** 输入 :! 然后紧接着输入一个外部命令可以执行该外部命令。**
1. 按下我们所熟悉的 : 命令使光标移动到屏幕底部。这样您就可以输入一行命令了。
2. 接着输入感叹号 ! 这个字符,这样就允许您执行外部的 shell 命令了。
3. 我们以 ls 命令为例。输入 !ls <回车> 。该命令就会列举出您当前目录的
内容,就如同您在命令行提示符下输入 ls 命令的结果一样。如果 !ls 没起
作用,您可以试试 :!dir 看看。
提示:所有的外部命令都可以以这种方式执行,包括带命令行参数的那些。
提示:所有的 : 命令都必须以敲 <回车> 键结束。从今以后我们就不会总是提到这一点
了。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第五讲第二节:关于保存文件的更多信息
** 要将对文件的改动保存到文件中,请输入 :w FILENAME 。**
1. 输入 :!dir 或者 :!ls 获知当前目录的内容。您应当已知道最后还得敲
<回车> 吧。
2. 选择一个未被用到的文件名,比如 TEST。
3. 接着输入 :w TEST (此处 TEST 是您所选择的文件名。)
4. 该命令会以 TEST 为文件名保存整个文件 (Vim 教程)。为了验证这一点,
请再次输入 :!dir 或 :!ls 查看您的目录列表内容。
请注意:如果您退出 Vim 然后在以命令 vim TEST 再次启动 Vim,那么该文件内
容应该同您保存时的文件内容是完全一样的。
5. 现在您可以删除 TEST 文件了。在 MS-DOS 下,请输入: :!del TEST
在 Unix 下,请输入: :!rm TEST
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第五讲第三节:一个具有选择性的保存命令
** 要保存文件的部分内容,请输入 v motion :w FILENAME **
1. 移动光标到本行。
2. 接着按 v 键,将光标移动至下面第五个条目上。您会注意到之间的文本被高亮了。
3. 然后按 : 字符。您将看到屏幕底部会出现 :'<,'> 。
4. 现在请输入 w TEST,其中 TEST 是一个未被使用的文件名。确认您看到了
:'<,'>w TEST 之后按 <回车> 键。
5. 这时 Vim 会把选中的行写入到以 TEST 命名的文件中去。使用 :!dir 或 :!ls
确认文件被正确保存。这次先别删除它!我们在下一讲中会用到它。
提示:按 v 键使 Vim 进入可视模式进行选取。您可以四处移动光标使选取区域变大或
变小。接着您可以使用一个操作符对选中文本进行操作。例如,按 d 键会删除
选中的文本内容。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第五讲第四节:提取和合并文件
** 要向当前文件中插入另外的文件的内容,请输入 :r FILENAME **
1. 请把光标移动到本行上面一行。
特别提示:执行步骤2之后您将看到第五讲第三节的文字,请届时往下移动
以再次看到本讲内容。
2. 接着通过命令 :r TEST 将前面创建的名为 TEST 的文件提取进来。
您所提取进来的文件将从光标所在位置处开始置入。
3. 为了确认文件已经提取成功,移动光标回到原来的位置就可以注意有两份第
五讲第三节的内容,一份是原始内容,另外一份是来自文件的副本。
提示:您还可以读取外部命令的输出。例如, :r !ls 可以读取 ls 命令的输出,并
把它放置在光标下面。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第五讲小结
1. :!command 用于执行一个外部命令 command。
请看一些实际例子:
(MS-DOS) (Unix)
:!dir :!ls - 用于显示当前目录的内容。
:!del FILENAME :!rm FILENAME - 用于删除名为 FILENAME 的文件。
2. :w FILENAME 可将当前 VIM 中正在编辑的文件保存到名为 FILENAME 的文
件中。
3. v motion :w FILENAME 可将当前编辑文件中可视模式下选中的内容保存到文件
FILENAME 中。
4. :r FILENAME 可提取磁盘文件 FILENAME 并将其插入到当前文件的光标位置
后面。
5. :r !dir 可以读取 dir 命令的输出并将其放置到当前文件的光标位置后面。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第六讲第一节:打开类命令
** 输入 o 将在光标的下方打开新的一行并进入插入模式。**
1. 请将光标移动到本节中下面标记有 ---> 的那一行。
2. 接着输入小写的 o 在光标 *下方* 打开新的一行,这个命令会使您
进入插入模式。
3. 然后输入一些文字,之后按 <ESC> 键退出插入模式而进入正常模式。
---> After typing o the cursor is placed on the open line in Insert mode.
4. 为了在光标 *上方* 打开新的一行,只需要输入大写的 O 而不是小写的 o
就可以了。请在下行测试一下吧。
---> Open up a line above this by typing O while the cursor is on this line.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第六讲第二节:附加类命令
** 输入 a 将可在光标之后插入文本。 **
1. 请在正常模式下将光标移动到本节中下面标记有 ---> 的第一行的行首。
2. 接着输入 e 直到光标位于 li 的末尾。
3. 输入小写的 a 则可在光标之后插入文本了。
4. 将单词补充完整,就像下一行中的那样。之后按 <ESC> 键退出插入模式回到
正常模式。
5. 使用 e 移动光标到下一步不完整的单词,重复步骤3和步骤4。
---> This li will allow you to pract appendi text to a line.
---> This line will allow you to practice appending text to a line.
提示:a、i 和 A 都会带您进入插入模式,惟一的区别在于字符插入的位置。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第六讲第三节:另外一个置换类命令的版本
** 输入大写的 R 可连续替换多个字符。**
1. 请将光标移动到本节中下面标记有 ---> 的第一行。移动光标到第一个 xxx 的
起始位置。
2. 然后输入大写的 R 开始把第一行中的不同于第二行的剩余字符逐一输入,就
可以全部替换掉原有的字符而使得第一行完全雷同第二行了。
3. 接着按 <ESC> 键退出替换模式回到正常模式。您可以注意到尚未替换的文本
仍然保持原状。
4. 重复以上步骤,将剩余的 xxx 也替换掉。
---> Adding 123 to xxx gives you xxx.
---> Adding 123 to 456 gives you 579.
提示:替换模式与插入模式相似,不过每个输入的字符都会删除一个已有的字符。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第六讲第四节:复制粘贴文本
** 使用操作符 y 复制文本,使用 p 粘贴文本 **
1. 定位到下面标记有 ---> 的一行,将光标移动到 "a)" 之后。
2. 接着使用 v 进入可视模式,移动光标到 "first" 的前面。
3. 现在输入 y 以抽出(复制)高亮的文本。
4. 然后移动光标到下一行的末尾:j$
5. 接着输入 p 以放置(粘贴)复制了的文本。然后输入:a second <ESC>。
6. 使用可视模式选中 " item.",用 y 复制,再用 j$ 将光标移动到下一行末尾,
用 p 将文本粘贴到那里。
---> a) this is the first item.
b)
提示:您还可以把 y 当作操作符来使用;例如 yw 可以用来复制一个单词。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第六讲第五节:设置类命令的选项
** 设置可使查找或者替换可忽略大小写的选项 **
1. 要查找单词 ignore 可在正常模式下输入 /ignore <回车>。
要重复查找该词,可以重复按 n 键。
2. 然后设置 ic 选项(Ignore Case,忽略大小写),请输入: :set ic
3. 现在可以通过键入 n 键再次查找单词 ignore。注意到 Ignore 和 IGNORE 现在
也被找到了。
4. 然后设置 hlsearch 和 incsearch 这两个选项,请输入: :set hls is
5. 现在可以再次输入查找命令,看看会有什么效果: /ignore <回车>
6. 要禁用忽略大小写,请输入: :set noic
提示:要移除匹配项的高亮显示,请输入: :nohlsearch
提示:如果您想要仅在一次查找时忽略字母大小写,您可以使用 \c:
/ignore\c <回车>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第六讲小结
1. 输入小写的 o 可以在光标下方打开新的一行并进入插入模式。
输入大写的 O 可以在光标上方打开新的一行。
2. 输入小写的 a 可以在光标所在位置之后插入文本。
输入大写的 A 可以在光标所在行的行末之后插入文本。
3. e 命令可以使光标移动到单词末尾。
4. 操作符 y 复制文本,p 粘贴先前复制的文本。
5. 输入大写的 R 将进入替换模式,直至按 <ESC> 键回到正常模式。
6. 输入 :set xxx 可以设置 xxx 选项。一些有用的选项如下:
'ic' 'ignorecase' 查找时忽略字母大小写
'is' 'incsearch' 查找短语时显示部分匹配
'hls' 'hlsearch' 高亮显示所有的匹配短语
选项名可以用完整版本,也可以用缩略版本。
7. 在选项前加上 no 可以关闭选项: :set noic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第七讲第一节:获取帮助信息
** 使用在线帮助系统 **
Vim 拥有一个细致全面的在线帮助系统。要启动该帮助系统,请选择如下三种方
法之一:
- 按下 <HELP> 键 (如果键盘上有的话)
- 按下 <F1> 键 (如果键盘上有的话)
- 输入 :help <回车>
请阅读帮助窗口中的文字以了解帮助是如何工作的。
输入 CTRL-W CTRL-W 可以使您在窗口之间跳转。
输入 :q <回车> 可以关闭帮助窗口。
提供一个正确的参数给":help"命令,您可以找到关于该主题的帮助。请试验以
下参数(可别忘了按回车键哦)
:help w
:help c_CTRL-D
:help insert-index
:help user-manual
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第七讲第二节:创建启动脚本
** 启用 Vim 的特性 **
Vim 的功能特性要比 Vi 多得多,但其中大部分都没有缺省启用。为了使用更多的
特性,您得创建一个 vimrc 文件。
1. 开始编辑 vimrc 文件,具体命令取决于您所使用的操作系统:
:edit ~/.vimrc 这是 Unix 系统所使用的命令
:edit $VIM/_vimrc 这是 MS-Windows 系统所使用的命令
2. 接着读取 vimrc 示例文件的内容:
:r $VIMRUNTIME/vimrc_example.vim
3. 保存文件,命令为:
:write
下次您启动 Vim 时,编辑器就会有了语法高亮的功能。
您可以把您喜欢的各种设置添加到这个 vimrc 文件中。
要了解更多信息请输入 :help vimrc-intro
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第七讲第三节:补全功能
** 使用 CTRL-D 和 <TAB> 可以进行命令行补全 **
1. 请确保 Vim 不是在以兼容模式运行: :set nocp
2. 查看一下当前目录下已经存在哪些文件,输入: :!ls 或者 :!dir
3. 现在输入一个目录的起始部分,例如输入: :e
4. 接着按 CTRL-D 键,Vim 会显示以 e 开始的命令的列表。
5. 然后按 <TAB> 键,Vim 会补全命令为 :edit 。
6. 现在添加一个空格,以及一个已有文件的文件名的起始部分,例如: :edit FIL
7. 接着按 <TAB> 键,Vim 会补全文件名(如果它是惟一匹配的)。
提示:补全对于许多命令都有效。您只需尝试按 CTRL-D 和 <TAB>。
它对于 :help 命令非常有用。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
第七讲小结
1. 输入 :help 或者按 <F1> 键或 <Help> 键可以打开帮助窗口。
2. 输入 :help cmd 可以找到关于 cmd 命令的帮助。
3. 输入 CTRL-W CTRL-W 可以使您在窗口之间跳转。
4. 输入 :q 以关闭帮助窗口
5. 您可以创建一个 vimrc 启动脚本文件用来保存您偏好的设置。
6. 当输入 : 命令时,按 CTRL-D 可以查看可能的补全结果。
按 <TAB> 可以使用一个补全。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim 教程到此就结束了。本教程只是为了简明地介绍一下 Vim 编辑器,但已足以让您
很容易使用这个编辑器了。毋庸质疑,vim还有很多很多的命令,本教程所介
绍的距离完整的差得很远。所以您要精通的话,还望继续努力哦。下一步您可以阅读
Vim 的用户手册,使用的命令是: :help user-manual
下面这本书值得推荐用于更进一步的阅读和学习:
Vim - Vi Improved - 作者:Steve Oualline
出版社:New Riders
这是第一本完全讲解 Vim 的书籍。它对于初学者特别有用。其中包含有大量实例
和图示。
欲知详情,请访问 http://iccf-holland.org/click5.html
以下这本书比较老了而且内容更多是关于 Vi 而非 Vim,但是也值得推荐:
Learning the Vi Editor - 作者:Linda Lamb
出版社:O'Reilly & Associates Inc.
这是一本不错的书,通过它您几乎能够了解到任何您想要使用 Vi 做的事情。
此书的第六个版本也包含了一些关于 Vim 的信息。
本教程是由来自 Calorado School of Mines 的 Michael C. Pierce 和
Robert K. Ware 所编写的,其中很多创意由来自 Colorado State University 的
Charles Smith 提供。编者的电子邮箱是:bware@mines.colorado.edu
本教程已由 Bram Moolenaar 专为 Vim 进行修订。
译制者附言:
===========
简体中文教程翻译版之译制者为梁昌泰 <beos@turbolinux.com.cn>,还有
另外一个联系地址:linuxrat@gnuchina.org。
繁体中文教程是从简体中文教程翻译版使用 Debian GNU/Linux 中文项目小
组的于广辉先生编写的中文汉字转码器 autoconvert 转换而成的,并对转
换的结果做了一些细节的改动。
变更记录:
=========
2012年10月01日 赵涛 <alick9188@gmail.com>
将 vimtutor 中译版从 1.5 升级到 1.7。
2002年08月30日 梁昌泰 <beos@turbolinux.com.cn>
感谢 RMS@SMTH 的指正,将多处错误修正。
2002年04月22日 梁昌泰 <linuxrat@gnuchina.org>
感谢 xuandong@sh163.net 的指正,将两处错别字修正。
2002年03月18日 梁昌泰 <linuxrat@gnuchina.org>
根据Bram Molenaar先生在2002年03月16日的来信要求,将vimtutor1.4中译
版升级到vimtutor1.5。
2001年11月15日 梁昌泰 <linuxrat@gnuchina.org>
将vimtutor1.4中译版提交给Bram Molenaar和Sven Guckes。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+13 -3
View File
@@ -45,6 +45,10 @@ Visual Studio
Building with Visual Studio (VS 98, VS .NET, VS .NET 2003, VS 2005, and VS 2008)
is straightforward. (These instructions should also work for VS 4 and VS 5.)
Using VS C++ 2008 Express is recommended, the binaries build with that run on
nearly all platforms. Binaries from later versions may not run on Windows 95
or XP.
To build Vim from the command line with MSVC, use Make_mvc.mak.
Visual Studio installed a batch file called vcvars32.bat, which you must
run to set up paths for nmake and MSVC.
@@ -172,6 +176,10 @@ This includes the IDE and the debugger.
To set the environment execute the msvc2008.bat script. You can then build
Vim with Make_mvc.mak.
For building 64 bit binaries you also need to install the SDK:
"Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1"
You don't need the examples and documentation.
Visual C++ 2010 Express Edition *msvc-2010-express*
-------------------------------
@@ -296,10 +304,12 @@ Now you have created the Windows binary from your Linux box! Have fun...
6. Building with Python support
===============================
(written by Ron Aaron: <ronaharon@yahoo.com>)
For building with MSVC 2008 the "Windows Installer" from www.python.org
works fine.
This has been tested with the mingw32 compiler, and the ActiveState
ActivePython:
(rest written by Ron Aaron: <ronaharon@yahoo.com>)
Building with the mingw32 compiler, and the ActiveState ActivePython:
http://www.ActiveState.com/Products/ActivePython/
After installing the ActivePython, you will have to create a 'mingw32'
+46 -23
View File
@@ -1,14 +1,15 @@
# Makefile for VIM on Win32, using 'EGCS/mingw32 1.1.2'.
# Makefile for VIM on Win32
#
# Info at http://www.mingw.org
# Also requires 'GNU make 3.77', which you can get through a link
# to 'JanJaap's page from the above page.
# Alternative x86 and 64-builds: http://mingw-w64.sourceforge.net
# Also requires GNU make, which you can download from the same sites.
# Get missing libraries from http://gnuwin32.sf.net.
#
# Tested on Win32 NT 4 and Win95.
#
# To make everything, just 'make -f Make_ming.mak'
# To make just e.g. gvim.exe, 'make -f Make_ming.mak gvim.exe'
# After a run, you can 'make -f Make_ming.mak clean' to clean up
# To make everything, just 'make -f Make_ming.mak'.
# To make just e.g. gvim.exe, 'make -f Make_ming.mak gvim.exe'.
# After a run, you can 'make -f Make_ming.mak clean' to clean up.
#
# NOTE: Sometimes 'GNU Make' will stop after building vimrun.exe -- I think
# it's just run out of memory or something. Run again, and it will continue
@@ -20,8 +21,8 @@
# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
# http://www.matcode.com/mpress.htm
#
# Maintained by Ron Aaron <ronaharon@yahoo.com>
# updated 2003 Jan 20
# Maintained by Ron Aaron <ronaharon@yahoo.com> et al.
# Updated 2012 Sep 5.
#>>>>> choose options:
# set to yes for a debug build
@@ -31,32 +32,33 @@ OPTIMIZE=MAXSPEED
# set to yes to make gvim, no for vim
GUI=yes
# FEATURES=[TINY | SMALL | NORMAL | BIG | HUGE]
# set to TINY to make minimal version (few features)
# Set to TINY to make minimal version (few features).
FEATURES=BIG
# set to one of i386, i486, i586, i686 as the minimum target processor
# Set to one of i386, i486, i586, i686 as the minimum target processor.
# For amd64/x64 architecture set ARCH=x86-64 .
ARCH=i386
# set to yes to cross-compile from unix; no=native Windows
# Set to yes to cross-compile from unix; no=native Windows.
CROSS=no
# set to path to iconv.h and libiconv.a to enable using 'iconv.dll'
# Set to path to iconv.h and libiconv.a to enable using 'iconv.dll'.
#ICONV="."
ICONV=yes
GETTEXT=yes
# set to yes to include multibyte support
# Set to yes to include multibyte support.
MBYTE=yes
# set to yes to include IME support
# Set to yes to include IME support.
IME=yes
DYNAMIC_IME=yes
# set to yes to enable writing a postscript file with :hardcopy
# Set to yes to enable writing a postscript file with :hardcopy.
POSTSCRIPT=no
# set to yes to enable OLE support
# Set to yes to enable OLE support.
OLE=no
# Set the default $(WINVER) to make it work with pre-Win2k
# Set the default $(WINVER) to make it work with pre-Win2k.
ifndef WINVER
WINVER = 0x0500
endif
# Set to yes to enable Cscope support
# Set to yes to enable Cscope support.
CSCOPE=yes
# Set to yes to enable Netbeans support
# Set to yes to enable Netbeans support.
NETBEANS=$(GUI)
@@ -431,11 +433,32 @@ endif
endif
endif
ifdef XPM
# Only allow XPM for a GUI build.
ifeq (yes, $(GUI))
CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include
ifndef XPM
ifeq ($(ARCH),i386)
XPM = xpm/x86
endif
ifeq ($(ARCH),i486)
XPM = xpm/x86
endif
ifeq ($(ARCH),i586)
XPM = xpm/x86
endif
ifeq ($(ARCH),i686)
XPM = xpm/x86
endif
ifeq ($(ARCH),x86-64)
XPM = xpm/x64
endif
endif
ifdef XPM
ifneq ($(XPM),no)
CFLAGS += -DFEAT_XPM_W32 -I $(XPM)/include -I $(XPM)/../include
endif
endif
endif
ifeq ($(DEBUG),yes)
@@ -565,10 +588,10 @@ TARGET := gvim$(DEBUG_SUFFIX).exe
DEFINES += $(DEF_GUI)
OBJ += $(GUIOBJ)
LFLAGS += -mwindows
OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)
OUTDIR = gobj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
else
TARGET := vim$(DEBUG_SUFFIX).exe
OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)
OUTDIR = obj$(DEBUG_SUFFIX)$(MZSCHEME_SUFFIX)$(ARCH)
endif
ifdef GETTEXT
+27 -6
View File
@@ -1,7 +1,7 @@
# Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me)
# and Win64, using the Microsoft Visual C++ compilers. Known to work with
# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005),
# VC9 (VS2008), and VC10 (VS2010).
# VC9 (VS2008), VC10 (VS2010) and VC11 (VS2012)
#
# To build using other Windows compilers, see INSTALLpc.txt
#
@@ -15,6 +15,9 @@
# This will build the console version of Vim with no additional interfaces.
# To add features, define any of the following:
#
# For MSVC 11 you need to specify where the Win32.mak file is, e.g.:
# SDK_INCLUDE_DIR="C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"
#
# !!!! After changing features do "nmake clean" first !!!!
#
# Feature Set: FEATURES=[TINY, SMALL, NORMAL, BIG, HUGE] (default is BIG)
@@ -213,6 +216,7 @@ CPU = i386
# We're on Windows 95
CPU = i386
!endif # !PROCESSOR_ARCHITECTURE
OBJDIR = $(OBJDIR)$(CPU)
# Build a retail version by default
@@ -226,7 +230,12 @@ MAKEFLAGS_GVIMEXT = DEBUG=yes
# Get all sorts of useful, standard macros from the Platform SDK.
!ifdef SDK_INCLUDE_DIR
!include $(SDK_INCLUDE_DIR)\Win32.mak
!else
!include <Win32.mak>
!endif
# Flag to turn on Win64 compatibility warnings for VC7.x and VC8.
WP64CHECK = /Wp64
@@ -283,10 +292,12 @@ NETBEANS_LIB = WSock32.lib
!ifndef XPM
# XPM is not set, use the included xpm files, depending on the architecture.
!if ("$(CPU)" == "AMD64") || ("$(CPU)" == "IA64")
!if "$(CPU)" == "AMD64"
XPM = xpm\x64
!else
!elseif "$(CPU)" == "i386"
XPM = xpm\x86
!else
XPM = no
!endif
!endif
!if "$(XPM)" != "no"
@@ -362,6 +373,10 @@ MSVCVER = 5.0
MSVCVER = 6.0
CPU = ix86
!endif
!if "$(_NMAKE_VER)" == "6.00.9782.0"
MSVCVER = 6.0
CPU = ix86
!endif
!if "$(_NMAKE_VER)" == "7.00.9466"
MSVCVER = 7.0
!endif
@@ -392,6 +407,12 @@ MSVCVER = 10.0
!if "$(_NMAKE_VER)" == "10.00.30319.01"
MSVCVER = 10.0
!endif
!if "$(_NMAKE_VER)" == "10.00.40219.01"
MSVCVER = 10.0
!endif
!if "$(_NMAKE_VER)" == "11.00.50727.1"
MSVCVER = 11.0
!endif
!endif
# Abort bulding VIM if version of VC is unrecognised.
@@ -406,7 +427,7 @@ MSVCVER = 10.0
!endif
# Convert processor ID to MVC-compatible number
!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0")
!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0") && ("$(MSVCVER)" != "11.0")
!if "$(CPUNR)" == "i386"
CPUARG = /G3
!elseif "$(CPUNR)" == "i486"
@@ -440,7 +461,7 @@ OPTFLAG = /O2
OPTFLAG = /Ox
!endif
!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0")
!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0")
# Use link time code generation if not worried about size
!if "$(OPTIMIZE)" != "SPACE"
OPTFLAG = $(OPTFLAG) /GL
@@ -905,7 +926,7 @@ LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
# Report link time code generation progress if used.
!ifdef NODEBUG
!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0")
!if ("$(MSVCVER)" == "8.0") || ("$(MSVCVER)" == "9.0") || ("$(MSVCVER)" == "10.0") || ("$(MSVCVER)" == "11.0")
!if "$(OPTIMIZE)" != "SPACE"
LINKARGS1 = $(LINKARGS1) /LTCG:STATUS
!endif
+58 -37
View File
@@ -4696,15 +4696,7 @@ $as_echo "not set, default to /usr" >&6; }
LUA_INC=
if test "X$vi_cv_path_lua_pfx" != "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include" >&5
$as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include... " >&6; }
if test -f $vi_cv_path_lua_pfx/include/lua.h; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
# Extract the first word of "lua", so it can be a program name with args.
# Extract the first word of "lua", so it can be a program name with args.
set dummy lua; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
@@ -4744,8 +4736,8 @@ $as_echo "no" >&6; }
fi
if test "X$vi_cv_path_lua" != "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Lua version" >&5
if test "X$vi_cv_path_lua" != "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Lua version" >&5
$as_echo_n "checking Lua version... " >&6; }
if ${vi_cv_version_lua+:} false; then :
$as_echo_n "(cached) " >&6
@@ -4754,23 +4746,31 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_lua" >&5
$as_echo "$vi_cv_version_lua" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua" >&5
$as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua... " >&6; }
if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include" >&5
$as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include... " >&6; }
if test -f $vi_cv_path_lua_pfx/include/lua.h; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
LUA_INC=/lua$vi_cv_version_lua
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
vi_cv_path_lua_pfx=
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua" >&5
$as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua... " >&6; }
if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
LUA_INC=/lua$vi_cv_version_lua
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
vi_cv_path_lua_pfx=
fi
fi
fi
if test "X$vi_cv_path_lua_pfx" != "X"; then
if test "X$vi_cv_version_lua" != "X"; then
if test "X$LUA_INC" != "X"; then
LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua"
else
LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua"
@@ -4782,16 +4782,21 @@ $as_echo "no" >&6; }
$as_echo "#define FEAT_LUA 1" >>confdefs.h
if test "$enable_luainterp" = "dynamic"; then
for i in 0 1 2 3 4 5 6 7 8 9; do
if test -f "${vi_cv_path_lua_pfx}/lib/liblua${vi_cv_version_lua}.so.$i"; then
LUA_SONAME=".$i"
break
fi
done
if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then
vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll"
else
for i in 0 1 2 3 4 5 6 7 8 9; do
if test -f "${vi_cv_path_lua_pfx}/lib/liblua${vi_cv_version_lua}.so.$i"; then
LUA_SONAME=".$i"
break
fi
done
vi_cv_dll_name_lua="liblua${vi_cv_version_lua}.so$LUA_SONAME"
fi
$as_echo "#define DYNAMIC_LUA 1" >>confdefs.h
LUA_LIBS=""
LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so$LUA_SONAME\\\" $LUA_CFLAGS"
LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS"
fi
fi
if test "$fail_if_missing" = "yes" -a -z "$LUA_SRC"; then
@@ -5385,6 +5390,7 @@ __:
@echo "python_LIBS='$(LIBS)'"
@echo "python_SYSLIBS='$(SYSLIBS)'"
@echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
@echo "python_DLLLIBRARY='$(DLLLIBRARY)'"
@echo "python_INSTSONAME='$(INSTSONAME)'"
eof
eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
@@ -5405,6 +5411,9 @@ eof
fi
if test "X$python_DLLLIBRARY" != "X"; then
python_INSTSONAME="$python_DLLLIBRARY"
fi
PYTHON_LIBS="${vi_cv_path_python_plibs}"
if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
@@ -5695,6 +5704,7 @@ __:
@echo "python3_BASEMODLIBS='$(BASEMODLIBS)'"
@echo "python3_LIBS='$(LIBS)'"
@echo "python3_SYSLIBS='$(SYSLIBS)'"
@echo "python3_DLLLIBRARY='$(DLLLIBRARY)'"
@echo "python3_INSTSONAME='$(INSTSONAME)'"
eof
eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
@@ -5707,6 +5717,9 @@ eof
fi
if test "X$python3_DLLLIBRARY" != "X"; then
python3_INSTSONAME="$python3_DLLLIBRARY"
fi
PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
@@ -6381,26 +6394,34 @@ $as_echo_n "checking Ruby version... " >&6; }
if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
$as_echo "OK" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Ruby rbconfig" >&5
$as_echo_n "checking Ruby rbconfig... " >&6; }
ruby_rbconfig="RbConfig"
if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then
ruby_rbconfig="Config"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ruby_rbconfig" >&5
$as_echo "$ruby_rbconfig" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Ruby header files" >&5
$as_echo_n "checking Ruby header files... " >&6; }
rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG["rubyhdrdir"] || Config::CONFIG["archdir"] || $hdrdir' 2>/dev/null`
rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG['rubyhdrdir'] || $ruby_rbconfig::CONFIG['archdir'] || \\$hdrdir" 2>/dev/null`
if test "X$rubyhdrdir" != "X"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $rubyhdrdir" >&5
$as_echo "$rubyhdrdir" >&6; }
RUBY_CFLAGS="-I$rubyhdrdir"
rubyarch=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["arch"]'`
rubyarch=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['arch']"`
if test -d "$rubyhdrdir/$rubyarch"; then
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch"
fi
rubyversion=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["ruby_version"].gsub(/\./, "")[0,2]'`
rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['ruby_version'].gsub(/\./, '')[0,2]"`
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LIBS"]'`
rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['LIBS']"`
if test "X$rubylibs" != "X"; then
RUBY_LIBS="$rubylibs"
fi
librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG["LIBRUBYARG"])'`
librubya=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG["LIBRUBY_A"])'`
rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG["libdir"])'`
librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBYARG'])"`
librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBY_A'])"`
rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['libdir'])"`
if test -f "$rubylibdir/$librubya"; then
librubyarg="$librubyarg"
RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
@@ -6413,7 +6434,7 @@ $as_echo "$rubyhdrdir" >&6; }
if test "X$librubyarg" != "X"; then
RUBY_LIBS="$librubyarg $RUBY_LIBS"
fi
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG["LDFLAGS"]'`
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG['LDFLAGS']"`
if test "X$rubyldflags" != "X"; then
rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'`
if test "X$rubyldflags" != "X"; then
@@ -6430,7 +6451,7 @@ $as_echo "$rubyhdrdir" >&6; }
$as_echo "#define FEAT_RUBY 1" >>confdefs.h
if test "$enable_rubyinterp" = "dynamic"; then
libruby=`$vi_cv_path_ruby -r rbconfig -e 'printf "lib%s.%s\n", Config::CONFIG["RUBY_SO_NAME"], Config::CONFIG["DLEXT"]'`
libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG['LIBRUBY_SO']"`
$as_echo "#define DYNAMIC_RUBY 1" >>confdefs.h
RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
+32 -19
View File
@@ -2639,7 +2639,7 @@ buflist_list(eap)
continue;
msg_putchar('\n');
if (buf_spname(buf) != NULL)
STRCPY(NameBuff, buf_spname(buf));
vim_strncpy(NameBuff, buf_spname(buf), MAXPATHL - 1);
else
home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE);
@@ -3062,7 +3062,7 @@ fileinfo(fullname, shorthelp, dont_truncate)
*p++ = '"';
if (buf_spname(curbuf) != NULL)
STRCPY(p, buf_spname(curbuf));
vim_strncpy(p, buf_spname(curbuf), IOSIZE - (p - buffer) - 1);
else
{
if (!fullname && curbuf->b_fname != NULL)
@@ -3242,12 +3242,15 @@ maketitle()
{
/* format: "fname + (path) (1 of 2) - VIM" */
#define SPACE_FOR_FNAME (IOSIZE - 100)
#define SPACE_FOR_DIR (IOSIZE - 20)
#define SPACE_FOR_ARGNR (IOSIZE - 10) /* at least room for " - VIM" */
if (curbuf->b_fname == NULL)
vim_strncpy(buf, (char_u *)_("[No Name]"), IOSIZE - 100);
vim_strncpy(buf, (char_u *)_("[No Name]"), SPACE_FOR_FNAME);
else
{
p = transstr(gettail(curbuf->b_fname));
vim_strncpy(buf, p, IOSIZE - 100);
vim_strncpy(buf, p, SPACE_FOR_FNAME);
vim_free(p);
}
@@ -3271,7 +3274,7 @@ maketitle()
buf[off++] = ' ';
buf[off++] = '(';
home_replace(curbuf, curbuf->b_ffname,
buf + off, IOSIZE - off, TRUE);
buf + off, SPACE_FOR_DIR - off, TRUE);
#ifdef BACKSLASH_IN_FILENAME
/* avoid "c:/name" to be reduced to "c" */
if (isalpha(buf[off]) && buf[off + 1] == ':')
@@ -3282,19 +3285,29 @@ maketitle()
if (p == buf + off)
/* must be a help buffer */
vim_strncpy(buf + off, (char_u *)_("help"),
(size_t)(IOSIZE - off - 1));
(size_t)(SPACE_FOR_DIR - off - 1));
else
*p = NUL;
/* translate unprintable chars */
p = transstr(buf + off);
vim_strncpy(buf + off, p, (size_t)(IOSIZE - off - 1));
vim_free(p);
/* Translate unprintable chars and concatenate. Keep some
* room for the server name. When there is no room (very long
* file name) use (...). */
if (off < SPACE_FOR_DIR)
{
p = transstr(buf + off);
vim_strncpy(buf + off, p, (size_t)(SPACE_FOR_DIR - off));
vim_free(p);
}
else
{
vim_strncpy(buf + off, (char_u *)"...",
(size_t)(SPACE_FOR_ARGNR - off));
}
STRCAT(buf, ")");
}
#ifndef FEAT_GUI_MACVIM
append_arg_number(curwin, buf, IOSIZE, FALSE);
append_arg_number(curwin, buf, SPACE_FOR_ARGNR, FALSE);
#endif
#if defined(FEAT_CLIENTSERVER)
@@ -3347,7 +3360,7 @@ maketitle()
else
{
if (buf_spname(curbuf) != NULL)
i_name = (char_u *)buf_spname(curbuf);
i_name = buf_spname(curbuf);
else /* use file name only in icon */
i_name = gettail(curbuf->b_ffname);
*i_str = NUL;
@@ -3763,7 +3776,7 @@ build_stl_str_hl(wp, out, outlen, fmt, use_sandbox, fillchar,
case STL_FILENAME:
fillable = FALSE; /* don't change ' ' to fillchar */
if (buf_spname(wp->w_buffer) != NULL)
STRCPY(NameBuff, buf_spname(wp->w_buffer));
vim_strncpy(NameBuff, buf_spname(wp->w_buffer), MAXPATHL - 1);
else
{
t = (opt == STL_FULLPATH) ? wp->w_buffer->b_ffname
@@ -5241,7 +5254,7 @@ write_viminfo_bufferlist(fp)
* Return special buffer name.
* Returns NULL when the buffer has a normal file name.
*/
char *
char_u *
buf_spname(buf)
buf_T *buf;
{
@@ -5260,9 +5273,9 @@ buf_spname(buf)
goto win_found;
win_found:
if (win != NULL && win->w_llist_ref != NULL)
return _(msg_loclist);
return (char_u *)_(msg_loclist);
else
return _(msg_qflist);
return (char_u *)_(msg_qflist);
}
#endif
#ifdef FEAT_QUICKFIX
@@ -5271,12 +5284,12 @@ win_found:
if (bt_nofile(buf))
{
if (buf->b_sfname != NULL)
return (char *)buf->b_sfname;
return _("[Scratch]");
return buf->b_sfname;
return (char_u *)_("[Scratch]");
}
#endif
if (buf->b_fname == NULL)
return _("[No Name]");
return (char_u *)_("[No Name]");
return NULL;
}
+5160 -11896
View File
File diff suppressed because it is too large Load Diff
+52 -33
View File
@@ -469,31 +469,31 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
LUA_INC=
if test "X$vi_cv_path_lua_pfx" != "X"; then
dnl -- try to find Lua executable
AC_PATH_PROG(vi_cv_path_lua, lua)
if test "X$vi_cv_path_lua" != "X"; then
dnl -- find Lua version
AC_CACHE_CHECK(Lua version, vi_cv_version_lua,
[ vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION)" | sed 's/.* //'` ])
fi
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include)
if test -f $vi_cv_path_lua_pfx/include/lua.h; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
dnl -- try to find Lua executable
AC_PATH_PROG(vi_cv_path_lua, lua)
if test "X$vi_cv_path_lua" != "X"; then
dnl -- find Lua version
AC_CACHE_CHECK(Lua version, vi_cv_version_lua,
[ vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION)" | sed 's/.* //'` ])
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
AC_MSG_RESULT(yes)
LUA_INC=/lua$vi_cv_version_lua
else
AC_MSG_RESULT(no)
vi_cv_path_lua_pfx=
fi
AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
AC_MSG_RESULT(yes)
LUA_INC=/lua$vi_cv_version_lua
else
AC_MSG_RESULT(no)
vi_cv_path_lua_pfx=
fi
fi
fi
if test "X$vi_cv_path_lua_pfx" != "X"; then
if test "X$vi_cv_version_lua" != "X"; then
if test "X$LUA_INC" != "X"; then
dnl Test alternate location using version
LUA_LIBS="-L${vi_cv_path_lua_pfx}/lib -llua$vi_cv_version_lua"
else
@@ -505,17 +505,22 @@ if test "$enable_luainterp" = "yes" -o "$enable_luainterp" = "dynamic"; then
LUA_PRO="if_lua.pro"
AC_DEFINE(FEAT_LUA)
if test "$enable_luainterp" = "dynamic"; then
dnl Determine the SONAME for the current version, but fallback to
dnl liblua${vi_cv_version_lua}.so if no SONAME-versioned file is found.
for i in 0 1 2 3 4 5 6 7 8 9; do
if test -f "${vi_cv_path_lua_pfx}/lib/liblua${vi_cv_version_lua}.so.$i"; then
LUA_SONAME=".$i"
break
fi
done
if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then
vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll"
else
dnl Determine the SONAME for the current version, but fallback to
dnl liblua${vi_cv_version_lua}.so if no SONAME-versioned file is found.
for i in 0 1 2 3 4 5 6 7 8 9; do
if test -f "${vi_cv_path_lua_pfx}/lib/liblua${vi_cv_version_lua}.so.$i"; then
LUA_SONAME=".$i"
break
fi
done
vi_cv_dll_name_lua="liblua${vi_cv_version_lua}.so$LUA_SONAME"
fi
AC_DEFINE(DYNAMIC_LUA)
LUA_LIBS=""
LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"liblua${vi_cv_version_lua}.so$LUA_SONAME\\\" $LUA_CFLAGS"
LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS"
fi
fi
if test "$fail_if_missing" = "yes" -a -z "$LUA_SRC"; then
@@ -913,6 +918,7 @@ __:
@echo "python_LIBS='$(LIBS)'"
@echo "python_SYSLIBS='$(SYSLIBS)'"
@echo "python_LINKFORSHARED='$(LINKFORSHARED)'"
@echo "python_DLLLIBRARY='$(DLLLIBRARY)'"
@echo "python_INSTSONAME='$(INSTSONAME)'"
eof
dnl -- delete the lines from make about Entering/Leaving directory
@@ -933,6 +939,9 @@ eof
fi
])
if test "X$python_DLLLIBRARY" != "X"; then
python_INSTSONAME="$python_DLLLIBRARY"
fi
PYTHON_LIBS="${vi_cv_path_python_plibs}"
if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then
PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\""
@@ -1116,6 +1125,7 @@ __:
@echo "python3_BASEMODLIBS='$(BASEMODLIBS)'"
@echo "python3_LIBS='$(LIBS)'"
@echo "python3_SYSLIBS='$(SYSLIBS)'"
@echo "python3_DLLLIBRARY='$(DLLLIBRARY)'"
@echo "python3_INSTSONAME='$(INSTSONAME)'"
eof
dnl -- delete the lines from make about Entering/Leaving directory
@@ -1128,6 +1138,9 @@ eof
vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//`
])
if test "X$python3_DLLLIBRARY" != "X"; then
python3_INSTSONAME="$python3_DLLLIBRARY"
fi
PYTHON3_LIBS="${vi_cv_path_python3_plibs}"
if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then
PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\""
@@ -1463,24 +1476,30 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
AC_MSG_CHECKING(Ruby version)
if $vi_cv_path_ruby -e '(VERSION rescue RUBY_VERSION) >= "1.6.0" or exit 1' >/dev/null 2>/dev/null; then
AC_MSG_RESULT(OK)
AC_MSG_CHECKING(Ruby rbconfig)
ruby_rbconfig="RbConfig"
if ! $vi_cv_path_ruby -r rbconfig -e 'RbConfig' >/dev/null 2>/dev/null; then
ruby_rbconfig="Config"
fi
AC_MSG_RESULT($ruby_rbconfig)
AC_MSG_CHECKING(Ruby header files)
rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e 'print Config::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]] || $hdrdir' 2>/dev/null`
rubyhdrdir=`$vi_cv_path_ruby -r mkmf -e "print $ruby_rbconfig::CONFIG[['rubyhdrdir']] || $ruby_rbconfig::CONFIG[['archdir']] || \\$hdrdir" 2>/dev/null`
if test "X$rubyhdrdir" != "X"; then
AC_MSG_RESULT($rubyhdrdir)
RUBY_CFLAGS="-I$rubyhdrdir"
rubyarch=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["arch"]]'`
rubyarch=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['arch']]"`
if test -d "$rubyhdrdir/$rubyarch"; then
RUBY_CFLAGS="$RUBY_CFLAGS -I$rubyhdrdir/$rubyarch"
fi
rubyversion=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["ruby_version"]].gsub(/\./, "")[[0,2]]'`
rubyversion=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['ruby_version']].gsub(/\./, '')[[0,2]]"`
RUBY_CFLAGS="$RUBY_CFLAGS -DRUBY_VERSION=$rubyversion"
rubylibs=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LIBS"]]'`
rubylibs=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LIBS']]"`
if test "X$rubylibs" != "X"; then
RUBY_LIBS="$rubylibs"
fi
librubyarg=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBYARG"]])'`
librubya=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["LIBRUBY_A"]])'`
rubylibdir=`$vi_cv_path_ruby -r rbconfig -e 'print Config.expand(Config::CONFIG[["libdir"]])'`
librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"`
librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"`
rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"`
if test -f "$rubylibdir/$librubya"; then
librubyarg="$librubyarg"
RUBY_LIBS="$RUBY_LIBS -L$rubylibdir"
@@ -1495,7 +1514,7 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
if test "X$librubyarg" != "X"; then
RUBY_LIBS="$librubyarg $RUBY_LIBS"
fi
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e 'print Config::CONFIG[["LDFLAGS"]]'`
rubyldflags=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig::CONFIG[['LDFLAGS']]"`
if test "X$rubyldflags" != "X"; then
dnl Ruby on Mac OS X 10.5 adds "-arch" flags but these should only
dnl be included if requested by passing --with-mac-arch to
@@ -1514,7 +1533,7 @@ if test "$enable_rubyinterp" = "yes" -o "$enable_rubyinterp" = "dynamic"; then
AC_DEFINE(FEAT_RUBY)
if test "$enable_rubyinterp" = "dynamic"; then
libruby=`$vi_cv_path_ruby -r rbconfig -e 'printf "lib%s.%s\n", Config::CONFIG[["RUBY_SO_NAME"]], Config::CONFIG[["DLEXT"]]'`
libruby=`$vi_cv_path_ruby -r rbconfig -e "puts $ruby_rbconfig::CONFIG[['LIBRUBY_SO']]"`
AC_DEFINE(DYNAMIC_RUBY)
RUBY_CFLAGS="-DDYNAMIC_RUBY_DLL=\\\"$libruby\\\" -DDYNAMIC_RUBY_VER=$rubyversion $RUBY_CFLAGS"
RUBY_LIBS=
+4 -2
View File
@@ -615,11 +615,13 @@ diff_redraw(dofold)
#endif
/* A change may have made filler lines invalid, need to take care
* of that for other windows. */
if (wp != curwin && wp->w_topfill > 0)
n = diff_check(wp, wp->w_topline);
if ((wp != curwin && wp->w_topfill > 0) || n > 0)
{
n = diff_check(wp, wp->w_topline);
if (wp->w_topfill > n)
wp->w_topfill = (n < 0 ? 0 : n);
else if (n > 0 && n > wp->w_topfill)
wp->w_topfill = n;
}
}
}
+8 -8
View File
@@ -4209,8 +4209,8 @@ ins_compl_get_exp(ini)
ins_buf->b_fname == NULL
? buf_spname(ins_buf)
: ins_buf->b_sfname == NULL
? (char *)ins_buf->b_fname
: (char *)ins_buf->b_sfname);
? ins_buf->b_fname
: ins_buf->b_sfname);
(void)msg_trunc_attr(IObuff, TRUE, hl_attr(HLF_R));
}
else if (*e_cpt == NUL)
@@ -8900,7 +8900,7 @@ ins_bs(c, mode, inserted_space_p)
*/
if ( mode == BACKSPACE_CHAR
&& ((p_sta && in_indent)
|| (curbuf->b_p_sts != 0
|| (get_sts_value() != 0
&& curwin->w_cursor.col > 0
&& (*(ml_get_cursor() - 1) == TAB
|| (*(ml_get_cursor() - 1) == ' '
@@ -8916,7 +8916,7 @@ ins_bs(c, mode, inserted_space_p)
if (p_sta && in_indent)
ts = (int)get_sw_value();
else
ts = (int)curbuf->b_p_sts;
ts = (int)get_sts_value();
/* Compute the virtual column where we want to be. Since
* 'showbreak' may get in the way, need to get the last column of
* the previous character. */
@@ -9624,7 +9624,7 @@ ins_tab()
*/
if (!curbuf->b_p_et
&& !(p_sta && ind && curbuf->b_p_ts != get_sw_value())
&& curbuf->b_p_sts == 0)
&& get_sts_value() == 0)
return TRUE;
if (stop_arrow() == FAIL)
@@ -9640,8 +9640,8 @@ ins_tab()
if (p_sta && ind) /* insert tab in indent, use 'shiftwidth' */
temp = (int)get_sw_value();
else if (curbuf->b_p_sts > 0) /* use 'softtabstop' when set */
temp = (int)curbuf->b_p_sts;
else if (curbuf->b_p_sts != 0) /* use 'softtabstop' when set */
temp = (int)get_sts_value();
else /* otherwise use 'tabstop' */
temp = (int)curbuf->b_p_ts;
temp -= get_nolist_virtcol() % temp;
@@ -9669,7 +9669,7 @@ ins_tab()
/*
* When 'expandtab' not set: Replace spaces by TABs where possible.
*/
if (!curbuf->b_p_et && (curbuf->b_p_sts || (p_sta && ind)))
if (!curbuf->b_p_et && (get_sts_value() || (p_sta && ind)))
{
char_u *ptr;
#ifdef FEAT_VREPLACE
+19
View File
@@ -687,6 +687,7 @@ static void f_settabvar __ARGS((typval_T *argvars, typval_T *rettv));
static void f_settabwinvar __ARGS((typval_T *argvars, typval_T *rettv));
static void f_setwinvar __ARGS((typval_T *argvars, typval_T *rettv));
static void f_shellescape __ARGS((typval_T *argvars, typval_T *rettv));
static void f_shiftwidth __ARGS((typval_T *argvars, typval_T *rettv));
static void f_simplify __ARGS((typval_T *argvars, typval_T *rettv));
#ifdef FEAT_FLOAT
static void f_sin __ARGS((typval_T *argvars, typval_T *rettv));
@@ -8052,6 +8053,7 @@ static struct fst
{"settabwinvar", 4, 4, f_settabwinvar},
{"setwinvar", 3, 3, f_setwinvar},
{"shellescape", 1, 2, f_shellescape},
{"shiftwidth", 0, 0, f_shiftwidth},
{"simplify", 1, 1, f_simplify},
#ifdef FEAT_FLOAT
{"sin", 1, 1, f_sin},
@@ -12288,9 +12290,15 @@ f_has(argvars, rettv)
# ifdef FEAT_MOUSE_PTERM
"mouse_pterm",
# endif
# ifdef FEAT_MOUSE_SGR
"mouse_sgr",
# endif
# ifdef FEAT_SYSMOUSE
"mouse_sysmouse",
# endif
# ifdef FEAT_MOUSE_URXVT
"mouse_urxvt",
# endif
# ifdef FEAT_MOUSE_XTERM
"mouse_xterm",
# endif
@@ -16679,6 +16687,17 @@ f_shellescape(argvars, rettv)
rettv->v_type = VAR_STRING;
}
/*
* shiftwidth() function
*/
static void
f_shiftwidth(argvars, rettv)
typval_T *argvars UNUSED;
typval_T *rettv;
{
rettv->vval.v_number = get_sw_value();
}
/*
* "simplify()" function
*/
+10 -5
View File
@@ -4851,7 +4851,7 @@ do_sub(eap)
#ifdef FEAT_EVAL
if (do_count)
{
/* prevent accidently changing the buffer by a function */
/* prevent accidentally changing the buffer by a function */
save_ma = curbuf->b_p_ma;
curbuf->b_p_ma = FALSE;
sandbox++;
@@ -5264,7 +5264,7 @@ do_sub_msg(count_only)
* is assumed to be 'p' if missing.
*
* This is implemented in two passes: first we scan the file for the pattern and
* set a mark for each line that (not) matches. secondly we execute the command
* set a mark for each line that (not) matches. Secondly we execute the command
* for each line that has a mark. This is required because after deleting
* lines we do not know where to search for the next match.
*/
@@ -5896,9 +5896,14 @@ find_help_tags(arg, num_matches, matches, keep_lang)
}
else
{
/* replace "[:...:]" with "\[:...:]"; "[+...]" with "\[++...]" */
if (arg[0] == '[' && (arg[1] == ':'
|| (arg[1] == '+' && arg[2] == '+')))
/* Replace:
* "[:...:]" with "\[:...:]"
* "[++...]" with "\[++...]"
* "\{" with "\\{"
*/
if ((arg[0] == '[' && (arg[1] == ':'
|| (arg[1] == '+' && arg[2] == '+')))
|| (arg[0] == '\\' && arg[1] == '{'))
*d++ = '\\';
for (s = arg; *s; ++s)
+1 -2
View File
@@ -1761,8 +1761,7 @@ check_changed_any(hidden)
msg_didout = FALSE;
}
if (EMSG2(_("E162: No write since last change for buffer \"%s\""),
buf_spname(buf) != NULL ? (char_u *)buf_spname(buf) :
buf->b_fname))
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname))
{
save = no_wait_return;
no_wait_return = FALSE;
+2 -2
View File
@@ -6483,7 +6483,7 @@ ex_colorscheme(eap)
#endif
}
else if (load_colors(eap->arg) == FAIL)
EMSG2(_("E185: Cannot find color scheme %s"), eap->arg);
EMSG2(_("E185: Cannot find color scheme '%s'"), eap->arg);
}
static void
@@ -7620,7 +7620,7 @@ ex_tabs(eap)
msg_putchar(bufIsChanged(wp->w_buffer) ? '+' : ' ');
msg_putchar(' ');
if (buf_spname(wp->w_buffer) != NULL)
STRCPY(IObuff, buf_spname(wp->w_buffer));
vim_strncpy(IObuff, buf_spname(wp->w_buffer), IOSIZE - 1);
else
home_replace(wp->w_buffer, wp->w_buffer->b_fname,
IObuff, IOSIZE, TRUE);
+4 -3
View File
@@ -667,9 +667,10 @@ getcmdline(firstc, count, indent)
c = plain_vgetc();
--no_mapping;
--allow_keys;
/* CTRL-\ e doesn't work when obtaining an expression. */
if (c != Ctrl_N && c != Ctrl_G
&& (c != 'e' || ccline.cmdfirstc == '='))
/* CTRL-\ e doesn't work when obtaining an expression, unless it
* is in a mapping. */
if (c != Ctrl_N && c != Ctrl_G && (c != 'e'
|| (ccline.cmdfirstc == '=' && KeyTyped)))
{
vungetc(c);
c = Ctrl_BSL;
+2
View File
@@ -1046,8 +1046,10 @@
* +mouse_gpm Unix only: Include code for Linux console mouse
* handling.
* +mouse_pterm PTerm mouse support for QNX
* +mouse_sgr Unix only: Include code for for SGR-styled mouse.
* +mouse_sysmouse Unix only: Include code for FreeBSD and DragonFly
* console mouse handling.
* +mouse_urxvt Unix only: Include code for for urxvt mosue handling.
* +mouse Any mouse support (any of the above enabled).
*/
/* OS/2 and Amiga console have no mouse support */
+5 -3
View File
@@ -359,7 +359,7 @@ get_beval_info(beval, getword, winp, lnump, textp, colp)
}
}
col = vcol2col(wp, lnum, col) - 1;
col = vcol2col(wp, lnum, col);
if (VIsual_active
&& wp->w_buffer == curwin->w_buffer
@@ -377,8 +377,10 @@ get_beval_info(beval, getword, winp, lnump, textp, colp)
return FAIL;
lbuf = ml_get_buf(curwin->w_buffer, VIsual.lnum, FALSE);
lbuf = vim_strnsave(lbuf + spos->col,
epos->col - spos->col + (*p_sel != 'e'));
len = epos->col - spos->col;
if (*p_sel != 'e')
len += MB_PTR2LEN(lbuf + epos->col);
lbuf = vim_strnsave(lbuf + spos->col, len);
lnum = spos->lnum;
col = spos->col;
}
+1 -1
View File
@@ -845,7 +845,6 @@ gui_mch_browse(int saving UNUSED,
char_u dirbuf[MAXPATHL];
guint log_handler;
const gchar *domain = "Gtk";
GtkFileFilter *gfilter;
title = CONVERT_TO_UTF8(title);
@@ -883,6 +882,7 @@ gui_mch_browse(int saving UNUSED,
int i = 0;
char_u *patt;
char_u *p = filter;
GtkFileFilter *gfilter;
gfilter = gtk_file_filter_new();
patt = alloc(STRLEN(filter));
+2 -1
View File
@@ -464,7 +464,8 @@ luaV_pushtypval(lua_State *L, typval_T *tv)
switch (tv->v_type)
{
case VAR_STRING:
lua_pushstring(L, (char *) tv->vval.v_string);
lua_pushstring(L, tv->vval.v_string == NULL
? "" : (char *)tv->vval.v_string);
break;
case VAR_NUMBER:
lua_pushinteger(L, (int) tv->vval.v_number);
+2 -1
View File
@@ -2649,7 +2649,8 @@ vim_to_mzscheme(typval_T *vim_value, int depth, Scheme_Hash_Table *visited)
new_value = FALSE;
else if (vim_value->v_type == VAR_STRING)
{
result = scheme_make_string((char *)vim_value->vval.v_string);
result = scheme_make_string(vim_value->vval.v_string == NULL
? "" : (char *)vim_value->vval.v_string);
MZ_GC_CHECK();
}
else if (vim_value->v_type == VAR_NUMBER)
+14 -3
View File
@@ -155,7 +155,7 @@ typedef int perl_key;
# define Perl_set_context dll_Perl_set_context
# if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
# define Perl_sv_2bool_flags dll_Perl_sv_2bool_flags
# define Perl_xs_apiversion_bootcheck dll_Perl_xs_apiversion_bootcheck
# define Perl_xs_apiversion_bootcheck dll_Perl_xs_apiversion_bootcheck
# else
# define Perl_sv_2bool dll_Perl_sv_2bool
# endif
@@ -225,6 +225,9 @@ typedef int perl_key;
# define Perl_call_list dll_Perl_call_list
# define Perl_Iscopestack_ix_ptr dll_Perl_Iscopestack_ix_ptr
# define Perl_Iunitcheckav_ptr dll_Perl_Iunitcheckav_ptr
# if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
# define PL_thr_key *dll_PL_thr_key
# endif
/*
* Declare HANDLE for perl.dll and function pointers.
@@ -315,6 +318,9 @@ static STRLEN* (*Perl_Tna_ptr)(register PerlInterpreter*);
static void (*Perl_sv_free2)(pTHX_ SV*);
static void (*Perl_sys_init)(int* argc, char*** argv);
static void (*Perl_sys_term)(void);
static void (*Perl_call_list)(pTHX_ I32, AV*);
# if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
# else
static SV** (*Perl_ISv_ptr)(register PerlInterpreter*);
static SV*** (*Perl_Istack_max_ptr)(register PerlInterpreter*);
static SV*** (*Perl_Istack_base_ptr)(register PerlInterpreter*);
@@ -326,16 +332,20 @@ static I32** (*Perl_Imarkstack_ptr_ptr)(register PerlInterpreter*);
static I32** (*Perl_Imarkstack_max_ptr)(register PerlInterpreter*);
static SV*** (*Perl_Istack_sp_ptr)(register PerlInterpreter*);
static OP** (*Perl_Iop_ptr)(register PerlInterpreter*);
static void (*Perl_call_list)(pTHX_ I32, AV*);
static I32* (*Perl_Iscopestack_ix_ptr)(register PerlInterpreter*);
static AV** (*Perl_Iunitcheckav_ptr)(register PerlInterpreter*);
# endif
#endif
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
static perl_key* dll_PL_thr_key;
#else
static GV** (*Perl_Idefgv_ptr)(register PerlInterpreter*);
static GV** (*Perl_Ierrgv_ptr)(register PerlInterpreter*);
static SV* (*Perl_Isv_yes_ptr)(register PerlInterpreter*);
static void (*boot_DynaLoader)_((pTHX_ CV*));
static perl_key* (*Perl_Gthr_key_ptr)_((pTHX));
#endif
static void (*boot_DynaLoader)_((pTHX_ CV*));
/*
* Table of name to function pointer of perl.
@@ -447,6 +457,7 @@ static struct {
# endif
#endif
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
{"PL_thr_key", (PERL_PROC*)&dll_PL_thr_key},
#else
{"Perl_Idefgv_ptr", (PERL_PROC*)&Perl_Idefgv_ptr},
{"Perl_Ierrgv_ptr", (PERL_PROC*)&Perl_Ierrgv_ptr},
+141 -20
View File
@@ -71,21 +71,41 @@ static struct PyMethodDef OutputMethods[] = {
/* Output buffer management
*/
static int
OutputSetattr(PyObject *self, char *name, PyObject *val)
{
if (val == NULL)
{
PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
return -1;
}
if (strcmp(name, "softspace") == 0)
{
if (!PyInt_Check(val))
{
PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
return -1;
}
((OutputObject *)(self))->softspace = PyInt_AsLong(val);
return 0;
}
PyErr_SetString(PyExc_AttributeError, _("invalid attribute"));
return -1;
}
static PyObject *
OutputWrite(PyObject *self, PyObject *args)
{
int len;
Py_ssize_t len = 0;
char *str = NULL;
int error = ((OutputObject *)(self))->error;
if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
return NULL;
/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
return NULL;
Py_BEGIN_ALLOW_THREADS
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);
@@ -331,7 +351,8 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
if (our_tv->v_type == VAR_STRING)
{
result = Py_BuildValue("s", our_tv->vval.v_string);
result = Py_BuildValue("s", our_tv->vval.v_string == NULL
? "" : (char *)our_tv->vval.v_string);
}
else if (our_tv->v_type == VAR_NUMBER)
{
@@ -612,6 +633,14 @@ pyll_add(PyObject *self, pylinkedlist_T *ref, pylinkedlist_T **last)
static PyTypeObject DictionaryType;
#define DICTKEY_GET_NOTEMPTY(err) \
DICTKEY_GET(err) \
if (*key == NUL) \
{ \
PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \
return err; \
}
typedef struct
{
PyObject_HEAD
@@ -664,7 +693,7 @@ pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict)
if (valObject == NULL)
return -1;
DICTKEY_GET(-1)
DICTKEY_GET_NOTEMPTY(-1)
di = dictitem_alloc(key);
@@ -735,7 +764,7 @@ pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict)
return -1;
}
DICTKEY_GET(-1)
DICTKEY_GET_NOTEMPTY(-1)
valObject = PyTuple_GetItem(litem, 1);
if (valObject == NULL)
@@ -779,6 +808,44 @@ pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict)
return 0;
}
static PyInt
DictionarySetattr(DictionaryObject *self, char *name, PyObject *val)
{
if (val == NULL)
{
PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes"));
return -1;
}
if (strcmp(name, "locked") == 0)
{
if (self->dict->dv_lock == VAR_FIXED)
{
PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed dictionary"));
return -1;
}
else
{
if (!PyBool_Check(val))
{
PyErr_SetString(PyExc_TypeError, _("Only boolean objects are allowed"));
return -1;
}
if (val == Py_True)
self->dict->dv_lock = VAR_LOCKED;
else
self->dict->dv_lock = 0;
}
return 0;
}
else
{
PyErr_SetString(PyExc_AttributeError, _("Cannot set this attribute"));
return -1;
}
}
static PyInt
DictionaryLength(PyObject *self)
{
@@ -789,16 +856,22 @@ DictionaryLength(PyObject *self)
DictionaryItem(PyObject *self, PyObject *keyObject)
{
char_u *key;
dictitem_T *val;
dictitem_T *di;
DICTKEY_DECL
DICTKEY_GET(NULL)
DICTKEY_GET_NOTEMPTY(NULL)
val = dict_find(((DictionaryObject *) (self))->dict, key, -1);
di = dict_find(((DictionaryObject *) (self))->dict, key, -1);
DICTKEY_UNREF
return ConvertToPyObject(&val->di_tv);
if (di == NULL)
{
PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
return NULL;
}
return ConvertToPyObject(&di->di_tv);
}
static PyInt
@@ -816,7 +889,7 @@ DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject)
return -1;
}
DICTKEY_GET(-1)
DICTKEY_GET_NOTEMPTY(-1)
di = dict_find(d, key, -1);
@@ -826,6 +899,7 @@ DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject)
if (di == NULL)
{
DICTKEY_UNREF
PyErr_SetString(PyExc_IndexError, _("no such key in dictionary"));
return -1;
}
@@ -850,6 +924,7 @@ DictionaryAssItem(PyObject *self, PyObject *keyObject, PyObject *valObject)
if (dict_add(d, di) == FAIL)
{
DICTKEY_UNREF
vim_free(di);
PyErr_SetVim(_("failed to add key to dictionary"));
return -1;
@@ -1235,6 +1310,44 @@ ListConcatInPlace(PyObject *self, PyObject *obj)
return self;
}
static int
ListSetattr(ListObject *self, char *name, PyObject *val)
{
if (val == NULL)
{
PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes"));
return -1;
}
if (strcmp(name, "locked") == 0)
{
if (self->list->lv_lock == VAR_FIXED)
{
PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed list"));
return -1;
}
else
{
if (!PyBool_Check(val))
{
PyErr_SetString(PyExc_TypeError, _("Only boolean objects are allowed"));
return -1;
}
if (val == Py_True)
self->list->lv_lock = VAR_LOCKED;
else
self->list->lv_lock = 0;
}
return 0;
}
else
{
PyErr_SetString(PyExc_AttributeError, _("Cannot set this attribute"));
return -1;
}
}
static struct PyMethodDef ListMethods[] = {
{"extend", (PyCFunction)ListConcatInPlace, METH_O, ""},
{ NULL, NULL, 0, NULL }
@@ -2521,8 +2634,10 @@ _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookupDict)
#if PY_MAJOR_VERSION >= 3
else if (PyBytes_Check(obj))
{
char_u *result = (char_u *) PyBytes_AsString(obj);
char_u *result;
if (PyString_AsStringAndSize(obj, (char **) &result, NULL) == -1)
return -1;
if (result == NULL)
return -1;
@@ -2540,7 +2655,8 @@ _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookupDict)
if (bytes == NULL)
return -1;
result = (char_u *) PyBytes_AsString(bytes);
if(PyString_AsStringAndSize(bytes, (char **) &result, NULL) == -1)
return -1;
if (result == NULL)
return -1;
@@ -2563,7 +2679,8 @@ _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookupDict)
if (bytes == NULL)
return -1;
result=(char_u *) PyString_AsString(bytes);
if(PyString_AsStringAndSize(bytes, (char **) &result, NULL) == -1)
return -1;
if (result == NULL)
return -1;
@@ -2578,8 +2695,10 @@ _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookupDict)
}
else if (PyString_Check(obj))
{
char_u *result = (char_u *) PyString_AsString(obj);
char_u *result;
if(PyString_AsStringAndSize(obj, (char **) &result, NULL) == -1)
return -1;
if (result == NULL)
return -1;
@@ -2633,7 +2752,8 @@ ConvertToPyObject(typval_T *tv)
switch (tv->v_type)
{
case VAR_STRING:
return PyBytes_FromString((char *) tv->vval.v_string);
return PyBytes_FromString(tv->vval.v_string == NULL
? "" : (char *)tv->vval.v_string);
case VAR_NUMBER:
return PyLong_FromLong((long) tv->vval.v_number);
#ifdef FEAT_FLOAT
@@ -2645,7 +2765,8 @@ ConvertToPyObject(typval_T *tv)
case VAR_DICT:
return DictionaryNew(tv->vval.v_dict);
case VAR_FUNC:
return FunctionNew(tv->vval.v_string);
return FunctionNew(tv->vval.v_string == NULL
? (char_u *)"" : tv->vval.v_string);
case VAR_UNKNOWN:
Py_INCREF(Py_None);
return Py_None;
+53 -36
View File
@@ -44,8 +44,6 @@
# undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */
#endif
#define PY_SSIZE_T_CLEAN
#ifdef FEAT_GUI_MACVIM
# include <Python/Python.h>
#else
@@ -59,6 +57,10 @@
#undef main /* Defined in python.h - aargh */
#undef HAVE_FCNTL_H /* Clash with os_win32.h */
#if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
# define PY_SSIZE_T_CLEAN
#endif
static void init_structs(void);
#define PyBytes_FromString PyString_FromString
@@ -166,6 +168,7 @@ struct PyMethodDef { Py_ssize_t a; };
# define PyInt_FromLong dll_PyInt_FromLong
# define PyLong_AsLong dll_PyLong_AsLong
# define PyLong_FromLong dll_PyLong_FromLong
# define PyBool_Type (*dll_PyBool_Type)
# define PyInt_Type (*dll_PyInt_Type)
# define PyLong_Type (*dll_PyLong_Type)
# define PyList_GetItem dll_PyList_GetItem
@@ -196,6 +199,7 @@ struct PyMethodDef { Py_ssize_t a; };
# define PyRun_SimpleString dll_PyRun_SimpleString
# define PyRun_String dll_PyRun_String
# define PyString_AsString dll_PyString_AsString
# define PyString_AsStringAndSize dll_PyString_AsStringAndSize
# define PyString_FromString dll_PyString_FromString
# define PyString_FromStringAndSize dll_PyString_FromStringAndSize
# define PyString_Size dll_PyString_Size
@@ -223,6 +227,8 @@ struct PyMethodDef { Py_ssize_t a; };
# define _PyObject_NextNotImplemented (*dll__PyObject_NextNotImplemented)
# endif
# define _Py_NoneStruct (*dll__Py_NoneStruct)
# define _Py_ZeroStruct (*dll__Py_ZeroStruct)
# define _Py_TrueStruct (*dll__Py_TrueStruct)
# define PyObject_Init dll__PyObject_Init
# define PyObject_GetIter dll_PyObject_GetIter
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
@@ -265,6 +271,7 @@ static long(*dll_PyInt_AsLong)(PyObject *);
static PyObject*(*dll_PyInt_FromLong)(long);
static long(*dll_PyLong_AsLong)(PyObject *);
static PyObject*(*dll_PyLong_FromLong)(long);
static PyTypeObject* dll_PyBool_Type;
static PyTypeObject* dll_PyInt_Type;
static PyTypeObject* dll_PyLong_Type;
static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt);
@@ -293,6 +300,7 @@ static PyObject*(*dll_PyModule_GetDict)(PyObject *);
static int(*dll_PyRun_SimpleString)(char *);
static PyObject *(*dll_PyRun_String)(char *, int, PyObject *, PyObject *);
static char*(*dll_PyString_AsString)(PyObject *);
static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, int *);
static PyObject*(*dll_PyString_FromString)(const char *);
static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt);
static PyInt(*dll_PyString_Size)(PyObject *);
@@ -321,6 +329,8 @@ static PyObject* (*dll_PyObject_GetIter)(PyObject *);
static iternextfunc dll__PyObject_NextNotImplemented;
# endif
static PyObject* dll__Py_NoneStruct;
static PyObject* _Py_ZeroStruct;
static PyObject* dll__Py_TrueStruct;
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *);
# endif
@@ -361,8 +371,15 @@ static struct
PYTHON_PROC *ptr;
} python_funcname_table[] =
{
#ifndef PY_SSIZE_T_CLEAN
{"PyArg_Parse", (PYTHON_PROC*)&dll_PyArg_Parse},
{"PyArg_ParseTuple", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
{"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
#else
{"_PyArg_Parse_SizeT", (PYTHON_PROC*)&dll_PyArg_Parse},
{"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&dll_PyArg_ParseTuple},
{"_Py_BuildValue_SizeT", (PYTHON_PROC*)&dll_Py_BuildValue},
#endif
{"PyMem_Free", (PYTHON_PROC*)&dll_PyMem_Free},
{"PyMem_Malloc", (PYTHON_PROC*)&dll_PyMem_Malloc},
{"PyDict_SetItemString", (PYTHON_PROC*)&dll_PyDict_SetItemString},
@@ -383,6 +400,7 @@ static struct
{"PyInt_FromLong", (PYTHON_PROC*)&dll_PyInt_FromLong},
{"PyLong_AsLong", (PYTHON_PROC*)&dll_PyLong_AsLong},
{"PyLong_FromLong", (PYTHON_PROC*)&dll_PyLong_FromLong},
{"PyBool_Type", (PYTHON_PROC*)&dll_PyBool_Type},
{"PyInt_Type", (PYTHON_PROC*)&dll_PyInt_Type},
{"PyLong_Type", (PYTHON_PROC*)&dll_PyLong_Type},
{"PyList_GetItem", (PYTHON_PROC*)&dll_PyList_GetItem},
@@ -411,6 +429,7 @@ static struct
{"PyRun_SimpleString", (PYTHON_PROC*)&dll_PyRun_SimpleString},
{"PyRun_String", (PYTHON_PROC*)&dll_PyRun_String},
{"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString},
{"PyString_AsStringAndSize", (PYTHON_PROC*)&dll_PyString_AsStringAndSize},
{"PyString_FromString", (PYTHON_PROC*)&dll_PyString_FromString},
{"PyString_FromStringAndSize", (PYTHON_PROC*)&dll_PyString_FromStringAndSize},
{"PyString_Size", (PYTHON_PROC*)&dll_PyString_Size},
@@ -424,7 +443,6 @@ static struct
{"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv},
{"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type},
{"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready},
{"Py_BuildValue", (PYTHON_PROC*)&dll_Py_BuildValue},
{"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod},
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \
&& SIZEOF_SIZE_T != SIZEOF_INT
@@ -443,6 +461,8 @@ static struct
{"_PyObject_NextNotImplemented", (PYTHON_PROC*)&dll__PyObject_NextNotImplemented},
# endif
{"_Py_NoneStruct", (PYTHON_PROC*)&dll__Py_NoneStruct},
{"_Py_ZeroStruct", (PYTHON_PROC*)&dll__Py_ZeroStruct},
{"_Py_TrueStruct", (PYTHON_PROC*)&dll__Py_TrueStruct},
# if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000
{"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype},
# endif
@@ -583,14 +603,15 @@ static PyTypeObject RangeType;
static int initialised = 0;
#define PYINITIALISED initialised
/* Add conversion from PyInt? */
#define DICTKEY_GET(err) \
if (!PyString_Check(keyObject)) \
{ \
PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \
return err; \
} \
key = (char_u *) PyString_AsString(keyObject);
if (PyString_AsStringAndSize(keyObject, (char **) &key, NULL) == -1) \
return err;
#define DICTKEY_UNREF
#define DICTKEY_DECL
@@ -724,9 +745,12 @@ Python_Init(void)
#else
PyMac_Initialize();
#endif
/* initialise threads */
/* Initialise threads, and save the state using PyGILState_Ensure.
* Without the call to PyGILState_Ensure, thread specific state (such
* as the system trace hook), will be lost between invocations of
* Python code. */
PyEval_InitThreads();
pygilstate = PyGILState_Ensure();
#ifdef DYNAMIC_PYTHON
get_exceptions();
#endif
@@ -944,31 +968,6 @@ OutputGetattr(PyObject *self, char *name)
return Py_FindMethod(OutputMethods, self, name);
}
static int
OutputSetattr(PyObject *self, char *name, PyObject *val)
{
if (val == NULL)
{
PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
return -1;
}
if (strcmp(name, "softspace") == 0)
{
if (!PyInt_Check(val))
{
PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
return -1;
}
((OutputObject *)(self))->softspace = PyInt_AsLong(val);
return 0;
}
PyErr_SetString(PyExc_AttributeError, _("invalid attribute"));
return -1;
}
/***************/
static int
@@ -1030,8 +1029,8 @@ static int CurrentSetattr(PyObject *, char *, PyObject *);
static PySequenceMethods BufferAsSeq = {
(PyInquiry) BufferLength, /* sq_length, len(x) */
(binaryfunc) 0, /* BufferConcat, */ /* sq_concat, x+y */
(PyIntArgFunc) 0, /* BufferRepeat, */ /* sq_repeat, x*n */
(binaryfunc) 0, /* BufferConcat, sq_concat, x+y */
(PyIntArgFunc) 0, /* BufferRepeat, sq_repeat, x*n */
(PyIntArgFunc) BufferItem, /* sq_item, x[i] */
(PyIntIntArgFunc) BufferSlice, /* sq_slice, x[i:j] */
(PyIntObjArgProc) BufferAssItem, /* sq_ass_item, x[i]=v */
@@ -1581,6 +1580,10 @@ PythonMod_Init(void)
PyDict_SetItemString(dict, "buffers", (PyObject *)(void *)&TheBufferList);
PyDict_SetItemString(dict, "current", (PyObject *)(void *)&TheCurrent);
PyDict_SetItemString(dict, "windows", (PyObject *)(void *)&TheWindowList);
PyDict_SetItemString(dict, "VAR_LOCKED", PyInt_FromLong(VAR_LOCKED));
PyDict_SetItemString(dict, "VAR_FIXED", PyInt_FromLong(VAR_FIXED));
PyDict_SetItemString(dict, "VAR_SCOPE", PyInt_FromLong(VAR_SCOPE));
PyDict_SetItemString(dict, "VAR_DEF_SCOPE", PyInt_FromLong(VAR_DEF_SCOPE));
if (PyErr_Occurred())
return -1;
@@ -1647,7 +1650,7 @@ static PyTypeObject DictionaryType = {
(destructor) DictionaryDestructor,
(printfunc) 0,
(getattrfunc) DictionaryGetattr,
(setattrfunc) 0,
(setattrfunc) DictionarySetattr,
(cmpfunc) 0,
(reprfunc) 0,
@@ -1674,6 +1677,13 @@ DictionaryDestructor(PyObject *self)
static PyObject *
DictionaryGetattr(PyObject *self, char *name)
{
DictionaryObject *this = ((DictionaryObject *) (self));
if (strcmp(name, "locked") == 0)
return PyInt_FromLong(this->dict->dv_lock);
else if (strcmp(name, "scope") == 0)
return PyInt_FromLong(this->dict->dv_scope);
return Py_FindMethod(DictionaryMethods, self, name);
}
@@ -1705,7 +1715,7 @@ static PyTypeObject ListType = {
(destructor) ListDestructor,
(printfunc) 0,
(getattrfunc) ListGetattr,
(setattrfunc) 0,
(setattrfunc) ListSetattr,
(cmpfunc) 0,
(reprfunc) 0,
@@ -1732,6 +1742,9 @@ ListDestructor(PyObject *self)
static PyObject *
ListGetattr(PyObject *self, char *name)
{
if (strcmp(name, "locked") == 0)
return PyInt_FromLong(((ListObject *)(self))->list->lv_lock);
return Py_FindMethod(ListMethods, self, name);
}
@@ -1792,6 +1805,10 @@ do_pyeval (char_u *str, typval_T *rettv)
case VAR_DICT: ++rettv->vval.v_dict->dv_refcount; break;
case VAR_LIST: ++rettv->vval.v_list->lv_refcount; break;
case VAR_FUNC: func_ref(rettv->vval.v_string); break;
case VAR_UNKNOWN:
rettv->v_type = VAR_NUMBER;
rettv->vval.v_number = 0;
break;
}
}
+139 -62
View File
@@ -42,8 +42,6 @@
# undef _DEBUG
#endif
#define PY_SSIZE_T_CLEAN
#ifdef F_BLANK
# undef F_BLANK
#endif
@@ -66,6 +64,10 @@
#undef main /* Defined in python.h - aargh */
#undef HAVE_FCNTL_H /* Clash with os_win32.h */
#if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000
# define PY_SSIZE_T_CLEAN
#endif
static void init_structs(void);
/* The "surrogateescape" error handler is new in Python 3.1 */
@@ -85,6 +87,10 @@ static void init_structs(void);
#define PyString_AsString(obj) PyBytes_AsString(obj)
#define PyString_Size(obj) PyBytes_GET_SIZE(bytes)
#define PyString_FromString(repr) PyUnicode_FromString(repr)
#define PyString_AsStringAndSize(obj, buffer, len) PyBytes_AsStringAndSize(obj, buffer, len)
#define PyInt_Check(obj) PyLong_Check(obj)
#define PyInt_FromLong(i) PyLong_FromLong(i)
#define PyInt_AsLong(obj) PyLong_AsLong(obj)
#if defined(DYNAMIC_PYTHON3) || defined(PROTO)
@@ -155,7 +161,6 @@ static void init_structs(void);
# define PyRun_String py3_PyRun_String
# define PySys_SetObject py3_PySys_SetObject
# define PySys_SetArgv py3_PySys_SetArgv
# define PyType_Type (*py3_PyType_Type)
# define PyType_Ready py3_PyType_Ready
#undef Py_BuildValue
# define Py_BuildValue py3_Py_BuildValue
@@ -164,21 +169,31 @@ static void init_structs(void);
# define Py_Finalize py3_Py_Finalize
# define Py_IsInitialized py3_Py_IsInitialized
# define _Py_NoneStruct (*py3__Py_NoneStruct)
# define _Py_FalseStruct (*py3__Py_FalseStruct)
# define _Py_TrueStruct (*py3__Py_TrueStruct)
# define _PyObject_NextNotImplemented (*py3__PyObject_NextNotImplemented)
# define PyModule_AddObject py3_PyModule_AddObject
# define PyImport_AppendInittab py3_PyImport_AppendInittab
# define _PyUnicode_AsString py3__PyUnicode_AsString
# if PY_VERSION_HEX >= 0x030300f0
# undef _PyUnicode_AsString
# define _PyUnicode_AsString py3_PyUnicode_AsUTF8
# else
# define _PyUnicode_AsString py3__PyUnicode_AsString
# endif
# undef PyUnicode_AsEncodedString
# define PyUnicode_AsEncodedString py3_PyUnicode_AsEncodedString
# undef PyBytes_AsString
# define PyBytes_AsString py3_PyBytes_AsString
# define PyBytes_AsStringAndSize py3_PyBytes_AsStringAndSize
# undef PyBytes_FromString
# define PyBytes_FromString py3_PyBytes_FromString
# define PyFloat_FromDouble py3_PyFloat_FromDouble
# define PyFloat_AsDouble py3_PyFloat_AsDouble
# define PyObject_GenericGetAttr py3_PyObject_GenericGetAttr
# define PyType_Type (*py3_PyType_Type)
# define PySlice_Type (*py3_PySlice_Type)
# define PyFloat_Type (*py3_PyFloat_Type)
# define PyBool_Type (*py3_PyBool_Type)
# define PyErr_NewException py3_PyErr_NewException
# ifdef Py_DEBUG
# define _Py_NegativeRefcount py3__Py_NegativeRefcount
@@ -238,7 +253,6 @@ static PyObject* (*py3_PyList_GetItem)(PyObject *, Py_ssize_t);
static PyObject* (*py3_PyImport_ImportModule)(const char *);
static PyObject* (*py3_PyImport_AddModule)(const char *);
static int (*py3_PyErr_BadArgument)(void);
static PyTypeObject* py3_PyType_Type;
static PyObject* (*py3_PyErr_Occurred)(void);
static PyObject* (*py3_PyModule_GetDict)(PyObject *);
static int (*py3_PyList_SetItem)(PyObject *, Py_ssize_t, PyObject *);
@@ -268,11 +282,18 @@ static void (*py3_PyErr_Clear)(void);
static PyObject*(*py3__PyObject_Init)(PyObject *, PyTypeObject *);
static iternextfunc py3__PyObject_NextNotImplemented;
static PyObject* py3__Py_NoneStruct;
static PyObject* py3__Py_FalseStruct;
static PyObject* py3__Py_TrueStruct;
static int (*py3_PyModule_AddObject)(PyObject *m, const char *name, PyObject *o);
static int (*py3_PyImport_AppendInittab)(const char *name, PyObject* (*initfunc)(void));
# if PY_VERSION_HEX >= 0x030300f0
static char* (*py3_PyUnicode_AsUTF8)(PyObject *unicode);
# else
static char* (*py3__PyUnicode_AsString)(PyObject *unicode);
# endif
static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char* encoding, const char* errors);
static char* (*py3_PyBytes_AsString)(PyObject *bytes);
static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, int *length);
static PyObject* (*py3_PyBytes_FromString)(char *str);
static PyObject* (*py3_PyFloat_FromDouble)(double num);
static double (*py3_PyFloat_AsDouble)(PyObject *);
@@ -280,8 +301,10 @@ static PyObject* (*py3_PyObject_GenericGetAttr)(PyObject *obj, PyObject *name);
static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version);
static PyObject* (*py3_PyType_GenericAlloc)(PyTypeObject *type, Py_ssize_t nitems);
static PyObject* (*py3_PyType_GenericNew)(PyTypeObject *type, PyObject *args, PyObject *kwds);
static PyTypeObject* py3_PyType_Type;
static PyTypeObject* py3_PySlice_Type;
static PyTypeObject* py3_PyFloat_Type;
static PyTypeObject* py3_PyBool_Type;
static PyObject* (*py3_PyErr_NewException)(char *name, PyObject *base, PyObject *dict);
static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor);
static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *);
@@ -325,7 +348,13 @@ static struct
{"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv},
{"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome},
{"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize},
# ifndef PY_SSIZE_T_CLEAN
{"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
{"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue},
# else
{"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&py3_PyArg_ParseTuple},
{"_Py_BuildValue_SizeT", (PYTHON_PROC*)&py3_Py_BuildValue},
# endif
{"PyMem_Free", (PYTHON_PROC*)&py3_PyMem_Free},
{"PyMem_Malloc", (PYTHON_PROC*)&py3_PyMem_Malloc},
{"PyList_New", (PYTHON_PROC*)&py3_PyList_New},
@@ -349,7 +378,6 @@ static struct
{"PyImport_ImportModule", (PYTHON_PROC*)&py3_PyImport_ImportModule},
{"PyImport_AddModule", (PYTHON_PROC*)&py3_PyImport_AddModule},
{"PyErr_BadArgument", (PYTHON_PROC*)&py3_PyErr_BadArgument},
{"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type},
{"PyErr_Occurred", (PYTHON_PROC*)&py3_PyErr_Occurred},
{"PyModule_GetDict", (PYTHON_PROC*)&py3_PyModule_GetDict},
{"PyList_SetItem", (PYTHON_PROC*)&py3_PyList_SetItem},
@@ -361,7 +389,6 @@ static struct
{"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter},
{"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong},
{"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New},
{"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue},
{"PyType_Ready", (PYTHON_PROC*)&py3_PyType_Ready},
{"PyDict_SetItemString", (PYTHON_PROC*)&py3_PyDict_SetItemString},
{"PyLong_AsLong", (PYTHON_PROC*)&py3_PyLong_AsLong},
@@ -373,12 +400,19 @@ static struct
{"Py_IsInitialized", (PYTHON_PROC*)&py3_Py_IsInitialized},
{"_PyObject_NextNotImplemented", (PYTHON_PROC*)&py3__PyObject_NextNotImplemented},
{"_Py_NoneStruct", (PYTHON_PROC*)&py3__Py_NoneStruct},
{"_Py_FalseStruct", (PYTHON_PROC*)&py3__Py_FalseStruct},
{"_Py_TrueStruct", (PYTHON_PROC*)&py3__Py_TrueStruct},
{"PyErr_Clear", (PYTHON_PROC*)&py3_PyErr_Clear},
{"PyObject_Init", (PYTHON_PROC*)&py3__PyObject_Init},
{"PyModule_AddObject", (PYTHON_PROC*)&py3_PyModule_AddObject},
{"PyImport_AppendInittab", (PYTHON_PROC*)&py3_PyImport_AppendInittab},
# if PY_VERSION_HEX >= 0x030300f0
{"PyUnicode_AsUTF8", (PYTHON_PROC*)&py3_PyUnicode_AsUTF8},
# else
{"_PyUnicode_AsString", (PYTHON_PROC*)&py3__PyUnicode_AsString},
# endif
{"PyBytes_AsString", (PYTHON_PROC*)&py3_PyBytes_AsString},
{"PyBytes_AsStringAndSize", (PYTHON_PROC*)&py3_PyBytes_AsStringAndSize},
{"PyBytes_FromString", (PYTHON_PROC*)&py3_PyBytes_FromString},
{"PyFloat_FromDouble", (PYTHON_PROC*)&py3_PyFloat_FromDouble},
{"PyFloat_AsDouble", (PYTHON_PROC*)&py3_PyFloat_AsDouble},
@@ -386,8 +420,10 @@ static struct
{"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2},
{"PyType_GenericAlloc", (PYTHON_PROC*)&py3_PyType_GenericAlloc},
{"PyType_GenericNew", (PYTHON_PROC*)&py3_PyType_GenericNew},
{"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type},
{"PySlice_Type", (PYTHON_PROC*)&py3_PySlice_Type},
{"PyFloat_Type", (PYTHON_PROC*)&py3_PyFloat_Type},
{"PyBool_Type", (PYTHON_PROC*)&py3_PyBool_Type},
{"PyErr_NewException", (PYTHON_PROC*)&py3_PyErr_NewException},
# ifdef Py_DEBUG
{"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount},
@@ -467,6 +503,12 @@ py3_runtime_link_init(char *libname, int verbose)
/* Load unicode functions separately as only the ucs2 or the ucs4 functions
* will be present in the library. */
# if PY_VERSION_HEX >= 0x030300f0
ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicode_FromString");
ucs_decode = symbol_from_dll(hinstPy3, "PyUnicode_Decode");
ucs_as_encoded_string = symbol_from_dll(hinstPy3,
"PyUnicode_AsEncodedString");
# else
ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicodeUCS2_FromString");
ucs_decode = symbol_from_dll(hinstPy3,
"PyUnicodeUCS2_Decode");
@@ -481,6 +523,7 @@ py3_runtime_link_init(char *libname, int verbose)
ucs_as_encoded_string = symbol_from_dll(hinstPy3,
"PyUnicodeUCS4_AsEncodedString");
}
# endif
if (ucs_from_string && ucs_decode && ucs_as_encoded_string)
{
py3_PyUnicode_FromString = ucs_from_string;
@@ -544,17 +587,20 @@ static int py3initialised = 0;
#define PYINITIALISED py3initialised
/* Add conversion from PyInt? */
#define DICTKEY_DECL PyObject *bytes = NULL;
#define DICTKEY_GET(err) \
if (PyBytes_Check(keyObject)) \
key = (char_u *) PyBytes_AsString(keyObject); \
{ \
if (PyString_AsStringAndSize(keyObject, (char **) &key, NULL) == -1) \
return err; \
} \
else if (PyUnicode_Check(keyObject)) \
{ \
bytes = PyString_AsBytes(keyObject); \
if (bytes == NULL) \
return err; \
key = (char_u *) PyBytes_AsString(bytes); \
if (key == NULL) \
if (PyString_AsStringAndSize(bytes, (char **) &key, NULL) == -1) \
return err; \
} \
else \
@@ -562,17 +608,21 @@ static int py3initialised = 0;
PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \
return err; \
}
#define DICTKEY_UNREF \
if (bytes != NULL) \
Py_XDECREF(bytes);
#define DICTKEY_DECL PyObject *bytes = NULL;
/*
* Include the code shared with if_python.c
*/
#include "if_py_both.h"
#define GET_ATTR_STRING(name, nameobj) \
char *name = ""; \
if (PyUnicode_Check(nameobj)) \
name = _PyUnicode_AsString(nameobj)
#define PY3OBJ_DELETED(obj) (obj->ob_base.ob_refcnt<=0)
static void
@@ -674,13 +724,19 @@ Python3_Init(void)
Py_SetPythonHome(PYTHON3_HOME);
#endif
PyImport_AppendInittab("vim", Py3Init_vim);
#if !defined(MACOS) || defined(MACOS_X_UNIX)
Py_Initialize();
#else
PyMac_Initialize();
#endif
/* initialise threads, must be after Py_Initialize() */
/* Initialise threads, and save the state using PyGILState_Ensure.
* Without the call to PyGILState_Ensure, thread specific state (such
* as the system trace hook), will be lost between invocations of
* Python code. */
PyEval_InitThreads();
pygilstate = PyGILState_Ensure();
#ifdef DYNAMIC_PYTHON3
get_py3_exceptions();
@@ -689,8 +745,6 @@ Python3_Init(void)
if (PythonIO_Init())
goto fail;
PyImport_AppendInittab("vim", Py3Init_vim);
globals = PyModule_GetDict(PyImport_AddModule("__main__"));
/* Remove the element from sys.path that was added because of our
@@ -910,9 +964,7 @@ ex_py3file(exarg_T *eap)
static PyObject *
OutputGetattro(PyObject *self, PyObject *nameobj)
{
char *name = "";
if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
GET_ATTR_STRING(name, nameobj);
if (strcmp(name, "softspace") == 0)
return PyLong_FromLong(((OutputObject *)(self))->softspace);
@@ -923,30 +975,9 @@ OutputGetattro(PyObject *self, PyObject *nameobj)
static int
OutputSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
{
char *name = "";
if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
GET_ATTR_STRING(name, nameobj);
if (val == NULL)
{
PyErr_SetString(PyExc_AttributeError, _("can't delete OutputObject attributes"));
return -1;
}
if (strcmp(name, "softspace") == 0)
{
if (!PyLong_Check(val))
{
PyErr_SetString(PyExc_TypeError, _("softspace must be an integer"));
return -1;
}
((OutputObject *)(self))->softspace = PyLong_AsLong(val);
return 0;
}
PyErr_SetString(PyExc_AttributeError, _("invalid attribute"));
return -1;
return OutputSetattr(self, name, val);
}
/***************/
@@ -1078,9 +1109,7 @@ BufferGetattro(PyObject *self, PyObject*nameobj)
{
BufferObject *this = (BufferObject *)(self);
char *name = "";
if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
GET_ATTR_STRING(name, nameobj);
if (CheckBuffer(this))
return NULL;
@@ -1244,9 +1273,7 @@ RangeDestructor(PyObject *self)
static PyObject *
RangeGetattro(PyObject *self, PyObject *nameobj)
{
char *name = "";
if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
GET_ATTR_STRING(name, nameobj);
if (strcmp(name, "start") == 0)
return Py_BuildValue("n", ((RangeObject *)(self))->start - 1);
@@ -1417,10 +1444,7 @@ WindowGetattro(PyObject *self, PyObject *nameobj)
{
WindowObject *this = (WindowObject *)(self);
char *name = "";
if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
GET_ATTR_STRING(name, nameobj);
if (CheckWindow(this))
return NULL;
@@ -1448,10 +1472,7 @@ WindowGetattro(PyObject *self, PyObject *nameobj)
static int
WindowSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
{
char *name = "";
if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
GET_ATTR_STRING(name, nameobj);
return WindowSetattr(self, name, val);
}
@@ -1495,9 +1516,7 @@ static PyTypeObject CurrentType;
static PyObject *
CurrentGetattro(PyObject *self UNUSED, PyObject *nameobj)
{
char *name = "";
if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
GET_ATTR_STRING(name, nameobj);
if (strcmp(name, "buffer") == 0)
return (PyObject *)BufferNew(curbuf);
@@ -1548,6 +1567,28 @@ static PyMappingMethods DictionaryAsMapping = {
/* mp_ass_subscript */ (objobjargproc) DictionaryAssItem,
};
static PyObject *
DictionaryGetattro(PyObject *self, PyObject *nameobj)
{
DictionaryObject *this = ((DictionaryObject *) (self));
GET_ATTR_STRING(name, nameobj);
if (strcmp(name, "locked") == 0)
return PyLong_FromLong(this->dict->dv_lock);
else if (strcmp(name, "scope") == 0)
return PyLong_FromLong(this->dict->dv_scope);
return PyObject_GenericGetAttr(self, nameobj);
}
static int
DictionarySetattro(PyObject *self, PyObject *nameobj, PyObject *val)
{
GET_ATTR_STRING(name, nameobj);
return DictionarySetattr((DictionaryObject *) self, name, val);
}
static PyTypeObject DictionaryType;
static void
@@ -1639,6 +1680,24 @@ ListAsSubscript(PyObject *self, PyObject *idxObject, PyObject *obj)
}
}
static PyObject *
ListGetattro(PyObject *self, PyObject *nameobj)
{
GET_ATTR_STRING(name, nameobj);
if (strcmp(name, "locked") == 0)
return PyLong_FromLong(((ListObject *) (self))->list->lv_lock);
return PyObject_GenericGetAttr(self, nameobj);
}
static int
ListSetattro(PyObject *self, PyObject *nameobj, PyObject *val)
{
GET_ATTR_STRING(name, nameobj);
return ListSetattr((ListObject *) self, name, val);
}
static void
ListDestructor(PyObject *self)
{
@@ -1668,9 +1727,8 @@ FunctionDestructor(PyObject *self)
FunctionGetattro(PyObject *self, PyObject *nameobj)
{
FunctionObject *this = (FunctionObject *)(self);
char *name = "";
if (PyUnicode_Check(nameobj))
name = _PyUnicode_AsString(nameobj);
GET_ATTR_STRING(name, nameobj);
if (strcmp(name, "name") == 0)
return PyUnicode_FromString((char *)(this->name));
@@ -1728,6 +1786,7 @@ static struct PyModuleDef vimmodule;
PyMODINIT_FUNC Py3Init_vim(void)
{
PyObject *mod;
PyObject *tmp;
/* The special value is removed from sys.path in Python3_Init(). */
static wchar_t *(argv[2]) = {L"/must>not&exist/foo", NULL};
@@ -1759,6 +1818,16 @@ PyMODINIT_FUNC Py3Init_vim(void)
Py_INCREF((PyObject *)(void *)&TheWindowList);
PyModule_AddObject(mod, "windows", (PyObject *)(void *)&TheWindowList);
#define ADD_INT_CONSTANT(name, value) \
tmp = PyLong_FromLong(value); \
Py_INCREF(tmp); \
PyModule_AddObject(mod, name, tmp)
ADD_INT_CONSTANT("VAR_LOCKED", VAR_LOCKED);
ADD_INT_CONSTANT("VAR_FIXED", VAR_FIXED);
ADD_INT_CONSTANT("VAR_SCOPE", VAR_SCOPE);
ADD_INT_CONSTANT("VAR_DEF_SCOPE", VAR_DEF_SCOPE);
if (PyErr_Occurred())
return NULL;
@@ -1817,6 +1886,10 @@ do_py3eval (char_u *str, typval_T *rettv)
case VAR_DICT: ++rettv->vval.v_dict->dv_refcount; break;
case VAR_LIST: ++rettv->vval.v_list->lv_refcount; break;
case VAR_FUNC: func_ref(rettv->vval.v_string); break;
case VAR_UNKNOWN:
rettv->v_type = VAR_NUMBER;
rettv->vval.v_number = 0;
break;
}
}
@@ -1910,6 +1983,8 @@ init_structs(void)
vim_memset(&DictionaryType, 0, sizeof(DictionaryType));
DictionaryType.tp_name = "vim.dictionary";
DictionaryType.tp_basicsize = sizeof(DictionaryObject);
DictionaryType.tp_getattro = DictionaryGetattro;
DictionaryType.tp_setattro = DictionarySetattro;
DictionaryType.tp_dealloc = DictionaryDestructor;
DictionaryType.tp_as_mapping = &DictionaryAsMapping;
DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT;
@@ -1920,6 +1995,8 @@ init_structs(void)
ListType.tp_name = "vim.list";
ListType.tp_dealloc = ListDestructor;
ListType.tp_basicsize = sizeof(ListObject);
ListType.tp_getattro = ListGetattro;
ListType.tp_setattro = ListSetattro;
ListType.tp_as_sequence = &ListAsSeq;
ListType.tp_as_mapping = &ListAsMapping;
ListType.tp_flags = Py_TPFLAGS_DEFAULT;
+15 -1
View File
@@ -182,6 +182,11 @@ static void ruby_vim_init(void);
#define rb_hash_new dll_rb_hash_new
#define rb_inspect dll_rb_inspect
#define rb_int2inum dll_rb_int2inum
#if SIZEOF_INT < SIZEOF_LONG /* 64 bits only */
#define rb_fix2int dll_rb_fix2int
#define rb_num2int dll_rb_num2int
#define rb_num2uint dll_rb_num2uint
#endif
#define rb_lastline_get dll_rb_lastline_get
#define rb_lastline_set dll_rb_lastline_set
#define rb_load_protect dll_rb_load_protect
@@ -272,7 +277,11 @@ static VALUE (*dll_rb_hash_aset) (VALUE, VALUE, VALUE);
static VALUE (*dll_rb_hash_new) (void);
static VALUE (*dll_rb_inspect) (VALUE);
static VALUE (*dll_rb_int2inum) (long);
static VALUE (*dll_rb_int2inum) (long);
#if SIZEOF_INT < SIZEOF_LONG /* 64 bits only */
static long (*dll_rb_fix2int) (VALUE);
static long (*dll_rb_num2int) (VALUE);
static unsigned long (*dll_rb_num2uint) (VALUE);
#endif
static VALUE (*dll_rb_lastline_get) (void);
static void (*dll_rb_lastline_set) (VALUE);
static void (*dll_rb_load_protect) (VALUE, int, int*);
@@ -381,6 +390,11 @@ static struct
{"rb_hash_new", (RUBY_PROC*)&dll_rb_hash_new},
{"rb_inspect", (RUBY_PROC*)&dll_rb_inspect},
{"rb_int2inum", (RUBY_PROC*)&dll_rb_int2inum},
#if SIZEOF_INT < SIZEOF_LONG /* 64 bits only */
{"rb_fix2int", (RUBY_PROC*)&dll_rb_fix2int},
{"rb_num2int", (RUBY_PROC*)&dll_rb_num2int},
{"rb_num2uint", (RUBY_PROC*)&dll_rb_num2uint},
#endif
{"rb_lastline_get", (RUBY_PROC*)&dll_rb_lastline_get},
{"rb_lastline_set", (RUBY_PROC*)&dll_rb_lastline_set},
{"rb_load_protect", (RUBY_PROC*)&dll_rb_load_protect},
+10 -4
View File
@@ -3793,13 +3793,15 @@ mb_charlen_len(str, len)
mb_unescape(pp)
char_u **pp;
{
static char_u buf[MB_MAXBYTES + 1];
int n, m = 0;
static char_u buf[6];
int n;
int m = 0;
char_u *str = *pp;
/* Must translate K_SPECIAL KS_SPECIAL KE_FILLER to K_SPECIAL and CSI
* KS_EXTRA KE_CSI to CSI. */
for (n = 0; str[n] != NUL && m <= MB_MAXBYTES; ++n)
* KS_EXTRA KE_CSI to CSI.
* Maximum length of a utf-8 character is 4 bytes. */
for (n = 0; str[n] != NUL && m < 4; ++n)
{
if (str[n] == K_SPECIAL
&& str[n + 1] == KS_SPECIAL
@@ -3836,6 +3838,10 @@ mb_unescape(pp)
*pp = str + n + 1;
return buf;
}
/* Bail out quickly for ASCII. */
if (buf[0] < 128)
break;
}
return NULL;
}
+2 -4
View File
@@ -780,9 +780,7 @@ ml_open_file(buf)
need_wait_return = TRUE; /* call wait_return later */
++no_wait_return;
(void)EMSG2(_("E303: Unable to open swap file for \"%s\", recovery impossible"),
buf_spname(buf) != NULL
? (char_u *)buf_spname(buf)
: buf->b_fname);
buf_spname(buf) != NULL ? buf_spname(buf) : buf->b_fname);
--no_wait_return;
}
@@ -1315,7 +1313,7 @@ ml_recover()
smsg((char_u *)_("Using swap file \"%s\""), NameBuff);
if (buf_spname(curbuf) != NULL)
STRCPY(NameBuff, buf_spname(curbuf));
vim_strncpy(NameBuff, buf_spname(curbuf), MAXPATHL - 1);
else
home_replace(NULL, curbuf->b_ffname, NameBuff, MAXPATHL, TRUE);
smsg((char_u *)_("Original file \"%s\""), NameBuff);
+7 -2
View File
@@ -960,8 +960,11 @@ getcount:
#ifdef FEAT_CMDL_INFO
need_flushbuf |= add_to_showcmd(ca.nchar);
#endif
/* For "gn" from redo, need to get one more char to determine the
* operator */
if (ca.nchar == 'r' || ca.nchar == '\'' || ca.nchar == '`'
|| ca.nchar == Ctrl_BSL)
|| ca.nchar == Ctrl_BSL
|| ((ca.nchar == 'n' || ca.nchar == 'N') && !stuff_empty()))
{
cp = &ca.extra_char; /* need to get a third character */
if (ca.nchar != 'r')
@@ -1083,6 +1086,8 @@ getcount:
ca.nchar = ca.extra_char;
idx = find_command(ca.cmdchar);
}
else if ((ca.nchar == 'n' || ca.nchar == 'N') && ca.cmdchar == 'g')
ca.oap->op_type = get_op_type(*cp, NUL);
else if (*cp == Ctrl_BSL)
{
long towait = (p_ttm >= 0 ? p_ttm : p_tm);
@@ -8043,7 +8048,7 @@ nv_g_cmd(cap)
#ifdef FEAT_VISUAL
if (!current_search(cap->count1, cap->nchar == 'n'))
#endif
beep_flush();
clearopbeep(oap);
break;
/*
+4 -1
View File
@@ -1623,6 +1623,7 @@ op_delete(oap)
#endif
linenr_T old_lcount = curbuf->b_ml.ml_line_count;
int did_yank = FALSE;
int orig_regname = oap->regname;
if (curbuf->b_ml.ml_flags & ML_EMPTY) /* nothing to do */
return OK;
@@ -1715,8 +1716,10 @@ op_delete(oap)
/*
* Put deleted text into register 1 and shift number registers if the
* delete contains a line break, or when a regname has been specified.
* Use the register name from before adjust_clip_reg() may have
* changed it.
*/
if (oap->regname != 0 || oap->motion_type == MLINE
if (orig_regname != 0 || oap->motion_type == MLINE
|| oap->line_count > 1 || oap->use_reg_one)
{
y_current = &y_regs[9];
+30 -19
View File
@@ -7660,24 +7660,30 @@ set_bool_option(opt_idx, varp, value, opt_flags)
/* 'undofile' */
else if ((int *)varp == &curbuf->b_p_udf || (int *)varp == &p_udf)
{
char_u hash[UNDO_HASH_SIZE];
buf_T *save_curbuf = curbuf;
for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next)
/* Only take action when the option was set. When reset we do not
* delete the undo file, the option may be set again without making
* any changes in between. */
if (curbuf->b_p_udf || p_udf)
{
/* When 'undofile' is set globally: for every buffer, otherwise
* only for the current buffer: Try to read in the undofile, if
* one exists and the buffer wasn't changed and the buffer was
* loaded. */
if ((curbuf == save_curbuf
|| (opt_flags & OPT_GLOBAL) || opt_flags == 0)
&& !curbufIsChanged() && curbuf->b_ml.ml_mfp != NULL)
char_u hash[UNDO_HASH_SIZE];
buf_T *save_curbuf = curbuf;
for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next)
{
u_compute_hash(hash);
u_read_undo(NULL, hash, curbuf->b_fname);
/* When 'undofile' is set globally: for every buffer, otherwise
* only for the current buffer: Try to read in the undofile,
* if one exists, the buffer wasn't changed and the buffer was
* loaded */
if ((curbuf == save_curbuf
|| (opt_flags & OPT_GLOBAL) || opt_flags == 0)
&& !curbufIsChanged() && curbuf->b_ml.ml_mfp != NULL)
{
u_compute_hash(hash);
u_read_undo(NULL, hash, curbuf->b_fname);
}
}
curbuf = save_curbuf;
}
curbuf = save_curbuf;
}
#endif
@@ -8647,11 +8653,6 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
p_window = Rows - 1;
}
if (curbuf->b_p_sts < 0)
{
errmsg = e_positive;
curbuf->b_p_sts = 0;
}
if (curbuf->b_p_ts <= 0)
{
errmsg = e_positive;
@@ -11574,6 +11575,16 @@ get_sw_value()
return curbuf->b_p_sw ? curbuf->b_p_sw : curbuf->b_p_ts;
}
/*
* Return the effective softtabstop value for the current buffer, using the
* 'tabstop' value when 'softtabstop' is negative.
*/
long
get_sts_value()
{
return curbuf->b_p_sts < 0 ? get_sw_value() : curbuf->b_p_sts;
}
#ifdef FEAT_FULLSCREEN
/*
* Read the 'fuoptions' option, set fuoptions_flags and
+4 -7
View File
@@ -2514,15 +2514,12 @@ mch_FullName(fname, buf, len, force)
}
l = STRLEN(buf);
if (l >= len)
retval = FAIL;
if (l >= len - 1)
retval = FAIL; /* no space for trailing "/" */
#ifndef VMS
else
{
if (l > 0 && buf[l - 1] != '/' && *fname != NUL
else if (l > 0 && buf[l - 1] != '/' && *fname != NUL
&& STRCMP(fname, ".") != 0)
STRCAT(buf, "/");
}
STRCAT(buf, "/");
#endif
}
+30 -9
View File
@@ -287,19 +287,40 @@ unescape_shellxquote(char_u *p, char_u *escaped)
HINSTANCE
vimLoadLib(char *name)
{
HINSTANCE dll = NULL;
char old_dir[MAXPATHL];
HINSTANCE dll = NULL;
char old_dir[MAXPATHL];
/* NOTE: Do not use mch_dirname() and mch_chdir() here, they may call
* vimLoadLib() recursively, which causes a stack overflow. */
if (exe_path == NULL)
get_exe_name();
if (exe_path != NULL && mch_dirname(old_dir, MAXPATHL) == OK)
if (exe_path != NULL)
{
/* Change directory to where the executable is, both to make sure we
* find a .dll there and to avoid looking for a .dll in the current
* directory. */
mch_chdir(exe_path);
dll = LoadLibrary(name);
mch_chdir(old_dir);
#ifdef FEAT_MBYTE
WCHAR old_dirw[MAXPATHL];
if (GetCurrentDirectoryW(MAXPATHL, old_dirw) != 0)
{
/* Change directory to where the executable is, both to make
* sure we find a .dll there and to avoid looking for a .dll
* in the current directory. */
SetCurrentDirectory(exe_path);
dll = LoadLibrary(name);
SetCurrentDirectoryW(old_dirw);
return dll;
}
/* Retry with non-wide function (for Windows 98). */
if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
#endif
if (GetCurrentDirectory(MAXPATHL, old_dir) != 0)
{
/* Change directory to where the executable is, both to make
* sure we find a .dll there and to avoid looking for a .dll
* in the current directory. */
SetCurrentDirectory(exe_path);
dll = LoadLibrary(name);
SetCurrentDirectory(old_dir);
}
}
return dll;
}
+1 -1
View File
@@ -108,7 +108,7 @@
*/
#define CMDBUFFSIZE 1024 /* size of the command processing buffer */
/* _MAX_PATH is only 256 (stdlib.h), but we want more for the 'path' option,
/* _MAX_PATH is only 260 (stdlib.h), but we want more for the 'path' option,
* thus use a larger number. */
#define MAXPATHL 1024
+1 -1
View File
@@ -51,7 +51,7 @@ void ex_buffer_all __ARGS((exarg_T *eap));
void do_modelines __ARGS((int flags));
int read_viminfo_bufferlist __ARGS((vir_T *virp, int writing));
void write_viminfo_bufferlist __ARGS((FILE *fp));
char *buf_spname __ARGS((buf_T *buf));
char_u *buf_spname __ARGS((buf_T *buf));
void buf_addsign __ARGS((buf_T *buf, int id, linenr_T lnum, int typenr));
linenr_T buf_change_sign_type __ARGS((buf_T *buf, int markId, int typenr));
int buf_getsigntype __ARGS((buf_T *buf, linenr_T lnum, int type));
+1
View File
@@ -57,4 +57,5 @@ void save_file_ff __ARGS((buf_T *buf));
int file_ff_differs __ARGS((buf_T *buf, int ignore_empty));
int check_ff_value __ARGS((char_u *p));
long get_sw_value __ARGS((void));
long get_sts_value __ARGS((void));
/* vim: set ft=c : */
+1 -1
View File
@@ -9905,7 +9905,7 @@ get_trans_bufname(buf)
buf_T *buf;
{
if (buf_spname(buf) != NULL)
STRCPY(NameBuff, buf_spname(buf));
vim_strncpy(NameBuff, buf_spname(buf), MAXPATHL - 1);
else
home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE);
trans_characters(NameBuff, MAXPATHL);
+16 -12
View File
@@ -4554,7 +4554,6 @@ current_search(count, forward)
int dir;
int result; /* result of various function calls */
char_u old_p_ws = p_ws;
int visual_active = FALSE;
int flags = 0;
pos_T save_VIsual;
int zerowidth = FALSE;
@@ -4570,11 +4569,6 @@ current_search(count, forward)
{
orig_pos = curwin->w_cursor;
save_VIsual = VIsual;
visual_active = TRUE;
/* just started visual selection, only one character */
if (equalpos(VIsual, curwin->w_cursor))
visual_active = FALSE;
pos = curwin->w_cursor;
start_pos = VIsual;
@@ -4628,7 +4622,7 @@ current_search(count, forward)
p_ws = old_p_ws;
return FAIL;
}
else if (!i && !result && !visual_active)
else if (!i && !result)
{
if (forward) /* try again from start of buffer */
{
@@ -4665,8 +4659,15 @@ current_search(count, forward)
if (VIsual_active)
{
redraw_curbuf_later(INVERTED); /* update the inversion */
if (*p_sel == 'e' && ltoreq(VIsual, curwin->w_cursor))
inc_cursor();
if (*p_sel == 'e')
{
/* Correction for exclusive selection depends on the direction. */
if (forward && ltoreq(VIsual, curwin->w_cursor))
inc_cursor();
else if (!forward && ltoreq(curwin->w_cursor, VIsual))
inc(&VIsual);
}
}
#ifdef FEAT_FOLDING
@@ -4700,7 +4701,8 @@ is_zerowidth(pattern)
regmmatch_T regmatch;
int nmatched = 0;
int result = -1;
pos_T pos;
pos_T pos;
int save_called_emsg = called_emsg;
if (search_regcomp(pattern, RE_SEARCH, RE_SEARCH,
SEARCH_KEEP, &regmatch) == FAIL)
@@ -4713,15 +4715,17 @@ is_zerowidth(pattern)
{
/* Zero-width pattern should match somewhere, then we can check if
* start and end are in the same position. */
called_emsg = FALSE;
nmatched = vim_regexec_multi(&regmatch, curwin, curbuf,
pos.lnum, (colnr_T)0, NULL);
if (!called_emsg)
result = (nmatched != 0
&& regmatch.startpos[0].lnum == regmatch.endpos[0].lnum
&& regmatch.startpos[0].col == regmatch.endpos[0].col);
&& regmatch.startpos[0].lnum == regmatch.endpos[0].lnum
&& regmatch.startpos[0].col == regmatch.endpos[0].col);
}
called_emsg |= save_called_emsg;
vim_free(regmatch.regprog);
return result;
}

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