summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-06-25 18:50:27 +0200
committerBram Moolenaar <Bram@vim.org>2014-06-25 18:50:27 +0200
commit946e27ab65d6f5d25c449a1bf6aedd808149601f (patch)
treec89760ff953e00b9ff6f273fcaee9ba38dce4b70 /runtime
parentb6da44ae82f93d036ffb2ba37a009119688d9971 (diff)
Updated runtime files.
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/htmlcomplete.vim44
-rw-r--r--runtime/doc/digraph.txt9
-rw-r--r--runtime/doc/eval.txt22
-rw-r--r--runtime/doc/options.txt43
-rw-r--r--runtime/doc/quickref.txt4
-rw-r--r--runtime/doc/starting.txt7
-rw-r--r--runtime/doc/tags7
-rw-r--r--runtime/doc/todo.txt57
-rw-r--r--runtime/ftplugin/html.vim44
-rw-r--r--runtime/indent/html.vim58
-rw-r--r--runtime/tutor/tutor.sr.cp1250971
-rw-r--r--runtime/tutor/tutor.sr.utf-8971
-rw-r--r--runtime/tutor/tutor.vim13
13 files changed, 2137 insertions, 113 deletions
diff --git a/runtime/autoload/htmlcomplete.vim b/runtime/autoload/htmlcomplete.vim
index b2f1aeeb90..984ba8b58e 100644
--- a/runtime/autoload/htmlcomplete.vim
+++ b/runtime/autoload/htmlcomplete.vim
@@ -1,7 +1,49 @@
" Vim completion script
" Language: HTML and XHTML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
-" Last Change: 2011 Apr 28
+" Last Change: 2014 Jun 20
+
+" Distinguish between HTML versions.
+" To use with other HTML versions add another "elseif" condition to match
+" proper DOCTYPE.
+function! htmlcomplete#DetectOmniFlavor()
+ if &filetype == 'xhtml'
+ let b:html_omni_flavor = 'xhtml10s'
+ else
+ let b:html_omni_flavor = 'html401t'
+ endif
+ let i = 1
+ let line = ""
+ while i < 10 && i < line("$")
+ let line = getline(i)
+ if line =~ '<!DOCTYPE.*\<DTD '
+ break
+ endif
+ let i += 1
+ endwhile
+ if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above
+ if line =~ ' HTML 3\.2'
+ let b:html_omni_flavor = 'html32'
+ elseif line =~ ' XHTML 1\.1'
+ let b:html_omni_flavor = 'xhtml11'
+ else " two-step detection with strict/frameset/transitional
+ if line =~ ' XHTML 1\.0'
+ let b:html_omni_flavor = 'xhtml10'
+ elseif line =~ ' HTML 4\.01'
+ let b:html_omni_flavor = 'html401'
+ elseif line =~ ' HTML 4.0\>'
+ let b:html_omni_flavor = 'html40'
+ endif
+ if line =~ '\<Transitional\>'
+ let b:html_omni_flavor .= 't'
+ elseif line =~ '\<Frameset\>'
+ let b:html_omni_flavor .= 'f'
+ else
+ let b:html_omni_flavor .= 's'
+ endif
+ endif
+ endif
+endfunction
function! htmlcomplete#CompleteTags(findstart, base)
if a:findstart
diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt
index cb9cd48ef2..2be73da5b9 100644
--- a/runtime/doc/digraph.txt
+++ b/runtime/doc/digraph.txt
@@ -1,4 +1,4 @@
-*digraph.txt* For Vim version 7.4. Last change: 2014 Apr 17
+*digraph.txt* For Vim version 7.4. Last change: 2014 Jun 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -170,6 +170,11 @@ used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
used for the euro sign, while both of them are the character 164, 0xa4. For
compatibility with zsh Eu can also be used for the euro sign.
+ROUBLE
+
+The rouble sign was added in 2014 as 0x20bd. Vim supports the digraphs =R and
+=P for this. Note that R= and P= are other characters.
+
*digraph-table*
char digraph hex dec official name ~
^@ NU 0x00 0 NULL (NUL)
@@ -966,6 +971,8 @@ char digraph hex dec official name ~
₧ Pt 20A7 8359 PESETA SIGN
â‚© W= 20A9 8361 WON SIGN
€ Eu 20AC 8364 EURO SIGN
+₽ =R 20BD 8381 ROUBLE SIGN
+₽ =P 20BD 8381 ROUBLE SIGN
℃ oC 2103 8451 DEGREE CELSIUS
â„… co 2105 8453 CARE OF
℉ oF 2109 8457 DEGREE FAHRENHEIT
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 695ac1f2b8..c61ac07f46 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1,4 +1,4 @@
-*eval.txt* For Vim version 7.4. Last change: 2014 Jun 12
+*eval.txt* For Vim version 7.4. Last change: 2014 Jun 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2609,7 +2609,7 @@ cursor({list})
with two, three or four item:
[{lnum}, {col}, {off}]
[{lnum}, {col}, {off}, {curswant}]
- This is like the return value of |getpos()| or |getcurpos|,
+ This is like the return value of |getpos()| or |getcurpos()|,
but without the first item.
Does not change the jumplist.
@@ -5629,11 +5629,19 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702*
If you want a list to remain unmodified make a copy first: >
:let sortedlist = sort(copy(mylist))
-< Uses the string representation of each item to sort on.
- Numbers sort after Strings, |Lists| after Numbers.
- For sorting text in the current buffer use |:sort|.
+< When {func} is omitted, is empty or zero, then sort() uses the
+ string representation of each item to sort on. Numbers sort
+ after Strings, |Lists| after Numbers. For sorting text in the
+ current buffer use |:sort|.
+
+ When {func} is given and it is is '1' or 'i' then case is
+ ignored.
+
+ When {func} is given and it is 'n' then all items will be
+ sorted numerical (Implementation detail: This uses the
+ strtod() function to parse numbers, Strings, Lists, Dicts and
+ Funcrefs will be considered as being 0).
- When {func} is given and it is one then case is ignored.
When {func} is a |Funcref| or a function name, this function
is called to compare items. The function is invoked with two
items as argument and must return zero if they are equal, 1 or
@@ -6555,7 +6563,7 @@ xor({expr}, {expr}) *xor()*
*feature-list*
-There are three types of features:
+There are four types of features:
1. Features that are only supported when they have been enabled when Vim
was compiled |+feature-list|. Example: >
:if has("cindent")
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 6a2ad89a39..20391406fe 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.4. Last change: 2014 May 28
+*options.txt* For Vim version 7.4. Last change: 2014 Jun 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1200,6 +1200,38 @@ A jump table for the options with a short description can be found at |Q_op|.
break if 'linebreak' is on. Only works for ASCII and also for 8-bit
characters when 'encoding' is an 8-bit encoding.
+ *'breakindent'* *'bri'*
+'breakindent' 'bri' boolean (default off)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+linebreak|
+ feature}
+ Every wrapped line will continue visually indented (same amount of
+ space as the beginning of that line), thus preserving horizontal blocks
+ of text.
+
+ *'breakindentopt'* *'briopt'*
+'breakindentopt' 'briopt' string (default empty)
+ local to window
+ {not in Vi}
+ {not available when compiled without the |+linebreak|
+ feature}
+ Settings for 'breakindent'. It can consist of the following optional
+ items and must be seperated by a comma:
+ min:{n} Minimum text width that will be kept after
+ applying 'breakindent', even if the resulting
+ text should normally be narrower. This prevents
+ text indented almost to the right window border
+ occupying lot of vertical space when broken.
+ shift:{n} After applying 'breakindent', wrapped line
+ beginning will be shift by given number of
+ characters. It permits dynamic French paragraph
+ indentation (negative) or emphasizing the line
+ continuation (positive).
+ sbr Display the 'showbreak' value before applying the
+ additional indent.
+ The default value for min is 20 and shift is 0.
+
*'browsedir'* *'bsdir'*
'browsedir' 'bsdir' string (default: "last")
global
@@ -4575,12 +4607,13 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{not available when compiled without the |+linebreak|
feature}
- If on Vim will wrap long lines at a character in 'breakat' rather
+ If on, Vim will wrap long lines at a character in 'breakat' rather
than at the last character that fits on the screen. Unlike
'wrapmargin' and 'textwidth', this does not insert <EOL>s in the file,
- it only affects the way the file is displayed, not its contents. The
- value of 'showbreak' is used to put in front of wrapped lines.
- This option is not used when the 'wrap' option is off or 'list' is on.
+ it only affects the way the file is displayed, not its contents.
+ If 'breakindent' is set, line is visually indented. Then, the value
+ of 'showbreak' is used to put in front of wrapped lines. This option
+ is not used when the 'wrap' option is off or 'list' is on.
Note that <Tab> characters after an <EOL> are mostly not displayed
with the right amount of white space.
diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt
index 90d3597759..79d87fa915 100644
--- a/runtime/doc/quickref.txt
+++ b/runtime/doc/quickref.txt
@@ -1,4 +1,4 @@
-*quickref.txt* For Vim version 7.4. Last change: 2013 Jun 29
+*quickref.txt* For Vim version 7.4. Last change: 2014 Jun 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -624,6 +624,8 @@ Short explanation of each option: *option-list*
'bioskey' 'biosk' MS-DOS: use bios calls for input characters
'bomb' prepend a Byte Order Mark to the file
'breakat' 'brk' characters that may cause a line break
+'breakindent' 'bri' wrapped line repeats indent
+'breakindentopt' 'briopt' settings for 'breakindent'
'browsedir' 'bsdir' which directory to start browsing in
'bufhidden' 'bh' what to do when buffer is no longer in window
'buflisted' 'bl' whether the buffer shows up in the buffer list
diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index a5de2f0732..14b0bbffa7 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1,4 +1,4 @@
-*starting.txt* For Vim version 7.4. Last change: 2014 Mar 29
+*starting.txt* For Vim version 7.4. Last change: 2014 Jun 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -167,7 +167,10 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
*-+/*
+/{pat} The cursor will be positioned on the first line containing
"pat" in the first file being edited (see |pattern| for the
- available search patterns).
+ available search patterns). The search starts at the cursor
+ position, which can be the first line or the cursor position
+ last used from |viminfo|. To force a search from the first
+ line use "+1 +/pat".
+{command} *-+c* *-c*
-c {command} {command} will be executed after the first file has been
diff --git a/runtime/doc/tags b/runtime/doc/tags
index bda3c6df2e..f063350086 100644
--- a/runtime/doc/tags
+++ b/runtime/doc/tags
@@ -91,6 +91,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'bl' options.txt /*'bl'*
'bomb' options.txt /*'bomb'*
'breakat' options.txt /*'breakat'*
+'breakindent' options.txt /*'breakindent'*
+'breakindentopt' options.txt /*'breakindentopt'*
+'bri' options.txt /*'bri'*
+'briopt' options.txt /*'briopt'*
'brk' options.txt /*'brk'*
'browsedir' options.txt /*'browsedir'*
'bs' options.txt /*'bs'*
@@ -2524,8 +2528,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:noh pattern.txt /*:noh*
:nohlsearch pattern.txt /*:nohlsearch*
:nor map.txt /*:nor*
+:nore map.txt /*:nore*
:norea map.txt /*:norea*
:noreabbrev map.txt /*:noreabbrev*
+:norem map.txt /*:norem*
:noremap map.txt /*:noremap*
:noremap! map.txt /*:noremap!*
:noreme gui.txt /*:noreme*
@@ -6826,6 +6832,7 @@ match() eval.txt /*match()*
match-highlight pattern.txt /*match-highlight*
match-parens tips.txt /*match-parens*
matchadd() eval.txt /*matchadd()*
+matchaddpos() eval.txt /*matchaddpos()*
matcharg() eval.txt /*matcharg()*
matchdelete() eval.txt /*matchdelete()*
matchend() eval.txt /*matchend()*
diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt
index fb203b39f4..d0ddf5b461 100644
--- a/runtime/doc/todo.txt
+++ b/runtime/doc/todo.txt
@@ -1,4 +1,4 @@
-*todo.txt* For Vim version 7.4. Last change: 2014 Jun 12
+*todo.txt* For Vim version 7.4. Last change: 2014 Jun 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -57,27 +57,18 @@ directory exists. (Sergio Gallelli, 2013 Dec 29)
Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
-Setting 'ttymouse' empty causes Dec mouse to be detected. (Elijah Griffin,
-2014 May 13)
-
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
Value returned by virtcol() changes depending on how lines wrap. This is
inconsistant with the documentation.
-Serbian translation of the vimtutor. (Ivan Nejgebauer, 2014 Jun 2)
-
-Patch to add matchaddpos(), match using a position instead of a pattern.
-To be used for matchparen. (Alexey Radkov, 2014 Jun 1)
-Waiting for tests. Some on Jun 2.
-
MS-Windows: Crash opening very long file name starting with "\\".
(Christian Brock, 2012 Jun 29)
Syntax highlighting slow (hangs) in SASS file. (Niek Bosch, 2013 Aug 21)
Patch to translate 0xce in K_NUL 3. (Yasuhiro Matsumoto, 2014 June 6)
-Doesn't work yet.
+Update by Nobuhiro Takasaki, Jun 19.
Adding "~" to 'cdpath' doesn't work for completion? (Davido, 2013 Aug 19)
@@ -87,8 +78,6 @@ Jun 8)
Syntax file for gnuplot. Existing one is very old. (Andrew Rasmussen, 2014
Feb 24)
-Add digraph for Rouble: =P. What's the Unicode?
-
Issue 174: Detect Mason files.
No error for missing endwhile. (ZyX, 2014 Mar 20)
@@ -109,6 +98,10 @@ Update from Ken Takata, 2014 Jan 10. Newer 2014 Apr 3.
Win32: use 64 bit stat() if possible. (Ken Takata, 2014 May 12)
More tests May 14. Update May 29.
+The garbage collector may use too much stack. Make set_ref_in_item()
+iterative instead of recursive. Test program by Marc Weber (2013 Dec 10)
+Patch by Ben Fritz, 2014 Jun 22.
+
Idea: For a window in the middle (has window above and below it), use
right-mouse-drag on the status line to move a window up/down without changing
it's height? It's like dragging the status bar above it at the same time.
@@ -121,9 +114,6 @@ This does not give an error: (Andre Sihera, 2014 Mar 21)
This neither: (ZyX)
vim -u NONE 1 2 3 -c 'bufdo while 1 | echo 1'
-Patch for signs in GTK. (Christian Brabandt, 2014 Jun 10)
-Asked about it.
-
'viewdir' default on MS-Windows is not a good choice, it's a system directory.
Change 'viewdir' to "$HOME/vimfiles/view" and use 'viewdiralt' to also read
from?
@@ -133,6 +123,7 @@ Problem with upwards search on Windows (works OK on Linux). (Brett Stahlman,
When 'clipboard' is "unnamed", :g/pat/d is very slow. Only set the clipboard
after the last delete? (Praful, 2014 May 28)
+Patch by Christian Brabandt, 2014 Jun 18.
Include a plugin manager with Vim? Neobundle seems to be the best currently.
Long message about this from ZyX, 2014 Mar 23. And following replies.
@@ -180,6 +171,16 @@ Editing an ascii file as ucs-2 or ucs-4 causes display errors.
":Next 1 some-arg" does not complain about trailing argument. Also for
various other commands. (ZyX, 2014 Mar 30)
+Patch to add sortuniq(). (Cade Forester, 2014 Mar 19)
+Or add uniq() instead? Patch by lcd47, but it has problems.
+
+Patch to support sorting on floating point number. (Alex Jakushev, 2010 Oct
+30)
+
+Patch to support expression argument to sort() instead of a function name.
+Yasuhiro Matsumoto, 2013 May 31.
+Or should we add a more general mechanism, like lambda functions?
+
VMS: Select() doesn't work properly, typing ESC may hang Vim. Use sys$qiow
instead. (Samuel Ferencik, 2013 Sep 28)
@@ -195,9 +196,6 @@ Patch to make test 100 work on MS-Windows. (Taro Muraoka, 2013 Dec 12)
Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14)
-Patch to add sortuniq(). (Cade Forester, 2014 Mar 19)
-Or add uniq() instead? Patch by lcd47, but it has problems.
-
Perl: support for Activestate perl 5.18: Issue 170.
Several syntax file match "^\s*" which may get underlined if that's in the
@@ -300,19 +298,12 @@ Works OK for echo, just not for ":call" and ":call call()". (Ted, 2011 Mar
Patch by Christian Brabandt, 2013 Mar 23.
Not 100% sure this is the right solution.
-Patch to support expression argument to sort() instead of a function name.
-Yasuhiro Matsumoto, 2013 May 31.
-Or should we add a more general mechanism, like lambda functions?
-
Problem caused by patch 7.3.638: window->open does not update window
correctly. Issue 91.
Patch to add {lhs} to :mapclear: clear all maps starting with {lhs}.
(Christian Brabandt, 2013 Dec 9)
-The garbage collector may use too much stack. Make set_ref_in_item()
-iterative instead of recursive. Test program by Marc Weber (2013 Dec 10)
-
Exception caused by argument of return is not caught by try/catch.
(David Barnett, 2013 Nov 19)
@@ -323,17 +314,6 @@ Issue 28.
Patch to fix that 'cedit' is recognized after :normal. (Christian Brabandt,
2013 Mar 19, later message)
-- Patch for 'breakindent' option: repeat indent for wrapped line. (Vaclav
- Smilauer, 2004 Sep 13, fix Oct 31, update 2007 May 30)
- Version for latest MacVim: Tobia Conforto, 2009 Nov 23
- More recent version: https://retracile.net/wiki/VimBreakIndent
- Posted to vim-dev by Taylor Hedberg, 2011 Nov 25
- Update by Taylor Hedberg, 2013 May 30.
- Updated for Vim 7.4 by Ken Takata, 2013 Oct 5.
- Update by Christian Brabandt, 2014 May 9. Remarks by Ken Takata.
- Update by Christian 2014 May 12, github link on May 15
- 2014 May 28: remarks from Bram
-
Patch to view coverage of the tests. (Nazri Ramliy, 2013 Feb 15)
Patch to invert characters differently in GTK. (Yukihiro Nakadaira, 2013 May
@@ -676,9 +656,6 @@ Build problem with small features on Mac OS X 10.6. (Rainer, 2011 Jan 24)
"0g@$" puts '] on last byte of multi-byte. (ZyX, 2011 Jan 22)
-Patch to support sorting on floating point number. (Alex Jakushev, 2010 Oct
-30)
-
Patch to addd TextDeletePost and TextYankPost events. (Philippe Vaucher, 2011
May 24) Update May 26.
diff --git a/runtime/ftplugin/html.vim b/runtime/ftplugin/html.vim
index 418da06a67..7579080ea5 100644
--- a/runtime/ftplugin/html.vim
+++ b/runtime/ftplugin/html.vim
@@ -20,49 +20,9 @@ if exists("g:ft_html_autocomment") && (g:ft_html_autocomment == 1)
setlocal formatoptions-=t formatoptions+=croql
endif
-
if exists('&omnifunc')
- " Distinguish between HTML versions
- " To use with other HTML versions add another
- " elseif condition to match proper DOCTYPE
- setlocal omnifunc=htmlcomplete#CompleteTags
-
- if &filetype == 'xhtml'
- let b:html_omni_flavor = 'xhtml10s'
- else
- let b:html_omni_flavor = 'html401t'
- endif
- let i = 1
- let line = ""
- while i < 10 && i < line("$")
- let line = getline(i)
- if line =~ '<!DOCTYPE.*\<DTD '
- break
- endif
- let i += 1
- endwhile
- if line =~ '<!DOCTYPE.*\<DTD ' " doctype line found above
- if line =~ ' HTML 3\.2'
- let b:html_omni_flavor = 'html32'
- elseif line =~ ' XHTML 1\.1'
- let b:html_omni_flavor = 'xhtml11'
- else " two-step detection with strict/frameset/transitional
- if line =~ ' XHTML 1\.0'
- let b:html_omni_flavor = 'xhtml10'
- elseif line =~ ' HTML 4\.01'
- let b:html_omni_flavor = 'html401'
- elseif line =~ ' HTML 4.0\>'
- let b:html_omni_flavor = 'html40'
- endif
- if line =~ '\<Transitional\>'
- let b:html_omni_flavor .= 't'
- elseif line =~ '\<Frameset\>'
- let b:html_omni_flavor .= 'f'
- else
- let b:html_omni_flavor .= 's'
- endif
- endif
- endif
+ setlocal omnifunc=htmlcomplete#CompleteTags
+ call htmlcomplete#DetectOmniFlavor()
endif
" HTML: thanks to Johannes Zellner and Benji Fisher.
diff --git a/runtime/indent/html.vim b/runtime/indent/html.vim
index 601aad89fd..d1f439905a 100644
--- a/runtime/indent/html.vim
+++ b/runtime/indent/html.vim
@@ -2,7 +2,7 @@
" General: "{{{
" File: html.vim (Vimscript #2075)
" Author: Andy Wokula <anwoku@yahoo.de>
-" Last Change: 2013 Jun 12
+" Last Change: 2014 Jun 19
" Rev Days: 13
" Version: 0.9
" Vim Version: Vim7
@@ -30,6 +30,9 @@ let b:did_indent = 1
setlocal indentexpr=HtmlIndent()
setlocal indentkeys=o,O,<Return>,<>>,{,},!^F
+" Needed for % to work when finding start of a tag.
+setlocal matchpairs+=<:>
+
let b:indent = {"lnum": -1}
let b:undo_indent = "set inde< indk<| unlet b:indent"
@@ -72,7 +75,7 @@ func! HtmlIndent_CheckUserSettings() "{{{
endfunc "}}}
" Init Script Vars "{{{
-let s:usestate = 1
+let s:lasttick = 0
let s:css1indent = 0
let s:js1indent = 0
" not to be changed:
@@ -150,7 +153,7 @@ func! s:CountITags(...) "{{{
if a:0==0
let s:block = s:newstate.block
- let tmpline = substitute(s:curline, '<\zs\/\=\w\+\>\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
+ let tmpline = substitute(s:curline, '<\zs/\=\w\+\>\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
if s:block == 3
let s:newstate.scripttype = s:GetScriptType(matchstr(tmpline, '\C.*<SCRIPT\>\zs[^>]*'))
endif
@@ -158,7 +161,7 @@ func! s:CountITags(...) "{{{
else
let s:block = 0 " assume starting outside of a block
let s:countonly = 1 " don't change state
- let tmpline = substitute(s:altline, '<\zs\/\=\w\+\>\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
+ let tmpline = substitute(s:altline, '<\zs/\=\w\+\>\|<!--\|-->', '\=s:CheckTag(submatch(0))', 'g')
let s:countonly = 0
endif
endfunc "}}}
@@ -321,6 +324,7 @@ func! s:FreshState(lnum) "{{{
" else within usual html
let s:altline = tolower(getline(state.lnum))
+
" check a:lnum-1 for closing comment (we need indent from the opening line)
let comcol = stridx(s:altline, '-->')
if comcol >= 0
@@ -337,11 +341,28 @@ func! s:FreshState(lnum) "{{{
" TODO check tags that follow "-->"
endif
+ " Check if the previous line starts with end tag.
+ let swendtag = match(s:altline, '^\s*</') >= 0
+
+ " If previous line ended in a closing tag, line up with the opening tag.
+ " Avoids aligning with continuation lines.
+ " TODO: this assumes the start tag is at the start of a line.
+ if !swendtag && s:altline =~ '</\w\+\s*>\s*$'
+ call cursor(state.lnum, 99999)
+ normal F<h
+ " TODO: doesn't work for nested <br> and the like
+ let slnum = searchpair('<\w\+', '', '</\w', 'bW')
+ if slnum > 0
+ let state.baseindent = indent(slnum)
+ return state
+ endif
+ endif
+
" else no comments
+ let state.lnum = s:FindTagStart(state.lnum)
+ let s:altline = tolower(getline(state.lnum))
call s:CountITags(1)
let state.baseindent = indent(state.lnum) + s:nextrel * s:ShiftWidth()
- " line starts with end tag
- let swendtag = match(s:altline, '^\s*</') >= 0
if !swendtag
let state.baseindent += s:curind * s:ShiftWidth()
endif
@@ -380,6 +401,7 @@ func! s:CSSIndent() "{{{
endif
let minline = b:indent.blocklnr
let pnum = s:css_prevnoncomment(v:lnum - 1, minline)
+ let pnum = s:FindTagStart(pnum)
if pnum <= minline
" < is to catch errors
" indent for first content line after comments
@@ -431,6 +453,19 @@ func! s:Alien5() "{{{
return -1
endfunc "}}}
+" When the "lnum" line ends in ">" find the line containing the
+" matching "<". Avoids using the indent of a continuation line.
+" Moves the cursor.
+" Return the matching line number or "lnum".
+func! s:FindTagStart(lnum) "{{{
+ if getline(a:lnum) =~ '>\s*$'
+ call cursor(a:lnum, 99999)
+ normal! %
+ return line('.')
+ endif
+ return a:lnum
+endfunc "}}}
+
func! HtmlIndent() "{{{
let s:curline = tolower(getline(v:lnum))
let indentunit = s:ShiftWidth()
@@ -441,7 +476,7 @@ func! HtmlIndent() "{{{
" does the line start with a closing tag?
let swendtag = match(s:curline, '^\s*</') >= 0
- if prevnonblank(v:lnum-1) == b:indent.lnum && s:usestate
+ if prevnonblank(v:lnum-1) == b:indent.lnum && s:lasttick == b:changedtick - 1
" use state (continue from previous line)
else
" start over (know nothing)
@@ -465,14 +500,10 @@ func! HtmlIndent() "{{{
let indent = s:Alien{b:indent.block}()
let s:newstate.baseindent = b:indent.blocktagind + s:nextrel * indentunit
endif
- call extend(b:indent, s:newstate, "force")
- return indent
else
" block continues
" indent this line with alien method
let indent = s:Alien{b:indent.block}()
- call extend(b:indent, s:newstate, "force")
- return indent
endif
else
" not within a block - within usual html
@@ -486,9 +517,10 @@ func! HtmlIndent() "{{{
let indent = b:indent.baseindent
let s:newstate.baseindent = indent + (s:curind + s:nextrel) * indentunit
endif
- call extend(b:indent, s:newstate, "force")
- return indent
endif
+ let s:lasttick = b:changedtick
+ call extend(b:indent, s:newstate, "force")
+ return indent
endfunc "}}}
diff --git a/runtime/tutor/tutor.sr.cp1250 b/runtime/tutor/tutor.sr.cp1250
new file mode 100644
index 0000000000..a99aacc34a
--- /dev/null
+++ b/runtime/tutor/tutor.sr.cp1250
@@ -0,0 +1,971 @@
+===============================================================================
+= D o b r o d o š l i u VIM p r i r u è n i k - Verzija 1.7 =
+===============================================================================
+
+ Vim je moæan editor sa mnogo komandi, suviše da bismo ih ovde sve
+ opisali. Priruènik je zamišljen da opiše dovoljno komandi da biste
+ mogli lagodno da koristite Vim kao editor opšte namene.
+
+ Približno vreme potrebno za uspešan završetak priruènika je izmeðu
+ 25 i 30 minuta, u zavisnosti od vremena potrošenog na vežbu.
+
+ UPOZORENJE:
+ Komande u lekcijama æe menjati tekst. Iskopirajte ovaj fajl i
+ vežbajte na kopiji (ako ste pokrenuli "vimtutor" ovo je veæ kopija).
+
+ Važno je upamtiti da je ovaj priruènik zamišljen za aktivnu vežbu.
+ To znaèi da morate upotrebljavati komande o kojima èitate da biste
+ ih nauèili. Ako samo èitate tekst, zaboraviæete komande!
+
+ Ako je Caps Lock ukljuèen ISKLJUÈITE ga. Pritisnite taster j dovoljno
+ puta da lekcija 1.1 cela stane na ekran.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcija 1.1: POMERANJE KURSORA
+
+
+ ** Za pomeranje kursora, pritiskajte tastere h,j,k,l kako je prikazano **
+ ^
+ k Savet: h je s leve strane i pomera kursor u levo.
+ < h l > l je s desne strane i pomera kursor u desno.
+ j j izgleda kao strelica naniže.
+ v
+ 1. Pomerajte kursor po ekranu dok se ne naviknete na komande.
+
+ 2. Pritisnite taster (j) dok ne poène da se ponavlja.
+ Sada znate kako da doðete do naredne lekcije.
+
+ 3. Koristeæi taster j preðite na lekciju 1.2.
+
+NAPOMENA: Ako niste sigurni šta ste zapravo pritisnuli, pritisnite <ESC>
+ za prelazak u Normal mod i pokušajte ponovo.
+
+NAPOMENA: Strelice takoðe pomeraju kursor, ali korišæenje tastera hjkl je
+ znatno brže, kad se jednom naviknete na njih. Zaista!
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcija 1.2: IZLAZAK IZ VIM-a
+
+
+ !! UPOZORENJE: Pre izvoðenja bilo kog koraka, proèitajte celu lekciju!!
+
+ 1. Pritisnite <ESC> (editor je sada u Normal modu).
+
+ 2. Otkucajte: :q! <ENTER>.
+ Ovime se izlazi iz editora, sa GUBITKOM svih izmena.
+
+ 3. Kada se pojavi komandni prompt, unesite komandu koja je pokrenula
+ ovaj priruènik: vimtutor <ENTER>
+
+ 4. Ako ste upamtili ove korake, izvršite ih redom od 1 do 3 da biste
+ izašli iz editora i ponovo ga pokrenuli.
+
+NAPOMENA: :q! <ENTER> poništava sve izmene koje ste napravili.
+ U narednim lekcijama nauèiæete kako da saèuvate izmene.
+
+ 5. Pomerite kursor na lekciju 1.3.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcija 1.3: IZMENA TEKSTA - BRISANJE
+
+
+ ** Pritisnite x za brisanje znaka pod kursorom. **
+
+ 1. Pomerite kursor na red oznaèen sa --->.
+
+ 2. Da biste ispravili greške, pomerajte kursor dok se
+ ne naðe na slovu koje treba izbrisati.
+
+ 3. Pritisnite taster x da izbrišete neželjeno slovo.
+
+ 4. Ponavljajte korake od 2 do 4 dok ne ispravite sve greške.
+
+---> RRRibaa riibi grizzze rrreepp.
+
+ 5. Kad ispravite red, preðite na lekciju 1.4.
+
+NAPOMENA: Dok koristite priruènik, nemojte uèiti komande napamet,
+ veæ vežbajte njihovu primenu.
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcija 1.4: IZMENA TEKSTA - UBACIVANJE
+
+
+ ** Pritisnite i za ubacivanje teksta ispred kursora. **
+
+ 1. Pomerite kursor na prvi sledeæi red oznaèen sa --->.
+
+ 2. Da biste tekst prvog reda izjednaèili s tekstom drugog, namestite
+ kursor na prvi znak POSLE kog æete ubaciti potreban tekst.
+
+ 3. Pritisnite i pa unesite potrebne dopune.
+
+ 4. Po ispravci svake greške pritisnite <ESC> da se vratite u Normal mod.
+ Ponovite korake od 2 do 4 da biste ispravili celu reèenicu.
+
+---> Do teka neoje v red.
+---> Deo teksta nedostaje iz ovog reda.
+
+ 5. Preðite na sledeæu lekciju.
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcija 1.5: IZMENA TEKSTA - DODAVANJE
+
+
+ ** Pritisnite A za dodavanje teksta. **
+
+ 1. Pomerite kursor na prvi sledeæi red oznaèen sa --->.
+ Nije važno gde se nalazi kursor u tom redu.
+
+ 2. Pritisnite A i unesite dodatni tekst.
+
+ 3. Pošto ste dodali tekst, pritisnite <ESC> za povratak u
+ Normal mod.
+
+ 4. Pomerite kursor na drugi red oznaèen sa ---> i ponavljajte
+ korake 2 i 3 dok ne ispravite tekst.
+
+---> Deo teksta nedostaje u
+ Deo teksta nedostaje u ovom redu.
+---> Deo teksta nedostaje
+ Deo teksta nedostaje i ovde.
+
+ 5. Preðite na lekciju 1.6.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcija 1.6: IZMENA FAJLA
+
+
+ ** Upotrebite :wq za snimanje teksta i izlazak iz editora. **
+
+ !! UPOZORENJE: Pre izvoðenja bilo kog koraka, proèitajte celu lekciju!!
+
+ 1. Izaðite iz editora kao u lekciji 1.2: :q!
+
+ 2. Na komandnom promptu unesite sledeæu komandu: vim tutor <ENTER>
+ 'vim' je komanda za pokretanja Vim editora, 'tutor' je ime fajla koji
+ želite da menjate. Koristite fajl koji imate pravo da menjate.
+
+ 3. Ubacujte i brišite tekst kao u prethodnim lekcijama.
+
+ 4. Snimite izmenjeni tekst i izaðite iz Vim-a: :wq <ENTER>
+
+ 5. Ponovo pokrenite vimtutor i proèitajte rezime koji sledi.
+
+ 6. Pošto proèitate korake iznad i u potpunosti ih razumete:
+ izvršite ih.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ REZIME lekcije 1
+
+
+ 1. Kursor se pomera strelicama ili pomoæu tastera hjkl .
+ h (levo) j (dole) k (gore) l (desno)
+
+ 2. Za pokretanje Vim-a iz shell-a: vim IME_FAJLA <ENTER>
+
+ 3. Izlaz: <ESC> :q! <ENTER> sve promene su izgubljene.
+ ILI: <ESC> :wq <ENTER> promene su saèuvane.
+
+ 4. Brisanje znaka na kome se nalazi kursor: x
+
+ 5. Ubacivanja ili dodavanje teksta:
+ i unesite tekst <ESC> unos ispred kursora
+ A unesite tekst <ESC> dodavanje na kraju reda
+
+NAPOMENA: Pritiskom na <ESC> prebacujete Vim u Normal mod i
+ prekidate neželjenu ili delimièno izvršenu komandu.
+
+Nastavite sa lekcijom 2.
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcija 2.1: NAREDBE BRISANJA
+
+
+ ** Otkucajte dw za brisanje reèi. **
+
+ 1. Pritisnite <ESC> da biste bili sigurni da ste u Normal modu.
+
+ 2. Pomerite kursor na red oznaèen sa --->.
+
+ 3. Pomerite kursor na poèetak reèi koju treba izbrisati.
+
+ 4. Otkucajte dw da biste uklonili reè.
+
+NAPOMENA: Slovo d æe se pojaviti na dnu ekrana kad ga otkucate. Vim èeka
+ da otkucate w . Ako je prikazano neko drugo slovo, pogrešili ste u
+ kucanju; pritisnite <ESC> i pokušajte ponovo. (Ako se ne pojavi
+ ništa, možda je iskljuèena opcija 'showcmd': vidi lekciju 6.5.)
+
+---> Neke reèi smešno ne pripadaju na papir ovoj reèenici.
+
+ 5. Ponavljajte korake 3 i 4 dok ne ispravite reèenicu, pa
+ preðite na lekciju 2.2.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcija 2.2: JOŠ BRISANJA
+
+
+ ** Otkucajte d$ za brisanje znakova do kraja reda. **
+
+ 1. Pritisnite <ESC> da biste bili sigurni da ste u Normal modu.
+
+ 2. Pomerite kursor na red oznaèen sa --->.
+
+ 3. Pomerite kursor do kraja ispravnog dela reèenice
+ (POSLE prve . ).
+
+ 4. Otkucajte d$ za brisanje ostatka reda.
+
+---> Neko je uneo kraj ovog reda dvaput. kraj ovog reda dvaput.
+
+ 5. Preðite na lekciju 2.3 za podrobnije objašnjenje.
+
+
+
+
+
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Lekcija 2.3: O OPERATORIMA I POKRETIMA
+
+
+ Mnoge komande za izmenu teksta sastoje se od operatora i pokreta.
+ Oblik komande brisanja sa d operatorom je sledeæi:
+