From 48339a69cccce88750d845dde59f2f6cee16119d Mon Sep 17 00:00:00 2001 From: gryf Date: Sun, 16 Jan 2011 21:14:28 +0100 Subject: [PATCH] Mark plugin update, changed order for setting terminal options (turning on 256 colors) --- .vimrc | 4 ++-- GetLatest/GetLatestVimScripts.dat | 2 +- autoload/mark.vim | 20 +++++++++++++------ doc/mark.txt | 32 +++++++++++++++++-------------- doc/tags | 10 +++++++++- 5 files changed, 44 insertions(+), 24 deletions(-) diff --git a/.vimrc b/.vimrc index 1b3c872..7c0c869 100644 --- a/.vimrc +++ b/.vimrc @@ -89,14 +89,14 @@ autocmd BufRead *.tmux.conf set filetype=tmux "}}} "TERMINAL: options for terminal emulators {{{ if $TERM == 'rxvt-unicode' || $TERM == 'xterm' - set t_Co=256 "Enable 256 colors support set term=rxvt-unicode256 "Set terminal type + set t_Co=256 "Enable 256 colors support "repair urxvt ctrl+pgup/down behaviour map [5^ map [6^ elseif $TERM == 'screen' || $TERM == 'screen-256color' - set t_Co=256 "Enable 256 colors support set term=screen-256color "Set terminal type + set t_Co=256 "Enable 256 colors support set t_kN=[6;*~ set t_kP=[5;*~ endif diff --git a/GetLatest/GetLatestVimScripts.dat b/GetLatest/GetLatestVimScripts.dat index 481eb6e..0909f93 100644 --- a/GetLatest/GetLatestVimScripts.dat +++ b/GetLatest/GetLatestVimScripts.dat @@ -6,7 +6,7 @@ ScriptID SourceID Filename 1984 13961 fuzzyfinder.vim 311 7645 grep.vim 2727 11120 jsbeautify.vim -2666 13424 Mark +2666 14741 Mark 2262 8944 occur.vim 910 14691 pydoc.vim #2421 9423 pysmell.vim diff --git a/autoload/mark.vim b/autoload/mark.vim index 9ebabb6..cf1e01e 100644 --- a/autoload/mark.vim +++ b/autoload/mark.vim @@ -2,7 +2,7 @@ " Description: Highlight several words in different colors simultaneously. " " Copyright: (C) 2005-2008 by Yuheng Xie -" (C) 2008-2010 by Ingo Karkat +" (C) 2008-2011 by Ingo Karkat " The VIM LICENSE applies to this script; see ':help copyright'. " " Maintainer: Ingo Karkat @@ -10,8 +10,13 @@ " Dependencies: " - SearchSpecial.vim autoload script (optional, for improved search messages). " -" Version: 2.4.0 +" Version: 2.4.1 " Changes: +" 13-Jan-2011, Ingo Karkat +" - FIX: Using a named register for capturing the visual selection on +" {Visual}m and {Visual}r clobbered the unnamed register. Now +" using the unnamed register. +" " 13-Jul-2010, Ingo Karkat " - ENH: The MarkSearch mappings ([*#/?]) add the original cursor " position to the jump list, like the built-in [/?*#nN] commands. This allows @@ -83,10 +88,13 @@ function! mark#MarkCurrentWord() endfunction function! s:GetVisualSelection() - let save_a = @a - silent normal! gv"ay - let res = @a - let @a = save_a + let save_clipboard = &clipboard + set clipboard= " Avoid clobbering the selection and clipboard registers. + let save_reg = @@ + silent normal! gvy + let res = @@ + let @@ = save_reg + let &clipboard = save_clipboard return res endfunction function! mark#GetVisualSelectionAsLiteralPattern() diff --git a/doc/mark.txt b/doc/mark.txt index 86d6ba4..c301ad8 100644 --- a/doc/mark.txt +++ b/doc/mark.txt @@ -4,10 +4,9 @@ (original version by Yuheng Xie) *mark.vim* description |mark-description| -usage |mark-usage| -installation |mark-installation| -configuration |mark-configuration| -integration |mark-integration| +usage |mark-usage| +installation |mark-installation| +configuration |mark-configuration| limitations |mark-limitations| known problems |mark-known-problems| todo |mark-todo| @@ -16,7 +15,7 @@ history |mark-history| ============================================================================== DESCRIPTION *mark-description* -This script adds mappings and a :Mark command to highlight several words in +This plugin adds mappings and a :Mark command to highlight several words in different colors simultaneously, similar to the built-in 'hlsearch' highlighting of search results and the * |star| command. For example, when you are browsing a big program file, you could highlight multiple identifiers in @@ -24,7 +23,7 @@ parallel. This will make it easier to trace the source code. This is a continuation of vimscript #1238 by Yuheng Xie, who apparently doesn't maintain his original version anymore and cannot be reached via the -email address in his profile. This script offers the following advantages over +email address in his profile. This plugin offers the following advantages over the original: - Much faster, all colored words can now be highlighted, no more clashes with syntax highlighting (due to use of matchadd()). @@ -33,7 +32,8 @@ the original: - Like the built-in commands, jumps take an optional [count] to quickly skip over some marks. -RELATED WORKS * +RELATED WORKS * + - MultipleSearch (vimscript #479) can highlight in a single window and in all buffers, but still relies on the :syntax highlighting method, which is slower and less reliable. @@ -44,16 +44,18 @@ RELATED WORKS * ============================================================================== USAGE *mark-usage* -HIGHLIGHTING *mark-highlighting* - +HIGHLIGHTING *mark-highlighting* + *m* *v_m* m Mark or unmark the word under the cursor, similar to the |star| command. {Visual}m Mark or unmark the visual selection. + *r* *v_r* r Manually input a regular expression to highlight. {Visual}r (Based on the visual selection.) In accordance with the built-in |star| command, all these mappings use 'ignorecase', but not 'smartcase'. + *n* n Clear the mark under the cursor / all marks. *:Mark* :Mark {pattern} Mark or unmark {pattern}. @@ -63,7 +65,7 @@ HIGHLIGHTING *mark-highlighting* SEARCHING *mark-searching* - + *star* *#* */* *?* [count]* [count]# [count]* [count]# [count]/ [count]? @@ -130,9 +132,6 @@ this plugin is sourced. To remove the default overriding of * and #, use: > nmap IgnoreMarkSearchNext MarkSearchNext nmap IgnoreMarkSearchPrev MarkSearchPrev < -============================================================================== -INTEGRATION *mark-integration* - ============================================================================== LIMITATIONS *mark-limitations* @@ -165,6 +164,11 @@ http://vim.wikia.com/wiki/Highlight_multiple_words: ============================================================================== HISTORY *mark-history* +2.4.1 13-Jan-2011 +- FIX: Using a named register for capturing the visual selection on + {Visual}m and {Visual}r clobbered the unnamed register. Now + using the unnamed register. + 2.4.0 13-Jul-2010 - ENH: The MarkSearch mappings ([*#/?]) add the original cursor position to the jump list, like the built-in [/?*#nN] commands. This allows @@ -260,7 +264,7 @@ Initial version published by Yuheng Xie on vim.org. ============================================================================== Copyright: (C) 2005-2008 by Yuheng Xie - (C) 2008-2010 by Ingo Karkat + (C) 2008-2011 by Ingo Karkat The VIM LICENSE applies to this script; see|copyright|. Maintainer: Ingo Karkat diff --git a/doc/tags b/doc/tags index f52bf8c..acaf2b3 100644 --- a/doc/tags +++ b/doc/tags @@ -126,6 +126,13 @@ :VimwikiToggleListItem vimwiki.txt /*:VimwikiToggleListItem* :VimwikiUISelect vimwiki.txt /*:VimwikiUISelect* :VimwikiVSplitLink vimwiki.txt /*:VimwikiVSplitLink* +# mark.txt /*#* +/ mark.txt /*\/* +? mark.txt /*?* +m mark.txt /*m* +n mark.txt /*n* +r mark.txt /*r* +star mark.txt /*star* ExtractSnips() snipMate.txt /*ExtractSnips()* ExtractSnipsFile() snipMate.txt /*ExtractSnipsFile()* Filename() snipMate.txt /*Filename()* @@ -404,7 +411,6 @@ mark-highlighting mark.txt /*mark-highlighting* mark-history mark.txt /*mark-history* mark-ideas mark.txt /*mark-ideas* mark-installation mark.txt /*mark-installation* -mark-integration mark.txt /*mark-integration* mark-known-problems mark.txt /*mark-known-problems* mark-limitations mark.txt /*mark-limitations* mark-searching mark.txt /*mark-searching* @@ -840,6 +846,8 @@ surround-replacements surround.txt /*surround-replacements* surround-targets surround.txt /*surround-targets* surround.txt surround.txt /*surround.txt* vS surround.txt /*vS* +v_m mark.txt /*v_m* +v_r mark.txt /*v_r* vcscommand vcscommand.txt /*vcscommand* vcscommand-buffer-management vcscommand.txt /*vcscommand-buffer-management* vcscommand-buffer-variables vcscommand.txt /*vcscommand-buffer-variables*