Skip to content
Snippets Groups Projects
Commit 1e015460 authored by Bram Moolenaar's avatar Bram Moolenaar
Browse files

updated for version 7.0150

parent bfd8fc05
No related merge requests found
Showing
with 1178 additions and 914 deletions
" Vim completion script
" Language: CSS 2.1
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2005 Sep 19
" Last Change: 2005 Sep 23
function! csscomplete#CompleteCSS(findstart, base)
if a:findstart
......@@ -18,6 +18,8 @@ else
" 3. if } we are outside of css definitions
" 4. for comments ignoring is be the easiest but assume they are the same
" as 1.
" 5. if @ complete at-rule
" 6. if ! complete important
let line = a:base
let res = []
......@@ -26,14 +28,16 @@ else
" We need the last occurrence of char so reverse line
let revline = join(reverse(split(line, '.\zs')), '')
let openbrace = stridx(revline, '{')
let closebrace = stridx(revline, '}')
let colon = stridx(revline, ':')
let semicolon = stridx(revline, ';')
let opencomm = stridx(revline, '*/') " Line was reversed
let closecomm = stridx(revline, '/*') " Line was reversed
let style = stridx(revline, '=\s*elyts') " Line was reversed
let atrule = stridx(revline, '@')
let colon = stridx(revline, ':')
let semicolon = stridx(revline, ';')
let opencomm = stridx(revline, '*/') " Line was reversed
let closecomm = stridx(revline, '/*') " Line was reversed
let style = stridx(revline, '=\s*elyts') " Line was reversed
let atrule = stridx(revline, '@')
let exclam = stridx(revline, '!')
if openbrace > -1
let borders[openbrace] = "openbrace"
......@@ -59,6 +63,9 @@ else
if atrule > -1
let borders[atrule] = "atrule"
endif
if exclam > -1
let borders[exclam] = "exclam"
endif
if len(borders) == 0 || borders[min(keys(borders))] =~ '^\(openbrace\|semicolon\|opencomm\|closecomm\|style\)$'
" Complete properties
......@@ -318,6 +325,22 @@ else
return []
elseif borders[min(keys(borders))] == 'exclam'
" Complete values
let impbase = matchstr(line, '.\{-}!\s*\ze[a-zA-Z ]*$')
let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$')
let values = ["important"]
for m in values
if m =~? '^'.entered_imp
call add(res, impbase . m)
endif
endfor
return res
elseif borders[min(keys(borders))] == 'atrule'
let afterat = matchstr(line, '.*@\zs.*')
......@@ -368,7 +391,7 @@ else
endif
let values = ["charset", "page", "media", "import"]
let values = ["charset", "page", "media", "import", "font-face"]
let atrulebase = matchstr(line, '.*@\ze[a-zA-Z -]*$')
let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$')
......
" Vim completion script
" Language: XHTML 1.0 Strict
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2005 Sep 19
" Last Change: 2005 Sep 23
function! htmlcomplete#CompleteTags(findstart, base)
if a:findstart
......@@ -66,8 +66,13 @@ function! htmlcomplete#CompleteTags(findstart, base)
" it possible?
" Also retrieving class names from current file and linked
" stylesheets.
if a:base =~ "\\(on[a-z]*\\|style\\|class\\)\\s*=\\s*[\"']"
if a:base =~ "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
if a:base =~ "\\(on[a-z]*\\|id\\|style\\|class\\)\\s*=\\s*[\"']"
if a:base =~ "\\(id\\|class\\)\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
if a:base =~ "class\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
let search_for = "class"
elseif a:base =~ "id\\s*=\\s*[\"'][a-zA-Z0-9_ -]*$"
let search_for = "id"
endif
" Handle class name completion
" 1. Find lines of <link stylesheet>
" 1a. Check file for @import
......@@ -76,9 +81,22 @@ function! htmlcomplete#CompleteTags(findstart, base)
let head = getline(search('<head\>'), search('<\/head>'))
let headjoined = join(copy(head), ' ')
if headjoined =~ '<style'
let stylehead = substitute(headjoined, '+>\*[', ' ', 'g')
let styleheadlines = split(stylehead)
let headclasslines = filter(copy(styleheadlines), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
let stylehead = substitute(headjoined, '+>\*[,', ' ', 'g')
if search_for == 'class'
let styleheadlines = split(stylehead)
let headclasslines = filter(copy(styleheadlines), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
else
let stylesheet = split(headjoined, '[{}]')
" Get all lines which fit id syntax
let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
" Filter out possible color definitions
call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
" Filter out complex border definitions
call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
let templines = join(classlines, ' ')
let headclasslines = split(templines)
call filter(headclasslines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
endif
let internal = 1
else
let internal = 0
......@@ -93,13 +111,15 @@ function! htmlcomplete#CompleteTags(findstart, base)
let styletable += [matchstr(line, "href\\s*=\\s*[\"']\\zs\\f\\+\\ze")]
endif
endfor
for file in filestable
for file in styletable
if filereadable(file)
let stylesheet = readfile(file)
let secimport = filter(copy(stylesheet), "v:val =~ '@import'")
if len(secimport) > 0
for line in secimport
let secimportfiles += [matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")]
let secfile = matchstr(line, "import\\s\\+\\(url(\\)\\?[\"']\\?\\zs\\f\\+\\ze")
let secfile = fnamemodify(file, ":p:h").'/'.secfile
let secimportfiles += [secfile]
endfor
endif
endif
......@@ -109,10 +129,24 @@ function! htmlcomplete#CompleteTags(findstart, base)
for file in cssfiles
if filereadable(file)
let stylesheet = readfile(file)
let stylefile = join(stylesheet)
let stylefile = substitute(stylefile, '+>\*[', ' ', 'g')
let stylesheet = split(stylefile)
let classlines = filter(copy(stylesheet), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
let stylefile = join(stylesheet, ' ')
let stylefile = substitute(stylefile, '+>\*[,', ' ', 'g')
if search_for == 'class'
let stylesheet = split(stylefile)
let classlines = filter(copy(stylesheet), "v:val =~ '\\([a-zA-Z0-9:]\\+\\)\\?\\.[a-zA-Z0-9_-]\\+'")
else
let stylesheet = split(stylefile, '[{}]')
" Get all lines which fit id syntax
let classlines = filter(copy(stylesheet), "v:val =~ '#[a-zA-Z0-9_-]\\+'")
" Filter out possible color definitions
call filter(classlines, "v:val !~ ':\\s*#[a-zA-Z0-9_-]\\+'")
" Filter out complex border definitions
call filter(classlines, "v:val !~ '\\(none\\|hidden\\|dotted\\|dashed\\|solid\\|double\\|groove\\|ridge\\|inset\\|outset\\)\\s*#[a-zA-Z0-9_-]\\+'")
let templines = join(classlines, ' ')
let stylelines = split(templines)
let classlines = filter(stylelines, "v:val =~ '#[a-zA-Z0-9_-]\\+'")
endif
endif
" We gathered classes definitions from all external files
let classes += classlines
......@@ -120,43 +154,71 @@ function! htmlcomplete#CompleteTags(findstart, base)
if internal == 1
let classes += headclasslines
endif
let elements = {}
for element in classes
if element =~ '^\.'
let class = matchstr(element, '^\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
let class = substitute(class, ':.*', '', '')
if has_key(elements, "common")
let elements["common"] .= " ".class
else
let elements["common"] = class
endif
else
let class = matchstr(element, '[a-zA-Z1-6]*\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
let tagname = tolower(matchstr(element, '[a-zA-Z1-6]*\ze.'))
if tagname != ''
if has_key(elements, tagname)
let elements[tagname] .= " ".class
if search_for == 'class'
let elements = {}
for element in classes
if element =~ '^\.'
let class = matchstr(element, '^\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
let class = substitute(class, ':.*', '', '')
if has_key(elements, 'common')
let elements['common'] .= ' '.class
else
let elements[tagname] = class
let elements['common'] = class
endif
else
let class = matchstr(element, '[a-zA-Z1-6]*\.\zs[a-zA-Z][a-zA-Z0-9_-]*\ze')
let tagname = tolower(matchstr(element, '[a-zA-Z1-6]*\ze.'))
if tagname != ''
if has_key(elements, tagname)
let elements[tagname] .= ' '.class
else
let elements[tagname] = class
endif
endif
endif
endfor
if has_key(elements, tag) && has_key(elements, 'common')
let values = split(elements[tag]." ".elements['common'])
elseif has_key(elements, tag) && !has_key(elements, 'common')
let values = split(elements[tag])
elseif !has_key(elements, tag) && has_key(elements, 'common')
let values = split(elements['common'])
else
return []
endif
endfor
if has_key(elements, tag) && has_key(elements, "common")
let values = split(elements[tag]." ".elements["common"])
elseif has_key(elements, tag) && !has_key(elements, "common")
let values = split(elements[tag])
elseif !has_key(elements, tag) && has_key(elements, "common")
let values = split(elements["common"])
else
return []
elseif search_for == 'id'
" Find used IDs
" 1. Catch whole file
let filelines = getline(1, line('$'))
" 2. Find lines with possible id
let used_id_lines = filter(filelines, 'v:val =~ "id\\s*=\\s*[\"''][a-zA-Z0-9_-]\\+"')
" 3a. Join all filtered lines
let id_string = join(used_id_lines, ' ')
" 3b. And split them to be sure each id is in separate item
let id_list = split(id_string, 'id\s*=\s*')
" 4. Extract id values
let used_id = map(id_list, 'matchstr(v:val, "[\"'']\\zs[a-zA-Z0-9_-]\\+\\ze")')
let joined_used_id = ','.join(used_id, ',').','
let allvalues = map(classes, 'matchstr(v:val, ".*#\\zs[a-zA-Z0-9_-]\\+")')
let values = []
for element in classes
if joined_used_id !~ ','.element.','
let values += [element]
endif
endfor
endif
" We need special version of sbase
let classbase = matchstr(a:base, ".*[\"']")
let classquote = matchstr(classbase, '.$')
let classquote = matchstr(classbase, '.$')
let entered_class = matchstr(attr, ".*=\\s*[\"']\\zs.*")
......@@ -229,6 +291,10 @@ function! htmlcomplete#CompleteTags(findstart, base)
let values = ["text", "password", "checkbox", "radio", "submit", "reset", "file", "hidden", "image", "button"]
elseif a:base =~ '^button'
let values = ["button", "submit", "reset"]
elseif a:base =~ '^style'
let values = ["text/css"]
elseif a:base =~ '^script'
let values = ["text/javascript"]
endif
else
return []
......@@ -313,11 +379,11 @@ function! htmlcomplete#CompleteTags(findstart, base)
elseif tag == 'q'
let attrs = coreattrs + ["cite"]
elseif tag == 'script'
let attrs = ["id", "charset", "type", "src", "defer", "xml:space"]
let attrs = ["id", "charset", "type=\"text/javascript\"", "type", "src", "defer", "xml:space"]
elseif tag == 'select'
let attrs = coreattrs + ["name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange"]
elseif tag == 'style'
let attrs = coreattrs + ["id", "type", "media", "title", "xml:space"]
let attrs = coreattrs + ["id", "type=\"text/css\"", "type", "media", "title", "xml:space"]
elseif tag == 'table'
let attrs = coreattrs + ["summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding"]
elseif tag =~ '^\(thead\|tfoot\|tbody\|tr\)$'
......
This diff is collapsed.
......@@ -24,13 +24,22 @@ endif
let s:cpo_save = &cpo
set cpo-=C
CompilerSet makeprg=eruby
if exists("eruby_compiler") && eruby_compiler == "eruby"
CompilerSet makeprg=eruby
else
CompilerSet makeprg=erb
endif
CompilerSet errorformat=eruby:\ %f:%l:%m,
\%E%f:%l:\ %m,
\%-Z%p^,
\%C%m,
\%-G%.%#
CompilerSet errorformat=
\eruby:\ %f:%l:%m,
\%+E%f:%l:\ parse\ error,
\%W%f:%l:\ warning:\ %m,
\%E%f:%l:in\ %*[^:]:\ %m,
\%E%f:%l:\ %m,
\%-C%\tfrom\ %f:%l:in\ %.%#,
\%-Z%\tfrom\ %f:%l,
\%-Z%p^,
\%-G%.%#
let &cpo = s:cpo_save
unlet s:cpo_save
......
*diff.txt* For Vim version 7.0aa. Last change: 2005 Apr 26
*diff.txt* For Vim version 7.0aa. Last change: 2005 Sep 21
VIM REFERENCE MANUAL by Bram Moolenaar
......@@ -218,7 +218,7 @@ It is an error if there is no change for the cursor to move to.
==============================================================================
4. Diff copying *copy-diffs* *E99* *E100* *E101* *E102* *E103*
*merge*
There are two commands to copy text from one buffer to another. The result is
that the buffers will be equal within the specified range.
......@@ -235,6 +235,8 @@ that the buffers will be equal within the specified range.
Modify another buffer to undo difference with the current
buffer. Just like ":diffget" but the other buffer is modified
instead of the current one.
When [bufspec] is omitted and there is more than one other
buffer in diff mode where 'modifiable' is set this fails.
See below for [range].
*do*
......
*eval.txt* For Vim version 7.0aa. Last change: 2005 Sep 20
*eval.txt* For Vim version 7.0aa. Last change: 2005 Sep 25
VIM REFERENCE MANUAL by Bram Moolenaar
......@@ -2547,11 +2547,12 @@ getcmdpos() *getcmdpos()*
getcmdtype() *getcmdtype()*
Return the current command-line type. Possible return values
are:
/ Search forward command
? Search backward command
: Ex-command mode
@ Input mode
> Debug mode
: normal Ex command
> debug mode command |debug-mode|
/ forward search command
? backward search command
@ |input()| command
- |:insert| or |:append| command
Only works when editing the command line, thus requires use of
|c_CTRL-\_e| or |c_CTRL-R_=|. Returns an empty string
otherwise.
......@@ -2939,8 +2940,8 @@ input({prompt} [, {text} [, {completion}]]) *input()*
: echo "Cheers!"
:endif
<
If the optional {text} is present, this is used for the
default reply, as if the user typed this. Example: >
If the optional {text} is present and not empty, this is used
for the default reply, as if the user typed this. Example: >
:let color = input("Color? ", "white")
< The optional {completion} argument specifies the type of
......@@ -4049,10 +4050,30 @@ soundfold({word})
the method can be quite slow.
*spellbadword()*
spellbadword() Return the badly spelled word under or after the cursor.
The cursor is moved to the start of the bad word.
When no bad word is found in the cursor line an empty String
is returned and the cursor doesn't move.
spellbadword([{sentence}])
Without argument: The result is the badly spelled word under
or after the cursor. The cursor is moved to the start of the
bad word. When no bad word is found in the cursor line the
result is an empty string and the cursor doesn't move.
With argument: The result is the first word in {sentence} that
is badly spelled. If there are no spelling mistakes the
result is an empty string.
The return value is a list with two items:
- The badly spelled word or an empty string.
- The type of the spelling error:
"bad" spelling mistake
"rare" rare word
"local" word only valid in another region
"caps" word should start with Capital
Example: >
echo spellbadword("the quik brown fox")
< ['quik', 'bad'] ~
The spelling information for the current window is used. The
'spell' option must be set and the value of 'spelllang' is
used.
*spellsuggest()*
spellsuggest({word} [, {max}])
......
*insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 18
*insert.txt* For Vim version 7.0aa. Last change: 2005 Sep 23
VIM REFERENCE MANUAL by Bram Moolenaar
......@@ -988,20 +988,35 @@ are included.
(X)HTML *ft-html-omni*
When using after CTRL-X CTRL-O after "<" it is completed with tag name
available in current context. Inside of tag completion aids to choose
proper attributes, and when possible choose appropriate attribute value
including class names for CSS styles.
When used after "</" CTRL-X CTRL-O will close the last opened tag.
CTRL-X CTRL-O provides completion of various elements of (X)HTML files.
It is designed to support writing of XHTML 1.0 Strict files but will
also works for other versions of HTML. Features:
- after "<" complete tag name depending on context (no div suggest
inside of an a tag)
- inside of tag complete proper attributes (no width attribute for an
a tag)
- when attribute has limited number of possible values help to complete
them
- complete values of "class" and "id" attributes with data obtained from
style tag and included CSS files
- when completing "style" attribute or working inside of "style" tag
switch to |ft-css-omni| completion
- when used after "</" CTRL-X CTRL-O will close the last opened tag
File htmlcomplete.vim provides through |autoload| mechanism
GetLastOpenTag function which can be used in XML files to get name of
last open tag with: >
last open tag with (b:unaryTagsStack has to be defined): >
:echo htmlcomplete#GetLastOpenTag("b:unaryTagsStack")
CSS *ft-css-omni*
Complete properties and their appropriate values according to CSS 2.1
specification.
==============================================================================
8. Insert mode commands *inserting*
......
*map.txt* For Vim version 7.0aa. Last change: 2005 Aug 16
*map.txt* For Vim version 7.0aa. Last change: 2005 Sep 22
VIM REFERENCE MANUAL by Bram Moolenaar
......@@ -306,11 +306,12 @@ If you type a space, then "foo" will get inserted, plus the space. If you
type "a", then "bar" will get inserted.
{Vi does not allow ambiguous mappings}
*map_CTRL_C*
It's not possible to use a CTRL-C in the {lhs}. You just can't map CTRL-C.
The reason is that CTRL-C must always be available to break a running command.
Exception: When using the GUI version on MS-Windows CTRL-C can be mapped to
allow a Copy command to the clipboard. Use CTRL-Break to interrupt Vim.
*map_CTRL-C*
Using CTRL-C in the {lhs} is possible, but it will only work when Vim is
waiting for a key, not when Vim is busy with something. When Vim is busy
CTRL-C interrupts/breaks the command.
When using the GUI version on MS-Windows CTRL-C can be mapped to allow a Copy
command to the clipboard. Use CTRL-Break to interrupt Vim.
*map_space_in_lhs*
To include a space in {lhs} precede it with a CTRL-V (type two CTRL-Vs for
......
*message.txt* For Vim version 7.0aa. Last change: 2005 Aug 01
*message.txt* For Vim version 7.0aa. Last change: 2005 Sep 25
VIM REFERENCE MANUAL by Bram Moolenaar
......@@ -23,7 +23,7 @@ The number of remembered messages is fixed at 20.
*g<*
The "g<" command can be used to see the last page of previous command output.
This is especially useful if you accidentally typed <Space> at the hit-return
This is especially useful if you accidentally typed <Space> at the hit-enter
prompt.
Note: when you stopped the output with "q" at the more prompt only up to that
point will be displayed.
......@@ -813,4 +813,8 @@ Any other key causes the meaning of the keys to be displayed.
Note: The typed key is directly obtained from the terminal, it is not mapped
and typeahead is ignored.
The |g<| command can be used to see the last page of previous command output.
This is especially useful if you accidentally typed <Space> at the hit-enter
prompt.
vim:tw=78:ts=8:ft=help:norl:
*options.txt* For Vim version 7.0aa. Last change: 2005 Sep 13
*options.txt* For Vim version 7.0aa. Last change: 2005 Sep 25
VIM REFERENCE MANUAL by Bram Moolenaar
......@@ -3647,9 +3647,11 @@ A jump table for the options with a short description can be found at |Q_op|.
Pattern to be used to find an include command. It is a search
pattern, just like for the "/" command (See |pattern|). The default
value is for C programs. This option is used for the commands "[i",
"]I", "[d", etc. The 'isfname' option is used to recognize the file
name that comes after the matched pattern. See |option-backslash|
about including spaces and backslashes.
"]I", "[d", etc.
Normally the 'isfname' option is used to recognize the file name that
comes after the matched pattern. But if both "\zs" and "\ze" appear
in the pattern then the text spanned by them is used as the file name.
See |option-backslash| about including spaces and backslashes.
*'includeexpr'* *'inex'*
'includeexpr' 'inex' string (default "")
......@@ -5160,6 +5162,9 @@ A jump table for the options with a short description can be found at |Q_op|.
Minimal number of lines to scroll when the cursor gets off the
screen (e.g., with "j"). Not used for scroll commands (e.g., CTRL-E,
CTRL-D). Useful if your terminal scrolls very slowly.
When set to a negative number from -1 to -100 this is used as the
percentage of the window height. Thus -50 scrolls half the window
height.
NOTE: This option is set to 1 when 'compatible' is set.
*'scrolloff'* *'so'*
......
This diff is collapsed.
*spell.txt* For Vim version 7.0aa. Last change: 2005 Sep 12
*spell.txt* For Vim version 7.0aa. Last change: 2005 Sep 25
VIM REFERENCE MANUAL by Bram Moolenaar
......@@ -1124,6 +1124,10 @@ Don't include simple one-character replacements or swaps. Vim will try these
anyway. You can include whole words if you want to, but you might want to use
the "file:" item in 'spellsuggest' instead.
You can include a space by using an underscore:
REP the_the the ~
SIMILAR CHARACTERS *spell-MAP*
......
......@@ -4973,6 +4973,7 @@ ft-chill-syntax syntax.txt /*ft-chill-syntax*
ft-cobol-syntax syntax.txt /*ft-cobol-syntax*
ft-coldfusion-syntax syntax.txt /*ft-coldfusion-syntax*
ft-csh-syntax syntax.txt /*ft-csh-syntax*
ft-css-omni insert.txt /*ft-css-omni*
ft-cweb-syntax syntax.txt /*ft-cweb-syntax*
ft-cynlib-syntax syntax.txt /*ft-cynlib-syntax*
ft-desktop-syntax syntax.txt /*ft-desktop-syntax*
......@@ -5082,6 +5083,7 @@ g'a motion.txt /*g'a*
g, motion.txt /*g,*
g0 motion.txt /*g0*
g8 various.txt /*g8*
g:netrw-a pi_netrw.txt /*g:netrw-a*
g:netrw_alto pi_netrw.txt /*g:netrw_alto*
g:netrw_altv pi_netrw.txt /*g:netrw_altv*
g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin*
......@@ -5705,7 +5707,7 @@ map-self-destroy tips.txt /*map-self-destroy*
map-typing map.txt /*map-typing*
map-which-keys map.txt /*map-which-keys*
map.txt map.txt /*map.txt*
map_CTRL_C map.txt /*map_CTRL_C*
map_CTRL-C map.txt /*map_CTRL-C*
map_backslash map.txt /*map_backslash*
map_bar map.txt /*map_bar*
map_empty_rhs map.txt /*map_empty_rhs*
......@@ -5747,6 +5749,7 @@ menu-priority gui.txt /*menu-priority*
menu-separator gui.txt /*menu-separator*
menu.vim gui.txt /*menu.vim*
menus gui.txt /*menus*
merge diff.txt /*merge*
message-history message.txt /*message-history*
message.txt message.txt /*message.txt*
messages message.txt /*messages*
......@@ -5853,7 +5856,6 @@ netrw-O pi_netrw.txt /*netrw-O*
netrw-R pi_netrw.txt /*netrw-R*
netrw-S pi_netrw.txt /*netrw-S*
netrw-U pi_netrw.txt /*netrw-U*
netrw-a pi_netrw.txt /*netrw-a*
netrw-activate pi_netrw.txt /*netrw-activate*
netrw-b pi_netrw.txt /*netrw-b*
netrw-bookmark pi_netrw.txt /*netrw-bookmark*
......@@ -7322,13 +7324,6 @@ zf fold.txt /*zf*
zg spell.txt /*zg*
zh scroll.txt /*zh*
zi fold.txt /*zi*
zip zip.txt /*zip*
zip-contents zip.txt /*zip-contents*
zip-copyright zip.txt /*zip-copyright*
zip-history zip.txt /*zip-history*
zip-manual zip.txt /*zip-manual*
zip-usage zip.txt /*zip-usage*
zip.txt zip.txt /*zip.txt*
zj fold.txt /*zj*
zk fold.txt /*zk*
zl scroll.txt /*zl*
......
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Sep 19
" Last Change: 2005 Sep 25
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
......@@ -16,7 +16,7 @@ set cpo&vim
augroup filetypedetect
" Ignored extensions
au BufNewFile,BufRead *.orig,*.bak,*.old,*.new,*.rpmsave,*.rpmnew
au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.rpmsave,?\+.rpmnew
\ exe "doau filetypedetect BufRead " . expand("<afile>:r")
au BufNewFile,BufRead *~
\ let s:name = expand("<afile>") |
......@@ -26,7 +26,7 @@ au BufNewFile,BufRead *~
\ endif |
\ unlet s:name |
\ unlet s:short
au BufNewFile,BufRead *.in
au BufNewFile,BufRead ?\+.in
\ if expand("<afile>:t") != "configure.in" |
\ exe "doau filetypedetect BufRead " . expand("<afile>:r") |
\ endif
......
" Vim indent file
" Language: Ruby
" Maintainer: Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
" Info: $Id$
" URL: http://vim-ruby.rubyforge.org/
" Anon CVS: See above site
" Licence: GPL (http://www.gnu.org)
" Disclaimer:
" This program is distributed in the hope that it will be useful,
" but WITHOUT ANY WARRANTY; without even the implied warranty of
" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
" GNU General Public License for more details.
" ----------------------------------------------------------------------------
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
runtime! indent/html.vim
This diff is collapsed.
......@@ -82,7 +82,7 @@ let s:end_start_regex = '^\s*\zs\<\%(module\|class\|def\|if\|for' .
let s:end_middle_regex = '\<\%(ensure\|else\|\%(\%(^\|;\)\s*\)\@<=\<rescue\>\|when\|elsif\)\>'
" Regex that defines the end-match for the 'end' keyword.
let s:end_end_regex = '\%(^\|[^.]\)\@<=\<end\>'
let s:end_end_regex = '\%(^\|[^.:]\)\@<=\<end\>'
" Expression used for searchpair() call for finding match for 'end' keyword.
let s:end_skip_expr = s:skip_expr .
......@@ -244,17 +244,12 @@ function GetRubyIndent()
" If we have a deindenting keyword, find its match and indent to its level.
" TODO: this is messy
if s:Match(v:lnum, s:ruby_deindent_keywords)
" let lnum = s:PrevNonBlankNonString(v:lnum - 1)
"
" if lnum == 0
" return 0
" endif
"
" return indent(v:lnum) - &sw
call cursor(v:lnum, 1)
if searchpair(s:end_start_regex, s:end_middle_regex, s:end_end_regex, 'bW',
\ s:end_skip_expr) > 0
if strpart(getline('.'), 0, col('.') - 1) =~ '=\s*'
let line = getline('.')
if strpart(line, 0, col('.') - 1) =~ '=\s*$' &&
\ strpart(line, col('.') - 1, 2) !~ 'do'
let ind = virtcol('.') - 1
else
let ind = indent('.')
......@@ -380,5 +375,3 @@ endfunction
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
" Vim indent file
" Language: SML
" Maintainer: Saikat Guha <sg266@cornell.edu>
" Hubert Chao <hc85@cornell.edu>
" Original OCaml Version:
" Jean-Francois Yuen <jfyuen@ifrance.com>
" Mike Leary <leary@nwlink.com>
" Markus Mottl <markus@oefai.at>
" OCaml URL: http://www.oefai.at/~markus/vim/indent/ocaml.vim
" Last Change: 2003 Jan 04 - Adapted to SML
" 2002 Nov 06 - Some fixes (JY)
" 2002 Oct 28 - Fixed bug with indentation of ']' (MM)
" 2002 Oct 22 - Major rewrite (JY)
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
setlocal expandtab
setlocal indentexpr=GetSMLIndent()
setlocal indentkeys+=0=and,0=else,0=end,0=handle,0=if,0=in,0=let,0=then,0=val,0=fun,0=\|,0=*),0)
setlocal nolisp
setlocal nosmartindent
setlocal textwidth=80
setlocal shiftwidth=2
" Comment formatting
if (has("comments"))
set comments=sr:(*,mb:*,ex:*)
set fo=cqort
endif
" Only define the function once.
"if exists("*GetSMLIndent")
"finish
"endif
" Define some patterns:
let s:beflet = '^\s*\(initializer\|method\|try\)\|\(\<\(begin\|do\|else\|in\|then\|try\)\|->\|;\)\s*$'
let s:letpat = '^\s*\(let\|type\|module\|class\|open\|exception\|val\|include\|external\)\>'
let s:letlim = '\(\<\(sig\|struct\)\|;;\)\s*$'
let s:lim = '^\s*\(exception\|external\|include\|let\|module\|open\|type\|val\)\>'
let s:module = '\<\%(let\|sig\|struct\)\>'
let s:obj = '^\s*\(constraint\|inherit\|initializer\|method\|val\)\>\|\<\(object\|object\s*(.*)\)\s*$'
let s:type = '^\s*\%(let\|type\)\>.*='
let s:val = '^\s*\(val\|external\)\>.*:'
" Skipping pattern, for comments
function! s:SkipPattern(lnum, pat)
let def = prevnonblank(a:lnum - 1)
while def > 0 && getline(def) =~ a:pat
let def = prevnonblank(def - 1)
endwhile
return def
endfunction
" Indent for ';;' to match multiple 'let'
function! s:GetInd(lnum, pat, lim)
let llet = search(a:pat, 'bW')
let old = indent(a:lnum)
while llet > 0
let old = indent(llet)
let nb = s:SkipPattern(llet, '^\s*(\*.*\*)\s*$')
if getline(nb) =~ a:lim
return old
endif
let llet = search(a:pat, 'bW')
endwhile
return old
endfunction
" Indent pairs
function! s:FindPair(pstart, pmid, pend)
call search(a:pend, 'bW')
" return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
let lno = searchpair(a:pstart, a:pmid, a:pend, 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
if lno == -1
return indent(lno)
else
return col(".") - 1
endif
endfunction
function! s:FindLet(pstart, pmid, pend)
call search(a:pend, 'bW')
" return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
let lno = searchpair(a:pstart, a:pmid, a:pend, 'bW', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"')
let moduleLine = getline(lno)
if lno == -1 || moduleLine =~ '^\s*\(fun\|structure\|signature\)\>'
return indent(lno)
else
return col(".") - 1
endif
endfunction
" Indent 'let'
"function! s:FindLet(pstart, pmid, pend)
" call search(a:pend, 'bW')
" return indent(searchpair(a:pstart, a:pmid, a:pend, 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment" || getline(".") =~ "^\\s*let\\>.*=.*\\<in\\s*$" || getline(prevnonblank(".") - 1) =~ "^\\s*let\\>.*=\\s*$\\|" . s:beflet'))
"endfunction
function! GetSMLIndent()
" Find a non-blank line above the current line.
let lnum = prevnonblank(v:lnum - 1)
" At the start of the file use zero indent.
if lnum == 0
return 0
endif
let ind = indent(lnum)
let lline = getline(lnum)
" Return double 'shiftwidth' after lines matching:
if lline =~ '^\s*|.*=>\s*$'
return ind + &sw + &sw
elseif lline =~ '^\s*val\>.*=\s*$'
return ind + &sw
endif
let line = getline(v:lnum)
" Indent lines starting with 'end' to matching module
if line =~ '^\s*end\>'
return s:FindLet(s:module, '', '\<end\>')
" Match 'else' with 'if'
elseif line =~ '^\s*else\>'
if lline !~ '^\s*\(if\|else\|then\)\>'
return s:FindPair('\<if\>', '', '\<then\>')
else return ind
endif
" Match 'then' with 'if'
elseif line =~ '^\s*then\>'
if lline !~ '^\s*\(if\|else\|then\)\>'
return s:FindPair('\<if\>', '', '\<then\>')
else return ind
endif
" Indent if current line begins with ']'
elseif line =~ '^\s*\]'
return s:FindPair('\[','','\]')
" Indent current line starting with 'in' to last matching 'let'
elseif line =~ '^\s*in\>'
let ind = s:FindLet('\<let\>','','\<in\>')
" Indent from last matching module if line matches:
elseif line =~ '^\s*\(fun\|val\|open\|structure\|and\|datatype\|type\|exception\)\>'
cursor(lnum,1)
let lastModule = indent(searchpair(s:module, '', '\<end\>', 'bWn', 'synIDattr(synID(line("."), col("."), 0), "name") =~? "string\\|comment"'))
if lastModule == -1
return 0
else
return lastModule + &sw
endif
" Indent lines starting with '|' from matching 'case', 'handle'
elseif line =~ '^\s*|'
" cursor(lnum,1)
let lastSwitch = search('\<\(case\|handle\|fun\|datatype\)\>','bW')
let switchLine = getline(lastSwitch)
let switchLineIndent = indent(lastSwitch)
if lline =~ '^\s*|'
return ind
endif
if switchLine =~ '\<case\>'
return col(".") + 2
elseif switchLine =~ '\<handle\>'
return switchLineIndent + &sw
elseif switchLine =~ '\<datatype\>'
call search('=')
return col(".") - 1
else
return switchLineIndent + 2
endif
" Indent if last line ends with 'sig', 'struct', 'let', 'then', 'else',
" 'in'
elseif lline =~ '\<\(sig\|struct\|let\|in\|then\|else\)\s*$'
let ind = ind + &sw
" Indent if last line ends with 'of', align from 'case'
elseif lline =~ '\<\(of\)\s*$'
call search('\<case\>',"bW")
let ind = col(".")+4
" Indent if current line starts with 'of'
elseif line =~ '^\s*of\>'
call search('\<case\>',"bW")
let ind = col(".")+1
" Indent if last line starts with 'fun', 'case', 'fn'
elseif lline =~ '^\s*\(fun\|fn\|case\)\>'
let ind = ind + &sw
endif
" Don't indent 'let' if last line started with 'fun', 'fn'
if line =~ '^\s*let\>'
if lline =~ '^\s*\(fun\|fn\)'
let ind = ind - &sw
endif
endif
return ind
endfunction
" vim:sw=2
" netrw.vim: Handles file transfer and remote directory listing across a network
" PLUGIN PORTION
" Date: Sep 08, 2005
" Last Change: Aug 29, 2005
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Version: 66
" License: Vim License (see vim's :help license)
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
......@@ -20,6 +21,17 @@
" ---------------------------------------------------------------------
" Load Once: {{{1
if exists("g:loaded_netrw") || &cp
finish
endif
if v:version < 600
echoerr "***netrw*** doesn't support Vim version ".v:version
finish
endif
let g:loaded_netrw = "v66"
if v:version < 700
let loaded_explorer = 1
endif
let s:keepcpo= &cpo
set cpo&vim
......@@ -126,7 +138,7 @@ endfun
" example and as a fix for a Windows 95 problem: in my
" experience, win95's ftp always dumped four blank lines
" at the end of the transfer.
if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
if has("win95") && g:netrw_win95ftp
fun! NetReadFixup(method, line1, line2)
" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
if method == 3 " ftp (no <.netrc>)
......
" NetrwSettings.vim: makes netrw settings simpler
" Date: Aug 16, 2005
" Last Change: Aug 16, 2005
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Version: 3
" Version: 3
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment