1
0
forked from aniani/vim

Add the conceal patch from Vince Negri.

This commit is contained in:
Bram Moolenaar
2010-06-05 23:22:07 +02:00
parent 945e2dbb63
commit 860cae1cec
40 changed files with 1737 additions and 698 deletions

View File

@@ -1163,6 +1163,13 @@ b:changedtick The total number of changes to the current buffer. It is
A variable name that is preceded with "w:" is local to the current window. It
is deleted when the window is closed.
One local window variable is predefined:
*w:ownsyntax-variable* *ownsyntax*
w:ownsyntax Set to 1 if the window has an independent syntax installed
via the |:ownsyntax| command. The default for a window is
0. Syntax scripts can use this to determine whether they
should set b:current_syntax or w:current_syntax.
*tabpage-variable* *t:var*
A variable name that is preceded with "t:" is local to the current tab page,
It is deleted when the tab page is closed. {not available when compiled
@@ -5772,7 +5779,7 @@ undofile({name}) *undofile()*
Return the name of the undo file that would be used for a file
with name {name} when writing. This uses the 'undodir'
option, finding directories that exist. It does not check if
the undo file exist.
the undo file exists.
{name} is always expanded to the full path, since that is what
is used internally.
Useful in combination with |:wundo| and |:rundo|.

View File

@@ -1707,6 +1707,25 @@ A jump table for the options with a short description can be found at |Q_op|.
combination with "menu" or "menuone".
'conceallevel' 'conc' *'conceallevel'* *'conc'*
number (default 0)
local to window
{not in Vi}
{not available when compiled without the |+conceal|
feature}
Determine how text with the "conceal" syntax attribute is shown:
'conceallevel' Effect
0 Text is shown normally
1 Each block of concealed text is replaced with the
character defined in 'listchars' (default is a dash)
and highlighted with the "Conceal" highlight group.
2 Concealed text is completely hidden unless it has a
custom replacement character defined (see
|:syn-cchar|.
3 Concealed text is completely hidden.
*'confirm'* *'cf'* *'noconfirm'* *'nocf'*
'confirm' 'cf' boolean (default off)
global
@@ -2132,6 +2151,20 @@ A jump table for the options with a short description can be found at |Q_op|.
Give messages when adding a cscope database. See |cscopeverbose|.
NOTE: This option is reset when 'compatible' is set.
*'cursorbind'* *'crb'* *'nocursorbind'* *'nocrb'*
'cursorbind' 'crb' boolean (default off)
local to window
{not in Vi}
{not available when compiled without the |+cursorbind|
feature}
When this option is set, as the cursor in the current
window moves other cursorbound windows (windows that also have
this option set) move their cursors to the corresponding line and
column. This option is useful for viewing the
differences between two versions of a file (see 'diff'); in diff mode,
inserted and deleted lines (though not characters within a line) are
taken into account.
*'cursorcolumn'* *'cuc'* *'nocursorcolumn'* *'nocuc'*
'cursorcolumn' 'cuc' boolean (default off)
@@ -3615,7 +3648,7 @@ A jump table for the options with a short description can be found at |Q_op|.
f:Folded,F:FoldColumn,A:DiffAdd,
C:DiffChange,D:DiffDelete,T:DiffText,
>:SignColumn,B:SpellBad,P:SpellCap,
R:SpellRare,L:SpellLocal,
R:SpellRare,L:SpellLocal,-:Conceal,
+:Pmenu,=:PmenuSel,
x:PmenuSbar,X:PmenuThumb")
global
@@ -3659,6 +3692,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|hl-SpellCap| P word that should start with capital|spell|
|hl-SpellRare| R rare word |spell|
|hl-SpellLocal| L word from other region |spell|
|hl-Conceal| - the placeholders used for concealed characters
(see 'conceallevel')
|hl-Pmenu| + popup menu normal line
|hl-PmenuSel| = popup menu normal line
|hl-PmenuSbar| x popup menu scrollbar
@@ -4416,6 +4451,8 @@ A jump table for the options with a short description can be found at |Q_op|.
precedes:c Character to show in the first column, when 'wrap'
is off and there is text preceding the character
visible in the first column.
conceal:c Character to show in place of concealed text, when
'conceallevel' is set to 1.
nbsp:c Character to show for a non-breakable space (character
0xA0, 160). Left blank when omitted.

View File

@@ -35,7 +35,8 @@ In the User Manual:
13. Linking groups |:highlight-link|
14. Cleaning up |:syn-clear|
15. Highlighting tags |tag-highlight|
16. Color xterms |xterm-color|
16. Window-local syntax |:ownsyntax|
17. Color xterms |xterm-color|
{Vi does not have any of these commands}
@@ -3115,12 +3116,14 @@ and may be mixed with patterns.
Not all commands accept all arguments. This table shows which arguments
can not be used for all commands:
*E395* *E396*
contains oneline fold display extend ~
:syntax keyword - - - - -
:syntax match yes - yes yes yes
:syntax region yes yes yes yes yes
contains oneline fold display extend concealends~
:syntax keyword - - - - - -
:syntax match yes - yes yes yes -
:syntax region yes yes yes yes yes yes
These arguments can be used for all three commands:
conceal
cchar
contained
containedin
nextgroup
@@ -3129,6 +3132,27 @@ These arguments can be used for all three commands:
skipnl
skipempty
conceal *conceal* *:syn-conceal*
When the "conceal" argument is given, the item is marked as concealable.
Whether or not it is actually concealed depends on the setting on the
'conceallevel' option.
concealends *:syn-concealends*
When the "concealends" argument is given, the start and end matches of
the region, but not the contents of the region, are marked as concealable.
Whether or not they are actually concealed depends on the setting on the
'conceallevel' option. The ends of a region can only be concealed separately
in this way when they have their own highlighting via "matchgroup"
cchar *:syn-cchar*
The "cchar" argument defines the character shown in place of the item
when it is concealed (setting "cchar" only makes sense when the conceal
argument is given.) If "cchar" is not set then the default conceal
character defined in the 'listchars' option is used. Example: >
:syntax match Entity "&" conceal cchar=&
contained *:syn-contained*
@@ -3385,6 +3409,16 @@ Note that this example doesn't work for nested "if"s. You need to add
"contains" arguments to make that work (omitted for simplicity of the
example).
IMPLICIT CONCEAL *:syn-conceal-implicit*
:sy[ntax] conceal [on|off]
This defines if the following ":syntax" commands will define keywords,
matches or regions with the "conceal" flag set. After ":syn conceal
on", all subsequent ":syn keyword", ":syn match" or ":syn region"
defined will have the "conceal" flag set implicitly. ":syn conceal
off" returns to the normal state where the "conceal" flag must be
given explicitly.
==============================================================================
7. Syntax patterns *:syn-pattern* *E401* *E402*
@@ -4169,6 +4203,9 @@ These are the default highlighting groups. These groups are used by the
'highlight' option default. Note that the highlighting depends on the value
of 'background'. You can see the current settings with the ":highlight"
command.
*hl-Conceal*
Conceal placeholder characters substituted for concealed
text (see 'conceallevel')
*hl-Cursor*
Cursor the character under the cursor
*hl-CursorIM*
@@ -4471,6 +4508,28 @@ And put these lines in your .vimrc: >
autocmd BufRead,BufNewFile *.[ch] exe 'so ' . fname
autocmd BufRead,BufNewFile *.[ch] endif
==============================================================================
16. Window-local syntax *:ownsyntax*
Normally all windows on a buffer share the same syntax settings. It is
possible, however, to set a particular window on a file to have its own
private syntax setting. A possible example would be to edit LaTeX source
with conventional highlighting in one window, while seeing the same source
highlighted differently (so as to hide control sequences and indicate bold,
italic etc regions) in another. The 'scrollbind' option is useful here.
To set the current window to have the syntax "foo", separately from all other
windows on the buffer: >
:ownsyntax foo
Once a window has its own syntax, syntax commands executed from other windows
on the same buffer (including :syntax clear) have no effect. Conversely,
syntax commands executed from that window do not effect other windows on the
same buffer.
A window with its own syntax reverts to normal behaviour when another buffer
is loaded into that window.
==============================================================================
16. Color xterms *xterm-color* *color-xterm*

View File

@@ -134,6 +134,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'complete' options.txt /*'complete'*
'completefunc' options.txt /*'completefunc'*
'completeopt' options.txt /*'completeopt'*
'conc' options.txt /*'conc'*
'conceallevel' options.txt /*'conceallevel'*
'confirm' options.txt /*'confirm'*
'consk' options.txt /*'consk'*
'conskey' options.txt /*'conskey'*
@@ -143,6 +145,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'cpo' options.txt /*'cpo'*
'cpoptions' options.txt /*'cpoptions'*
'cpt' options.txt /*'cpt'*
'crb' options.txt /*'crb'*
'cryptmethod' options.txt /*'cryptmethod'*
'cscopepathcomp' options.txt /*'cscopepathcomp'*
'cscopeprg' options.txt /*'cscopeprg'*
@@ -158,6 +161,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'csverb' options.txt /*'csverb'*
'cuc' options.txt /*'cuc'*
'cul' options.txt /*'cul'*
'cursorbind' options.txt /*'cursorbind'*
'cursorcolumn' options.txt /*'cursorcolumn'*
'cursorline' options.txt /*'cursorline'*
'cwh' options.txt /*'cwh'*
@@ -482,12 +486,14 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'noconskey' options.txt /*'noconskey'*
'nocopyindent' options.txt /*'nocopyindent'*
'nocp' options.txt /*'nocp'*
'nocrb' options.txt /*'nocrb'*
'nocscopetag' options.txt /*'nocscopetag'*
'nocscopeverbose' options.txt /*'nocscopeverbose'*
'nocst' options.txt /*'nocst'*
'nocsverb' options.txt /*'nocsverb'*
'nocuc' options.txt /*'nocuc'*
'nocul' options.txt /*'nocul'*
'nocursorbind' options.txt /*'nocursorbind'*
'nocursorcolumn' options.txt /*'nocursorcolumn'*
'nocursorline' options.txt /*'nocursorline'*
'nodeco' options.txt /*'nodeco'*
@@ -1120,8 +1126,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
+cmdline_hist various.txt /*+cmdline_hist*
+cmdline_info various.txt /*+cmdline_info*
+comments various.txt /*+comments*
+conceal various.txt /*+conceal*
+cryptv various.txt /*+cryptv*
+cscope various.txt /*+cscope*
+cursorbind various.txt /*+cursorbind*
+cursorshape various.txt /*+cursorshape*
+debug various.txt /*+debug*
+dialog_con various.txt /*+dialog_con*
@@ -2495,6 +2503,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:ounmap map.txt /*:ounmap*
:ounme gui.txt /*:ounme*
:ounmenu gui.txt /*:ounmenu*
:ownsyntax syntax.txt /*:ownsyntax*
:p various.txt /*:p*
:pc windows.txt /*:pc*
:pclose windows.txt /*:pclose*
@@ -2761,8 +2770,12 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:syn syntax.txt /*:syn*
:syn-arguments syntax.txt /*:syn-arguments*
:syn-case syntax.txt /*:syn-case*
:syn-cchar syntax.txt /*:syn-cchar*
:syn-clear syntax.txt /*:syn-clear*
:syn-cluster syntax.txt /*:syn-cluster*
:syn-conceal syntax.txt /*:syn-conceal*
:syn-conceal-implicit syntax.txt /*:syn-conceal-implicit*
:syn-concealends syntax.txt /*:syn-concealends*
:syn-contained syntax.txt /*:syn-contained*
:syn-containedin syntax.txt /*:syn-containedin*
:syn-contains syntax.txt /*:syn-contains*
@@ -4956,6 +4969,7 @@ complete_check() eval.txt /*complete_check()*
complex-change change.txt /*complex-change*
complex-repeat repeat.txt /*complex-repeat*
compress pi_gzip.txt /*compress*
conceal syntax.txt /*conceal*
confirm() eval.txt /*confirm()*
connection-refused message.txt /*connection-refused*
console-menus gui.txt /*console-menus*
@@ -6019,6 +6033,7 @@ hit-enter-prompt message.txt /*hit-enter-prompt*
hit-return message.txt /*hit-return*
hitest.vim syntax.txt /*hitest.vim*
hjkl usr_02.txt /*hjkl*
hl-Conceal syntax.txt /*hl-Conceal*
hl-Cursor syntax.txt /*hl-Cursor*
hl-CursorColumn syntax.txt /*hl-CursorColumn*
hl-CursorIM syntax.txt /*hl-CursorIM*
@@ -6895,6 +6910,7 @@ os_unix.txt os_unix.txt /*os_unix.txt*
os_vms.txt os_vms.txt /*os_vms.txt*
os_win32.txt os_win32.txt /*os_win32.txt*
other-features vi_diff.txt /*other-features*
ownsyntax eval.txt /*ownsyntax*
p change.txt /*p*
page-down intro.txt /*page-down*
page-up intro.txt /*page-up*
@@ -8200,6 +8216,7 @@ vt100-cursor-keys term.txt /*vt100-cursor-keys*
vt100-function-keys term.txt /*vt100-function-keys*
w motion.txt /*w*
w32-clientserver remote.txt /*w32-clientserver*
w:ownsyntax-variable eval.txt /*w:ownsyntax-variable*
w:var eval.txt /*w:var*
warningmsg-variable eval.txt /*warningmsg-variable*
white-space pattern.txt /*white-space*

View File

@@ -1082,6 +1082,10 @@ restored. (Luc St-Louis)
Vim 7.3:
- Included conceal patch.
remove w:ownsyntax, automatically set w:current_syntax to the value of
b:current_syntax after loading a syntax file.
:ownsyntax only sets w:current_syntax.
- using NSIS 2.46: install on Windows 7 works, but no "Edit with Vim" menu.
Use register_shell_extension()? (George Reilly, 2010 May 26)
Ron's version: http://dev.ronware.org/p/vim/finfo?name=gvim.nsi
@@ -1108,10 +1112,6 @@ Vim 7.3:
- Create a helphelp.txt file, move instructions there to write help files from
various.txt and list by Tony.
Patches to include:
- Include conceal patch?
http://vince.negri.googlepages.com/
http://vim.wikia.com/wiki/Patch_to_conceal_parts_of_lines
http://sites.google.com/site/vincenegri/conceal-ownsyntax.diff?attredirects=0
- Patch for Lisp support with ECL (Mikael Jansson, 2008 Oct 25)
- Minor patches from Dominique Pelle, 2010 May 15
- Gvimext patch to support wide file names. (Szabolcs Horvat 2008 Sep 10)

View File

@@ -293,8 +293,10 @@ N *+cmdline_compl* command line completion |cmdline-completion|
N *+cmdline_hist* command line history |cmdline-history|
N *+cmdline_info* |'showcmd'| and |'ruler'|
N *+comments* |'comments'| support
m *+conceal* "conceal" support, see ||conceal|| |:syn-conceal| etc.
N *+cryptv* encryption support |encryption|
B *+cscope* |cscope| support
m *+cursorbind* |'cursorbind'| support
m *+cursorshape* |termcap-cursor-shape| support
m *+debug* Compiled for debugging.
N *+dialog_gui* Support for |:confirm| with GUI dialog.

View File

@@ -373,6 +373,11 @@ if has("linebreak")
call append("$", "\t(local to window)")
call <SID>OptionL("nuw")
endif
if has("conceal")
call append("$", "conceallevel\tcontrols whether concealable elements are hidden")
call append("$", "\t(local to window)")
call <SID>OptionL("conc")
endif
call <SID>Header("syntax, highlighting and spelling")