GetLatestVimScripts
git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@153 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
This commit is contained in:
parent
a89ce114bc
commit
647bd57e00
@ -1,12 +1,12 @@
|
||||
ScriptID SourceID Filename
|
||||
--------------------------
|
||||
1075 8042 netrw.vim
|
||||
1075 8351 netrw.vim
|
||||
1502 7078 vimball.vim
|
||||
1008 3118 srec.vim (ftplugin)
|
||||
1009 3119 srec.vim (syntax file)
|
||||
475 2535 latex-suite (install in vimfiles.latex)
|
||||
614 3666 C-Referenz
|
||||
670 6208 visincr.vim (Visual Increment)
|
||||
670 8073 visincr.vim (Visual Increment)
|
||||
862 2635 cscope_quickfix.vim
|
||||
51 171 cscope_macros.vim
|
||||
102 5306 DirDiff.vim
|
||||
@ -18,13 +18,15 @@ ScriptID SourceID Filename
|
||||
987 6978 DoxygenToolkit.vim
|
||||
1397 6887 xml.vim
|
||||
1290 5190 LogiPat.vim
|
||||
1881 7505 svndiff
|
||||
1881 8355 svndiff
|
||||
1462 5612 dtd2xml
|
||||
1046 4249 Lusty Explorer
|
||||
2043 7805 VimPdb (debugging python)
|
||||
1776 7902 Vimgrep Replace
|
||||
2048 7817 BlockDiff
|
||||
39 7637 matchit.vim
|
||||
2092 8041 reloaded.vim (matrix colorscheme)
|
||||
642 7080 getscript.vim
|
||||
642 7080 :AutoInstall: GetLatestVimScripts.vim
|
||||
39 8196 matchit.vim
|
||||
2092 8095 reloaded.vim (matrix colorscheme)
|
||||
848 8203 SrchRplcHiGrp.vim (Search/Replace on Syntax Group)
|
||||
294 8407 Align.vim
|
||||
642 8136 getscript.vim
|
||||
642 8136 :AutoInstall: GetLatestVimScripts.vim
|
||||
|
1007
vimfiles/autoload/Align.vim
Normal file
1007
vimfiles/autoload/Align.vim
Normal file
File diff suppressed because it is too large
Load Diff
147
vimfiles/autoload/calutil.vim
Normal file
147
vimfiles/autoload/calutil.vim
Normal file
@ -0,0 +1,147 @@
|
||||
" calutil.vim: some calendar utilities
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Oct 19, 2007
|
||||
" Version: 3a ASTRO-ONLY
|
||||
" ---------------------------------------------------------------------
|
||||
if exists("loaded_calutil")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_calutil= "v3a"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" DayOfWeek: {{{1
|
||||
" Usage : call calutil#DayOfWeek(y,m,d,[0|1|2])
|
||||
" g:CalUtilDayOfWeek: if 0-> integer (default)
|
||||
" 1-> 3-letter English abbreviation for name of day
|
||||
" 2-> English name of day
|
||||
" Returns
|
||||
" g:CalUtilDayOfWeek
|
||||
" ---------
|
||||
" 1 : 0 1 2 3 4 5 6
|
||||
" 2 : Mon Tue Wed Thu Fri Sat Sun
|
||||
" 3 : Monday Tuesday Wednesday Thursday Friday Saturday Sunday
|
||||
fun! calutil#DayOfWeek(y,m,d,...)
|
||||
if a:0 > 0
|
||||
let g:CalUtilDayOfWeek= a:1
|
||||
endif
|
||||
|
||||
let z= Cal2Jul(a:y,a:m,a:d)
|
||||
if z >= 0
|
||||
let z= z%7
|
||||
else
|
||||
let z= 7 - (-z%7)
|
||||
endif
|
||||
|
||||
if exists("g:CalUtilDayOfWeek")
|
||||
if g:CalUtilDayOfWeek == 2
|
||||
let dow0="Mon"
|
||||
let dow1="Tue"
|
||||
let dow2="Wed"
|
||||
let dow3="Thu"
|
||||
let dow4="Fri"
|
||||
let dow5="Sat"
|
||||
let dow6="Sun"
|
||||
return dow{z}
|
||||
elseif g:CalUtilDayOfWeek == 3
|
||||
let dow0="Monday"
|
||||
let dow1="Tuesday"
|
||||
let dow2="Wednesday"
|
||||
let dow3="Thursday"
|
||||
let dow4="Friday"
|
||||
let dow5="Saturday"
|
||||
let dow6="Sunday"
|
||||
return dow{z}
|
||||
endif
|
||||
endif
|
||||
return z
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" calutil#Cal2Jul: convert a (after 9/14/1752) Gregorian calendar date to Julian day {{{1
|
||||
" (on,before " ) Julian calendar date to Julian day
|
||||
" (proleptic)
|
||||
fun! calutil#Cal2Jul(y,m,d)
|
||||
let year = a:y
|
||||
let month= a:m
|
||||
let day = a:d
|
||||
|
||||
" there is no year zero
|
||||
if year == 0
|
||||
let year= -1
|
||||
elseif year < 0
|
||||
let year= year + 1
|
||||
endif
|
||||
|
||||
let julday= day - 32075 +
|
||||
\ 1461*(year + 4800 + (month - 14)/12)/4 +
|
||||
\ 367*(month - 2 - ((month - 14)/12)*12)/12 -
|
||||
\ 3*((year + 4900 + (month - 14)/12)/100)/4
|
||||
|
||||
" 2361221 == Sep 2, 1752, which was followed immediately by
|
||||
" Sep 14, 1752 (in England). Various countries
|
||||
" adopted the Gregorian calendar at different times.
|
||||
if julday <= 2361221
|
||||
let a = (14-month)/12
|
||||
let y = year + 4800 - a
|
||||
let m = month + 12*a - 3
|
||||
let julday = day + (153*m + 2)/5 + y*365 + y/4 - 32083
|
||||
endif
|
||||
return julday
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" calutil#Jul2Cal: convert a Julian day to a date: {{{1
|
||||
" Default year/month/day
|
||||
" julday,1 julday,"ymd" year/month/day
|
||||
" julday,2 julday,"mdy" month/day/year
|
||||
" julday,3 julday,"dmy" day/month/year
|
||||
fun! calutil#Jul2Cal(julday,...)
|
||||
let julday= a:julday
|
||||
|
||||
if julday <= 2361221
|
||||
" Proleptic Julian Calendar:
|
||||
" 2361210 == Sep 2, 1752, which was followed immediately by Sep 14, 1752
|
||||
" in England
|
||||
let c = julday + 32082
|
||||
let d = (4*c + 3)/1461
|
||||
let e = c - (1461*d)/4
|
||||
let m = (5*e + 2)/153
|
||||
let day = e - (153*m + 2)/5 + 1
|
||||
let month = m + 3 - 12*(m/10)
|
||||
let year = d - 4800 + m/10
|
||||
if year <= 0
|
||||
" proleptic Julian Calendar: there *is* no year 0!
|
||||
let year= year - 1
|
||||
endif
|
||||
|
||||
else
|
||||
" Gregorian calendar
|
||||
let t1 = julday + 68569
|
||||
let t2 = 4*t1/146097
|
||||
let t1 = t1 - (146097*t2 + 3)/4
|
||||
let yr = 4000*(t1 + 1)/1461001
|
||||
let t1 = t1 - (1461*yr/4 - 31)
|
||||
let mo = 80*t1/2447
|
||||
let day = (t1 - 2447*mo/80)
|
||||
let t1 = mo/11
|
||||
let month = (mo + 2 - 12*t1)
|
||||
let year = (100*(t2 - 49) + yr + t1)
|
||||
endif
|
||||
|
||||
if a:0 > 0
|
||||
if a:1 == 1 || a:1 =~ "ymd"
|
||||
return year."/".month."/".day
|
||||
elseif a:1 == 2 || a:1 =~ "mdy"
|
||||
return month."/".day."/".year
|
||||
elseif a:1 == 3 || a:1 =~ "dmy"
|
||||
return day."/".month."/".year
|
||||
else
|
||||
return year."/".month."/".day
|
||||
endif
|
||||
else
|
||||
return year."/".month."/".day
|
||||
endif
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" vim: ts=4 fdm=marker
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -126,6 +126,7 @@ fun! netrwSettings#NetrwSettings()
|
||||
put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd
|
||||
put = 'let g:netrw_preview = '.g:netrw_preview
|
||||
put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd
|
||||
put = 'let g:netrw_retmap = '.g:netrw_retmap
|
||||
put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd
|
||||
put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd
|
||||
put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd
|
||||
@ -133,6 +134,7 @@ fun! netrwSettings#NetrwSettings()
|
||||
put = 'let g:netrw_sort_by = '.g:netrw_sort_by
|
||||
put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
|
||||
put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
|
||||
put = 'let g:netrw_special_syntax = '.g:netrw_special_syntax
|
||||
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
|
||||
put = 'let g:netrw_scpport = '.g:netrw_scpport
|
||||
put = 'let g:netrw_sshport = '.g:netrw_sshport
|
||||
|
@ -1,7 +1,7 @@
|
||||
" visincr.vim: Visual-block incremented lists
|
||||
" Author: Charles E. Campbell, Jr. Ph.D.
|
||||
" Date: Sep 19, 2006
|
||||
" Version: 17
|
||||
" Date: Dec 19, 2007
|
||||
" Version: 19
|
||||
"
|
||||
" Visincr assumes that a block of numbers selected by a
|
||||
" ctrl-v (visual block) has been selected for incrementing.
|
||||
@ -26,32 +26,43 @@ if &cp || exists("g:loaded_visincr")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo = &cpo
|
||||
let g:loaded_visincr = "v17"
|
||||
let g:loaded_visincr = "v19"
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Methods: {{{1
|
||||
let s:I = 0
|
||||
let s:II = 1
|
||||
let s:IMDY = 2
|
||||
let s:IYMD = 3
|
||||
let s:IDMY = 4
|
||||
let s:ID = 5
|
||||
let s:IM = 6
|
||||
let s:IA = 7
|
||||
let s:IX = 8
|
||||
let s:IIX = 9
|
||||
let s:IO = 10
|
||||
let s:IIO = 11
|
||||
let s:IR = 12
|
||||
let s:IIR = 13
|
||||
let s:RI = 14
|
||||
let s:RII = 15
|
||||
let s:RIMDY = 16
|
||||
let s:RIYMD = 17
|
||||
let s:RIDMY = 18
|
||||
let s:RID = 19
|
||||
let s:RIM = 20
|
||||
let s:I = 0
|
||||
let s:II = 1
|
||||
let s:IMDY = 2
|
||||
let s:IYMD = 3
|
||||
let s:IDMY = 4
|
||||
let s:ID = 5
|
||||
let s:IM = 6
|
||||
let s:IA = 7
|
||||
let s:IX = 8
|
||||
let s:IIX = 9
|
||||
let s:IO = 10
|
||||
let s:IIO = 11
|
||||
let s:IR = 12
|
||||
let s:IIR = 13
|
||||
let s:IPOW = 14
|
||||
let s:IIPOW = 15
|
||||
let s:RI = 16
|
||||
let s:RII = 17
|
||||
let s:RIMDY = 18
|
||||
let s:RIYMD = 19
|
||||
let s:RIDMY = 20
|
||||
let s:RID = 21
|
||||
let s:RIM = 22
|
||||
let s:RIA = 23
|
||||
let s:RIX = 24
|
||||
let s:RIIX = 25
|
||||
let s:RIO = 26
|
||||
let s:RIIO = 27
|
||||
let s:RIR = 28
|
||||
let s:RIIR = 29
|
||||
let s:RIPOW = 30
|
||||
let s:RIIPOW = 31
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
" Options: {{{1
|
||||
@ -60,7 +71,7 @@ if !exists("g:visincr_leaddate")
|
||||
let g:visincr_leaddate = '0'
|
||||
endif
|
||||
if !exists("g:visincr_datedivset")
|
||||
let g:visincr_datedivset= '[-./]'
|
||||
let g:visincr_datedivset= '[-./_:~,+*^]\='
|
||||
endif
|
||||
|
||||
" ==============================================================================
|
||||
@ -86,17 +97,20 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
" save boundary line numbers and set up method {{{3
|
||||
let y1 = line("'<")
|
||||
let y2 = line("'>")
|
||||
let method = (a:method >= s:RI)? a:method - s:RI : a:method
|
||||
let method = (a:method >= s:RI)? (a:method - s:RI) : a:method
|
||||
let leaddate= g:visincr_leaddate
|
||||
" call Decho("a:method=".a:method." s:RI=".s:RI." method=".method." leaddeate<".leaddate.">")
|
||||
|
||||
" get increment (default=1) {{{3
|
||||
" get increment (default=1; except for power increments, that's default=2) {{{3
|
||||
if a:0 > 0
|
||||
let incr= a:1
|
||||
if a:method == s:IX || a:method == s:IIX
|
||||
if method == s:IX || method == s:IIX
|
||||
let incr= s:Hex2Dec(incr)
|
||||
elseif a:method == s:IO || a:method == s:IIO
|
||||
elseif method == s:IO || method == s:IIO
|
||||
let incr= s:Oct2Dec(incr)
|
||||
endif
|
||||
elseif method == s:IPOW || method == s:IIPOW
|
||||
let incr= 2
|
||||
else
|
||||
let incr= 1
|
||||
endif
|
||||
@ -153,6 +167,14 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
let restrict= '\c\%'.col(".").'c\(jan\|feb\|mar\|apr\|may\|jun\|jul\|aug\|sep\|oct\|nov\|dec\)'
|
||||
endif
|
||||
" call Decho(":IM restricted<".restrict.">")
|
||||
|
||||
elseif a:method == s:RIPOW
|
||||
let restrict= '\%'.col(".").'c\d'
|
||||
" call Decho(":RIPOW restricted<".restrict.">")
|
||||
|
||||
elseif a:method == s:RIIPOW
|
||||
let restrict= '\%'.col(".").'c\s\{,'.width.'}\d'
|
||||
" call Decho(":RIIPOW restricted<".restrict.">")
|
||||
endif
|
||||
|
||||
" determine zfill {{{3
|
||||
@ -368,10 +390,19 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
|
||||
let pat = '^.*\%'.leftcol.'v\( \=[0-9]\{1,4}\)'.g:visincr_datedivset.'\( \=[0-9]\{1,2}\)'.g:visincr_datedivset.'\( \=[0-9]\{1,4}\)\%'.rghtcol.'v.*$'
|
||||
let datediv= substitute(curline,'^.*\%'.leftcol.'v\%( \=[0-9]\{1,4}\)\('.g:visincr_datedivset.'\).*$','\1','')
|
||||
if strlen(datediv) > 1
|
||||
redraw!
|
||||
echohl WarningMsg
|
||||
echomsg "***visincr*** Your date looks odd, is g:visincr_datedivset<".g:visincr_datedivset."> what you want?"
|
||||
endif
|
||||
" call Decho("pat <".pat.">")
|
||||
" call Decho("datediv<".datediv.">")
|
||||
|
||||
" IMDY: {{{3
|
||||
if method == s:IMDY
|
||||
if datediv == ""
|
||||
let pat= '^.*\%'.leftcol.'v\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,4}\)\%'.rghtcol.'v.*$'
|
||||
endif
|
||||
let m = substitute(substitute(curline,pat,'\1',''),' ','','ge')+0
|
||||
let d = substitute(substitute(curline,pat,'\2',''),' ','','ge')+0
|
||||
let y = substitute(substitute(curline,pat,'\3',''),' ','','ge')+0
|
||||
@ -380,6 +411,9 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
|
||||
" IYMD: {{{3
|
||||
elseif method == s:IYMD
|
||||
if datediv == ""
|
||||
let pat= '^.*\%'.leftcol.'v\( \=[0-9]\{1,4}\)\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,2}\)\%'.rghtcol.'v.*$'
|
||||
endif
|
||||
let y = substitute(substitute(curline,pat,'\1',''),' ','','ge')+0
|
||||
let m = substitute(substitute(curline,pat,'\2',''),' ','','ge')+0
|
||||
let d = substitute(substitute(curline,pat,'\3',''),' ','','ge')+0
|
||||
@ -388,6 +422,9 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
|
||||
" IDMY: {{{3
|
||||
elseif method == s:IDMY
|
||||
if datediv == ""
|
||||
let pat= '^.*\%'.leftcol.'v\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,2}\)\( \=[0-9]\{1,4}\)\%'.rghtcol.'v.*$'
|
||||
endif
|
||||
let d = substitute(substitute(curline,pat,'\1',''),' ','','ge')+0
|
||||
let m = substitute(substitute(curline,pat,'\2',''),' ','','ge')+0
|
||||
let y = substitute(substitute(curline,pat,'\3',''),' ','','ge')+0
|
||||
@ -454,7 +491,7 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
return
|
||||
endif " IMDY IYMD IDMY ID IM
|
||||
|
||||
" I II IX IIX IO IIO IR IIR: {{{3
|
||||
" I II IX IIX IO IIO IR IIR IPOW IIPOW: {{{3
|
||||
" construct a line from the first line that only has the number in it
|
||||
let rml = rghtcol - leftcol
|
||||
let rmlp1 = rml + 1
|
||||
@ -508,6 +545,7 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
let ocnt = cnt
|
||||
" call Decho("cntlen=".cntlen." cnt=".cnt." ocnt=".ocnt." (before I*[XOR] subs)")
|
||||
|
||||
" elide leading zeros
|
||||
if method == s:IX || method == s:IIX
|
||||
let cnt= substitute(cnt,'^0*\([1-9a-fA-F]\|0$\)','\1',"ge")
|
||||
elseif method == s:IO || method == s:IIO
|
||||
@ -539,6 +577,20 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
else
|
||||
let maxcnt= s:Dec2Rom(s:Rom2Dec(cnt) + incr*(y2 - y1))
|
||||
endif
|
||||
elseif method == s:IPOW || method == s:IIPOW
|
||||
let maxcnt = cnt
|
||||
let i = 1
|
||||
if incr > 0
|
||||
while i <= (y2-y1)
|
||||
let maxcnt= maxcnt*incr
|
||||
let i= i + 1
|
||||
endwhile
|
||||
else
|
||||
while i <= (y2-y1)
|
||||
let maxcnt= maxcnt/(-incr)
|
||||
let i= i + 1
|
||||
endwhile
|
||||
endif
|
||||
else
|
||||
let maxcnt= printf("%d",cnt + incr*(y2 - y1))
|
||||
endif
|
||||
@ -596,9 +648,9 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
let ins= ins - 1
|
||||
endwhile
|
||||
|
||||
" back up to left-of-block (plus optional left-hand-side modeling) {{{3
|
||||
" back up to left-of-block (plus optional left-hand-side modeling) (left-justification support) {{{3
|
||||
norm! 0
|
||||
if method == s:I || method == s:IO || method == s:IX || method == s:IR
|
||||
if method == s:I || method == s:IO || method == s:IX || method == s:IR || method == s:IPOW
|
||||
let bkup= leftcol
|
||||
" call Decho("bkup= [leftcol=".leftcol."] (due to method)")
|
||||
elseif maxcntlen > 0
|
||||
@ -627,7 +679,7 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
silent! exe 's/\%'.leftcol.'v\( \+\)/\=substitute(submatch(1)," ","'.zfill.'","ge")/e'
|
||||
endif
|
||||
|
||||
" set up for next line {{{3
|
||||
" update cnt: set up for next line {{{3
|
||||
if l != y2
|
||||
norm! j
|
||||
endif
|
||||
@ -637,6 +689,12 @@ fun! visincr#VisBlockIncr(method,...)
|
||||
let cnt= s:Dec2Oct(s:Oct2Dec(cnt) + incr)
|
||||
elseif method == s:IR || method == s:IIR
|
||||
let cnt= s:Dec2Rom(s:Rom2Dec(cnt) + incr)
|
||||
elseif method == s:IPOW || method == s:IIPOW
|
||||
if incr > 0
|
||||
let cnt= cnt*incr
|
||||
elseif incr < 0
|
||||
let cnt= cnt/(-incr)
|
||||
endif
|
||||
else
|
||||
let cnt= cnt + incr
|
||||
endif
|
||||
|
@ -10,18 +10,17 @@ if exists("syntax_on")
|
||||
endif
|
||||
let g:colors_name="reloaded"
|
||||
|
||||
hi LineNr term=bold gui=bold guifg=White guibg=DarkGray
|
||||
hi Normal ctermfg=Green ctermbg=Black
|
||||
hi Normal guifg=Green guibg=Black
|
||||
hi NonText ctermfg=DarkGray ctermbg=Black
|
||||
hi NonText guifg=DarkGray guibg=Black
|
||||
hi NonText ctermfg=DarkGreen ctermbg=Black
|
||||
hi NonText guifg=DarkGreen guibg=Black
|
||||
|
||||
hi Statement ctermfg=Green ctermbg=Black
|
||||
hi Statement guifg=Green guibg=Black
|
||||
hi Comment ctermfg=DarkGreen ctermbg=Black cterm=bold term=bold
|
||||
hi Comment guifg=DarkGreen guibg=Black gui=bold term=bold
|
||||
hi Constant ctermfg=Black ctermbg=Green
|
||||
hi Constant guifg=Black guibg=Green
|
||||
hi Constant ctermfg=Green ctermbg=DarkGreen
|
||||
hi Constant guifg=Green guibg=DarkGreen
|
||||
hi Identifier ctermfg=Green ctermbg=Black
|
||||
hi Identifier guifg=Green guibg=Black
|
||||
hi Type ctermfg=Green ctermbg=Black
|
||||
@ -48,19 +47,24 @@ let g:colors_name="reloaded"
|
||||
hi WarningMsg guifg=Yellow guibg=Black
|
||||
hi VertSplit ctermfg=White ctermbg=Black
|
||||
hi VertSplit guifg=White guibg=Black
|
||||
hi Directory ctermfg=Green ctermbg=DarkBlue
|
||||
hi Directory guifg=Green guibg=DarkBlue
|
||||
hi Directory ctermfg=DarkGreen ctermbg=Black
|
||||
hi Directory guifg=DarkGreen guibg=Black
|
||||
hi Visual ctermfg=White ctermbg=DarkGray cterm=underline term=none
|
||||
hi Visual guifg=White guibg=DarkGray gui=underline term=none
|
||||
hi Title ctermfg=White ctermbg=DarkBlue
|
||||
hi Title guifg=White guibg=DarkBlue
|
||||
|
||||
hi StatusLine term=bold cterm=bold,underline ctermfg=White ctermbg=Black
|
||||
hi StatusLine term=bold gui=bold,underline guifg=White guibg=Black
|
||||
hi StatusLine term=bold cterm=bold,underline ctermfg=Green ctermbg=Black
|
||||
hi StatusLine term=bold gui=bold,underline guifg=Green guibg=Black
|
||||
hi StatusLineNC term=bold cterm=bold,underline ctermfg=Gray ctermbg=Black
|
||||
hi StatusLineNC term=bold gui=bold,underline guifg=Gray guibg=Black
|
||||
hi LineNr term=bold cterm=bold ctermfg=White ctermbg=DarkGray
|
||||
hi LineNr term=bold gui=bold guifg=White guibg=DarkGray
|
||||
hi LineNr term=bold cterm=bold ctermfg=Black ctermbg=DarkGreen
|
||||
hi LineNr term=bold gui=bold guifg=Black guibg=DarkGreen
|
||||
hi SpecialKey guifg=DarkGreen guibg=Black
|
||||
hi SpecialKey ctermfg=DarkGreen ctermbg=Black
|
||||
|
||||
hi cursorline guifg=Black guibg=DarkGreen
|
||||
hi cursorline ctermfg=Black ctermbg=DarkGreen
|
||||
hi cursorcolumn guifg=Black guibg=Green
|
||||
hi cursorcolumn ctermfg=Black ctermbg=Green
|
||||
|
||||
hi cursorline ctermbg=White
|
||||
hi cursorline guibg=DarkGray
|
||||
|
1387
vimfiles/doc/Align.txt
Normal file
1387
vimfiles/doc/Align.txt
Normal file
File diff suppressed because it is too large
Load Diff
199
vimfiles/doc/SrchRplcHiGrp.txt
Normal file
199
vimfiles/doc/SrchRplcHiGrp.txt
Normal file
@ -0,0 +1,199 @@
|
||||
*SrchRplcHiGrp.txt* Search and Replace Restricted to a Highlighting Group
|
||||
|
||||
Author: David Fishburn January 22, 2008
|
||||
|
||||
|
||||
==============================================================================
|
||||
1. Contents *srchrplchigrp* *srchrplchigrp-contents*
|
||||
|
||||
1. Contents......................: |srchrplchigrp-contents|
|
||||
2. Commands......................: |srchrplchigrp-commands|
|
||||
SR............................: |SR|
|
||||
SRDispHiGrp...................: |SRDispHiGrp|
|
||||
SRChooseHiGrp.................: |SRChooseHiGrp|
|
||||
SRHiGrp.......................: |SRHiGrp|
|
||||
3. Examples......................: |srchrplchigrp-examples|
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Commands *srchrplchigrp-commands*
|
||||
|
||||
SR = Search and Replace *SR*
|
||||
|
||||
SRDispHiGrp *SRDispHiGrp*
|
||||
Displays the syntax id and name the of the syntax group
|
||||
which has been chosen.
|
||||
|
||||
SRChooseHiGrp[!] *SRChooseHiGrp*
|
||||
Before you can run the search and replace command (:SRHiGrp),
|
||||
you must choose which syntax group id you want to operate on.
|
||||
The top level syntax id of the current cursor position is
|
||||
chosen (ie. the top-level one versus the final one).
|
||||
|
||||
The optional bang lets SRChooseHiGrp use the translated
|
||||
syntax ID. This is final one versus the top-level one.
|
||||
|
||||
Assuming we were using a SQL file and placed the cursor on the
|
||||
FROM word, then using the SyntaxAttr plugin
|
||||
(http://vim.sourceforge.net/script.php?script_id=383)
|
||||
it displays both the top-level and translated
|
||||
(or final) highlight group as follows: >
|
||||
group: sqlKeyword->Statement guifg=#ffff00(#ffff00)
|
||||
<
|
||||
|
||||
Examples: >
|
||||
:SRChooseHiGrp
|
||||
< Will operate on only sqlKeyword syntax groups
|
||||
>
|
||||
:SRChooseHiGrp!
|
||||
< Will operate on all Statement syntax groups. Based on
|
||||
|group-name|, the Statement group will highlight the
|
||||
same color for the following highlight groups:
|
||||
Conditional
|
||||
Repeat
|
||||
Label
|
||||
Operator
|
||||
Keyword
|
||||
Exception
|
||||
Therefore SRChooseHiGrp! will operate over all of the
|
||||
above syntax groups.
|
||||
|
||||
SRSearch *SRSearch*
|
||||
This command will perform a forward search starting at the current
|
||||
cursor position for a specified highlight group name. The range defaults
|
||||
to the entire file. It supports all visual modes, characterwise (v),
|
||||
linewise (V) and blockwise (<C-V>).
|
||||
|
||||
It optionally takes takes one parameter. You can supply a hightlight
|
||||
group name: >
|
||||
:SRSearch Statement
|
||||
<
|
||||
The command supports highlight group name completion. >
|
||||
:SRSearch C<Tab>
|
||||
< Depending on which syntax groups are defined (given your filetype and
|
||||
various plugins) this will cycle through all highlight group names
|
||||
beginning with the letter 'C'.
|
||||
|
||||
Alternatively, you can use the SRChooseHiGrp or SRChooseHiGrp!
|
||||
command to select the highlight group. Running SRSearch
|
||||
without a parameter will check if a valid group name was
|
||||
selected via SRChooseHiGrp and begin the search. If no valid
|
||||
group name was specified, an error message will be reported.
|
||||
|
||||
SRHiGrp[!] *SRHiGrp*
|
||||
This command will perform a search and replace over a visual
|
||||
range. It works in all visual modes, characterwise (v),
|
||||
linewise (V) and blockwise (<C-V>).
|
||||
|
||||
It optionally takes takes 2 parameters.
|
||||
|
||||
Parameter 1 controls what characters are matched. The default
|
||||
for this value is \(\w\+\>\). This expression is appended to
|
||||
the \%# which starts the match from the current cursor
|
||||
position. This expression must specify a submatch \(...\).
|
||||
|
||||
Parameter 2 controls what to do with the matched string. The
|
||||
default for this value is \U\1. This expression will cause
|
||||
the matched string to be UPPER cased. The \1 refers to the
|
||||
submatch from the first parameter.
|
||||
|
||||
If the parameters are not supplied, the user will be prompted
|
||||
to enter the expression(s).
|
||||
|
||||
The optional bang (!) works the same as SRHiGrp, but will
|
||||
operate on all syntax groups that are NOT the chosen one
|
||||
(SRChooseHiGrp).
|
||||
|
||||
Syntax: >
|
||||
[range]SRHiGrp[!] 'from-pattern','to-string'
|
||||
<
|
||||
==============================================================================
|
||||
3. Examples *srchrplchigrp-examples*
|
||||
|
||||
SRHiGrp
|
||||
-------
|
||||
|
||||
First place your cursor on an item that is syntax colored the way
|
||||
you want:
|
||||
>
|
||||
:SRChooseHiGrp
|
||||
<
|
||||
Next, visually select a block of text
|
||||
(all visual modes are supported)
|
||||
>
|
||||
:SRHiGrp
|
||||
or
|
||||
:SRHiGrp '\(\w\+\>\)'
|
||||
or
|
||||
:SRHiGrp '\(\w\+\>\)', '\U\1'
|
||||
<
|
||||
If you had the following in a SQL file:
|
||||
>
|
||||
if exists( select 1
|
||||
from sys.sysprocedure sp
|
||||
key join sys.sysuserperm sup
|
||||
where sp.proc_name = 'sp_http_course_detail'
|
||||
and sup.user_name = user_name() ) then
|
||||
drop procedure sp_http_course_detail;
|
||||
end if;
|
||||
<
|
||||
Where the keywords (if, exists, select, from ...) are all
|
||||
highlighted yellow (based on my colorscheme). After I visually
|
||||
select the area and run the command taking default prompts:
|
||||
>
|
||||
:'<,'>SRHiGrp
|
||||
<
|
||||
The result is:
|
||||
>
|
||||
IF EXISTS( SELECT 1
|
||||
FROM sys.sysprocedure sp
|
||||
KEY JOIN sys.sysuserperm sup
|
||||
WHERE sp.proc_name = 'sp_http_course_detail'
|
||||
AND sup.user_name = user_name() ) THEN
|
||||
DROP PROCEDURE sp_http_course_detail;
|
||||
END IF;
|
||||
<
|
||||
Where the keywords (if, exists, select, from ...) are all
|
||||
highlighted yellow (based on my colorscheme). After I visually
|
||||
select the area and run the command taking default prompts: >
|
||||
|
||||
:'<,'>SRHiGrp!
|
||||
<
|
||||
The result is:
|
||||
>
|
||||
if exists( select 1
|
||||
from SYS.SYSPROCEDURE SP
|
||||
key join SYS.SYSUSERPERM SUP
|
||||
where SP.PROC_NAME = 'SP_HTTP_COURSE_DETAIL'
|
||||
and SUP.USER_NAME = USER_NAME() ) then
|
||||
drop procedure SP_HTTP_COURSE_DETAIL;
|
||||
end if;
|
||||
<
|
||||
|
||||
SRSearch
|
||||
--------
|
||||
|
||||
SRSearch simply does a forward search for the specified highlight
|
||||
group. A few examples: >
|
||||
:SRSearch sqlKeyword
|
||||
:1,5SRSearch sqlKeyword
|
||||
:'<,'>SRSearch sqlKeyword
|
||||
<
|
||||
Optionally, you can first choose the hightlight group by placing your
|
||||
cursor on the highlight you want and: >
|
||||
:SRChooseHiGrp
|
||||
:SRSearch
|
||||
<
|
||||
Using Vim's tab completion you can also: >
|
||||
:SRSearch s<Tab>
|
||||
<
|
||||
Each time you press tab, it will cycle through the currently defined
|
||||
syntax highlight groups beginning with the letter 's'.
|
||||
|
||||
The results of the search is displayed in the command line and is
|
||||
highlighted in the color of the syntax group. This will remind you
|
||||
which group was searched for. >
|
||||
SRSearch - Match found - Group ID: 171 Name: sqlKeyword
|
||||
SRSearch - Match NOT found - Group ID: 171 Name: sqlKeyword
|
||||
<
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
@ -1,408 +1,414 @@
|
||||
*pi_getscript.txt* For Vim version 7.0. Last change: 2006 Nov 1
|
||||
>
|
||||
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell, Jr.
|
||||
<
|
||||
Authors: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamilyA.Mbiz>
|
||||
(remove NOSPAM from the email address)
|
||||
*GetLatestVimScripts-copyright*
|
||||
Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. *glvs-copyright*
|
||||
The VIM LICENSE applies to getscript.vim and
|
||||
pi_getscript.txt (see |copyright|) except use
|
||||
"getscript" instead of "Vim". No warranty, express or implied.
|
||||
Use At-Your-Own-Risk.
|
||||
|
||||
Getscript is a plugin that simplifies retrieval of the latest versions of the
|
||||
scripts that you yourself use! Typing |:GLVS| will invoke getscript; it will
|
||||
then use the <GetLatestVimScripts.dat> (see |GetLatestVimScripts_dat|) file to
|
||||
get the latest versions of scripts listed therein from http://vim.sf.net/.
|
||||
|
||||
==============================================================================
|
||||
1. Contents *glvs-contents* *glvs* *getscript*
|
||||
*GetLatestVimScripts*
|
||||
|
||||
1. Contents........................................: |glvs-contents|
|
||||
2. GetLatestVimScripts -- Getting Started..........: |glvs-install|
|
||||
3. GetLatestVimScripts Usage.......................: |glvs-usage|
|
||||
4. GetLatestVimScripts Data File...................: |glvs-data|
|
||||
5. GetLatestVimScripts Friendly Plugins............: |glvs-plugins|
|
||||
6. GetLatestVimScripts AutoInstall.................: |glvs-autoinstall|
|
||||
7. GetLatestViMScripts Options.....................: |glvs-options|
|
||||
8. GetLatestVimScripts Algorithm...................: |glvs-alg|
|
||||
9. GetLatestVimScripts History.....................: |glvs-hist|
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. GetLatestVimScripts -- Getting Started *getscript-start*
|
||||
*getlatestvimscripts-install*
|
||||
|
||||
VERSION FROM VIM DISTRIBUTION *glvs-dist-install*
|
||||
|
||||
Vim 7.0 does not include the GetLatestVimScripts.dist file which
|
||||
serves as an example and a template. So, you'll need to create
|
||||
your own! See |GetLatestVimScripts_dat|.
|
||||
|
||||
VERSION FROM VIM SF NET *glvs-install*
|
||||
|
||||
NOTE: The last step, that of renaming/moving the GetLatestVimScripts.dist
|
||||
file, is for those who have just downloaded GetLatestVimScripts.tar.bz2 for
|
||||
the first time.
|
||||
|
||||
The GetLatestVimScripts.dist file serves as an example and a template for your
|
||||
own personal list. Feel free to remove all the scripts mentioned within it;
|
||||
the "important" part of it is the first two lines.
|
||||
|
||||
Your computer needs to have wget for GetLatestVimScripts to do its work.
|
||||
|
||||
1. if compressed: gunzip getscript.vba.gz
|
||||
2. Unix:
|
||||
vim getscript.vba
|
||||
:so %
|
||||
:q
|
||||
cd ~/.vim/GetLatest
|
||||
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
|
||||
(edit GetLatestVimScripts.dat to install your own personal
|
||||
list of desired plugins -- see |GetLatestVimScripts_dat|)
|
||||
|
||||
3. Windows:
|
||||
vim getscript.vba
|
||||
:so %
|
||||
:q
|
||||
cd **path-to-vimfiles**/GetLatest
|
||||
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
|
||||
(edit GetLatestVimScripts.dat to install your own personal
|
||||
list of desired plugins -- see |GetLatestVimScripts_dat|)
|
||||
|
||||
|
||||
==============================================================================
|
||||
3. GetLatestVimScripts Usage *glvs-usage* *:GLVS*
|
||||
|
||||
Unless its been defined elsewhere, >
|
||||
:GLVS
|
||||
will invoke GetLatestVimScripts(). If some other plugin has defined that
|
||||
command, then you may type
|
||||
>
|
||||
:GetLatestVimScripts
|
||||
<
|
||||
The script will attempt to update and, if permitted, will automatically
|
||||
install scripts from http://vim.sourceforge.net/. To do so it will peruse a
|
||||
file,
|
||||
>
|
||||
.vim/GetLatest/GetLatestVimScripts.dat (unix)
|
||||
<
|
||||
or >
|
||||
..wherever..\vimfiles\GetLatest\GetLatestVimScripts.dat (windows)
|
||||
(see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin
|
||||
directory (see |glvs-plugins|).
|
||||
|
||||
Scripts which have been downloaded will appear in the
|
||||
~/.vim/GetLatest (unix) or ..wherever..\vimfiles\GetLatest (windows)
|
||||
subdirectory. GetLatestVimScripts will attempt to automatically
|
||||
install them if you have the following line in your <.vimrc>: >
|
||||
|
||||
let g:GetLatestVimScripts_allowautoinstall=1
|
||||
|
||||
The <GetLatestVimScripts.dat> file will be automatically be updated to
|
||||
reflect the latest version of script(s) so downloaded.
|
||||
(also see |glvs-options|)
|
||||
|
||||
|
||||
==============================================================================
|
||||
4. GetLatestVimScripts Data File *getscript-data* *glvs-data*
|
||||
*:GetLatestVimScripts_dat*
|
||||
The data file <GetLatestVimScripts.dat> must have for its first two lines
|
||||
the following text:
|
||||
>
|
||||
ScriptID SourceID Filename
|
||||
--------------------------
|
||||
<
|
||||
Following those two lines are three columns; the first two are numeric
|
||||
followed by a text column. The GetLatest/GetLatestVimScripts.dist file
|
||||
contains an example of such a data file. Anything following a #... is
|
||||
ignored, so you may embed comments in the file.
|
||||
|
||||
The first number on each line gives the script's ScriptID. When you're about
|
||||
to use a web browser to look at scripts on http://vim.sf.net/, just before you
|
||||
click on the script's link, you'll see a line resembling
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=40
|
||||
|
||||
The "40" happens to be a ScriptID that GetLatestVimScripts needs to
|
||||
download the associated page.
|
||||
|
||||
The second number on each line gives the script's SourceID. The SourceID
|
||||
records the count of uploaded scripts as determined by vim.sf.net; hence it
|
||||
serves to indicate "when" a script was uploaded. Setting the SourceID to 1
|
||||
insures that GetLatestVimScripts will assume that the script it has is
|
||||
out-of-date.
|
||||
|
||||
The SourceID is extracted by GetLatestVimScripts from the script's page on
|
||||
vim.sf.net; whenever its greater than the one stored in the
|
||||
GetLatestVimScripts.dat file, the script will be downloaded
|
||||
(see |GetLatestVimScripts_dat|).
|
||||
|
||||
If your script's author has included a special comment line in his/her plugin,
|
||||
the plugin itself will be used by GetLatestVimScripts to build your
|
||||
<GetLatestVimScripts.dat> file, including any dependencies on other scripts it
|
||||
may have. As an example, consider: >
|
||||
|
||||
" GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim
|
||||
|
||||
This comment line tells getscript.vim to check vimscript #884 and that the
|
||||
script is automatically installable. Getscript will also use this line to
|
||||
help build the GetLatestVimScripts.dat file, by including a line such as: >
|
||||
|
||||
884 1 AutoAlign.vim
|
||||
<
|
||||
in it an AutoAlign.vim line isn't already in GetLatestVimScripts.dat file.
|
||||
See |glvs-plugins| for more. Thus, GetLatestVimScripts thus provides a
|
||||
comprehensive ability to keep your plugins up-to-date!
|
||||
|
||||
*GetLatestVimScripts_dat*
|
||||
As an example of a <GetLatestVimScripts.dat> file:
|
||||
>
|
||||
ScriptID SourceID Filename
|
||||
--------------------------
|
||||
294 1 Align.vim
|
||||
120 2 decho.vim
|
||||
40 3 DrawIt.tar.gz
|
||||
451 4 EasyAccents.vim
|
||||
195 5 engspchk.vim
|
||||
642 6 GetLatestVimScripts.vim
|
||||
489 7 Manpageview.vim
|
||||
<
|
||||
Note: the first two lines are required, but essentially act as comments.
|
||||
|
||||
|
||||
==============================================================================
|
||||
5. GetLatestVimScripts Friendly Plugins *getscript-plugins* *glvs-plugins*
|
||||
|
||||
If a plugin author includes the following comment anywhere in their plugin,
|
||||
GetLatestVimScripts will find it and use it to automatically build the user's
|
||||
GetLatestVimScripts.dat files:
|
||||
>
|
||||
src_id
|
||||
v
|
||||
" GetLatestVimScripts: ### ### yourscriptname
|
||||
^
|
||||
scriptid
|
||||
<
|
||||
As an author, you should include such a line in to refer to your own script
|
||||
plus any additional lines describing any plugin dependencies it may have.
|
||||
Same format, of course!
|
||||
|
||||
If your command is auto-installable (see |glvs-autoinstall|), and most scripts
|
||||
are, then you may include :AutoInstall: at the start of "yourscriptname".
|
||||
|
||||
GetLatestVimScripts commands for those scripts are then appended, if not
|
||||
already present, to the user's GetLatest/GetLatestVimScripts.dat file. Its a
|
||||
relatively painless way to automate the acquisition of any scripts your
|
||||
plugins depend upon.
|
||||
|
||||
Now, as an author, you probably don't want GetLatestVimScripts to download
|
||||
your own scripts for you yourself, thereby overwriting your not-yet-released
|
||||
hard work. GetLatestVimScripts provides a solution for this: put
|
||||
>
|
||||
0 0 yourscriptname
|
||||
<
|
||||
into your <GetLatestVimScripts.dat> file and GetLatestVimScripts will skip
|
||||
examining the "yourscriptname" scripts for those GetLatestVimScripts comment
|
||||
lines. As a result, those lines won't be inadvertently installed into your
|
||||
<GetLatestVimScripts.dat> file and subsequently used to download your own
|
||||
scripts. This is especially important to do if you've included the
|
||||
:AutoInstall: option.
|
||||
|
||||
Be certain to use the same "yourscriptname" in the "0 0 yourscriptname" line
|
||||
as you've used in your GetLatestVimScripts comment!
|
||||
|
||||
|
||||
==============================================================================
|
||||
6. GetLatestVimScripts AutoInstall *getscript-autoinstall*
|
||||
*glvs-autoinstall*
|
||||
|
||||
GetLatestVimScripts now supports "AutoInstall". Not all scripts are
|
||||
supportive of auto-install, as they may have special things you need to do to
|
||||
install them (please refer to the script's "install" directions). On the
|
||||
other hand, most scripts will be auto-installable.
|
||||
|
||||
To let GetLatestVimScripts do an autoinstall, the data file's comment field
|
||||
should begin with (surrounding blanks are ignored): >
|
||||
|
||||
:AutoInstall:
|
||||
<
|
||||
Both colons are needed, and it should begin the comment (yourscriptname)
|
||||
field.
|
||||
|
||||
One may prevent any autoinstalling by putting the following line in your
|
||||
<.vimrc>: >
|
||||
|
||||
let g:GetLatestVimScripts_allowautoinstall= 0
|
||||
<
|
||||
With :AutoInstall: enabled, as it is by default, files which end with
|
||||
|
||||
---.tar.bz2 : decompressed & untarred in .vim/ directory
|
||||
---.vba.bz2 : decompressed in .vim/ directory, then vimball handles it
|
||||
---.vim.bz2 : decompressed & moved into .vim/plugin directory
|
||||
---.tar.gz : decompressed & untarred in .vim/ directory
|
||||
---.vba.gz : decompressed in .vim/ directory, then vimball handles it
|
||||
---.vim.gz : decompressed & moved into .vim/plugin directory
|
||||
---.vba : unzipped in .vim/ directory
|
||||
---.vim : moved to .vim/plugin directory
|
||||
---.zip : unzipped in .vim/ directory
|
||||
|
||||
and which merely need to have their components placed by the untar/gunzip or
|
||||
move-to-plugin-directory process should be auto-installable. Vimballs, of
|
||||
course, should always be auto-installable.
|
||||
|
||||
When is a script not auto-installable? Let me give an example:
|
||||
|
||||
.vim/after/syntax/blockhl.vim
|
||||
|
||||
The <blockhl.vim> script provides block highlighting for C/C++ programs; it is
|
||||
available at:
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=104
|
||||
|
||||
Currently, vim's after/syntax only supports by-filetype scripts (in
|
||||
blockhl.vim's case, that's after/syntax/c.vim). Hence, auto-install would
|
||||
possibly overwrite the current user's after/syntax/c.vim file.
|
||||
|
||||
In my own case, I use <aftersyntax.vim> (renamed to after/syntax/c.vim) to
|
||||
allow a after/syntax/c/ directory:
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=1023
|
||||
|
||||
The script allows multiple syntax files to exist separately in the
|
||||
after/syntax/c subdirectory. I can't bundle aftersyntax.vim in and build an
|
||||
appropriate tarball for auto-install because of the potential for the
|
||||
after/syntax/c.vim contained in it to overwrite a user's c.vim.
|
||||
|
||||
|
||||
==============================================================================
|
||||
7. GetLatestVimScripts Options *glvs-options*
|
||||
>
|
||||
g:GetLatestVimScripts_wget
|
||||
< default= "wget"
|
||||
This variable holds the name of the command for obtaining
|
||||
scripts.
|
||||
>
|
||||
g:GetLatestVimScripts_options
|
||||
< default= "-q -O"
|
||||
This variable holds the options to be used with the
|
||||
g:GetLatestVimScripts_wget command.
|
||||
>
|
||||
g:getLatestVimScripts_allowautoinstall
|
||||
< default= 1
|
||||
This variable indicates whether GetLatestVimScripts is allowed
|
||||
to attempt to automatically install scripts. Note that it
|
||||
doesn't understand vimballs (yet). Furthermore, the plugin
|
||||
author has to have explicitly indicated that his/her plugin
|
||||
is automatically installable.
|
||||
|
||||
|
||||
==============================================================================
|
||||
8. GetLatestVimScripts Algorithm *glvs-algorithm* *glvs-alg*
|
||||
|
||||
The Vim sourceforge page dynamically creates a page by keying off of the
|
||||
so-called script-id. Within the webpage of
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=40
|
||||
|
||||
is a line specifying the latest source-id (src_id). The source identifier
|
||||
numbers are always increasing, hence if the src_id is greater than the one
|
||||
recorded for the script in GetLatestVimScripts then its time to download a
|
||||
newer copy of that script.
|
||||
|
||||
GetLatestVimScripts will then download the script and update its internal
|
||||
database of script ids, source ids, and scriptnames.
|
||||
|
||||
The AutoInstall process will:
|
||||
|
||||
Move the file from GetLatest/ to the following directory
|
||||
Unix : $HOME/.vim
|
||||
Windows: $HOME\vimfiles
|
||||
if the downloaded file ends with ".bz2"
|
||||
bunzip2 it
|
||||
else if the downloaded file ends with ".gz"
|
||||
gunzip it
|
||||
if the resulting file ends with ".zip"
|
||||
unzip it
|
||||
else if the resulting file ends with ".tar"
|
||||
tar -oxvf it
|
||||
else if the resulting file ends with ".vim"
|
||||
move it to the plugin subdirectory
|
||||
|
||||
|
||||
==============================================================================
|
||||
9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1
|
||||
|
||||
v24 Apr 16, 2007 : * removed save&restore of the fo option during script
|
||||
loading
|
||||
v23 Nov 03, 2006 : * ignores comments (#...)
|
||||
* handles vimballs
|
||||
v22 Oct 13, 2006 : * supports automatic use of curl if wget is not
|
||||
available
|
||||
v21 May 01, 2006 : * now takes advantage of autoloading.
|
||||
v20 Dec 23, 2005 : * Eric Haarbauer found&fixed a bug with unzip use;
|
||||
unzip needs the -o flag to overwrite.
|
||||
v19 Nov 28, 2005 : * v18's GetLatestVimScript line accessed the wrong
|
||||
script! Fixed.
|
||||
v18 Mar 21, 2005 : * bugfix to automatic database construction
|
||||
* bugfix - nowrapscan caused an error
|
||||
(tnx to David Green for the fix)
|
||||
Apr 01, 2005 * if shell is bash, "mv" instead of "ren" used in
|
||||
:AutoInstall:s, even though its o/s is windows
|
||||
Apr 01, 2005 * when downloading errors occurred, GLVS was
|
||||
terminating early. It now just goes on to trying
|
||||
the next script (after trying three times to
|
||||
download a script description page)
|
||||
Apr 20, 2005 * bugfix - when a failure to download occurred,
|
||||
GetLatestVimScripts would stop early and claim that
|
||||
everything was current. Fixed.
|
||||
v17 Aug 25, 2004 : * g:GetLatestVimScripts_allowautoinstall, which
|
||||
defaults to 1, can be used to prevent all
|
||||
:AutoInstall:
|
||||
v16 Aug 25, 2004 : * made execution of bunzip2/gunzip/tar/zip silent
|
||||
* fixed bug with :AutoInstall: use of helptags
|
||||
v15 Aug 24, 2004 : * bugfix: the "0 0 comment" download prevention wasn't
|
||||
always preventing downloads (just usually). Fixed.
|
||||
v14 Aug 24, 2004 : * bugfix -- helptags was using dotvim, rather than
|
||||
s:dotvim. Fixed.
|
||||
v13 Aug 23, 2004 : * will skip downloading a file if its scriptid or srcid
|
||||
is zero. Useful for script authors; that way their
|
||||
own GetLatestVimScripts activity won't overwrite
|
||||
their scripts.
|
||||
v12 Aug 23, 2004 : * bugfix - a "return" got left in the distribution that
|
||||
was intended only for testing. Removed, now works.
|
||||
* :AutoInstall: implemented
|
||||
v11 Aug 20, 2004 : * GetLatestVimScripts is now a plugin:
|
||||
* :GetLatestVimScripts command
|
||||
* (runtimepath)/GetLatest/GetLatestVimScripts.dat
|
||||
now holds scripts that need updating
|
||||
v10 Apr 19, 2004 : * moved history from script to doc
|
||||
v9 Jan 23, 2004 : windows (win32/win16/win95) will use
|
||||
double quotes ("") whereas other systems will use
|
||||
single quotes ('') around the urls in calls via wget
|
||||
v8 Dec 01, 2003 : makes three tries at downloading
|
||||
v7 Sep 02, 2003 : added error messages if "Click on..." or "src_id="
|
||||
not found in downloaded webpage
|
||||
Uses t_ti, t_te, and rs to make progress visible
|
||||
v6 Aug 06, 2003 : final status messages now display summary of work
|
||||
( "Downloaded someqty scripts" or
|
||||
"Everything was current")
|
||||
Now GetLatestVimScripts is careful about downloading
|
||||
GetLatestVimScripts.vim itself!
|
||||
(goes to <NEW_GetLatestVimScripts.vim>)
|
||||
v5 Aug 04, 2003 : missing an endif near bottom
|
||||
v4 Jun 17, 2003 : redraw! just before each "considering" message
|
||||
v3 May 27, 2003 : Protects downloaded files from errant shell
|
||||
expansions with single quotes: '...'
|
||||
v2 May 14, 2003 : extracts name of item to be obtained from the
|
||||
script file. Uses it instead of comment field
|
||||
for output filename; comment is used in the
|
||||
"considering..." line and is now just a comment!
|
||||
* Fixed a bug: a string-of-numbers is not the
|
||||
same as a number, so I added zero to them
|
||||
and they became numbers. Fixes comparison.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:fdm=marker
|
||||
*pi_getscript.txt* For Vim version 7.0. Last change: 2008 Jan 07
|
||||
>
|
||||
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell, Jr.
|
||||
<
|
||||
Authors: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamilyA.Mbiz>
|
||||
(remove NOSPAM from the email address)
|
||||
*GetLatestVimScripts-copyright*
|
||||
Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. *glvs-copyright*
|
||||
The VIM LICENSE applies to getscript.vim and
|
||||
pi_getscript.txt (see |copyright|) except use
|
||||
"getscript" instead of "Vim". No warranty, express or implied.
|
||||
Use At-Your-Own-Risk.
|
||||
|
||||
Getscript is a plugin that simplifies retrieval of the latest versions of the
|
||||
scripts that you yourself use! Typing |:GLVS| will invoke getscript; it will
|
||||
then use the <GetLatestVimScripts.dat> (see |GetLatestVimScripts_dat|) file to
|
||||
get the latest versions of scripts listed therein from http://vim.sf.net/.
|
||||
|
||||
==============================================================================
|
||||
1. Contents *glvs-contents* *glvs* *getscript*
|
||||
*GetLatestVimScripts*
|
||||
|
||||
1. Contents........................................: |glvs-contents|
|
||||
2. GetLatestVimScripts -- Getting Started..........: |glvs-install|
|
||||
3. GetLatestVimScripts Usage.......................: |glvs-usage|
|
||||
4. GetLatestVimScripts Data File...................: |glvs-data|
|
||||
5. GetLatestVimScripts Friendly Plugins............: |glvs-plugins|
|
||||
6. GetLatestVimScripts AutoInstall.................: |glvs-autoinstall|
|
||||
7. GetLatestViMScripts Options.....................: |glvs-options|
|
||||
8. GetLatestVimScripts Algorithm...................: |glvs-alg|
|
||||
9. GetLatestVimScripts History.....................: |glvs-hist|
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. GetLatestVimScripts -- Getting Started *getscript-start*
|
||||
*getlatestvimscripts-install*
|
||||
|
||||
VERSION FROM VIM DISTRIBUTION *glvs-dist-install*
|
||||
|
||||
Vim 7.0 does not include the GetLatestVimScripts.dist file which
|
||||
serves as an example and a template. So, you'll need to create
|
||||
your own! See |GetLatestVimScripts_dat|.
|
||||
|
||||
VERSION FROM VIM SF NET *glvs-install*
|
||||
|
||||
NOTE: The last step, that of renaming/moving the GetLatestVimScripts.dist
|
||||
file, is for those who have just downloaded GetLatestVimScripts.tar.bz2 for
|
||||
the first time.
|
||||
|
||||
The GetLatestVimScripts.dist file serves as an example and a template for your
|
||||
own personal list. Feel free to remove all the scripts mentioned within it;
|
||||
the "important" part of it is the first two lines.
|
||||
|
||||
Your computer needs to have wget for GetLatestVimScripts to do its work.
|
||||
|
||||
1. if compressed: gunzip getscript.vba.gz
|
||||
2. Unix:
|
||||
vim getscript.vba
|
||||
:so %
|
||||
:q
|
||||
cd ~/.vim/GetLatest
|
||||
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
|
||||
(edit GetLatestVimScripts.dat to install your own personal
|
||||
list of desired plugins -- see |GetLatestVimScripts_dat|)
|
||||
|
||||
3. Windows:
|
||||
vim getscript.vba
|
||||
:so %
|
||||
:q
|
||||
cd **path-to-vimfiles**/GetLatest
|
||||
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
|
||||
(edit GetLatestVimScripts.dat to install your own personal
|
||||
list of desired plugins -- see |GetLatestVimScripts_dat|)
|
||||
|
||||
|
||||
==============================================================================
|
||||
3. GetLatestVimScripts Usage *glvs-usage* *:GLVS*
|
||||
|
||||
Unless its been defined elsewhere, >
|
||||
:GLVS
|
||||
will invoke GetLatestVimScripts(). If some other plugin has defined that
|
||||
command, then you may type
|
||||
>
|
||||
:GetLatestVimScripts
|
||||
<
|
||||
The script will attempt to update and, if permitted, will automatically
|
||||
install scripts from http://vim.sourceforge.net/. To do so it will peruse a
|
||||
file,
|
||||
>
|
||||
.vim/GetLatest/GetLatestVimScripts.dat (unix)
|
||||
<
|
||||
or >
|
||||
..wherever..\vimfiles\GetLatest\GetLatestVimScripts.dat (windows)
|
||||
(see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin
|
||||
directory (see |glvs-plugins|).
|
||||
|
||||
Scripts which have been downloaded will appear in the
|
||||
~/.vim/GetLatest (unix) or ..wherever..\vimfiles\GetLatest (windows)
|
||||
subdirectory. GetLatestVimScripts will attempt to automatically
|
||||
install them if you have the following line in your <.vimrc>: >
|
||||
|
||||
let g:GetLatestVimScripts_allowautoinstall=1
|
||||
|
||||
The <GetLatestVimScripts.dat> file will be automatically be updated to
|
||||
reflect the latest version of script(s) so downloaded.
|
||||
(also see |glvs-options|)
|
||||
|
||||
|
||||
==============================================================================
|
||||
4. GetLatestVimScripts Data File *getscript-data* *glvs-data*
|
||||
*:GetLatestVimScripts_dat*
|
||||
The data file <GetLatestVimScripts.dat> must have for its first two lines
|
||||
the following text:
|
||||
>
|
||||
ScriptID SourceID Filename
|
||||
--------------------------
|
||||
<
|
||||
Following those two lines are three columns; the first two are numeric
|
||||
followed by a text column. The GetLatest/GetLatestVimScripts.dist file
|
||||
contains an example of such a data file. Anything following a #... is
|
||||
ignored, so you may embed comments in the file.
|
||||
|
||||
The first number on each line gives the script's ScriptID. When you're about
|
||||
to use a web browser to look at scripts on http://vim.sf.net/, just before you
|
||||
click on the script's link, you'll see a line resembling
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=40
|
||||
|
||||
The "40" happens to be a ScriptID that GetLatestVimScripts needs to
|
||||
download the associated page.
|
||||
|
||||
The second number on each line gives the script's SourceID. The SourceID
|
||||
records the count of uploaded scripts as determined by vim.sf.net; hence it
|
||||
serves to indicate "when" a script was uploaded. Setting the SourceID to 1
|
||||
insures that GetLatestVimScripts will assume that the script it has is
|
||||
out-of-date.
|
||||
|
||||
The SourceID is extracted by GetLatestVimScripts from the script's page on
|
||||
vim.sf.net; whenever its greater than the one stored in the
|
||||
GetLatestVimScripts.dat file, the script will be downloaded
|
||||
(see |GetLatestVimScripts_dat|).
|
||||
|
||||
If your script's author has included a special comment line in his/her plugin,
|
||||
the plugin itself will be used by GetLatestVimScripts to build your
|
||||
<GetLatestVimScripts.dat> file, including any dependencies on other scripts it
|
||||
may have. As an example, consider: >
|
||||
|
||||
" GetLatestVimScripts: 884 1 :AutoInstall: AutoAlign.vim
|
||||
|
||||
This comment line tells getscript.vim to check vimscript #884 and that the
|
||||
script is automatically installable. Getscript will also use this line to
|
||||
help build the GetLatestVimScripts.dat file, by including a line such as: >
|
||||
|
||||
884 1 AutoAlign.vim
|
||||
<
|
||||
in it an AutoAlign.vim line isn't already in GetLatestVimScripts.dat file.
|
||||
See |glvs-plugins| for more. Thus, GetLatestVimScripts thus provides a
|
||||
comprehensive ability to keep your plugins up-to-date!
|
||||
|
||||
*GetLatestVimScripts_dat*
|
||||
As an example of a <GetLatestVimScripts.dat> file:
|
||||
>
|
||||
ScriptID SourceID Filename
|
||||
--------------------------
|
||||
294 1 Align.vim
|
||||
120 2 decho.vim
|
||||
40 3 DrawIt.tar.gz
|
||||
451 4 EasyAccents.vim
|
||||
195 5 engspchk.vim
|
||||
642 6 GetLatestVimScripts.vim
|
||||
489 7 Manpageview.vim
|
||||
<
|
||||
Note: the first two lines are required, but essentially act as comments.
|
||||
|
||||
|
||||
==============================================================================
|
||||
5. GetLatestVimScripts Friendly Plugins *getscript-plugins* *glvs-plugins*
|
||||
|
||||
If a plugin author includes the following comment anywhere in their plugin,
|
||||
GetLatestVimScripts will find it and use it to automatically build the user's
|
||||
GetLatestVimScripts.dat files:
|
||||
>
|
||||
src_id
|
||||
v
|
||||
" GetLatestVimScripts: ### ### yourscriptname
|
||||
^
|
||||
scriptid
|
||||
<
|
||||
As an author, you should include such a line in to refer to your own script
|
||||
plus any additional lines describing any plugin dependencies it may have.
|
||||
Same format, of course!
|
||||
|
||||
If your command is auto-installable (see |glvs-autoinstall|), and most scripts
|
||||
are, then you may include :AutoInstall: at the start of "yourscriptname".
|
||||
|
||||
GetLatestVimScripts commands for those scripts are then appended, if not
|
||||
already present, to the user's GetLatest/GetLatestVimScripts.dat file. Its a
|
||||
relatively painless way to automate the acquisition of any scripts your
|
||||
plugins depend upon.
|
||||
|
||||
Now, as an author, you probably don't want GetLatestVimScripts to download
|
||||
your own scripts for you yourself, thereby overwriting your not-yet-released
|
||||
hard work. GetLatestVimScripts provides a solution for this: put
|
||||
>
|
||||
0 0 yourscriptname
|
||||
<
|
||||
into your <GetLatestVimScripts.dat> file and GetLatestVimScripts will skip
|
||||
examining the "yourscriptname" scripts for those GetLatestVimScripts comment
|
||||
lines. As a result, those lines won't be inadvertently installed into your
|
||||
<GetLatestVimScripts.dat> file and subsequently used to download your own
|
||||
scripts. This is especially important to do if you've included the
|
||||
:AutoInstall: option.
|
||||
|
||||
Be certain to use the same "yourscriptname" in the "0 0 yourscriptname" line
|
||||
as you've used in your GetLatestVimScripts comment!
|
||||
|
||||
|
||||
==============================================================================
|
||||
6. GetLatestVimScripts AutoInstall *getscript-autoinstall*
|
||||
*glvs-autoinstall*
|
||||
|
||||
GetLatestVimScripts now supports "AutoInstall". Not all scripts are
|
||||
supportive of auto-install, as they may have special things you need to do to
|
||||
install them (please refer to the script's "install" directions). On the
|
||||
other hand, most scripts will be auto-installable.
|
||||
|
||||
To let GetLatestVimScripts do an autoinstall, the data file's comment field
|
||||
should begin with (surrounding blanks are ignored): >
|
||||
|
||||
:AutoInstall:
|
||||
<
|
||||
Both colons are needed, and it should begin the comment (yourscriptname)
|
||||
field.
|
||||
|
||||
One may prevent any autoinstalling by putting the following line in your
|
||||
<.vimrc>: >
|
||||
|
||||
let g:GetLatestVimScripts_allowautoinstall= 0
|
||||
<
|
||||
With :AutoInstall: enabled, as it is by default, files which end with
|
||||
|
||||
---.tar.bz2 : decompressed & untarred in .vim/ directory
|
||||
---.vba.bz2 : decompressed in .vim/ directory, then vimball handles it
|
||||
---.vim.bz2 : decompressed & moved into .vim/plugin directory
|
||||
---.tar.gz : decompressed & untarred in .vim/ directory
|
||||
---.vba.gz : decompressed in .vim/ directory, then vimball handles it
|
||||
---.vim.gz : decompressed & moved into .vim/plugin directory
|
||||
---.vba : unzipped in .vim/ directory
|
||||
---.vim : moved to .vim/plugin directory
|
||||
---.zip : unzipped in .vim/ directory
|
||||
|
||||
and which merely need to have their components placed by the untar/gunzip or
|
||||
move-to-plugin-directory process should be auto-installable. Vimballs, of
|
||||
course, should always be auto-installable.
|
||||
|
||||
When is a script not auto-installable? Let me give an example:
|
||||
|
||||
.vim/after/syntax/blockhl.vim
|
||||
|
||||
The <blockhl.vim> script provides block highlighting for C/C++ programs; it is
|
||||
available at:
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=104
|
||||
|
||||
Currently, vim's after/syntax only supports by-filetype scripts (in
|
||||
blockhl.vim's case, that's after/syntax/c.vim). Hence, auto-install would
|
||||
possibly overwrite the current user's after/syntax/c.vim file.
|
||||
|
||||
In my own case, I use <aftersyntax.vim> (renamed to after/syntax/c.vim) to
|
||||
allow a after/syntax/c/ directory:
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=1023
|
||||
|
||||
The script allows multiple syntax files to exist separately in the
|
||||
after/syntax/c subdirectory. I can't bundle aftersyntax.vim in and build an
|
||||
appropriate tarball for auto-install because of the potential for the
|
||||
after/syntax/c.vim contained in it to overwrite a user's c.vim.
|
||||
|
||||
|
||||
==============================================================================
|
||||
7. GetLatestVimScripts Options *glvs-options*
|
||||
>
|
||||
g:GetLatestVimScripts_wget
|
||||
< default= "wget"
|
||||
This variable holds the name of the command for obtaining
|
||||
scripts.
|
||||
>
|
||||
g:GetLatestVimScripts_options
|
||||
< default= "-q -O"
|
||||
This variable holds the options to be used with the
|
||||
g:GetLatestVimScripts_wget command.
|
||||
>
|
||||
g:getLatestVimScripts_allowautoinstall
|
||||
< default= 1
|
||||
This variable indicates whether GetLatestVimScripts is allowed
|
||||
to attempt to automatically install scripts. Note that it
|
||||
doesn't understand vimballs (yet). Furthermore, the plugin
|
||||
author has to have explicitly indicated that his/her plugin
|
||||
is automatically installable.
|
||||
|
||||
|
||||
==============================================================================
|
||||
8. GetLatestVimScripts Algorithm *glvs-algorithm* *glvs-alg*
|
||||
|
||||
The Vim sourceforge page dynamically creates a page by keying off of the
|
||||
so-called script-id. Within the webpage of
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=40
|
||||
|
||||
is a line specifying the latest source-id (src_id). The source identifier
|
||||
numbers are always increasing, hence if the src_id is greater than the one
|
||||
recorded for the script in GetLatestVimScripts then it's time to download a
|
||||
newer copy of that script.
|
||||
|
||||
GetLatestVimScripts will then download the script and update its internal
|
||||
database of script ids, source ids, and scriptnames.
|
||||
|
||||
The AutoInstall process will:
|
||||
|
||||
Move the file from GetLatest/ to the following directory
|
||||
Unix : $HOME/.vim
|
||||
Windows: $HOME\vimfiles
|
||||
if the downloaded file ends with ".bz2"
|
||||
bunzip2 it
|
||||
else if the downloaded file ends with ".gz"
|
||||
gunzip it
|
||||
if the resulting file ends with ".zip"
|
||||
unzip it
|
||||
else if the resulting file ends with ".tar"
|
||||
tar -oxvf it
|
||||
else if the resulting file ends with ".vim"
|
||||
move it to the plugin subdirectory
|
||||
|
||||
|
||||
==============================================================================
|
||||
9. GetLatestVimScripts History *getscript-history* *glvs-hist* {{{1
|
||||
|
||||
v29 Jan 07, 2008 : * Bram M pointed out that cpo is a global option and that
|
||||
getscriptPlugin.vim was setting it but not restoring it.
|
||||
v28 Jan 02, 2008 : * improved shell quoting character handling, cygwin
|
||||
interface, register-a bypass
|
||||
Oct 29, 2007 * Bill McCarthy suggested a change to getscript that avoids
|
||||
creating pop-up windows
|
||||
v24 Apr 16, 2007 : * removed save&restore of the fo option during script
|
||||
loading
|
||||
v23 Nov 03, 2006 : * ignores comments (#...)
|
||||
* handles vimballs
|
||||
v22 Oct 13, 2006 : * supports automatic use of curl if wget is not
|
||||
available
|
||||
v21 May 01, 2006 : * now takes advantage of autoloading.
|
||||
v20 Dec 23, 2005 : * Eric Haarbauer found&fixed a bug with unzip use;
|
||||
unzip needs the -o flag to overwrite.
|
||||
v19 Nov 28, 2005 : * v18's GetLatestVimScript line accessed the wrong
|
||||
script! Fixed.
|
||||
v18 Mar 21, 2005 : * bugfix to automatic database construction
|
||||
* bugfix - nowrapscan caused an error
|
||||
(tnx to David Green for the fix)
|
||||
Apr 01, 2005 * if shell is bash, "mv" instead of "ren" used in
|
||||
:AutoInstall:s, even though its o/s is windows
|
||||
Apr 01, 2005 * when downloading errors occurred, GLVS was
|
||||
terminating early. It now just goes on to trying
|
||||
the next script (after trying three times to
|
||||
download a script description page)
|
||||
Apr 20, 2005 * bugfix - when a failure to download occurred,
|
||||
GetLatestVimScripts would stop early and claim that
|
||||
everything was current. Fixed.
|
||||
v17 Aug 25, 2004 : * g:GetLatestVimScripts_allowautoinstall, which
|
||||
defaults to 1, can be used to prevent all
|
||||
:AutoInstall:
|
||||
v16 Aug 25, 2004 : * made execution of bunzip2/gunzip/tar/zip silent
|
||||
* fixed bug with :AutoInstall: use of helptags
|
||||
v15 Aug 24, 2004 : * bugfix: the "0 0 comment" download prevention wasn't
|
||||
always preventing downloads (just usually). Fixed.
|
||||
v14 Aug 24, 2004 : * bugfix -- helptags was using dotvim, rather than
|
||||
s:dotvim. Fixed.
|
||||
v13 Aug 23, 2004 : * will skip downloading a file if its scriptid or srcid
|
||||
is zero. Useful for script authors; that way their
|
||||
own GetLatestVimScripts activity won't overwrite
|
||||
their scripts.
|
||||
v12 Aug 23, 2004 : * bugfix - a "return" got left in the distribution that
|
||||
was intended only for testing. Removed, now works.
|
||||
* :AutoInstall: implemented
|
||||
v11 Aug 20, 2004 : * GetLatestVimScripts is now a plugin:
|
||||
* :GetLatestVimScripts command
|
||||
* (runtimepath)/GetLatest/GetLatestVimScripts.dat
|
||||
now holds scripts that need updating
|
||||
v10 Apr 19, 2004 : * moved history from script to doc
|
||||
v9 Jan 23, 2004 : windows (win32/win16/win95) will use
|
||||
double quotes ("") whereas other systems will use
|
||||
single quotes ('') around the urls in calls via wget
|
||||
v8 Dec 01, 2003 : makes three tries at downloading
|
||||
v7 Sep 02, 2003 : added error messages if "Click on..." or "src_id="
|
||||
not found in downloaded webpage
|
||||
Uses t_ti, t_te, and rs to make progress visible
|
||||
v6 Aug 06, 2003 : final status messages now display summary of work
|
||||
( "Downloaded someqty scripts" or
|
||||
"Everything was current")
|
||||
Now GetLatestVimScripts is careful about downloading
|
||||
GetLatestVimScripts.vim itself!
|
||||
(goes to <NEW_GetLatestVimScripts.vim>)
|
||||
v5 Aug 04, 2003 : missing an endif near bottom
|
||||
v4 Jun 17, 2003 : redraw! just before each "considering" message
|
||||
v3 May 27, 2003 : Protects downloaded files from errant shell
|
||||
expansions with single quotes: '...'
|
||||
v2 May 14, 2003 : extracts name of item to be obtained from the
|
||||
script file. Uses it instead of comment field
|
||||
for output filename; comment is used in the
|
||||
"considering..." line and is now just a comment!
|
||||
* Fixed a bug: a string-of-numbers is not the
|
||||
same as a number, so I added zero to them
|
||||
and they became numbers. Fixes comparison.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:fdm=marker
|
||||
|
@ -1,4 +1,4 @@
|
||||
*pi_netrw.txt* For Vim version 7.1. Last change: 2007 Dec 12
|
||||
*pi_netrw.txt* For Vim version 7.1. Last change: 2008 Feb 26
|
||||
|
||||
-----------------------------------------------------
|
||||
NETRW REFERENCE MANUAL by Charles E. Campbell, Jr.
|
||||
@ -45,12 +45,14 @@
|
||||
Customizing Browsing With A User Function..........|netrw-x|
|
||||
Deleting Files Or Directories......................|netrw-D|
|
||||
Directory Exploring Commands.......................|netrw-explore|
|
||||
Exploring With Stars and Patterns..................|netrw-star|
|
||||
Displaying Information About File..................|netrw-qf|
|
||||
Edit File Or Directory Hiding List.................|netrw-ctrl-h|
|
||||
Editing The Sorting Sequence.......................|netrw-S|
|
||||
Going Up...........................................|netrw--|
|
||||
Hiding Files Or Directories........................|netrw-a|
|
||||
Improving Browsing.................................|netrw-ssh-hack|
|
||||
Listing Bookmarks And History......................|netrw-q|
|
||||
Listing Bookmarks And History......................|netrw-qb|
|
||||
Making A New Directory.............................|netrw-d|
|
||||
Making The Browsing Directory The Current Directory|netrw-c|
|
||||
Marked Files: Compression And Decompression........|netrw-mz|
|
||||
@ -807,11 +809,13 @@ There are several things you can do to affect the browser's display of files:
|
||||
|
||||
* To change the listing style, press the "i" key (|netrw-i|).
|
||||
Currently there are four styles: thin, long, wide, and tree.
|
||||
|
||||
* To hide files (don't want to see those xyz~ files anymore?) see
|
||||
|netrw-ctrl-h|.
|
||||
|
||||
* Press s to sort files by name, time, or size.
|
||||
|
||||
See |netrw-browse-cmds| for all the things you can do!
|
||||
See |netrw-browse-cmds| for all the things you can do with netrw!
|
||||
|
||||
|
||||
QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
@ -830,6 +834,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
d Make a directory |netrw-d|
|
||||
D Attempt to remove the file(s)/directory(ies) |netrw-D|
|
||||
gb Go to previous bookmarked directory |netrw-gb|
|
||||
gi Display information on file |netrw-qf|
|
||||
<c-h> Edit file hiding list |netrw-ctrl-h|
|
||||
i Cycle between thin, long, wide, and tree listings |netrw-i|
|
||||
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
|
||||
@ -838,6 +843,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
md Apply diff to marked files (up to 3) |netrw-md|
|
||||
me Place marked files on arg list and edit them |netrw-me|
|
||||
mf Mark a file |netrw-mf|
|
||||
mh Toggle marked file suffices' presence on hiding list |netrw-mh|
|
||||
mm Move marked files to marked-file target directory |netrw-mm|
|
||||
mp Print marked files |netrw-mp|
|
||||
mr Mark files satisfying a |regexp| |netrw-mr|
|
||||
@ -851,7 +857,7 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
O Obtain a file specified by cursor |netrw-O|
|
||||
p Preview the file |netrw-p|
|
||||
P Browse in the previously used window |netrw-P|
|
||||
q List bookmarked directories and history |netrw-q|
|
||||
q List bookmarked directories and history |netrw-qb|
|
||||
r Reverse sorting order |netrw-r|
|
||||
R Rename the designed file(s)/directory(ies) |netrw-R|
|
||||
s Select sorting style: by name, time, or file size |netrw-s|
|
||||
@ -869,11 +875,13 @@ QUICK REFERENCE: MAPS *netrw-browse-maps* {{{2
|
||||
see |netrw-P|
|
||||
<rightmouse> (gvim only) delete file/directory using word under
|
||||
mouse
|
||||
<2-leftmouse> (gvim only) when in a netrw-selected file, a double
|
||||
clicked leftmouse button will return to the netrw
|
||||
browser window. This mapping is available only if
|
||||
the user doesn't already have a <2-leftmouse> mapping.
|
||||
See |g:netrw_noretmap| if you don't want this mapping.
|
||||
<2-leftmouse> (gvim only) when:
|
||||
* in a netrw-selected file, AND
|
||||
* |g:netrw_retmap| == 1 AND
|
||||
* the user doesn't already have a <2-leftmouse> mapping
|
||||
defined before netrw is autoloaded,
|
||||
then a double clicked leftmouse button will return
|
||||
to the netrw browser window.
|
||||
<s-leftmouse> (gvim only) like mf, will mark files
|
||||
|
||||
QUICK REFERENCE: COMMANDS *netrw-explore-cmds* *netrw-browse-cmds* {{{2
|
||||
@ -895,7 +903,7 @@ One may easily "bookmark" a directory by using >
|
||||
<
|
||||
Any count may be used. One may use viminfo's "!" option to retain bookmarks
|
||||
between vim sessions. See |netrw-gb| for how to return to a bookmark and
|
||||
|netrw-q| for how to list them.
|
||||
|netrw-qb| for how to list them.
|
||||
|
||||
|
||||
BROWSING *netrw-cr* {{{2
|
||||
@ -917,10 +925,17 @@ default. When the option is one or two, the splitting will be taken
|
||||
horizontally or vertically, respectively. When the option is set to three, a
|
||||
<cr> will cause the file to appear in a new tab.
|
||||
|
||||
When using the gui (gvim), one may also click on a file using the leftmouse
|
||||
button. A doubly-clicked leftmouse button will return to the netrw browser
|
||||
window (unless |g:netrw_noretmap| is used, or the double-click leftmouse map
|
||||
is already defined before netrw is loaded).
|
||||
|
||||
When using the gui (gvim) one may select a file by pressing the <leftmouse>
|
||||
button. In addtion, if
|
||||
|
||||
*|g:netrw_retmap| == 1 AND (its default value is 0)
|
||||
* in a netrw-selected file, AND
|
||||
* the user doesn't already have a <2-leftmouse> mapping defined before
|
||||
netrw is loaded
|
||||
|
||||
then a doubly-clicked leftmouse button will return to the netrw browser
|
||||
window.
|
||||
|
||||
Netrw attempts to speed up browsing, especially for remote browsing where one
|
||||
may have to enter passwords, by keeping and re-using previously obtained
|
||||
@ -1022,7 +1037,7 @@ To change directory back to a bookmarked directory, use
|
||||
{cnt}gb
|
||||
|
||||
Any count may be used to reference any of the bookmarks. See |netrw-mb| on
|
||||
how to bookmark a directory and |netrw-q| on how to list bookmarks.
|
||||
how to bookmark a directory and |netrw-qb| on how to list bookmarks.
|
||||
|
||||
|
||||
CHANGING TO A PREDECESSOR DIRECTORY *netrw-u* *netrw-updir* {{{2
|
||||
@ -1038,7 +1053,7 @@ CHANGING TO A SUCCESSOR DIRECTORY *netrw-U* *netrw-downdir* {{{2
|
||||
|
||||
With the "U" map, one can change to a later directory (successor).
|
||||
This map is the opposite of the "u" map. (see |netrw-u|) Use the
|
||||
q map to list both the bookmarks and history. (see |netrw-q|)
|
||||
q map to list both the bookmarks and history. (see |netrw-qb|)
|
||||
|
||||
|
||||
NETRW CLEAN *netrw-clean* *:NetrwClean*
|
||||
@ -1198,6 +1213,9 @@ DIRECTORY EXPLORATION COMMANDS {{{2
|
||||
By default, these commands use the current file's directory. However, one
|
||||
may explicitly provide a directory (path) to use.
|
||||
|
||||
The |g:netrw_winsize| variable also is used, if specified by the user, to
|
||||
size Hexplore and Vexplore windows.
|
||||
|
||||
:Rexplore This command is a little different from the others. When one
|
||||
edits a file, for example by pressing <cr> when atop a file in
|
||||
a netrw browser window, :Rexplore will return the display to
|
||||
@ -1205,32 +1223,41 @@ may explicitly provide a directory (path) to use.
|
||||
of <2-leftmouse> (which is only available under gvim and
|
||||
cooperative terms).
|
||||
|
||||
*netrw-starstar*
|
||||
When Explore, Sexplore, Hexplore, or Vexplore are used with a **/filepat,
|
||||
such as:
|
||||
>
|
||||
:Explore **/filename_pattern
|
||||
|
||||
*netrw-star* *netrw-starpat* *netrw-starstar* *netrw-starstarpat*
|
||||
EXPLORING WITH STARS AND PATTERNS
|
||||
|
||||
When Explore, Sexplore, Hexplore, or Vexplore are used with one of the
|
||||
following four styles, Explore generates a list of files which satisfy
|
||||
the request. >
|
||||
|
||||
*/filepat files in current directory which satisfy filepat
|
||||
**/filepat files in current directory or below which satisfy the
|
||||
file pattern
|
||||
*//pattern files in the current directory which contain the
|
||||
pattern (vimgrep is used)
|
||||
**//pattern files in the current directory or below which contain
|
||||
the pattern (vimgrep is used)
|
||||
<
|
||||
netrw will attempt to find a file in the current directory or any subdirectory
|
||||
which matches the filename pattern. Internally, it produces a list of files
|
||||
which match the pattern and their paths; to that extent it resembles the Unix
|
||||
operation:
|
||||
>
|
||||
find $(pwd) -name "$1" -exec "echo" "{}" ";" 2> /dev/null
|
||||
<
|
||||
The directory display is updated to show the subdirectory containing a
|
||||
matching file. One may then proceed to the next (or previous) matching files'
|
||||
directories by using Nexplore or Pexplore, respectively. If your console or
|
||||
gui produces recognizable shift-up or shift-down sequences, then you'll likely
|
||||
find using shift-downarrow and shift-uparrow convenient. They're mapped by
|
||||
netrw:
|
||||
The cursor will be placed on the first file in the list. One may then
|
||||
continue to go to subsequent files on that list via |:Nexplore| or to
|
||||
preceding files on that list with |:Pexplore|. Explore will update the
|
||||
directory and place the cursor appropriately.
|
||||
|
||||
A plain >
|
||||
:Explore
|
||||
will clear the explore list.
|
||||
|
||||
If your console or gui produces recognizable shift-up or shift-down sequences,
|
||||
then you'll likely find using shift-downarrow and shift-uparrow convenient.
|
||||
They're mapped by netrw:
|
||||
|
||||
<s-down> == Nexplore, and
|
||||
<s-up> == Pexplore.
|
||||
|
||||
As an example, consider
|
||||
>
|
||||
:Explore **/*.c
|
||||
:Explore */*.c
|
||||
:Nexplore
|
||||
:Nexplore
|
||||
:Pexplore
|
||||
@ -1238,29 +1265,6 @@ As an example, consider
|
||||
The status line will show, on the right hand side of the status line, a
|
||||
message like "Match 3 of 20".
|
||||
|
||||
*netrw-starpat*
|
||||
When Explore, Sexplore, Hexplore, or Vexplore are used with a */pattern,
|
||||
such as:
|
||||
>
|
||||
:Explore */pattern
|
||||
<
|
||||
netrw will use |:vimgrep| to find files which contain the given pattern.
|
||||
Like what happens with |netrw-starstar|, a list of files which contain
|
||||
matches to the given pattern is generated. The cursor will then jump
|
||||
to the first file with the given pattern; |:Nexplore|, |:Pexplore|, and
|
||||
the shifted-down and -up arrows work with the list to move to the next
|
||||
or previous files in that list.
|
||||
|
||||
*netrw-starstarpat*
|
||||
When Explore, Sexplore, Hexplore, or Vexplore are used with a **//pattern,
|
||||
such as:
|
||||
>
|
||||
:Explore **//pattern
|
||||
<
|
||||
then Explore will use |:vimgrep| to find files like |netrw-starpat|;
|
||||
however, Explore will also search subdirectories as well as the current
|
||||
directory.
|
||||
|
||||
Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
|
||||
|g:netrw_fastbrowse| |g:netrw_ftp_browse_reject|
|
||||
|g:netrw_ftp_list_cmd| |g:netrw_ftp_sizelist_cmd|
|
||||
@ -1268,6 +1272,13 @@ Associated setting variables: |g:netrw_keepdir| |g:netrw_browse_split|
|
||||
|g:netrw_liststyle|
|
||||
|
||||
|
||||
DISPLAYING INFORMATION ABOUT FILE *netrw-qf* {{{2
|
||||
|
||||
With the cursor atop a filename, pressing "qf" will reveal the file's size
|
||||
and last modification timestamp. Currently this capability is only available
|
||||
for local files.
|
||||
|
||||
|
||||
EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide* {{{2
|
||||
|
||||
The "<ctrl-h>" map brings up a requestor allowing the user to change the
|
||||
@ -1279,14 +1290,15 @@ either be hidden (ie. not shown) or be the only ones displayed (see
|
||||
Associated setting variable: |g:netrw_hide|
|
||||
|
||||
|
||||
EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
|
||||
EDITING THE SORTING SEQUENCE *netrw-S* *netrw-sortsequence* {{{2
|
||||
|
||||
When "Sorted by" is name, one may specify priority via the sorting sequence
|
||||
(g:netrw_sort_sequence). The sorting sequence typically prioritizes the
|
||||
name-listing by suffix, although any pattern will do. Patterns are delimited
|
||||
by commas. The default sorting sequence is:
|
||||
by commas. The default sorting sequence is (all one line):
|
||||
>
|
||||
[\/]$,*,\.bak$,\.o$,\.h$,\.info$,\.swp$,\.obj$
|
||||
'[\/]$,\.[a-np-z]$,\.h$,\.c$,\.cpp$,*,\.o$,\.obj$,\.info$,
|
||||
\.swp$,\.bak$,\~$'
|
||||
<
|
||||
The lone * is where all filenames not covered by one of the other patterns
|
||||
will end up. One may change the sorting sequence by modifying the
|
||||
@ -1297,7 +1309,7 @@ Related topics: |g:netrw-s| |g:netrw-S|
|
||||
Associated setting variable: |g:netrw_sort_sequence|
|
||||
|
||||
|
||||
GOING UP *netrw--* {{{2
|
||||
GOING UP *netrw--* {{{2
|
||||
|
||||
To go up a directory, press "-" or press the <cr> when atop the ../ directory
|
||||
entry in the listing.
|
||||
@ -1314,7 +1326,7 @@ preferred. The NetList function which implements remote browsing
|
||||
expects that directories will be flagged by a trailing slash.
|
||||
|
||||
|
||||
HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
|
||||
HIDING FILES OR DIRECTORIES *netrw-a* *netrw-hiding* {{{2
|
||||
|
||||
Netrw's browsing facility allows one to use the hiding list in one of three
|
||||
ways: ignore it, hide files which match, and show only those files which
|
||||
@ -1353,6 +1365,11 @@ If files have been marked using |netrw-mf|, then this command will:
|
||||
and showing only non-hidden files.
|
||||
endif
|
||||
|
||||
*netrw-gh*
|
||||
As a quick shortcut, one may press >
|
||||
gh
|
||||
to toggle between hiding files which begin with a period (dot) or not.
|
||||
|
||||
Associated setting variable: |g:netrw_list_hide|
|
||||
|
||||
*netrw-ctrl_h*
|
||||
@ -1400,10 +1417,12 @@ passwords:
|
||||
http://sial.org/howto/openssh/publickey-auth/
|
||||
|
||||
|
||||
LISTING BOOKMARKS AND HISTORY *netrw-q* *netrw-listbookmark* {{{2
|
||||
LISTING BOOKMARKS AND HISTORY *netrw-qb* *netrw-listbookmark* {{{2
|
||||
|
||||
Pressing "q" will list the bookmarked directories and directory traversal
|
||||
history (query). (see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|)
|
||||
Pressing "qb" (query bookmarks) will list the bookmarked directories and
|
||||
directory traversal history (query).
|
||||
|
||||
(see |netrw-mb|, |netrw-gb|, |netrw-u|, and |netrw-U|)
|
||||
|
||||
|
||||
MAKING A NEW DIRECTORY *netrw-d* {{{2
|
||||
@ -1457,7 +1476,7 @@ associated decompressing utilities; see |g:netrw_decompress|.
|
||||
|
||||
Associated setting variables: |g:netrw_compress| |g:netrw_decompress|
|
||||
|
||||
MARKED FILES: COPYING *netrw-mc* {{{2
|
||||
MARKED FILES: COPYING *netrw-mc* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
Select a target directory with mt (|netrw-mt|). Then change directory,
|
||||
@ -1465,18 +1484,29 @@ select file(s) (see |netrw-mf|), and press "mc".
|
||||
|
||||
Associated setting variable: |g:netrw_localcopycmd| |g:netrw_ssh_cmd|
|
||||
|
||||
MARKED FILES: DIFF *netrw-md* {{{2
|
||||
MARKED FILES: DIFF *netrw-md* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
Use |vimdiff| to visualize difference between selected files (two or
|
||||
three may be selected for this).
|
||||
|
||||
MARKED FILES: EDITING *netrw-me* {{{2
|
||||
MARKED FILES: EDITING *netrw-me* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
This command will place the marked files on the |arglist| and commence
|
||||
editing them. One may return the to explorer window with |:Rexplore|.
|
||||
|
||||
MARKED FILES: HIDING AND UNHIDING BY SUFFIX *netrw-mh* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
This command extracts the suffices of the marked files and toggles their
|
||||
presence on the hiding list. Please note that marking the same suffix
|
||||
this way multiple times will result in the suffix's presence being toggled
|
||||
for each file (so an even quantity of marked files having the same suffix
|
||||
is the same as not having bothered to select them at all).
|
||||
|
||||
Related topics: |netrw-a| |g:netrw_list_hide|
|
||||
|
||||
MARKED FILES: MOVING *netrw-mm* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
@ -1485,7 +1515,7 @@ select file(s) (see |netrw-mf|), and press "mm".
|
||||
|
||||
Associated setting variable: |g:netrw_localmovecmd| |g:netrw_ssh_cmd|
|
||||
|
||||
MARKED FILES: PRINTING *netrw-mp* {{{2
|
||||
MARKED FILES: PRINTING *netrw-mp* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
Netrw will apply the |:hardcopy| command to marked files. What it does
|
||||
@ -1493,7 +1523,13 @@ is open each file in a one-line window, execute hardcopy, then close the
|
||||
one-line window.
|
||||
|
||||
|
||||
MARKED FILES: TAGGING *netrw-mT* {{{2
|
||||
MARKED FILES: SOURCING *netrw-ms* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
Netrw will source the marked files (using vim's |:source| command)
|
||||
|
||||
|
||||
MARKED FILES: TAGGING *netrw-mT* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
The "mt" mapping will apply the command in |g:netrw_ctags| (by default, its
|
||||
@ -1518,19 +1554,31 @@ edit the desired file and go to the tag.
|
||||
Associated setting variables: |g:netrw_ctags| |g:netrw_ssh_cmd|
|
||||
|
||||
|
||||
MARKED FILES: SETTING TARGET DIRECTORY *netrw-mt* {{{2
|
||||
MARKED FILES: SETTING THE TARGET DIRECTORY *netrw-mt* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
Set the marked file move/copy target (see |netrw-mc| and |netrw-mm|).
|
||||
Set the marked file copy/move-to target (see |netrw-mc| and |netrw-mm|):
|
||||
|
||||
* if the cursor is atop a file name, then the netrw window's currently
|
||||
displayed directory is used for the copy/move-to target.
|
||||
|
||||
MARKED FILES: UNMARKING *netrw-mu* {{{2
|
||||
* also, if the cursor is in the banner, then the netrw window's currently
|
||||
displayed directory is used for the copy/move-to target.
|
||||
|
||||
* however, if the cursor is atop a directory name, then that directory is
|
||||
used for the copy/move-to target
|
||||
|
||||
There is only one copy/move-to target per vim session; ie. the target is a
|
||||
script variable (see |s:var|) and is shared between all netrw windows (in an
|
||||
instance of vim).
|
||||
|
||||
MARKED FILES: UNMARKING *netrw-mu* {{{2
|
||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||
|
||||
The "mu" mapping will unmark all currently marked files.
|
||||
|
||||
|
||||
MARKING FILES *netrw-mf* {{{2
|
||||
MARKING FILES *netrw-mf* {{{2
|
||||
(also see |netrw-mr|)
|
||||
|
||||
One may mark files with the cursor atop a filename and then pressing "mf".
|
||||
@ -1549,7 +1597,7 @@ Two commands, |netrw-mc| and |netrw-mm|, copy/move marked files to a
|
||||
target directory (which can be set with |netrw-mt|).
|
||||
|
||||
|
||||
MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
|
||||
MARKING FILES BY REGULAR EXPRESSION *netrw-mr* {{{2
|
||||
(also see |netrw-mf|)
|
||||
|
||||
One may also mark files by pressing "mr"; netrw will then issue a prompt,
|
||||
@ -1676,6 +1724,7 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
= 3: tree style listing
|
||||
*g:netrw_list_hide* comma separated pattern list for hiding files
|
||||
Patterns are regular expressions (see |regexp|)
|
||||
Example: let g:netrw_list_hide= '.*\.swp$'
|
||||
default: ""
|
||||
|
||||
*g:netrw_localcopycmd* ="cp" Linux/Unix/MacOS/Cygwin
|
||||
@ -1704,9 +1753,11 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
*g:netrw_mkdir_cmd* command for making a remote directory
|
||||
default: "ssh USEPORT HOSTNAME mkdir"
|
||||
|
||||
*g:netrw_noretmap* if it exists and is set to one, then
|
||||
<2-leftmouse> will not be mapped for easy
|
||||
*g:netrw_retmap* if it exists and is set to one, then
|
||||
<2-leftmouse> will be mapped for easy
|
||||
return to the netrw browser window.
|
||||
(example: click once to select and open
|
||||
a file, double-click to return)
|
||||
default: =0
|
||||
|
||||
*g:netrw_rm_cmd* command for removing files
|
||||
@ -1729,6 +1780,28 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
default: '[\/]$,*,\.bak$,\.o$,\.h$,
|
||||
\.info$,\.swp$,\.obj$'
|
||||
|
||||
*g:netrw_special_syntax* If true, then certain files will be shown
|
||||
in special syntax in the browser:
|
||||
|
||||
netrwBak : *.bak
|
||||
netrwCompress: *.gz *.bz2 *.Z *.zip
|
||||
netrwData : *.dat
|
||||
netrwHdr : *.h
|
||||
netrwLib : *.a *.so *.lib *.dll
|
||||
netrwMakefile: [mM]akefile *.mak
|
||||
netrwObj : *.o *.obj
|
||||
netrwTags : tags ANmenu ANtags
|
||||
netrwTilde : *~
|
||||
netrwTmp : tmp* *tmp
|
||||
|
||||
These syntax highlighting groups are linked
|
||||
to Folded or DiffChange by default
|
||||
(see |hl-Folded| and |hl-DiffChange|), but
|
||||
one may put lines like >
|
||||
hi link netrwCompress Visual
|
||||
< into one's <.vimrc> to use one's own
|
||||
preferences.
|
||||
|
||||
*g:netrw_ssh_cmd* One may specify an executable command
|
||||
to use instead of ssh for remote actions
|
||||
such as listing, file removal, etc.
|
||||
@ -1759,7 +1832,9 @@ your browsing preferences. (see also: |netrw-settings|)
|
||||
" %a %Y-%m-%d %I-%M-%S %p"
|
||||
default: "%c"
|
||||
|
||||
*g:netrw_winsize* specify initial size of new o/v windows
|
||||
*g:netrw_winsize* specify initial size of new windows made with
|
||||
"o" (see |netrw-o|), "v" (see |netrw-v|),
|
||||
|:Hexplore| or |:Vexplore|.
|
||||
default: ""
|
||||
|
||||
*g:NetrwTopLvlMenu* This variable specifies the top level
|
||||
@ -2162,6 +2237,61 @@ which is loaded automatically at startup (assuming :set nocp).
|
||||
==============================================================================
|
||||
12. History *netrw-history* {{{1
|
||||
|
||||
v122: Feb 12, 2008 * bugfix - first sorting sequence match now has
|
||||
priority
|
||||
Feb 14, 2008 * bugfix - sorting sequence was effectively ignoring
|
||||
sequencing priority of anything following '*'
|
||||
* toggling a marked file was showing incorrect list
|
||||
(list was correct, but displayed matches weren't)
|
||||
* |g:netrw_special_syntax| implemented
|
||||
v121: Feb 11, 2008 * Bram M reported that :e file ... :e . would not
|
||||
retain the alternate file. Fixed -- I hope!
|
||||
* bugfix -- apparently v120 broke an explicit
|
||||
:Explore dirname
|
||||
v120: Jan 21, 2008 * |netrw-mt| changed to allow for target selection
|
||||
based on whether or not word under cursor is a
|
||||
directory or file, or if cursor is in banner
|
||||
area.
|
||||
* |netrw-mh| included (hiding by marked-file suffix)
|
||||
* functions moved about a bit (improved
|
||||
categorization)
|
||||
* executable files now displayed with trailing (*)
|
||||
* symbolically linked files now displayed with
|
||||
trailing (@)
|
||||
* Somewhen, s:NetrwMarkFileMove() got damaged. Its
|
||||
now restored (missing an endif, for example).
|
||||
* |netrw-mu| implemented (unmarking marked files)
|
||||
* many bugs have been removed from the marked file
|
||||
system (tnx to Mark S. for feedback)
|
||||
* |netrw-ms| implemented (sourcing marked files)
|
||||
* fixed use of P with tree listing style
|
||||
* multiple tree listing now supported
|
||||
* ./ suppressed
|
||||
* changed q -> qb (query bookmarks)
|
||||
* implemented |netrw-qf|
|
||||
* Explore now has four special list-generation
|
||||
modes: */filepat **/filepat
|
||||
*//pattern **//pattern
|
||||
* gh (|netrw-gh|) is a shortcut for toggling the
|
||||
hiding of files and directories beginning with a
|
||||
dot
|
||||
v119: Jan 10, 2008 * When g:netrw_keepdir is false,
|
||||
NetrwOptionsRestore() had a problem
|
||||
(Bill McCarthy)
|
||||
Jan 11, 2008 * Netrw now shows symbolic links with a trailing
|
||||
"@" and special highlighting.
|
||||
Jan 15, 2008 * Changed g:netrw_noretmap -> |g:netrw_retmap|.
|
||||
Changed: disabled by default at Bram's
|
||||
preference.
|
||||
v118: Jan 02, 2008 * Fixed a problem with Windows;
|
||||
:Explore c:/path/ would not work,
|
||||
but :Explore c:/path would.
|
||||
* Fixed a bug in s:NetrwOptionRestore() - lcd's
|
||||
argument wasn't being properly escaped so it
|
||||
wouldn't handle spaces in directory names.
|
||||
(Gary Johnson)
|
||||
v117: Jan 02, 2008 * Fixed a problem with P; had to include
|
||||
a b:netrw_curdir bypass (Bram Moolenaar)
|
||||
v116: Nov 27, 2007 * netrw#LocalBrowseCheck() has &ft=="netrw"
|
||||
check to prevent doing a directory listing
|
||||
(was getting unexpected directory refreshes
|
||||
|
@ -1,7 +1,20 @@
|
||||
'go' Align.txt /*'go'*
|
||||
:Explore pi_netrw.txt /*:Explore*
|
||||
:GLVS pi_getscript.txt /*:GLVS*
|
||||
:GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat*
|
||||
:Hexplore pi_netrw.txt /*:Hexplore*
|
||||
:I visincr.txt /*:I*
|
||||
:IA visincr.txt /*:IA*
|
||||
:ID visincr.txt /*:ID*
|
||||
:II visincr.txt /*:II*
|
||||
:IIO visincr.txt /*:IIO*
|
||||
:IIR visincr.txt /*:IIR*
|
||||
:IIX visincr.txt /*:IIX*
|
||||
:IM visincr.txt /*:IM*
|
||||
:IO visincr.txt /*:IO*
|
||||
:IPOW visincr.txt /*:IPOW*
|
||||
:IR visincr.txt /*:IR*
|
||||
:IX visincr.txt /*:IX*
|
||||
:LP LogiPat.txt /*:LP*
|
||||
:LPF LogiPat.txt /*:LPF*
|
||||
:LogiPat LogiPat.txt /*:LogiPat*
|
||||
@ -10,6 +23,11 @@
|
||||
:NetrwClean pi_netrw.txt /*:NetrwClean*
|
||||
:Nexplore pi_netrw.txt /*:Nexplore*
|
||||
:Pexplore pi_netrw.txt /*:Pexplore*
|
||||
:RI visincr.txt /*:RI*
|
||||
:RID visincr.txt /*:RID*
|
||||
:RIDMY visincr.txt /*:RIDMY*
|
||||
:RIPOW visincr.txt /*:RIPOW*
|
||||
:RM visincr.txt /*:RM*
|
||||
:Rexplore pi_netrw.txt /*:Rexplore*
|
||||
:RmVimball pi_vimball.txt /*:RmVimball*
|
||||
:Sexplore pi_netrw.txt /*:Sexplore*
|
||||
@ -22,23 +40,13 @@
|
||||
:UseVimball pi_vimball.txt /*:UseVimball*
|
||||
:Vexplore pi_netrw.txt /*:Vexplore*
|
||||
:VimballList pi_vimball.txt /*:VimballList*
|
||||
Align-copyright Align.txt /*Align-copyright*
|
||||
C-Reference crefvim.txt /*C-Reference*
|
||||
GetLatestVimScripts pi_getscript.txt /*GetLatestVimScripts*
|
||||
GetLatestVimScripts-copyright pi_getscript.txt /*GetLatestVimScripts-copyright*
|
||||
GetLatestVimScripts_dat pi_getscript.txt /*GetLatestVimScripts_dat*
|
||||
I visincr.txt /*I*
|
||||
IA visincr.txt /*IA*
|
||||
ID visincr.txt /*ID*
|
||||
IDMY visincr.txt /*IDMY*
|
||||
II visincr.txt /*II*
|
||||
IIO visincr.txt /*IIO*
|
||||
IIR visincr.txt /*IIR*
|
||||
IIX visincr.txt /*IIX*
|
||||
IM visincr.txt /*IM*
|
||||
IMDY visincr.txt /*IMDY*
|
||||
IO visincr.txt /*IO*
|
||||
IR visincr.txt /*IR*
|
||||
IX visincr.txt /*IX*
|
||||
IYMD visincr.txt /*IYMD*
|
||||
LogiPat() LogiPat.txt /*LogiPat()*
|
||||
LogiPat-flags LogiPat.txt /*LogiPat-flags*
|
||||
@ -46,10 +54,93 @@ MatchError matchit.txt /*MatchError*
|
||||
Nread pi_netrw.txt /*Nread*
|
||||
Nsource pi_netrw.txt /*Nsource*
|
||||
Nwrite pi_netrw.txt /*Nwrite*
|
||||
SR SrchRplcHiGrp.txt /*SR*
|
||||
SRChooseHiGrp SrchRplcHiGrp.txt /*SRChooseHiGrp*
|
||||
SRDispHiGrp SrchRplcHiGrp.txt /*SRDispHiGrp*
|
||||
SRHiGrp SrchRplcHiGrp.txt /*SRHiGrp*
|
||||
SRSearch SrchRplcHiGrp.txt /*SRSearch*
|
||||
SrchRplcHiGrp.txt SrchRplcHiGrp.txt /*SrchRplcHiGrp.txt*
|
||||
TCommentDefineType() tComment.txt /*TCommentDefineType()*
|
||||
Vimball-copyright pi_vimball.txt /*Vimball-copyright*
|
||||
[% matchit.txt /*[%*
|
||||
]% matchit.txt /*]%*
|
||||
align Align.txt /*align*
|
||||
align-align Align.txt /*align-align*
|
||||
align-codepoint Align.txt /*align-codepoint*
|
||||
align-command Align.txt /*align-command*
|
||||
align-commands Align.txt /*align-commands*
|
||||
align-concept Align.txt /*align-concept*
|
||||
align-concepts Align.txt /*align-concepts*
|
||||
align-contents Align.txt /*align-contents*
|
||||
align-control Align.txt /*align-control*
|
||||
align-history Align.txt /*align-history*
|
||||
align-manual Align.txt /*align-manual*
|
||||
align-maps Align.txt /*align-maps*
|
||||
align-option Align.txt /*align-option*
|
||||
align-options Align.txt /*align-options*
|
||||
align-strlen Align.txt /*align-strlen*
|
||||
align-usage Align.txt /*align-usage*
|
||||
align-utf Align.txt /*align-utf*
|
||||
align-utf8 Align.txt /*align-utf8*
|
||||
align.txt Align.txt /*align.txt*
|
||||
alignctrl Align.txt /*alignctrl*
|
||||
alignctrl- Align.txt /*alignctrl-*
|
||||
alignctrl-+ Align.txt /*alignctrl-+*
|
||||
alignctrl-- Align.txt /*alignctrl--*
|
||||
alignctrl-: Align.txt /*alignctrl-:*
|
||||
alignctrl-< Align.txt /*alignctrl-<*
|
||||
alignctrl-= Align.txt /*alignctrl-=*
|
||||
alignctrl-> Align.txt /*alignctrl->*
|
||||
alignctrl-C Align.txt /*alignctrl-C*
|
||||
alignctrl-I Align.txt /*alignctrl-I*
|
||||
alignctrl-P Align.txt /*alignctrl-P*
|
||||
alignctrl-W Align.txt /*alignctrl-W*
|
||||
alignctrl-c Align.txt /*alignctrl-c*
|
||||
alignctrl-g Align.txt /*alignctrl-g*
|
||||
alignctrl-l Align.txt /*alignctrl-l*
|
||||
alignctrl-m Align.txt /*alignctrl-m*
|
||||
alignctrl-no-option Align.txt /*alignctrl-no-option*
|
||||
alignctrl-p Align.txt /*alignctrl-p*
|
||||
alignctrl-r Align.txt /*alignctrl-r*
|
||||
alignctrl-separators Align.txt /*alignctrl-separators*
|
||||
alignctrl-settings Align.txt /*alignctrl-settings*
|
||||
alignctrl-v Align.txt /*alignctrl-v*
|
||||
alignctrl-w Align.txt /*alignctrl-w*
|
||||
alignman Align.txt /*alignman*
|
||||
alignmanual Align.txt /*alignmanual*
|
||||
alignmap-Htd Align.txt /*alignmap-Htd*
|
||||
alignmap-T= Align.txt /*alignmap-T=*
|
||||
alignmap-a, Align.txt /*alignmap-a,*
|
||||
alignmap-a< Align.txt /*alignmap-a<*
|
||||
alignmap-a= Align.txt /*alignmap-a=*
|
||||
alignmap-a? Align.txt /*alignmap-a?*
|
||||
alignmap-abox Align.txt /*alignmap-abox*
|
||||
alignmap-acom Align.txt /*alignmap-acom*
|
||||
alignmap-adcom Align.txt /*alignmap-adcom*
|
||||
alignmap-adec Align.txt /*alignmap-adec*
|
||||
alignmap-adef Align.txt /*alignmap-adef*
|
||||
alignmap-afnc Align.txt /*alignmap-afnc*
|
||||
alignmap-anum Align.txt /*alignmap-anum*
|
||||
alignmap-aocom Align.txt /*alignmap-aocom*
|
||||
alignmap-ascom Align.txt /*alignmap-ascom*
|
||||
alignmap-history Align.txt /*alignmap-history*
|
||||
alignmap-m= Align.txt /*alignmap-m=*
|
||||
alignmap-t# Align.txt /*alignmap-t#*
|
||||
alignmap-t, Align.txt /*alignmap-t,*
|
||||
alignmap-t: Align.txt /*alignmap-t:*
|
||||
alignmap-t; Align.txt /*alignmap-t;*
|
||||
alignmap-t< Align.txt /*alignmap-t<*
|
||||
alignmap-t= Align.txt /*alignmap-t=*
|
||||
alignmap-t? Align.txt /*alignmap-t?*
|
||||
alignmap-tab Align.txt /*alignmap-tab*
|
||||
alignmap-tml Align.txt /*alignmap-tml*
|
||||
alignmap-ts, Align.txt /*alignmap-ts,*
|
||||
alignmap-tsp Align.txt /*alignmap-tsp*
|
||||
alignmap-tsq Align.txt /*alignmap-tsq*
|
||||
alignmap-tt Align.txt /*alignmap-tt*
|
||||
alignmap-t~ Align.txt /*alignmap-t~*
|
||||
alignmaps Align.txt /*alignmaps*
|
||||
alignusage Align.txt /*alignusage*
|
||||
b:match_col matchit.txt /*b:match_col*
|
||||
b:match_debug matchit.txt /*b:match_debug*
|
||||
b:match_ignorecase matchit.txt /*b:match_ignorecase*
|
||||
@ -1332,9 +1423,9 @@ g:netrw_maxfilenamelen pi_netrw.txt /*g:netrw_maxfilenamelen*
|
||||
g:netrw_menu pi_netrw.txt /*g:netrw_menu*
|
||||
g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd*
|
||||
g:netrw_nogx pi_netrw.txt /*g:netrw_nogx*
|
||||
g:netrw_noretmap pi_netrw.txt /*g:netrw_noretmap*
|
||||
g:netrw_preview pi_netrw.txt /*g:netrw_preview*
|
||||
g:netrw_rcp_cmd pi_netrw.txt /*g:netrw_rcp_cmd*
|
||||
g:netrw_retmap pi_netrw.txt /*g:netrw_retmap*
|
||||
g:netrw_rm_cmd pi_netrw.txt /*g:netrw_rm_cmd*
|
||||
g:netrw_rmdir_cmd pi_netrw.txt /*g:netrw_rmdir_cmd*
|
||||
g:netrw_rmf_cmd pi_netrw.txt /*g:netrw_rmf_cmd*
|
||||
@ -1347,6 +1438,7 @@ g:netrw_silent pi_netrw.txt /*g:netrw_silent*
|
||||
g:netrw_sort_by pi_netrw.txt /*g:netrw_sort_by*
|
||||
g:netrw_sort_direction pi_netrw.txt /*g:netrw_sort_direction*
|
||||
g:netrw_sort_sequence pi_netrw.txt /*g:netrw_sort_sequence*
|
||||
g:netrw_special_syntax pi_netrw.txt /*g:netrw_special_syntax*
|
||||
g:netrw_ssh_browse_reject pi_netrw.txt /*g:netrw_ssh_browse_reject*
|
||||
g:netrw_ssh_cmd pi_netrw.txt /*g:netrw_ssh_cmd*
|
||||
g:netrw_sshport pi_netrw.txt /*g:netrw_sshport*
|
||||
@ -1471,6 +1563,7 @@ netrw-file pi_netrw.txt /*netrw-file*
|
||||
netrw-fixup pi_netrw.txt /*netrw-fixup*
|
||||
netrw-ftp pi_netrw.txt /*netrw-ftp*
|
||||
netrw-gb pi_netrw.txt /*netrw-gb*
|
||||
netrw-gh pi_netrw.txt /*netrw-gh*
|
||||
netrw-gx pi_netrw.txt /*netrw-gx*
|
||||
netrw-handler pi_netrw.txt /*netrw-handler*
|
||||
netrw-help pi_netrw.txt /*netrw-help*
|
||||
@ -1490,11 +1583,13 @@ netrw-mc pi_netrw.txt /*netrw-mc*
|
||||
netrw-md pi_netrw.txt /*netrw-md*
|
||||
netrw-me pi_netrw.txt /*netrw-me*
|
||||
netrw-mf pi_netrw.txt /*netrw-mf*
|
||||
netrw-mh pi_netrw.txt /*netrw-mh*
|
||||
netrw-ml_get pi_netrw.txt /*netrw-ml_get*
|
||||
netrw-mm pi_netrw.txt /*netrw-mm*
|
||||
netrw-move pi_netrw.txt /*netrw-move*
|
||||
netrw-mp pi_netrw.txt /*netrw-mp*
|
||||
netrw-mr pi_netrw.txt /*netrw-mr*
|
||||
netrw-ms pi_netrw.txt /*netrw-ms*
|
||||
netrw-mt pi_netrw.txt /*netrw-mt*
|
||||
netrw-mu pi_netrw.txt /*netrw-mu*
|
||||
netrw-mx pi_netrw.txt /*netrw-mx*
|
||||
@ -1528,7 +1623,8 @@ netrw-prvwin pi_netrw.txt /*netrw-prvwin*
|
||||
netrw-pscp pi_netrw.txt /*netrw-pscp*
|
||||
netrw-psftp pi_netrw.txt /*netrw-psftp*
|
||||
netrw-putty pi_netrw.txt /*netrw-putty*
|
||||
netrw-q pi_netrw.txt /*netrw-q*
|
||||
netrw-qb pi_netrw.txt /*netrw-qb*
|
||||
netrw-qf pi_netrw.txt /*netrw-qf*
|
||||
netrw-r pi_netrw.txt /*netrw-r*
|
||||
netrw-read pi_netrw.txt /*netrw-read*
|
||||
netrw-ref pi_netrw.txt /*netrw-ref*
|
||||
@ -1542,6 +1638,7 @@ netrw-sort pi_netrw.txt /*netrw-sort*
|
||||
netrw-sortsequence pi_netrw.txt /*netrw-sortsequence*
|
||||
netrw-source pi_netrw.txt /*netrw-source*
|
||||
netrw-ssh-hack pi_netrw.txt /*netrw-ssh-hack*
|
||||
netrw-star pi_netrw.txt /*netrw-star*
|
||||
netrw-starpat pi_netrw.txt /*netrw-starpat*
|
||||
netrw-starstar pi_netrw.txt /*netrw-starstar*
|
||||
netrw-starstarpat pi_netrw.txt /*netrw-starstarpat*
|
||||
@ -1579,6 +1676,10 @@ rsync pi_netrw.txt /*rsync*
|
||||
s:netrw_passwd pi_netrw.txt /*s:netrw_passwd*
|
||||
scp pi_netrw.txt /*scp*
|
||||
sftp pi_netrw.txt /*sftp*
|
||||
srchrplchigrp SrchRplcHiGrp.txt /*srchrplchigrp*
|
||||
srchrplchigrp-commands SrchRplcHiGrp.txt /*srchrplchigrp-commands*
|
||||
srchrplchigrp-contents SrchRplcHiGrp.txt /*srchrplchigrp-contents*
|
||||
srchrplchigrp-examples SrchRplcHiGrp.txt /*srchrplchigrp-examples*
|
||||
tComment-Installation tComment.txt /*tComment-Installation*
|
||||
tComment-Key-Bindings tComment.txt /*tComment-Key-Bindings*
|
||||
tComment-Usage tComment.txt /*tComment-Usage*
|
||||
@ -1602,11 +1703,13 @@ visincr-ID visincr.txt /*visincr-ID*
|
||||
visincr-IDMY visincr.txt /*visincr-IDMY*
|
||||
visincr-II visincr.txt /*visincr-II*
|
||||
visincr-IIO visincr.txt /*visincr-IIO*
|
||||
visincr-IIPOW visincr.txt /*visincr-IIPOW*
|
||||
visincr-IIR visincr.txt /*visincr-IIR*
|
||||
visincr-IIX visincr.txt /*visincr-IIX*
|
||||
visincr-IM visincr.txt /*visincr-IM*
|
||||
visincr-IMDY visincr.txt /*visincr-IMDY*
|
||||
visincr-IO visincr.txt /*visincr-IO*
|
||||
visincr-IPOW visincr.txt /*visincr-IPOW*
|
||||
visincr-IR visincr.txt /*visincr-IR*
|
||||
visincr-IX visincr.txt /*visincr-IX*
|
||||
visincr-IYMD visincr.txt /*visincr-IYMD*
|
||||
@ -1614,8 +1717,10 @@ visincr-RI visincr.txt /*visincr-RI*
|
||||
visincr-RID visincr.txt /*visincr-RID*
|
||||
visincr-RIDMY visincr.txt /*visincr-RIDMY*
|
||||
visincr-RII visincr.txt /*visincr-RII*
|
||||
visincr-RIIPOW visincr.txt /*visincr-RIIPOW*
|
||||
visincr-RIM visincr.txt /*visincr-RIM*
|
||||
visincr-RIMDY visincr.txt /*visincr-RIMDY*
|
||||
visincr-RIPOW visincr.txt /*visincr-RIPOW*
|
||||
visincr-RIYMD visincr.txt /*visincr-RIYMD*
|
||||
visincr-calutil visincr.txt /*visincr-calutil*
|
||||
visincr-copyright visincr.txt /*visincr-copyright*
|
||||
@ -1628,5 +1733,6 @@ visincr-increment visincr.txt /*visincr-increment*
|
||||
visincr-leaddate visincr.txt /*visincr-leaddate*
|
||||
visincr-options visincr.txt /*visincr-options*
|
||||
visincr-raggedright visincr.txt /*visincr-raggedright*
|
||||
visincr-restrict visincr.txt /*visincr-restrict*
|
||||
visincr-usage visincr.txt /*visincr-usage*
|
||||
visincr.txt visincr.txt /*visincr.txt*
|
||||
|
@ -1,8 +1,8 @@
|
||||
*visincr.txt* The Visual Incrementing Tool Sep 19, 2006
|
||||
*visincr.txt* The Visual Incrementing Tool Oct 17, 2007
|
||||
|
||||
Author: Charles E. Campbell, Jr. <NdrchipO@ScampbellPfamily.AbizM>
|
||||
(remove NOSPAM from Campbell's email before using)
|
||||
Copyright: (c) 2004-2005 by Charles E. Campbell, Jr. *visincr-copyright*
|
||||
Copyright: (c) 2004-2007 by Charles E. Campbell, Jr. *visincr-copyright*
|
||||
The VIM LICENSE applies to visincr.vim and visincr.txt
|
||||
(see |copyright|) except use "visincr" instead of "Vim"
|
||||
No warranty, express or implied. Use At-Your-Own-Risk.
|
||||
@ -25,6 +25,8 @@ Copyright: (c) 2004-2005 by Charles E. Campbell, Jr. *visincr-copyright*
|
||||
:IA [#] ...................: |visincr-IA|
|
||||
:ID [#] ...................: |visincr-ID|
|
||||
:IM [#] ...................: |visincr-IM|
|
||||
:IPOW [#] ...................: |visincr-IPOW|
|
||||
:IIPOW [#] ..................: |visincr-IIPOW|
|
||||
4. Examples.....................: |visincr-examples|
|
||||
:I ..........................: |ex-viscinr-I|
|
||||
:II .........................: |ex-viscinr-II|
|
||||
@ -112,14 +114,21 @@ Copyright: (c) 2004-2005 by Charles E. Campbell, Jr. *visincr-copyright*
|
||||
then only three-letter abbreviations will be used.
|
||||
For more: see |visincr-IM|
|
||||
|
||||
*:RI* :*RII* :*RIMDY* *:RIDMY* *:RID* *:RM* *visincr-restrict*
|
||||
:RI RII RIYMD RIMDY RIDMY RID RM
|
||||
Restricted variants of the above commands - requires
|
||||
that the visual block on the current line start with
|
||||
an appropriate pattern (ie. a number for :I, a
|
||||
dayname for :ID, a monthname for :IM, etc).
|
||||
For more, see |visincr-RI|, |visincr-RII|, |visincr-RIYMD|,
|
||||
|visincr-RIMDY|, |visincr-RIDMY|, |visincr-RID|, and
|
||||
|visincr-M|.
|
||||
For more, see
|
||||
|
||||
Restricted left-justified incrementing......|visincr-RI|
|
||||
Restricted right-justified incrementing.....|visincr-RII|
|
||||
Restricted year/month/day incrementing......|visincr-RIYMD|
|
||||
Restricted month/day/year incrementing......|visincr-RIMDY|
|
||||
Restricted day/month/year incrementing......|visincr-RIDMY|
|
||||
Restricted dayname incrementing.............|visincr-RID|
|
||||
Restricted monthname incrementing...........|visincr-M|
|
||||
|
||||
|
||||
==============================================================================
|
||||
@ -129,7 +138,7 @@ Copyright: (c) 2004-2005 by Charles E. Campbell, Jr. *visincr-copyright*
|
||||
The visincr plugin facilitates making a column of increasing or decreasing
|
||||
numbers, dates, or daynames.
|
||||
|
||||
LEFT JUSTIFIED INCREMENTING *I* *viscinr-I*
|
||||
LEFT JUSTIFIED INCREMENTING *:I* *viscinr-I*
|
||||
:I [#] Will use the first line's number as a starting point to build
|
||||
a column of increasing numbers (or decreasing numbers if the
|
||||
increment is negative).
|
||||
@ -139,21 +148,21 @@ numbers, dates, or daynames.
|
||||
|
||||
The IX variant supports hexadecimal incrementing.
|
||||
|
||||
*visincr-RI*
|
||||
*visincr-RI*
|
||||
The restricted version (:RI) applies number incrementing only
|
||||
to those lines in the visual block that begin with a number.
|
||||
|
||||
See |visincr-raggedright| for a discussion on ragged-right
|
||||
handling.
|
||||
|
||||
*IX* *visincr-IX* *IO* *visincr-IO*
|
||||
*:IX* *visincr-IX* *:IO* *visincr-IO*
|
||||
The following two commands are variants of :I : >
|
||||
:IO [#] left justified octal incrementing
|
||||
:IX [#] left justified hexadecimal incrementing
|
||||
< The increments are in octal or hexadecimal for their
|
||||
respective commands.
|
||||
|
||||
*IR* *visincr-IR* *IIR* *visincr-IIR*
|
||||
*:IR* *visincr-IR* *:IIR* *visincr-IIR*
|
||||
These commands do left (IR) and right (IIR) justified
|
||||
Roman numeral enumeration. The increment for these
|
||||
commands is in the usual arabic numerals (ie. decimal)
|
||||
@ -162,7 +171,7 @@ numbers, dates, or daynames.
|
||||
|
||||
|
||||
|
||||
RIGHT JUSTIFIED INCREMENTING *II* *visincr-II*
|
||||
RIGHT JUSTIFIED INCREMENTING *:II* *visincr-II*
|
||||
:II [# [zfill]] Will use the first line's number as a starting point
|
||||
to build a column of increasing numbers (or decreasing numbers
|
||||
if the increment is negative).
|
||||
@ -172,14 +181,14 @@ numbers, dates, or daynames.
|
||||
Zfill : left padding will be done with the given
|
||||
character, typically a zero.
|
||||
|
||||
*IIX* *visincr-IIX* *IIO* *visincr-IIO*
|
||||
*:IIX* *visincr-IIX* *:IIO* *visincr-IIO*
|
||||
The following two commands are variants of :II :
|
||||
:IIO [# [zfill]] right justified octal incrementing
|
||||
:IIX [# [zfill]] right justified hexadecimal incrementing
|
||||
|
||||
*visincr-RII*
|
||||
The restricted version (:RII) applies number incrementing only to
|
||||
those lines in the visual block that begin with zero or more
|
||||
*visincr-RII*
|
||||
The restricted version (:RII) applies number incrementing only
|
||||
to those lines in the visual block that begin with zero or more
|
||||
spaces and end with a number.
|
||||
|
||||
RAGGED RIGHT HANDLING FOR I AND II *visincr-raggedright*
|
||||
@ -227,10 +236,13 @@ numbers, dates, or daynames.
|
||||
words.
|
||||
*g:visincr_datedivset*
|
||||
By default, the date dividers are: given by: >
|
||||
let g:visincr_datedivset= '[-./]'
|
||||
let g:visincr_datedivset= '[-./_:~,+*^]\='
|
||||
< You may change the set in your <.vimrc>. The separator actually
|
||||
used is the first one found in your date column.
|
||||
|
||||
used is the first one found in your date column. A date
|
||||
divider is no longer strictly required (note that \= in the
|
||||
date divider set). For :IMDY and :IDMY and no date dividers,
|
||||
the year may be 2 or 4 digits. For :IYMD, the year must be
|
||||
four digits if there are no date dividers.
|
||||
|
||||
SINGLE DIGIT DAYS OR MONTHS *visincr-leaddate*
|
||||
|
||||
@ -253,11 +265,11 @@ numbers, dates, or daynames.
|
||||
|
||||
http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs
|
||||
|
||||
ALPHABETIC INCREMENTING *IA* *visincr-IA*
|
||||
ALPHABETIC INCREMENTING *:IA* *visincr-IA*
|
||||
:IA Will produce an increasing/decreasing list of alphabetic
|
||||
characters.
|
||||
|
||||
DAYNAME INCREMENTING *ID* *visincr-ID* *visincr-RID*
|
||||
DAYNAME INCREMENTING *:ID* *visincr-ID* *visincr-RID*
|
||||
:ID [#] Will produce an increasing/decreasing list of daynames.
|
||||
Three-letter daynames will be used if the first day on the
|
||||
first line is a three letter dayname; otherwise, full names
|
||||
@ -267,7 +279,7 @@ numbers, dates, or daynames.
|
||||
to those lines in the visual block that begin with a dayname
|
||||
(mon tue wed thu fri sat).
|
||||
|
||||
MONTHNAME INCREMENTING *IM* *visincr-IM* *visincr-RIM*
|
||||
MONTHNAME INCREMENTING *:IM* *visincr-IM* *visincr-RIM*
|
||||
:IM [#] will produce an increasing/decreasing list of monthnames.
|
||||
Monthnames may be three-letter versions (jan feb etc) or
|
||||
fully-spelled out monthnames.
|
||||
@ -276,6 +288,16 @@ numbers, dates, or daynames.
|
||||
to those lines in the visual block that begin with a
|
||||
monthname (jan feb mar etc).
|
||||
|
||||
POWER INCREMENTING *:IPOW* *visincr-IPOW* *visincr-IIPOW*
|
||||
*:RIPOW* *visincr-RIPOW* *visincr-RIIPOW*
|
||||
:IPOW [#] will produce an increasing/decreasing list of powers times
|
||||
the starting point. The multiplier(divisor)'s default value
|
||||
is 2.
|
||||
|
||||
Restricted versions (:RIPOW and :RIIPOW) applies only
|
||||
to those lines in the visual block that begin with
|
||||
a number.
|
||||
|
||||
|
||||
==============================================================================
|
||||
4. Examples: *visincr-examples*
|
||||
@ -414,6 +436,10 @@ numbers, dates, or daynames.
|
||||
==============================================================================
|
||||
6. History: *visincr-history* {{{1
|
||||
|
||||
v18: 02/13/07 : included IPOW and variants
|
||||
02/15/07 * date dividers are no longer required
|
||||
10/17/07 * calutil.vim and calutil.txt included, and they
|
||||
use vim 7's autoload feature
|
||||
v17: 07/26/06 : -complete=expression added to all visincr
|
||||
commands
|
||||
07/27/06 * g:visincr_datedivset support included
|
||||
|
506
vimfiles/plugin/AlignMaps.vim
Normal file
506
vimfiles/plugin/AlignMaps.vim
Normal file
@ -0,0 +1,506 @@
|
||||
" AlignMaps: Alignment maps based upon <Align.vim>
|
||||
" Maintainer: Dr. Charles E. Campbell, Jr. <Charles.Campbell@gsfc.nasa.gov>
|
||||
" Date: Mar 06, 2008
|
||||
" Version: 39
|
||||
"
|
||||
" NOTE: the code herein needs vim 6.0 or later
|
||||
" needs <Align.vim> v6 or later
|
||||
" needs <cecutil.vim> v5 or later
|
||||
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" AlignMaps.vim is provided *as is* and comes with no warranty
|
||||
" of any kind, either expressed or implied. By using this
|
||||
" plugin, you agree that in no event will the copyright
|
||||
" holder be liable for any damages resulting from the use
|
||||
" of this software.
|
||||
"
|
||||
" Usage: {{{1
|
||||
" Use 'a to mark beginning of to-be-aligned region, Alternative: use v
|
||||
" move cursor to end of region, and execute map. (visual mode) to mark
|
||||
" The maps also set up marks 'y and 'z, and retain region, execute same map.
|
||||
" 'a at the beginning of region. Uses 'a, 'y, and 'z.
|
||||
"
|
||||
" Although the comments indicate the maps use a leading backslash,
|
||||
" actually they use <Leader> (:he mapleader), so the user can
|
||||
" specify that the maps start how he or she prefers.
|
||||
"
|
||||
" Note: these maps all use <Align.vim>.
|
||||
"
|
||||
" Romans 1:20 For the invisible things of Him since the creation of the {{{1
|
||||
" world are clearly seen, being perceived through the things that are
|
||||
" made, even His everlasting power and divinity; that they may be
|
||||
" without excuse.
|
||||
" ---------------------------------------------------------------------
|
||||
|
||||
" Load Once: {{{1
|
||||
if exists("g:loaded_alignmaps") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_alignmaps = "v39"
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" WS: wrapper start map (internal) {{{1
|
||||
" Produces a blank line above and below, marks with 'y and 'z
|
||||
if !hasmapto('<Plug>WrapperStart')
|
||||
nmap <unique> <SID>WS <Plug>AlignMapsWrapperStart
|
||||
endif
|
||||
nmap <silent> <script> <Plug>AlignMapsWrapperStart :set lz<CR>:call AlignWrapperStart()<CR>
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" AlignWrapperStart: {{{1
|
||||
fun! AlignWrapperStart()
|
||||
" call Dfunc("AlignWrapperStart()")
|
||||
|
||||
if line("'y") == 0 || line("'z") == 0 || !exists("s:alignmaps_wrapcnt") || s:alignmaps_wrapcnt <= 0
|
||||
" call Decho("wrapper initialization")
|
||||
let s:alignmaps_wrapcnt = 1
|
||||
let s:alignmaps_keepgd = &gdefault
|
||||
let s:alignmaps_keepsearch = @/
|
||||
let s:alignmaps_keepch = &ch
|
||||
let s:alignmaps_keepmy = SaveMark("'y")
|
||||
let s:alignmaps_keepmz = SaveMark("'z")
|
||||
let s:alignmaps_posn = SaveWinPosn(0)
|
||||
" set up fencepost blank lines
|
||||
put =''
|
||||
norm! mz'a
|
||||
put! =''
|
||||
ky
|
||||
let s:alignmaps_zline = line("'z")
|
||||
exe "'y,'zs/@/\177/ge"
|
||||
else
|
||||
" call Decho("embedded wrapper")
|
||||
let s:alignmaps_wrapcnt = s:alignmaps_wrapcnt + 1
|
||||
norm! 'yjma'zk
|
||||
endif
|
||||
|
||||
" change some settings to align-standard values
|
||||
set nogd
|
||||
set ch=2
|
||||
AlignPush
|
||||
norm! 'zk
|
||||
" call Dret("AlignWrapperStart : alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" WE: wrapper end (internal) {{{1
|
||||
" Removes guard lines, restores marks y and z, and restores search pattern
|
||||
if !hasmapto('<Plug>WrapperEnd')
|
||||
nmap <unique> <SID>WE <Plug>AlignMapsWrapperEnd
|
||||
endif
|
||||
nmap <silent> <script> <Plug>AlignMapsWrapperEnd :call AlignWrapperEnd()<CR>:set nolz<CR>
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" AlignWrapperEnd: {{{1
|
||||
fun! AlignWrapperEnd()
|
||||
" call Dfunc("AlignWrapperEnd() alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
|
||||
|
||||
" remove trailing white space introduced by whatever in the modification zone
|
||||
'y,'zs/ \+$//e
|
||||
|
||||
" restore AlignCtrl settings
|
||||
AlignPop
|
||||
|
||||
let s:alignmaps_wrapcnt= s:alignmaps_wrapcnt - 1
|
||||
if s:alignmaps_wrapcnt <= 0
|
||||
" initial wrapper ending
|
||||
exe "'y,'zs/\177/@/ge"
|
||||
|
||||
" if the 'z line hasn't moved, then go ahead and restore window position
|
||||
let zstationary= s:alignmaps_zline == line("'z")
|
||||
|
||||
" remove fencepost blank lines.
|
||||
" restore 'a
|
||||
norm! 'yjmakdd'zdd
|
||||
|
||||
" restore original 'y, 'z, and window positioning
|
||||
call RestoreMark(s:alignmaps_keepmy)
|
||||
call RestoreMark(s:alignmaps_keepmz)
|
||||
if zstationary > 0
|
||||
call RestoreWinPosn(s:alignmaps_posn)
|
||||
" call Decho("restored window positioning")
|
||||
endif
|
||||
|
||||
" restoration of options
|
||||
let &gd= s:alignmaps_keepgd
|
||||
let &ch= s:alignmaps_keepch
|
||||
let @/ = s:alignmaps_keepsearch
|
||||
|
||||
" remove script variables
|
||||
unlet s:alignmaps_keepch
|
||||
unlet s:alignmaps_keepsearch
|
||||
unlet s:alignmaps_keepmy
|
||||
unlet s:alignmaps_keepmz
|
||||
unlet s:alignmaps_keepgd
|
||||
unlet s:alignmaps_posn
|
||||
endif
|
||||
|
||||
" call Dret("AlignWrapperEnd : alignmaps_wrapcnt=".s:alignmaps_wrapcnt." my=".line("'y")." mz=".line("'z"))
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Complex C-code alignment maps: {{{1
|
||||
map <silent> <Leader>a? <SID>WS:AlignCtrl mIp1P1lC ? : : : : <CR>:'a,.Align<CR>:'a,'z-1s/\(\s\+\)? /?\1/e<CR><SID>WE
|
||||
map <silent> <Leader>a, <SID>WS:'y,'zs/\(\S\)\s\+/\1 /ge<CR>'yjma'zk<Leader>jnr,<CR>:silent 'y,'zg/,/call <SID>FixMultiDec()<CR>'z<Leader>adec<SID>WE
|
||||
map <silent> <Leader>a< <SID>WS:AlignCtrl mIp1P1=l << >><CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>a= <SID>WS:AlignCtrl mIp1P1=l<CR>:AlignCtrl g :=<CR>:'a,'zAlign :\==<CR><SID>WE
|
||||
map <silent> <Leader>abox <SID>WS:let g:alignmaps_iws=substitute(getline("'a"),'^\(\s*\).*$','\1','e')<CR>:'a,'z-1s/^\s\+//e<CR>:'a,'z-1s/^.*$/@&@/<CR>:AlignCtrl m=p01P0w @<CR>:'a,.Align<CR>:'a,'z-1s/@/ * /<CR>:'a,'z-1s/@$/*/<CR>'aYP:s/./*/g<CR>0r/'zkYp:s/./*/g<CR>0r A/<Esc>:exe "'a-1,'z-1s/^/".g:alignmaps_iws."/e"<CR><SID>WE
|
||||
map <silent> <Leader>acom <SID>WS:'a,.s/\/[*/]\/\=/@&@/e<CR>:'a,.s/\*\//@&/e<CR>:'y,'zs/^\( *\) @/\1@/e<CR>'zk<Leader>tW@:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
|
||||
map <silent> <Leader>adcom <SID>WS:'a,.v/^\s*\/[/*]/s/\/[*/]\*\=/@&@/e<CR>:'a,.v/^\s*\/[/*]/s/\*\//@&/e<CR>:'y,'zv/^\s*\/[/*]/s/^\( *\) @/\1@/e<CR>'zk<Leader>tdW@:'y,'zv/^\s*\/[/*]/s/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
|
||||
map <silent> <Leader>aocom :AlignPush<CR>:AlignCtrl g /[*/]<CR><Leader>acom:AlignPop<CR>
|
||||
map <silent> <Leader>ascom <SID>WS:'a,.s/\/[*/]/@&@/e<CR>:'a,.s/\*\//@&/e<CR>:silent! 'a,.g/^\s*@\/[*/]/s/@//ge<CR>:AlignCtrl v ^\s*\/[*/]<CR>:AlignCtrl g \/[*/]<CR>'zk<Leader>tW@:'y,'zs/^\(\s*\) @/\1/e<CR>:'y,'zs/ @//eg<CR><SID>WE
|
||||
map <silent> <Leader>adec <SID>WS:'a,'zs/\([^ \t/(]\)\([*&]\)/\1 \2/e<CR>:'y,'zv/^\//s/\([^ \t]\)\s\+/\1 /ge<CR>:'y,'zv/^\s*[*/]/s/\([^/][*&]\)\s\+/\1/ge<CR>:'y,'zv/^\s*[*/]/s/^\(\s*\%(\K\k*\s\+\%([a-zA-Z_*(&]\)\@=\)\+\)\([*(&]*\)\s*\([a-zA-Z0-9_()]\+\)\s*\(\(\[.\{-}]\)*\)\s*\(=\)\=\s*\(.\{-}\)\=\s*;/\1@\2#@\3\4@\6@\7;@/e<CR>:'y,'zv/^\s*[*/]/s/\*\/\s*$/@*\//e<CR>:'y,'zv/^\s*[*/]/s/^\s\+\*/@@@@@* /e<CR>:'y,'zv/^\s*[*/]/s/^@@@@@\*\(.*[^*/]\)$/&@*/e<CR>'yjma'zk:AlignCtrl v ^\s*[*/#]<CR><Leader>t@:'y,'zv/^\s*[*/]/s/@ //ge<CR>:'y,'zv/^\s*[*/]/s/\(\s*\);/;\1/e<CR>:'y,'zv/^#/s/# //e<CR>:'y,'zv/^\s\+[*/#]/s/\([^/*]\)\(\*\+\)\( \+\)/\1\3\2/e<CR>:'y,'zv/^\s\+[*/#]/s/\((\+\)\( \+\)\*/\2\1*/e<CR>:'y,'zv/^\s\+[*/#]/s/^\(\s\+\) \*/\1*/e<CR>:'y,'zv/^\s\+[*/#]/s/[ \t@]*$//e<CR>:'y,'zs/^[*]/ */e<CR><SID>WE
|
||||
map <silent> <Leader>adef <SID>WS:AlignPush<CR>:AlignCtrl v ^\s*\(\/\*\<bar>\/\/\)<CR>:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/^\(\s*\)#\(\s\)*define\s*\(\I[a-zA-Z_0-9(),]*\)\s*\(.\{-}\)\($\<Bar>\/\*\)/#\1\2define @\3@\4@\5/e<CR>:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/\($\<Bar>\*\/\)/@&/e<CR>'zk<Leader>t@'yjma'zk:'a,.v/^\s*\(\/\*\<bar>\/\/\)/s/ @//g<CR><SID>WE
|
||||
map <silent> <Leader>afnc :set lz<CR>:silent call <SID>Afnc()<CR>:set nolz<CR>
|
||||
if exists("g:alignmaps_usanumber")
|
||||
" map <silent> <Leader>anum <SID>WS
|
||||
" \:'a,'zs/\([-+]\)\=\(\d\+\%([eE][-+]\=\d\+\)\=\)\ze\%($\|[^@]\)/@\1@\2@@#/ge<CR>
|
||||
" \:'a,'zs/\([-+]\)\=\(\d*\)\(\.\)\(\d*\([eE][-+]\=\d\+\)\=\)/@\1@\2@\3@\4#/ge<CR>
|
||||
" \:AlignCtrl mp0P0r<CR>
|
||||
" \:'a,'zAlign [@#]<CR>
|
||||
" \:'a,'zs/@//ge<CR>
|
||||
" \:'a,'zs/#/ /ge<CR>
|
||||
" \<SID>WE
|
||||
map <silent> <Leader>anum <SID>WS:'a,'zs/\([0-9.]\)\s\+\zs\([-+]\=\d\)/@\1/ge<CR>
|
||||
\:'a,'zs/\.@/\.0@/ge<CR>
|
||||
\:AlignCtrl mp0P0r<CR>
|
||||
\:'a,'zAlign [.@]<CR>
|
||||
\:'a,'zs/@/ /ge<CR>
|
||||
\:'a,'zs/\(\.\)\(\s\+\)\([0-9.,eE+]\+\)/\1\3\2/ge<CR>
|
||||
\:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR>
|
||||
\<SID>WE
|
||||
elseif exists("g:alignmaps_euronumber")
|
||||
map <silent> <Leader>anum <SID>WS:'a,'zs/\([0-9.]\)\s\+\([-+]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0r<CR>:'a,'zAlign [,@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(,\)\(\s\+\)\([-0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
|
||||
else
|
||||
map <silent> <Leader>anum <SID>WS:'a,'zs/\([0-9.]\)\s\+\([-+]\=[.,]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0<CR>:'a,'zAlign [.,@]<CR>:'a,'zs/\([-0-9.,]*\)\(\s*\)\([.,]\)/\2\1\3/g<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
|
||||
endif
|
||||
map <silent> <Leader>aunum <SID>WS:'a,'zs/\([0-9.]\)\s\+\([-+]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0r<CR>:'a,'zAlign [.@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(\.\)\(\s\+\)\([-0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
|
||||
map <silent> <Leader>aenum <SID>WS:'a,'zs/\([0-9.]\)\s\+\([-+]\=\d\)/\1@\2/ge<CR>:'a,'zs/\.@/\.0@/ge<CR>:AlignCtrl mp0P0r<CR>:'a,'zAlign [,@]<CR>:'a,'zs/@/ /ge<CR>:'a,'zs/\(,\)\(\s\+\)\([-0-9.,eE+]\+\)/\1\3\2/ge<CR>:'a,'zs/\([eE]\)\(\s\+\)\([0-9+\-+]\+\)/\1\3\2/ge<CR><SID>WE
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" html table alignment {{{1
|
||||
map <silent> <Leader>Htd <SID>WS:'y,'zs%<[tT][rR]><[tT][dD][^>]\{-}>\<Bar></[tT][dD]><[tT][dD][^>]\{-}>\<Bar></[tT][dD]></[tT][rR]>%@&@%g<CR>'yjma'zk:AlignCtrl m=Ilp1P0 @<CR>:'a,.Align<CR>:'y,'zs/ @/@/<CR>:'y,'zs/@ <[tT][rR]>/<[tT][rR]>/ge<CR>:'y,'zs/@//ge<CR><SID>WE
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" character-based right-justified alignment maps {{{1
|
||||
map <silent> <Leader>T| <SID>WS:AlignCtrl mIp0P0=r <Bar><CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>T# <SID>WS:AlignCtrl mIp0P0=r #<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>T, <SID>WS:AlignCtrl mIp0P1=r ,<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>Ts, <SID>WS:AlignCtrl mIp0P1=r ,<CR>:'a,.Align<CR>:'a,.s/\(\s*\),/,\1/ge<CR><SID>WE
|
||||
map <silent> <Leader>T: <SID>WS:AlignCtrl mIp1P1=r :<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>T; <SID>WS:AlignCtrl mIp0P0=r ;<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>T< <SID>WS:AlignCtrl mIp0P0=r <<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>T= <SID>WS:'a,'z-1s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'z-1s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'z-1s/; */;@/e<CR>:'a,'z-1s/==/\="\<Char-0xff>\<Char-0xff>"/ge<CR>:'a,'z-1s/!=/\x="!\<Char-0xff>"/ge<CR>:AlignCtrl mIp1P1=r = @<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s/; *@/;/e<CR>:'a,'z-1s/; *$/;/e<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-1s/\xff/=/ge<CR><SID>WE<Leader>acom
|
||||
map <silent> <Leader>T? <SID>WS:AlignCtrl mIp0P0=r ?<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
|
||||
map <silent> <Leader>T@ <SID>WS:AlignCtrl mIp0P0=r @<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>Tab <SID>WS:'a,.s/^\(\t*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\t','@','g'),'\')/<CR>:AlignCtrl mI=r @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
|
||||
map <silent> <Leader>Tsp <SID>WS:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\s\+','@','g'),'\')/<CR>:AlignCtrl mI=r @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
|
||||
map <silent> <Leader>T~ <SID>WS:AlignCtrl mIp0P0=r ~<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" character-based left-justified alignment maps {{{1
|
||||
map <silent> <Leader>t| <SID>WS:AlignCtrl mIp0P0=l <Bar><CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>t# <SID>WS:AlignCtrl mIp0P0=l #<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>t, <SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>ts, <SID>WS:AlignCtrl mIp0P1=l ,<CR>:'a,.Align<CR>:'a,.s/\(\s*\),/,\1/ge<CR><SID>WE
|
||||
map <silent> <Leader>t: <SID>WS:AlignCtrl mIp1P1=l :<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>t; <SID>WS:AlignCtrl mIp0P1=l ;<CR>:'a,.Align<CR>:'y,'zs/\( *\);/;\1/ge<CR><SID>WE
|
||||
map <silent> <Leader>t< <SID>WS:AlignCtrl mIp0P0=l <<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>t= <SID>WS:call <SID>Equals()<CR><SID>WE
|
||||
map <silent> <Leader>w= <SID>WS:'a,'zg/=/s/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zg/=/s@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zg/=/s/==/\="\<Char-0xff>\<Char-0xff>"/ge<CR>:'a,'zg/=/s/!=/\="!\<Char-0xff>"/ge<CR>'zk:AlignCtrl mWp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1g/=/Align<CR>:'a,'z-1g/=/s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1g/=/s/\( \+\);/;\1/ge<CR>:'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e<CR>:'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e<CR>'zk<Leader>t@:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1g/=/s/\xff/=/ge<CR>:'y,'zg/=/s/ @//eg<CR><SID>WE
|
||||
map <silent> <Leader>t? <SID>WS:AlignCtrl mIp0P0=l ?<CR>:'a,.Align<CR>:.,'zs/ \( *\);/;\1/ge<CR><SID>WE
|
||||
map <silent> <Leader>t~ <SID>WS:AlignCtrl mIp0P0=l ~<CR>:'a,.Align<CR>:'y,'zs/ \( *\);/;\1/ge<CR><SID>WE
|
||||
map <silent> <Leader>m= <SID>WS:'a,'zs/\s\+\([*/+\-%<Bar>&\~^]\==\)/ \1/e<CR>:'a,'zs@ \+\([*/+\-%<Bar>&\~^]\)=@\1=@ge<CR>:'a,'zs/==/\="\<Char-0xff>\<Char-0xff>"/ge<CR>:'a,'zs/!=/\="!\<Char-0xff>"/ge<CR>'zk:AlignCtrl mIp1P1=l =<CR>:AlignCtrl g =<CR>:'a,'z-1Align<CR>:'a,'z-1s@\([*/+\-%<Bar>&\~^!=]\)\( \+\)=@\2\1=@ge<CR>:'a,'z-1s/\( \+\);/;\1/ge<CR>:'a,'z-s/%\ze[^=]/ @%@ /e<CR>'zk<Leader>t@:'y,'zs/^\(\s*\) @/\1/e<CR>:'a,'z-1s/\xff/=/ge<CR>:'y,'zs/ @//eg<CR><SID>WE
|
||||
map <silent> <Leader>tab <SID>WS:'a,.s/^\(\t*\)\(.*\)$/\=submatch(1).escape(substitute(submatch(2),'\t',"\<Char-0xff>",'g'),'\')/<CR>:if &ts == 1<bar>exe "AlignCtrl mI=lp0P0 \<Char-0xff>"<bar>else<bar>exe "AlignCtrl mI=l \<Char-0xff>"<bar>endif<CR>:'a,.Align<CR>:exe "'y+1,'z-1s/\<Char-0xff>/".((&ts == 1)? '\t' : ' ')."/g"<CR><SID>WE
|
||||
map <silent> <Leader>tml <SID>WS:AlignCtrl mWp1P0=l \\\@<!\\\s*$<CR>:'a,.Align<CR><SID>WE
|
||||
map <silent> <Leader>tsp <SID>WS:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).escape(substitute(submatch(2),'\s\+','@','g'),'\')/<CR>:AlignCtrl mI=lp0P0 @<CR>:'a,.Align<CR>:'y+1,'z-1s/@/ /g<CR><SID>WE
|
||||
map <silent> <Leader>tsq <SID>WS:'a,.AlignReplaceQuotedSpaces<CR>:'a,.s/^\(\s*\)\(.*\)/\=submatch(1).substitute(submatch(2),'\s\+','@','g')/<CR>:AlignCtrl mIp0P0=l @<CR>:'a,.Align<CR>:'y+1,'z-1s/[%@]/ /g<CR><SID>WE
|
||||
map <silent> <Leader>tt <SID>WS:AlignCtrl mIp1P1=l \\\@<!& \\\\<CR>:'a,.Align<CR><SID>WE
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" plain Align maps; these two are used in <Leader>acom..\afnc {{{1
|
||||
map <silent> <Leader>t@ :AlignCtrl mIp1P1=l @<CR>:'a,.Align<CR>
|
||||
map <silent> <Leader>tW@ :AlignCtrl mWp1P1=l @<CR>:'a,.Align<CR>
|
||||
map <silent> <Leader>tdW@ :AlignCtrl v ^\s*/[/*]<CR>:AlignCtrl mWp1P1=l @<CR>:'a,.Align<CR>
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Joiner : maps used above {{{1
|
||||
map <silent> <Leader>jnr= :call <SID>CharJoiner("=")<CR>
|
||||
map <silent> <Leader>jnr, :call <SID>CharJoiner(",")<CR>
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" visual-line mode variants: {{{1
|
||||
vmap <silent> <Leader>T| :<BS><BS><BS><CR>ma'><Leader>T|
|
||||
vmap <silent> <Leader>T, :<BS><BS><BS><CR>ma'><Leader>T,
|
||||
vmap <silent> <Leader>Ts, :<BS><BS><BS><CR>ma'><Leader>Ts,
|
||||
vmap <silent> <Leader>T: :<BS><BS><BS><CR>ma'><Leader>T:
|
||||
vmap <silent> <Leader>T< :<BS><BS><BS><CR>ma'><Leader>T<
|
||||
vmap <silent> <Leader>T= :<BS><BS><BS><CR>ma'><Leader>T=
|
||||
vmap <silent> <Leader>T@ :<BS><BS><BS><CR>ma'><Leader>T@
|
||||
vmap <silent> <Leader>Tsp :<BS><BS><BS><CR>ma'><Leader>Tsp
|
||||
vmap <silent> <Leader>a? :<BS><BS><BS><CR>ma'><Leader>a?
|
||||
vmap <silent> <Leader>a, :<BS><BS><BS><CR>ma'><Leader>a,
|
||||
vmap <silent> <Leader>a< :<BS><BS><BS><CR>ma'><Leader>a<
|
||||
vmap <silent> <Leader>a= :<BS><BS><BS><CR>ma'><Leader>a=
|
||||
vmap <silent> <Leader>abox :<BS><BS><BS><CR>ma'><Leader>abox
|
||||
vmap <silent> <Leader>acom :<BS><BS><BS><CR>ma'><Leader>acom
|
||||
vmap <silent> <Leader>aocom :<BS><BS><BS><CR>ma'><Leader>aocom
|
||||
vmap <silent> <Leader>ascom :<BS><BS><BS><CR>ma'><Leader>ascom
|
||||
vmap <silent> <Leader>adec :<BS><BS><BS><CR>ma'><Leader>adec
|
||||
vmap <silent> <Leader>adef :<BS><BS><BS><CR>ma'><Leader>adef
|
||||
vmap <silent> <Leader>afnc :<BS><BS><BS><CR>ma'><Leader>afnc
|
||||
vmap <silent> <Leader>anum :<BS><BS><BS><CR>ma'><Leader>anum
|
||||
"vmap <silent> <Leader>anum :B s/\(\d\)\s\+\(-\=[.,]\=\d\)/\1@\2/ge<CR>:AlignCtrl mp0P0<CR>gv:Align [.,@]<CR>:'<,'>s/\([-0-9.,]*\)\(\s\+\)\([.,]\)/\2\1\3/ge<CR>:'<,'>s/@/ /ge<CR>
|
||||
vmap <silent> <Leader>t| :<BS><BS><BS><CR>ma'><Leader>t|
|
||||
vmap <silent> <Leader>t, :<BS><BS><BS><CR>ma'><Leader>t,
|
||||
vmap <silent> <Leader>ts, :<BS><BS><BS><CR>ma'><Leader>ts,
|
||||
vmap <silent> <Leader>t: :<BS><BS><BS><CR>ma'><Leader>t:
|
||||
vmap <silent> <Leader>t; :<BS><BS><BS><CR>ma'><Leader>t;
|
||||
vmap <silent> <Leader>t< :<BS><BS><BS><CR>ma'><Leader>t<
|
||||
vmap <silent> <Leader>t= :<BS><BS><BS><CR>ma'><Leader>t=
|
||||
vmap <silent> <Leader>t? :<BS><BS><BS><CR>ma'><Leader>t?
|
||||
vmap <silent> <Leader>t@ :<BS><BS><BS><CR>ma'><Leader>t@
|
||||
vmap <silent> <Leader>tab :<BS><BS><BS><CR>ma'><Leader>tab
|
||||
vmap <silent> <Leader>tml :<BS><BS><BS><CR>ma'><Leader>tml
|
||||
vmap <silent> <Leader>tsp :<BS><BS><BS><CR>ma'><Leader>tsp
|
||||
vmap <silent> <Leader>tsq :<BS><BS><BS><CR>ma'><Leader>tsq
|
||||
vmap <silent> <Leader>tp@ :<BS><BS><BS><CR>ma'><Leader>tp@
|
||||
vmap <silent> <Leader>tt :<BS><BS><BS><CR>ma'><Leader>tt
|
||||
vmap <silent> <Leader>Htd :<BS><BS><BS><CR>ma'><Leader>Htd
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Menu Support: {{{1
|
||||
" ma ..move.. use menu
|
||||
" v V or ctrl-v ..move.. use menu
|
||||
if has("menu") && has("gui_running") && &go =~ 'm' && !exists("s:firstmenu")
|
||||
let s:firstmenu= 1
|
||||
if !exists("g:DrChipTopLvlMenu")
|
||||
let g:DrChipTopLvlMenu= "DrChip."
|
||||
endif
|
||||
if g:DrChipTopLvlMenu != ""
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.<<\ and\ >> <Leader>a<'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Assignment\ = <Leader>t='
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Assignment\ := <Leader>a='
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Backslashes <Leader>tml'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Breakup\ Comma\ Declarations <Leader>a,'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.C\ Comment\ Box <Leader>abox'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas <Leader>t,'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas <Leader>ts,'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Commas\ With\ Strings <Leader>tsq'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Comments <Leader>acom'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Comments\ Only <Leader>aocom'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Declaration\ Comments <Leader>adcom'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Declarations <Leader>adec'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Definitions <Leader>adef'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Function\ Header <Leader>afnc'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Html\ Tables <Leader>Htd'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.(\.\.\.)?\.\.\.\ :\ \.\.\. <Leader>a?'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers <Leader>anum'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers\ (American-Style) <Leader>aunum <Leader>aunum'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Numbers\ (Euro-Style) <Leader>aenum'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Spaces\ (Left\ Justified) <Leader>tsp'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Spaces\ (Right\ Justified) <Leader>Tsp'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Statements\ With\ Percent\ Style\ Comments <Leader>m='
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ < <Leader>t<'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ \| <Leader>t|'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ @ <Leader>t@'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Symbol\ # <Leader>t#'
|
||||
exe 'menu '.g:DrChipTopLvlMenu.'AlignMaps.Tabs <Leader>tab'
|
||||
endif
|
||||
endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" CharJoiner: joins lines which end in the given character (spaces {{{1
|
||||
" at end are ignored)
|
||||
fun! <SID>CharJoiner(chr)
|
||||
" call Dfunc("CharJoiner(chr=".a:chr.")")
|
||||
let aline = line("'a")
|
||||
let rep = line(".") - aline
|
||||
while rep > 0
|
||||
norm! 'a
|
||||
while match(getline(aline),a:chr . "\s*$") != -1 && rep >= 0
|
||||
" while = at end-of-line, delete it and join with next
|
||||
norm! 'a$
|
||||
j!
|
||||
let rep = rep - 1
|
||||
endwhile
|
||||
" update rep(eat) count
|
||||
let rep = rep - 1
|
||||
if rep <= 0
|
||||
" terminate loop if at end-of-block
|
||||
break
|
||||
endif
|
||||
" prepare for next line
|
||||
norm! jma
|
||||
let aline = line("'a")
|
||||
endwhile
|
||||
" call Dret("CharJoiner")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:Equals: {{{2
|
||||
fun! s:Equals()
|
||||
" call Dfunc("s:Equals()")
|
||||
'a,'zs/\s\+\([*/+\-%|&\~^]\==\)/ \1/e
|
||||
'a,'zs@ \+\([*/+\-%|&\~^]\)=@\1=@ge
|
||||
'a,'zs/==/\="\<Char-0xff>\<Char-0xff>"/ge
|
||||
'a,'zs/!=/\="!\<Char-0xff>"/ge
|
||||
norm g'zk
|
||||
AlignCtrl mIp1P1=l =
|
||||
AlignCtrl g =
|
||||
'a,'z-1Align
|
||||
'a,'z-1s@\([*/+\-%|&\~^!=]\)\( \+\)=@\2\1=@ge
|
||||
'a,'z-1s/\( \+\);/;\1/ge
|
||||
if &ft == "c" || &ft == "cpp"
|
||||
'a,'z-1v/^\s*\/[*/]/s/\/[*/]/@&@/e
|
||||
'a,'z-1v/^\s*\/[*/]/s/\*\//@&/e
|
||||
exe norm "'zk<Leader>t@"
|
||||
'y,'zs/^\(\s*\) @/\1/e
|
||||
endif
|
||||
'a,'z-1s/<Char-0xff>/=/ge
|
||||
'y,'zs/ @//eg
|
||||
" call Dret("s:Equals")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Afnc: useful for splitting one-line function beginnings {{{1
|
||||
" into one line per argument format
|
||||
fun! s:Afnc()
|
||||
" call Dfunc("Afnc()")
|
||||
|
||||
" keep display quiet
|
||||
let chkeep = &ch
|
||||
let gdkeep = &gd
|
||||
let vekeep = &ve
|
||||
set ch=2 nogd ve=
|
||||
|
||||
" will use marks y,z ; save current values
|
||||
let mykeep = SaveMark("'y")
|
||||
let mzkeep = SaveMark("'z")
|
||||
|
||||
" Find beginning of function -- be careful to skip over comments
|
||||
let cmmntid = synIDtrans(hlID("Comment"))
|
||||
let stringid = synIDtrans(hlID("String"))
|
||||
exe "norm! ]]"
|
||||
while search(")","bW") != 0
|
||||
" call Decho("line=".line(".")." col=".col("."))
|
||||
let parenid= synIDtrans(synID(line("."),col("."),1))
|
||||
if parenid != cmmntid && parenid != stringid
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
norm! %my
|
||||
s/(\s*\(\S\)/(\r \1/e
|
||||
exe "norm! `y%"
|
||||
s/)\s*\(\/[*/]\)/)\r\1/e
|
||||
exe "norm! `y%mz"
|
||||
'y,'zs/\s\+$//e
|
||||
'y,'zs/^\s\+//e
|
||||
'y+1,'zs/^/ /
|
||||
|
||||
" insert newline after every comma only one parenthesis deep
|
||||
sil! exe "norm! `y\<right>h"
|
||||
let parens = 1
|
||||
let cmmnt = 0
|
||||
let cmmntline= -1
|
||||
while parens >= 1
|
||||
" call Decho("parens=".parens." @a=".@a)
|
||||
exe 'norm! ma "ay`a '
|
||||
if @a == "("
|
||||
let parens= parens + 1
|
||||
elseif @a == ")"
|
||||
let parens= parens - 1
|
||||
|
||||
" comment bypass: /* ... */ or //...
|
||||
elseif cmmnt == 0 && @a == '/'
|
||||
let cmmnt= 1
|
||||
elseif cmmnt == 1
|
||||
if @a == '/'
|
||||
let cmmnt = 2 " //...
|
||||
let cmmntline= line(".")
|
||||
elseif @a == '*'
|
||||
let cmmnt= 3 " /*...
|
||||
else
|
||||
let cmmnt= 0
|
||||
endif
|
||||
elseif cmmnt == 2 && line(".") != cmmntline
|
||||
let cmmnt = 0
|
||||
let cmmntline= -1
|
||||
elseif cmmnt == 3 && @a == '*'
|
||||
let cmmnt= 4
|
||||
elseif cmmnt == 4
|
||||
if @a == '/'
|
||||
let cmmnt= 0 " ...*/
|
||||
elseif @a != '*'
|
||||
let cmmnt= 3
|
||||
endif
|
||||
|
||||
elseif @a == "," && parens == 1 && cmmnt == 0
|
||||
exe "norm! i\<CR>\<Esc>"
|
||||
endif
|
||||
endwhile
|
||||
norm! `y%mz%
|
||||
sil! 'y,'zg/^\s*$/d
|
||||
|
||||
" perform substitutes to mark fields for Align
|
||||
sil! 'y+1,'zv/^\//s/^\s\+\(\S\)/ \1/e
|
||||
sil! 'y+1,'zv/^\//s/\(\S\)\s\+/\1 /eg
|
||||
sil! 'y+1,'zv/^\//s/\* \+/*/ge
|
||||
" func
|
||||
" ws <- declaration -> <-ptr -> <-var-> <-[array][] -> <-glop-> <-end->
|
||||
sil! 'y+1,'zv/^\//s/^\s*\(\(\K\k*\s*\)\+\)\s\+\([(*]*\)\s*\(\K\k*\)\s*\(\(\[.\{-}]\)*\)\s*\(.\{-}\)\=\s*\([,)]\)\s*$/ \1@#\3@\4\5@\7\8/e
|
||||
sil! 'y+1,'z+1g/^\s*\/[*/]/norm! kJ
|
||||
sil! 'y+1,'z+1s%/[*/]%@&@%ge
|
||||
sil! 'y+1,'z+1s%*/%@&%ge
|
||||
AlignCtrl mIp0P0=l @
|
||||
sil! 'y+1,'zAlign
|
||||
sil! 'y,'zs%@\(/[*/]\)@%\t\1 %e
|
||||
sil! 'y,'zs%@\*/% */%e
|
||||
sil! 'y,'zs/@\([,)]\)/\1/
|
||||
sil! 'y,'zs/@/ /
|
||||
AlignCtrl mIlrp0P0= # @
|
||||
sil! 'y+1,'zAlign
|
||||
sil! 'y+1,'zs/#/ /
|
||||
sil! 'y+1,'zs/@//
|
||||
sil! 'y+1,'zs/\(\s\+\)\([,)]\)/\2\1/e
|
||||
|
||||
" Restore
|
||||
call RestoreMark(mykeep)
|
||||
call RestoreMark(mzkeep)
|
||||
let &ch= chkeep
|
||||
let &gd= gdkeep
|
||||
let &ve= vekeep
|
||||
|
||||
" call Dret("Afnc")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" FixMultiDec: converts a type arg,arg,arg; line to multiple lines {{{1
|
||||
fun! s:FixMultiDec()
|
||||
" call Dfunc("FixMultiDec()")
|
||||
|
||||
" save register x
|
||||
let xkeep = @x
|
||||
let curline = getline(".")
|
||||
" call Decho("curline<".curline.">")
|
||||
|
||||
" Get the type. I'm assuming one type per line (ie. int x; double y; on one line will not be handled properly)
|
||||
let @x=substitute(curline,'^\(\s*[a-zA-Z_ \t][a-zA-Z0-9_ \t]*\)\s\+[(*]*\h.*$','\1','')
|
||||
" call Decho("@x<".@x.">")
|
||||
|
||||
" transform line
|
||||
exe 's/,/;\r'.@x.' /ge'
|
||||
|
||||
"restore register x
|
||||
let @x= xkeep
|
||||
|
||||
" call Dret("FixMultiDec : my=".line("'y")." mz=".line("'z"))
|
||||
endfun
|
||||
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
" ------------------------------------------------------------------------------
|
||||
" vim: ts=4 nowrap fdm=marker
|
41
vimfiles/plugin/AlignPlugin.vim
Normal file
41
vimfiles/plugin/AlignPlugin.vim
Normal file
@ -0,0 +1,41 @@
|
||||
" AlignPlugin: tool to align multiple fields based on one or more separators
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Nov 15, 2007
|
||||
" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
|
||||
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
|
||||
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" Align.vim is provided *as is* and comes with no warranty
|
||||
" of any kind, either expressed or implied. By using this
|
||||
" plugin, you agree that in no event will the copyright
|
||||
" holder be liable for any damages resulting from the use
|
||||
" of this software.
|
||||
"
|
||||
" Romans 1:16,17a : For I am not ashamed of the gospel of Christ, for it is {{{1
|
||||
" the power of God for salvation for everyone who believes; for the Jew first,
|
||||
" and also for the Greek. For in it is revealed God's righteousness from
|
||||
" faith to faith.
|
||||
" ---------------------------------------------------------------------
|
||||
" Load Once: {{{1
|
||||
if &cp || exists("g:loaded_alignPlugin")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_alignPlugin = 1
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Public Interface: {{{1
|
||||
com! -bang -range -nargs=* Align <line1>,<line2>call Align#Align(<bang>0,<q-args>)
|
||||
com! -range -nargs=0 AlignReplaceQuotedSpaces <line1>,<line2>call Align#AlignReplaceQuotedSpaces()
|
||||
com! -nargs=* AlignCtrl call Align#AlignCtrl(<q-args>)
|
||||
com! -nargs=0 AlignPush call Align#AlignPush()
|
||||
com! -nargs=0 AlignPop call Align#AlignPop()
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Restore: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
" vim: ts=4 fdm=marker
|
@ -185,20 +185,23 @@ let s:licenseTag = s:licenseTag . "along with this program; if not, write to the
|
||||
let s:licenseTag = s:licenseTag . "Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\<enter>"
|
||||
|
||||
" Common standard constants
|
||||
if !exists("g:DoxygenToolkit_commandTag")
|
||||
let g:DoxygenToolkit_commandTag = "@"
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_briefTag_pre")
|
||||
let g:DoxygenToolkit_briefTag_pre = "@brief "
|
||||
let g:DoxygenToolkit_briefTag_pre = g:DoxygenToolkit_commandTag . "brief "
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_briefTag_post")
|
||||
let g:DoxygenToolkit_briefTag_post = ""
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_paramTag_pre")
|
||||
let g:DoxygenToolkit_paramTag_pre = "@param "
|
||||
let g:DoxygenToolkit_paramTag_pre = g:DoxygenToolkit_commandTag . "param "
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_paramTag_post")
|
||||
let g:DoxygenToolkit_paramTag_post = " "
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_returnTag")
|
||||
let g:DoxygenToolkit_returnTag = "@return "
|
||||
let g:DoxygenToolkit_returnTag = g:DoxygenToolkit_commandTag . "return "
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_blockHeader")
|
||||
let g:DoxygenToolkit_blockHeader = ""
|
||||
@ -210,22 +213,25 @@ if !exists("g:DoxygenToolkit_licenseTag")
|
||||
let g:DoxygenToolkit_licenseTag = s:licenseTag
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_fileTag")
|
||||
let g:DoxygenToolkit_fileTag = "@file "
|
||||
let g:DoxygenToolkit_fileTag = g:DoxygenToolkit_commandTag . "file "
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_authorTag")
|
||||
let g:DoxygenToolkit_authorTag = "@author "
|
||||
let g:DoxygenToolkit_authorTag = g:DoxygenToolkit_commandTag . "author "
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_dateTag")
|
||||
let g:DoxygenToolkit_dateTag = "@date "
|
||||
let g:DoxygenToolkit_dateTag = g:DoxygenToolkit_commandTag . "date "
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_dateFormat")
|
||||
let g:DoxygenToolkit_dateFormat = "%Y-%m-%d "
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_undocTag")
|
||||
let g:DoxygenToolkit_undocTag = "DOX_SKIP_BLOCK"
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_blockTag")
|
||||
let g:DoxygenToolkit_blockTag = "@name "
|
||||
let g:DoxygenToolkit_blockTag = g:DoxygenToolkit_commandTag . "name "
|
||||
endif
|
||||
if !exists("g:DoxygenToolkit_classTag")
|
||||
let g:DoxygenToolkit_classTag = "@class "
|
||||
let g:DoxygenToolkit_classTag = g:DoxygenToolkit_commandTag . "class "
|
||||
endif
|
||||
|
||||
if !exists("g:DoxygenToolkit_cinoptions")
|
||||
@ -254,6 +260,18 @@ else
|
||||
let g:DoxygenToolkit_commentType = "C"
|
||||
endif
|
||||
|
||||
if !exists("g:DoxygenToolkit_descriptionTag ")
|
||||
let g:DoxygenToolkit_descriptionTag = "Description"
|
||||
endif
|
||||
|
||||
if !exists("g:DoxygenToolkit_attentionTag ")
|
||||
let g:DoxygenToolkit_attentionTag = g:DoxygenToolkit_commandTag . "attention "
|
||||
endif
|
||||
|
||||
if !exists("g:DoxygenToolkit_saTag ")
|
||||
let g:DoxygenToolkit_saTag = g:DoxygenToolkit_commandTag . "sa "
|
||||
endif
|
||||
|
||||
if !exists("g:DoxygenToolkit_ignoreForReturn")
|
||||
let g:DoxygenToolkit_ignoreForReturn = "inline static virtual void"
|
||||
else
|
||||
@ -270,6 +288,31 @@ if !exists("g:DoxygenToolkit_briefTag_funcName")
|
||||
let g:DoxygenToolkit_briefTag_funcName = "no"
|
||||
endif
|
||||
|
||||
" Add name of function after pre brief tag if you want
|
||||
"if !exists("g:DoxygenToolkit_briefTag_funcName")
|
||||
" let g:DoxygenToolkit_briefTag_funcName = "no"
|
||||
"endif
|
||||
|
||||
" Add description to DoxAuthor if you want
|
||||
if !exists("g:DoxygenToolkit_author_description")
|
||||
let g:DoxygenToolkit_author_description = "no"
|
||||
endif
|
||||
|
||||
" Add description to Dox if you want
|
||||
if !exists("g:DoxygenToolkit_dox_description")
|
||||
let g:DoxygenToolkit_dox_description = "no"
|
||||
endif
|
||||
|
||||
" Add attention to Dox if you want
|
||||
if !exists("g:DoxygenToolkit_dox_attention")
|
||||
let g:DoxygenToolkit_dox_attention = "no"
|
||||
endif
|
||||
|
||||
" Add sa to Dox if you want
|
||||
if !exists("g:DoxygenToolkit_dox_sa")
|
||||
let g:DoxygenToolkit_dox_sa = "yes"
|
||||
endif
|
||||
|
||||
|
||||
""""""""""""""""""""""""""
|
||||
" Doxygen comment function
|
||||
@ -349,6 +392,7 @@ function! <SID>DoxygenCommentFunc()
|
||||
endif
|
||||
endif
|
||||
mark d
|
||||
|
||||
if ( g:DoxygenToolkit_endCommentTag != "" )
|
||||
exec "normal o" . g:DoxygenToolkit_endCommentTag
|
||||
endif
|
||||
@ -406,6 +450,13 @@ function! <SID>DoxygenCommentFunc()
|
||||
" Now can add brief post tag
|
||||
exec "normal A" . g:DoxygenToolkit_briefTag_post
|
||||
|
||||
" Add description
|
||||
if g:DoxygenToolkit_dox_description == "yes"
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_descriptionTag
|
||||
endif
|
||||
mark e
|
||||
|
||||
" Add return tag if function do not return void
|
||||
let l:beginArgPos = match(l:lineBuffer, l:argBegin)
|
||||
let l:beginP = 0 " Name can start at the beginning of l:lineBuffer, it is usually between whitespaces or space and parenthesis
|
||||
@ -437,8 +488,19 @@ function! <SID>DoxygenCommentFunc()
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_returnTag
|
||||
endif
|
||||
|
||||
" Add attention
|
||||
if g:DoxygenToolkit_dox_attention == "yes"
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_attentionTag
|
||||
endif
|
||||
|
||||
" Add sa
|
||||
if g:DoxygenToolkit_dox_sa == "yes"
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_saTag
|
||||
endif
|
||||
|
||||
" Looking for argument name in line buffer
|
||||
exec "normal `d"
|
||||
exec "normal `e"
|
||||
let l:argList = 0 " ==0 -> no argument, !=0 -> at least one arg
|
||||
|
||||
let l:beginP = 0
|
||||
@ -493,7 +555,7 @@ function! <SID>DoxygenCommentFunc()
|
||||
|
||||
" Add blank line if necessary
|
||||
if ( l:argList != 0 )
|
||||
exec "normal `do" . g:DoxygenToolkit_interCommentTag
|
||||
exec "normal `eo" . g:DoxygenToolkit_interCommentTag
|
||||
endif
|
||||
|
||||
" move the cursor to the correct position (after brief tag)
|
||||
@ -561,8 +623,12 @@ function! <SID>DoxygenAuthorFunc()
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_briefTag_pre
|
||||
mark d
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_authorTag . g:DoxygenToolkit_authorName
|
||||
let l:date = strftime("%Y-%m-%d")
|
||||
let l:date = strftime(g:DoxygenToolkit_dateFormat)
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_dateTag . l:date
|
||||
if ( g:DoxygenToolkit_author_description == "yes" )
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_descriptionTag
|
||||
endif
|
||||
if ( g:DoxygenToolkit_endCommentTag == "" )
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag
|
||||
else
|
||||
@ -619,8 +685,8 @@ function! <SID>DoxygenBlockFunc()
|
||||
exec "normal o" . g:DoxygenToolkit_startCommentTag
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_blockTag
|
||||
mark d
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . "@{ " . g:DoxygenToolkit_endCommentTag
|
||||
exec "normal o" . g:DoxygenToolkit_startCommentTag . " @} " . g:DoxygenToolkit_endCommentTag
|
||||
exec "normal o" . g:DoxygenToolkit_interCommentTag . g:DoxygenToolkit_commandTag . "{ " . g:DoxygenToolkit_endCommentTag
|
||||
exec "normal o" . g:DoxygenToolkit_startCommentTag . " " . g:DoxygenToolkit_commandTag . "} " . g:DoxygenToolkit_endCommentTag
|
||||
exec "normal `d"
|
||||
|
||||
" Restore standard comment expension
|
||||
|
488
vimfiles/plugin/SrchRplcHiGrp.vim
Normal file
488
vimfiles/plugin/SrchRplcHiGrp.vim
Normal file
@ -0,0 +1,488 @@
|
||||
" SrchRplcHiGrp.vim - Search and Replace based on a highlight group
|
||||
"
|
||||
" Version: 4.0
|
||||
" Author: David Fishburn <fishburn@ianywhere.com>
|
||||
" Last Changed: Mon 21 Jan 2008 06:17:14 PM Eastern Standard Time
|
||||
" Created: Tue Dec 02 2003 10:11:07 PM
|
||||
" Description: Search and Replace based on a syntax highlight group
|
||||
" Script: http://www.vim.org/script.php?script_id=848
|
||||
" License: GPL (http://www.gnu.org/licenses/gpl.html)
|
||||
"
|
||||
" Command Help: {{{
|
||||
" Ensure you have updated the help system:
|
||||
" :helptags $VIM/vimfiles/doc (Windows)
|
||||
" :helptags $VIM/.vim/doc (*nix)
|
||||
"
|
||||
" :h SRHiGrp
|
||||
" }}}
|
||||
|
||||
" If syntax is not enabled, do not bother loading this plugin
|
||||
if exists('g:loaded_srhg') || &cp || !exists("syntax_on")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_srhg = 1
|
||||
|
||||
" Default the highlight group to 0
|
||||
let s:srhg_group_id = 0
|
||||
let s:srhg_firstline = 0
|
||||
let s:srhg_lastline = 0
|
||||
|
||||
" Functions: "{{{
|
||||
|
||||
" SRWarningMsg:
|
||||
function! <SID>SRWarningMsg(msg) "{{{
|
||||
echohl WarningMsg
|
||||
echomsg a:msg
|
||||
echohl None
|
||||
endfunction "}}}
|
||||
|
||||
" SRDispHiGrp:
|
||||
" Echos the currently selected highlight group name to the screen.
|
||||
" If a parameter is supplied, it will display the message in the
|
||||
" colour of the group name.
|
||||
function! <SID>SRDispHiGrp(...) "{{{
|
||||
if s:srhg_group_id != 0
|
||||
if s:srhg_group_id < 0
|
||||
let gid = -s:srhg_group_id
|
||||
else
|
||||
let gid = s:srhg_group_id
|
||||
endif
|
||||
|
||||
if a:0 > 0 && strlen(a:1) > 0
|
||||
let msg = a:1
|
||||
else
|
||||
let msg = "SRHiGrp - Group ID: " .gid . " Name: " . synIDattr(gid,"name")
|
||||
endif
|
||||
|
||||
exec 'echohl ' . synIDattr(gid, "name")
|
||||
exec "echomsg '" . msg . "'"
|
||||
echohl None
|
||||
else
|
||||
echo "No highlight group has been choosen yet"
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
" SRChooseHiGrp:
|
||||
" Sets the script variable s:srhg_group_id to the value
|
||||
" of the highlight group underneath the current cursor
|
||||
" position.
|
||||
function! <SID>SRChooseHiGrp(use_top_level) "{{{
|
||||
if(a:use_top_level == 1)
|
||||
let cursynid = -synID(line("."),col("."),1)
|
||||
else
|
||||
let cursynid = synIDtrans(synID(line("."),col("."),1))
|
||||
endif
|
||||
|
||||
if cursynid == 0
|
||||
call s:SRWarningMsg(
|
||||
\ 'There is no syntax group specified ' .
|
||||
\ 'under the cursor'
|
||||
\ )
|
||||
else
|
||||
let s:srhg_group_id = cursynid
|
||||
call s:SRDispHiGrp()
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
" SRSetVisualRange:
|
||||
" Redefines the visual range if the user called the functions
|
||||
" with 1,5SR*
|
||||
function! <SID>SRSetVisualRange() "{{{
|
||||
" If the current line position is not at the beginning
|
||||
" or the end of the visual region
|
||||
if line(".") != line("'<") && line(".") != line("'>")
|
||||
" Visually select the rows to ensure the correct
|
||||
" range is operated on.
|
||||
" This handles the case that SRHiGrp was run as:
|
||||
" :SRHiGrp
|
||||
" :1,5SRHiGrp
|
||||
" instead of:
|
||||
" :'<,'>SRHiGrp
|
||||
|
||||
exec 'normal! '.s:srhg_firstline."GV"
|
||||
if s:srhg_lastline > s:srhg_firstline
|
||||
exec "normal! " .
|
||||
\ (s:srhg_lastline - s:srhg_firstline) .
|
||||
\ "j"
|
||||
endif
|
||||
exec "normal! \<Esc>"
|
||||
endif
|
||||
return 1
|
||||
endfunction "}}}
|
||||
|
||||
" SRPositionWord:
|
||||
" Places the cursor on the next match following the
|
||||
" previous line and column passed in.
|
||||
function! <SID>SRPositionWord(prvline, prvcol, bfirsttime) "{{{
|
||||
let prvline = a:prvline
|
||||
let prvcol = a:prvcol
|
||||
|
||||
" echo 'L:'. col("'<") . ' R:' . col("'>")
|
||||
" echo 'Visual Mode:'. visualmode()
|
||||
|
||||
if (prvline == 0) && (prvcol == 0)
|
||||
call s:SRSetVisualRange()
|
||||
let leftcol = col("'<") - 1
|
||||
" exe 'norm! '.s:srhg_firstline."G\<bar>".leftcol.(leftcol>0 ? 'l' : '' )
|
||||
call cursor(s:srhg_firstline,leftcol)
|
||||
return 1
|
||||
endif
|
||||
|
||||
while 1==1
|
||||
if visualmode() ==# 'v'
|
||||
if line(".") == s:srhg_firstline
|
||||
" let leftcol = col("'<") - 1
|
||||
let leftcol = col("'<")
|
||||
else
|
||||
let leftcol = 1
|
||||
endif
|
||||
if line(".") == s:srhg_lastline
|
||||
let rightcol = col("'>")
|
||||
else
|
||||
let rightcol = col("$")
|
||||
endif
|
||||
elseif visualmode() ==# 'V'
|
||||
let leftcol = 1
|
||||
let rightcol = col("$")
|
||||
elseif visualmode() ==# "\<C-V>"
|
||||
let leftcol = col("'<") - 1
|
||||
let leftcol = col("'<")
|
||||
let rightcol = col("'>")
|
||||
endif
|
||||
|
||||
" echo 'PrvLine:'.prvline.' prvcol:'.prvcol.
|
||||
" \' L:'.leftcol.' R:'.rightcol.
|
||||
" \' VL:'.leftcol.' VR:'.rightcol
|
||||
|
||||
" Position cursor on leftcol
|
||||
" on each new line based on visual mode
|
||||
if col(".") == leftcol && a:bfirsttime == 1
|
||||
" The cursor is already at it starting position,
|
||||
" do not move the cursor
|
||||
elseif col(".") < leftcol
|
||||
" exe 'norm! '.line(".")."G\<bar>".leftcol.(leftcol>0 ? 'l' : '' )
|
||||
call cursor(line("."),leftcol)
|
||||
else
|
||||
normal! w
|
||||
endif
|
||||
|
||||
" Add additional check to see if the cursor has
|
||||
" moved after the above, if not, exit.
|
||||
if (col(".") == prvcol) && (line(".") == prvline && a:bfirsttime != 1)
|
||||
return -1
|
||||
endif
|
||||
|
||||
|
||||
if col(".") >= leftcol &&
|
||||
\ col(".") <= rightcol &&
|
||||
\ line(".") <= s:srhg_lastline
|
||||
return 1
|
||||
elseif col(".") > rightcol && line(".") < s:srhg_lastline
|
||||
let prvline = prvline + 1
|
||||
" Position the cursor on the next line and move
|
||||
" to the start of the visual region
|
||||
" exe 'norm! '.prvline."G\<bar>".leftcol.(leftcol>0 ? 'l' : '' )
|
||||
call cursor(prvline,leftcol)
|
||||
break
|
||||
elseif col(".") < leftcol && line(".") <= s:srhg_lastline
|
||||
" outside of visual area, move to next word
|
||||
continue
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
endwhile
|
||||
|
||||
return 1
|
||||
endfunction "}}}
|
||||
|
||||
" SRHiGrp:
|
||||
" Traverses the region selected and performs all search and
|
||||
" replaces over the region for the selected highlight group.
|
||||
function! <SID>SRHiGrp(...) range "{{{
|
||||
|
||||
let s:srhg_firstline = a:firstline
|
||||
let s:srhg_lastline = a:lastline
|
||||
|
||||
if s:srhg_group_id == 0
|
||||
call s:SRWarningMsg(
|
||||
\ 'You must specify a syntax group name ' .
|
||||
\ 'by placing the cursor on a character ' .
|
||||
\ 'that is highlighted the way you want ' .
|
||||
\ 'and execute :SRChooseHiGrp or ' .
|
||||
\ ':SRChooseHiGrp!'
|
||||
\ )
|
||||
return
|
||||
endif
|
||||
|
||||
let group_name = synIDattr(s:srhg_group_id, 'name')
|
||||
if group_name == ''
|
||||
let group_name = synIDattr(-s:srhg_group_id, 'name')
|
||||
endif
|
||||
|
||||
if(a:0 > 0)
|
||||
if( a:1 == 0 || a:1 == 1)
|
||||
let match_group = a:1
|
||||
endif
|
||||
else
|
||||
" Default to operate on syntax groups that match
|
||||
let match_group = 1
|
||||
endif
|
||||
|
||||
if(a:0 > 1)
|
||||
let match_exp = a:2
|
||||
else
|
||||
let match_exp = '\(\w\+\>\)'
|
||||
let dialog_msg = "Enter match expression (default word at cursor - " .
|
||||
\ match_exp .
|
||||
\ "): "
|
||||
let l:var_val = inputdialog(dialog_msg, match_exp)
|
||||
let response = 1
|
||||
" Ok or Cancel result in an empty string
|
||||
if l:var_val == ""
|
||||
call s:SRWarningMsg(
|
||||
\ 'You must provide a match expression which ' .
|
||||
\ 'includes a submatch'
|
||||
\ )
|
||||
return
|
||||
endif
|
||||
let match_exp = l:var_val
|
||||
endif
|
||||
|
||||
if(a:0 > 2)
|
||||
let replace_exp = a:3
|
||||
else
|
||||
let replace_exp = '\U\1'
|
||||
let dialog_msg = "Enter replacement expression for the submatch " .
|
||||
\ "(ie capitalize word - \\U\\1): "
|
||||
let l:var_val = inputdialog(dialog_msg, replace_exp)
|
||||
let response = 1
|
||||
" Ok or Cancel result in an empty string
|
||||
if l:var_val == ""
|
||||
" If empty, check if they want to leave it empty
|
||||
" of skip this variable
|
||||
let response = confirm("Your value is empty!"
|
||||
\ , "&Use blank\n&Cancel", response)
|
||||
endif
|
||||
if response == 1
|
||||
" Replace the variable with what was entered
|
||||
let replace_exp = l:var_val
|
||||
else
|
||||
" Cancel
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" let higrpid = synIDtrans(hlID(s:srhg_group_id))
|
||||
let found = 0
|
||||
let firsttime = 1
|
||||
let lastline = line("$")
|
||||
let orgline = line(".")
|
||||
let orgcol = col(".")
|
||||
let curline = line(".")
|
||||
let curcol = col(".")
|
||||
let fenkeep = &fen
|
||||
let saveSearch = @/
|
||||
let saveFoldEnable = &foldenable
|
||||
setlocal nofoldenable
|
||||
|
||||
" Reset visual range if necessary
|
||||
call s:SRSetVisualRange()
|
||||
|
||||
" Restore the cursor position since resetting
|
||||
" the visual area could have moved the cursor
|
||||
call cursor(orgline, orgcol)
|
||||
|
||||
if s:SRPositionWord(orgline,(orgcol-1), firsttime) == -1
|
||||
call s:SRWarningMsg(
|
||||
\ 'Please reselect the visual area (ie gv)'
|
||||
\ )
|
||||
return
|
||||
endif
|
||||
let firsttime = 0
|
||||
|
||||
let gid = s:srhg_group_id
|
||||
if(gid < 0)
|
||||
let gid = -s:srhg_group_id
|
||||
endif
|
||||
|
||||
while line(".") <= a:lastline
|
||||
let curcol = col(".")
|
||||
let curline = line(".")
|
||||
let cursynid = (s:srhg_group_id < 0) ?
|
||||
\ -synID(line("."),col("."),1) :
|
||||
\ synIDtrans(synID(line("."),col("."),1))
|
||||
let cursynid = (s:srhg_group_id < 0) ? synID(line("."),col("."),1) : synIDtrans(synID(line("."),col("."),1))
|
||||
" Useful debugging statement:
|
||||
" echo col(".").':'.getline(".")[col(".")-1].':'.cursynid.':'.getline(".")
|
||||
|
||||
if line(".") == curline
|
||||
if match_group == 1 && cursynid == gid
|
||||
" Perform the subtitution, but do not report an error
|
||||
" if the match fails
|
||||
exec 's/\%#'.match_exp.'/'.replace_exp.'/e'
|
||||
" Since this command can move the cursor, put the cursor
|
||||
" back to its original position
|
||||
" exe 'norm! '.curline."G\<bar>".(curcol-1)."l"
|
||||
call cursor(curline,curcol)
|
||||
let found = 1
|
||||
elseif match_group == 0 && cursynid != gid
|
||||
" Perform the subtitution, but do not report an error
|
||||
" if the match fails
|
||||
exec 's/\%#'.match_exp.'/'.replace_exp.'/e'
|
||||
" Since this command can move the cursor, put the cursor
|
||||
" back to its original position
|
||||
exe 'norm! '.curline."G\<bar>".(curcol-1)."l"
|
||||
endif
|
||||
endif
|
||||
|
||||
let prvcol = curcol
|
||||
let prvline = curline
|
||||
if s:SRPositionWord(prvline, prvcol, firsttime) == -1
|
||||
break
|
||||
endif
|
||||
|
||||
endwhile
|
||||
|
||||
if found == 0
|
||||
call s:SRWarningMsg('Did not find highlight group: "'.group_name.'"')
|
||||
endif
|
||||
|
||||
" cleanup
|
||||
let &fen = fenkeep
|
||||
if foldlevel(".") > 0
|
||||
norm! zO
|
||||
endif
|
||||
let &foldenable = saveFoldEnable
|
||||
unlet curcol
|
||||
" unlet higrpid
|
||||
unlet lastline
|
||||
let @/ = saveSearch
|
||||
if exists("prvcol")
|
||||
unlet prvcol
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
"}}}
|
||||
|
||||
" SRSearch:
|
||||
" Finds the next occurrence of the highlight group within
|
||||
" the range selected from the current cursor position.
|
||||
function! <SID>SRSearch(fline, lline, ...) "{{{
|
||||
|
||||
let s:srhg_firstline = a:fline
|
||||
let s:srhg_lastline = a:lline
|
||||
|
||||
if a:0 > 0 && strlen(a:1) > 0
|
||||
let s:srhg_group_id = -hlID(a:1)
|
||||
let group_name = a:1
|
||||
else
|
||||
let group_name = synIDattr(-s:srhg_group_id, 'name')
|
||||
endif
|
||||
|
||||
if s:srhg_group_id == 0
|
||||
call s:SRWarningMsg(
|
||||
\ 'You must specify a syntax group name ' .
|
||||
\ 'on the command line (<Tab> to complete) ' .
|
||||
\ 'or by placing the cursor on a character ' .
|
||||
\ 'that is highlighted the way you want ' .
|
||||
\ 'and execute :SRChooseHiGrp or ' .
|
||||
\ ':SRChooseHiGrp!'
|
||||
\ )
|
||||
return
|
||||
endif
|
||||
|
||||
" let higrpid = synIDtrans(hlID(s:srhg_group_id))
|
||||
let found = 0
|
||||
let lastline = line("$")
|
||||
let orgline = line(".")
|
||||
let orgcol = col(".")
|
||||
let curline = line(".")
|
||||
let curcol = col(".")
|
||||
let fenkeep = &fen
|
||||
let saveSearch = @/
|
||||
let saveFoldEnable = &foldenable
|
||||
setlocal nofoldenable
|
||||
" Set this to false, to force the search to move the cursor
|
||||
" this prevents the user from having to manually move the
|
||||
" cursor between recursive calls.
|
||||
let firsttime = 0
|
||||
|
||||
" Reset visual range if necessary
|
||||
call s:SRSetVisualRange()
|
||||
|
||||
" Restore the cursor position since resetting
|
||||
" the visual area could have moved the cursor
|
||||
call cursor(orgline, orgcol)
|
||||
|
||||
if s:SRPositionWord(orgline,orgcol,firsttime) == -1
|
||||
call s:SRWarningMsg(
|
||||
\ 'Please reselect the visual area (ie gv)'
|
||||
\ )
|
||||
return
|
||||
endif
|
||||
|
||||
let gid = s:srhg_group_id
|
||||
if(gid < 0)
|
||||
let gid = -s:srhg_group_id
|
||||
endif
|
||||
|
||||
while line(".") <= s:srhg_lastline
|
||||
let curcol = col(".")
|
||||
let curline = line(".")
|
||||
let cursynid = (s:srhg_group_id < 0) ?
|
||||
\ -synID(line("."),col("."),1) :
|
||||
\ synIDtrans(synID(line("."),col("."),1))
|
||||
let cursynid = (s:srhg_group_id < 0) ? synID(line("."),col("."),1) : synIDtrans(synID(line("."),col("."),1))
|
||||
" Useful debugging statement:
|
||||
" echo col(".").':'.getline(".")[col(".")-1].':'.cursynid.':'.getline(".")
|
||||
|
||||
if line(".") == curline
|
||||
if cursynid == gid
|
||||
call s:SRDispHiGrp( "SRSearch - Match found - Group ID: " .
|
||||
\ gid . " Name: " . synIDattr(gid,"name")
|
||||
\ )
|
||||
let found = 1
|
||||
break
|
||||
endif
|
||||
endif
|
||||
|
||||
let prvcol = curcol
|
||||
let prvline = curline
|
||||
if s:SRPositionWord(prvline, prvcol, firsttime) == -1
|
||||
break
|
||||
endif
|
||||
|
||||
endwhile
|
||||
|
||||
if found == 0
|
||||
call s:SRDispHiGrp( "SRSearch - Match NOT found - Group ID: " .
|
||||
\ gid . " Name: " . synIDattr(gid,"name")
|
||||
\ )
|
||||
call cursor(orgline, orgcol)
|
||||
endif
|
||||
|
||||
" cleanup
|
||||
let &fen = fenkeep
|
||||
if foldlevel(".") > 0
|
||||
norm! zO
|
||||
endif
|
||||
let &foldenable = saveFoldEnable
|
||||
unlet curcol
|
||||
" unlet higrpid
|
||||
unlet lastline
|
||||
let @/ = saveSearch
|
||||
if exists("prvcol")
|
||||
unlet prvcol
|
||||
endif
|
||||
endfunction "}}}
|
||||
|
||||
"}}}
|
||||
|
||||
" Commands: {{{
|
||||
command! -range -bang -nargs=* SRHiGrp <line1>,<line2>call s:SRHiGrp(<bang>1,<args>)
|
||||
command! -bang -nargs=0 SRChooseHiGrp :call s:SRChooseHiGrp(<bang>1)
|
||||
command! -nargs=0 SRDispHiGrp :call s:SRDispHiGrp()
|
||||
command! -range=% -nargs=? -complete=highlight SRSearch call s:SRSearch(<line1>,<line2>,<q-args>)
|
||||
"}}}
|
||||
|
||||
" vim:fdm=marker:nowrap:ts=4:
|
482
vimfiles/plugin/cecutil.vim
Normal file
482
vimfiles/plugin/cecutil.vim
Normal file
@ -0,0 +1,482 @@
|
||||
" cecutil.vim : save/restore window position
|
||||
" save/restore mark position
|
||||
" save/restore selected user maps
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Version: 17
|
||||
" Date: Sep 04, 2007
|
||||
"
|
||||
" Saving Restoring Destroying Marks: {{{1
|
||||
" call SaveMark(markname) let savemark= SaveMark(markname)
|
||||
" call RestoreMark(markname) call RestoreMark(savemark)
|
||||
" call DestroyMark(markname)
|
||||
" commands: SM RM DM
|
||||
"
|
||||
" Saving Restoring Destroying Window Position: {{{1
|
||||
" call SaveWinPosn() let winposn= SaveWinPosn()
|
||||
" call RestoreWinPosn() call RestoreWinPosn(winposn)
|
||||
" \swp : save current window/buffer's position
|
||||
" \rwp : restore current window/buffer's previous position
|
||||
" commands: SWP RWP
|
||||
"
|
||||
" Saving And Restoring User Maps: {{{1
|
||||
" call SaveUserMaps(mapmode,maplead,mapchx,suffix)
|
||||
" call RestoreUserMaps(suffix)
|
||||
"
|
||||
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
|
||||
"
|
||||
" You believe that God is one. You do well. The demons also {{{1
|
||||
" believe, and shudder. But do you want to know, vain man, that
|
||||
" faith apart from works is dead? (James 2:19,20 WEB)
|
||||
|
||||
" Load Once: {{{1
|
||||
if &cp || exists("g:loaded_cecutil")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_cecutil = "v17"
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
"DechoVarOn
|
||||
|
||||
" -----------------------
|
||||
" Public Interface: {{{1
|
||||
" -----------------------
|
||||
|
||||
" Map Interface: {{{2
|
||||
if !hasmapto('<Plug>SaveWinPosn')
|
||||
map <unique> <Leader>swp <Plug>SaveWinPosn
|
||||
endif
|
||||
if !hasmapto('<Plug>RestoreWinPosn')
|
||||
map <unique> <Leader>rwp <Plug>RestoreWinPosn
|
||||
endif
|
||||
nmap <silent> <Plug>SaveWinPosn :call SaveWinPosn()<CR>
|
||||
nmap <silent> <Plug>RestoreWinPosn :call RestoreWinPosn()<CR>
|
||||
|
||||
" Command Interface: {{{2
|
||||
com! -bar -nargs=0 SWP call SaveWinPosn()
|
||||
com! -bar -nargs=0 RWP call RestoreWinPosn()
|
||||
com! -bar -nargs=1 SM call SaveMark(<q-args>)
|
||||
com! -bar -nargs=1 RM call RestoreMark(<q-args>)
|
||||
com! -bar -nargs=1 DM call DestroyMark(<q-args>)
|
||||
|
||||
if v:version < 630
|
||||
let s:modifier= "sil "
|
||||
else
|
||||
let s:modifier= "sil keepj "
|
||||
endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" SaveWinPosn: {{{1
|
||||
" let winposn= SaveWinPosn() will save window position in winposn variable
|
||||
" call SaveWinPosn() will save window position in b:cecutil_winposn{b:cecutil_iwinposn}
|
||||
" let winposn= SaveWinPosn(0) will *only* save window position in winposn variable (no stacking done)
|
||||
fun! SaveWinPosn(...)
|
||||
" call Dfunc("SaveWinPosn() a:0=".a:0)
|
||||
if line(".") == 1 && getline(1) == ""
|
||||
" call Dfunc("SaveWinPosn : empty buffer")
|
||||
return ""
|
||||
endif
|
||||
let so_keep = &so
|
||||
let siso_keep = &siso
|
||||
let ss_keep = &ss
|
||||
set so=0 siso=0 ss=0
|
||||
|
||||
let swline = line(".")
|
||||
let swcol = col(".")
|
||||
let swwline = winline() - 1
|
||||
let swwcol = virtcol(".") - wincol()
|
||||
let savedposn = "call GoWinbufnr(".winbufnr(0).")|silent ".swline
|
||||
let savedposn = savedposn."|".s:modifier."norm! 0z\<cr>"
|
||||
if swwline > 0
|
||||
let savedposn= savedposn.":".s:modifier."norm! ".swwline."\<c-y>\<cr>"
|
||||
endif
|
||||
if swwcol > 0
|
||||
let savedposn= savedposn.":".s:modifier."norm! 0".swwcol."zl\<cr>"
|
||||
endif
|
||||
let savedposn = savedposn.":".s:modifier."call cursor(".swline.",".swcol.")\<cr>"
|
||||
|
||||
" save window position in
|
||||
" b:cecutil_winposn_{iwinposn} (stack)
|
||||
" only when SaveWinPosn() is used
|
||||
if a:0 == 0
|
||||
if !exists("b:cecutil_iwinposn")
|
||||
let b:cecutil_iwinposn= 1
|
||||
else
|
||||
let b:cecutil_iwinposn= b:cecutil_iwinposn + 1
|
||||
endif
|
||||
" call Decho("saving posn to SWP stack")
|
||||
let b:cecutil_winposn{b:cecutil_iwinposn}= savedposn
|
||||
endif
|
||||
|
||||
let &so = so_keep
|
||||
let &siso = siso_keep
|
||||
let &ss = ss_keep
|
||||
|
||||
" if exists("b:cecutil_iwinposn") " Decho
|
||||
" call Decho("b:cecutil_winpos{".b:cecutil_iwinposn."}[".b:cecutil_winposn{b:cecutil_iwinposn}."]")
|
||||
" else " Decho
|
||||
" call Decho("b:cecutil_iwinposn doesn't exist")
|
||||
" endif " Decho
|
||||
" call Dret("SaveWinPosn [".savedposn."]")
|
||||
return savedposn
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" RestoreWinPosn: {{{1
|
||||
fun! RestoreWinPosn(...)
|
||||
" call Dfunc("RestoreWinPosn() a:0=".a:0)
|
||||
" call Decho("getline(1)<".getline(1).">")
|
||||
" call Decho("line(.)=".line("."))
|
||||
if line(".") == 1 && getline(1) == ""
|
||||
" call Dfunc("RestoreWinPosn : empty buffer")
|
||||
return ""
|
||||
endif
|
||||
let so_keep = &so
|
||||
let siso_keep = &siso
|
||||
let ss_keep = &ss
|
||||
set so=0 siso=0 ss=0
|
||||
|
||||
if a:0 == 0 || a:1 == ""
|
||||
" use saved window position in b:cecutil_winposn{b:cecutil_iwinposn} if it exists
|
||||
if exists("b:cecutil_iwinposn") && exists("b:cecutil_winposn{b:cecutil_iwinposn}")
|
||||
" call Decho("using stack b:cecutil_winposn{".b:cecutil_iwinposn."}<".b:cecutil_winposn{b:cecutil_iwinposn}.">")
|
||||
try
|
||||
exe "silent! ".b:cecutil_winposn{b:cecutil_iwinposn}
|
||||
catch /^Vim\%((\a\+)\)\=:E749/
|
||||
" ignore empty buffer error messages
|
||||
endtry
|
||||
" normally drop top-of-stack by one
|
||||
" but while new top-of-stack doesn't exist
|
||||
" drop top-of-stack index by one again
|
||||
if b:cecutil_iwinposn >= 1
|
||||
unlet b:cecutil_winposn{b:cecutil_iwinposn}
|
||||
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
|
||||
while b:cecutil_iwinposn >= 1 && !exists("b:cecutil_winposn{b:cecutil_iwinposn}")
|
||||
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
|
||||
endwhile
|
||||
if b:cecutil_iwinposn < 1
|
||||
unlet b:cecutil_iwinposn
|
||||
endif
|
||||
endif
|
||||
else
|
||||
echohl WarningMsg
|
||||
echomsg "***warning*** need to SaveWinPosn first!"
|
||||
echohl None
|
||||
endif
|
||||
|
||||
else " handle input argument
|
||||
" call Decho("using input a:1<".a:1.">")
|
||||
" use window position passed to this function
|
||||
exe "silent ".a:1
|
||||
" remove a:1 pattern from b:cecutil_winposn{b:cecutil_iwinposn} stack
|
||||
if exists("b:cecutil_iwinposn")
|
||||
let jwinposn= b:cecutil_iwinposn
|
||||
while jwinposn >= 1 " search for a:1 in iwinposn..1
|
||||
if exists("b:cecutil_winposn{jwinposn}") " if it exists
|
||||
if a:1 == b:cecutil_winposn{jwinposn} " and the pattern matches
|
||||
unlet b:cecutil_winposn{jwinposn} " unlet it
|
||||
if jwinposn == b:cecutil_iwinposn " if at top-of-stack
|
||||
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1 " drop stacktop by one
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let jwinposn= jwinposn - 1
|
||||
endwhile
|
||||
endif
|
||||
endif
|
||||
|
||||
" seems to be something odd: vertical motions after RWP
|
||||
" cause jump to first column. Following fixes that
|
||||
if wincol() > 1
|
||||
silent norm! hl
|
||||
elseif virtcol(".") < virtcol("$")
|
||||
silent norm! lh
|
||||
endif
|
||||
|
||||
let &so = so_keep
|
||||
let &siso = siso_keep
|
||||
let &ss = ss_keep
|
||||
|
||||
" call Dret("RestoreWinPosn")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" GoWinbufnr: go to window holding given buffer (by number) {{{1
|
||||
" Prefers current window; if its buffer number doesn't match,
|
||||
" then will try from topleft to bottom right
|
||||
fun! GoWinbufnr(bufnum)
|
||||
" call Dfunc("GoWinbufnr(".a:bufnum.")")
|
||||
if winbufnr(0) == a:bufnum
|
||||
" call Dret("GoWinbufnr : winbufnr(0)==a:bufnum")
|
||||
return
|
||||
endif
|
||||
winc t
|
||||
let first=1
|
||||
while winbufnr(0) != a:bufnum && (first || winnr() != 1)
|
||||
winc w
|
||||
let first= 0
|
||||
endwhile
|
||||
" call Dret("GoWinbufnr")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" SaveMark: sets up a string saving a mark position. {{{1
|
||||
" For example, SaveMark("a")
|
||||
" Also sets up a global variable, g:savemark_{markname}
|
||||
fun! SaveMark(markname)
|
||||
" call Dfunc("SaveMark(markname<".a:markname.">)")
|
||||
let markname= a:markname
|
||||
if strpart(markname,0,1) !~ '\a'
|
||||
let markname= strpart(markname,1,1)
|
||||
endif
|
||||
" call Decho("markname=".markname)
|
||||
|
||||
let lzkeep = &lz
|
||||
set lz
|
||||
|
||||
if 1 <= line("'".markname) && line("'".markname) <= line("$")
|
||||
let winposn = SaveWinPosn(0)
|
||||
exe s:modifier."norm! `".markname
|
||||
let savemark = SaveWinPosn(0)
|
||||
let g:savemark_{markname} = savemark
|
||||
let savemark = markname.savemark
|
||||
call RestoreWinPosn(winposn)
|
||||
else
|
||||
let g:savemark_{markname} = ""
|
||||
let savemark = ""
|
||||
endif
|
||||
|
||||
let &lz= lzkeep
|
||||
|
||||
" call Dret("SaveMark : savemark<".savemark.">")
|
||||
return savemark
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" RestoreMark: {{{1
|
||||
" call RestoreMark("a") -or- call RestoreMark(savemark)
|
||||
fun! RestoreMark(markname)
|
||||
" call Dfunc("RestoreMark(markname<".a:markname.">)")
|
||||
|
||||
if strlen(a:markname) <= 0
|
||||
" call Dret("RestoreMark : no such mark")
|
||||
return
|
||||
endif
|
||||
let markname= strpart(a:markname,0,1)
|
||||
if markname !~ '\a'
|
||||
" handles 'a -> a styles
|
||||
let markname= strpart(a:markname,1,1)
|
||||
endif
|
||||
" call Decho("markname=".markname." strlen(a:markname)=".strlen(a:markname))
|
||||
|
||||
let lzkeep = &lz
|
||||
set lz
|
||||
let winposn = SaveWinPosn(0)
|
||||
|
||||
if strlen(a:markname) <= 2
|
||||
if exists("g:savemark_{markname}") && strlen(g:savemark_{markname}) != 0
|
||||
" use global variable g:savemark_{markname}
|
||||
" call Decho("use savemark list")
|
||||
call RestoreWinPosn(g:savemark_{markname})
|
||||
exe "norm! m".markname
|
||||
endif
|
||||
else
|
||||
" markname is a savemark command (string)
|
||||
" call Decho("use savemark command")
|
||||
let markcmd= strpart(a:markname,1)
|
||||
call RestoreWinPosn(markcmd)
|
||||
exe "norm! m".markname
|
||||
endif
|
||||
|
||||
call RestoreWinPosn(winposn)
|
||||
let &lz = lzkeep
|
||||
|
||||
" call Dret("RestoreMark")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" DestroyMark: {{{1
|
||||
" call DestroyMark("a") -- destroys mark
|
||||
fun! DestroyMark(markname)
|
||||
" call Dfunc("DestroyMark(markname<".a:markname.">)")
|
||||
|
||||
" save options and set to standard values
|
||||
let reportkeep= &report
|
||||
let lzkeep = &lz
|
||||
set lz report=10000
|
||||
|
||||
let markname= strpart(a:markname,0,1)
|
||||
if markname !~ '\a'
|
||||
" handles 'a -> a styles
|
||||
let markname= strpart(a:markname,1,1)
|
||||
endif
|
||||
" call Decho("markname=".markname)
|
||||
|
||||
let curmod = &mod
|
||||
let winposn = SaveWinPosn(0)
|
||||
1
|
||||
let lineone = getline(".")
|
||||
exe "k".markname
|
||||
d
|
||||
put! =lineone
|
||||
let &mod = curmod
|
||||
call RestoreWinPosn(winposn)
|
||||
|
||||
" restore options to user settings
|
||||
let &report = reportkeep
|
||||
let &lz = lzkeep
|
||||
|
||||
" call Dret("DestroyMark")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" QArgSplitter: to avoid \ processing by <f-args>, <q-args> is needed. {{{1
|
||||
" However, <q-args> doesn't split at all, so this one returns a list
|
||||
" with splits at all whitespace (only!), plus a leading length-of-list.
|
||||
" The resulting list: qarglist[0] corresponds to a:0
|
||||
" qarglist[i] corresponds to a:{i}
|
||||
fun! QArgSplitter(qarg)
|
||||
" call Dfunc("QArgSplitter(qarg<".a:qarg.">)")
|
||||
let qarglist = split(a:qarg)
|
||||
let qarglistlen = len(qarglist)
|
||||
let qarglist = insert(qarglist,qarglistlen)
|
||||
" call Dret("QArgSplitter ".string(qarglist))
|
||||
return qarglist
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" ListWinPosn:
|
||||
"fun! ListWinPosn() " Decho
|
||||
" if !exists("b:cecutil_iwinposn") || b:cecutil_iwinposn == 0 " Decho
|
||||
" call Decho("nothing on SWP stack") " Decho
|
||||
" else " Decho
|
||||
" let jwinposn= b:cecutil_iwinposn " Decho
|
||||
" while jwinposn >= 1 " Decho
|
||||
" if exists("b:cecutil_winposn{jwinposn}") " Decho
|
||||
" call Decho("winposn{".jwinposn."}<".b:cecutil_winposn{jwinposn}.">") " Decho
|
||||
" else " Decho
|
||||
" call Decho("winposn{".jwinposn."} -- doesn't exist") " Decho
|
||||
" endif " Decho
|
||||
" let jwinposn= jwinposn - 1 " Decho
|
||||
" endwhile " Decho
|
||||
" endif " Decho
|
||||
"endfun " Decho
|
||||
"com! -nargs=0 LWP call ListWinPosn() " Decho
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" SaveUserMaps: this function sets up a script-variable (s:restoremap) {{{1
|
||||
" which can be used to restore user maps later with
|
||||
" call RestoreUserMaps()
|
||||
"
|
||||
" mapmode - see :help maparg for its list
|
||||
" ex. "n" = Normal
|
||||
" If the first letter is u, then unmapping will be done
|
||||
" ex. "un" = Normal + unmapping
|
||||
" maplead - see mapchx
|
||||
" mapchx - "<something>" handled as a single map item.
|
||||
" ex. "<left>"
|
||||
" - "string" a string of single letters which are actually
|
||||
" multiple two-letter maps (using the maplead:
|
||||
" maplead . each_character_in_string)
|
||||
" ex. maplead="\" and mapchx="abc" saves user mappings for
|
||||
" \a, \b, and \c
|
||||
" Of course, if maplead is "", then for mapchx="abc",
|
||||
" mappings for a, b, and c are saved.
|
||||
" - :something handled as a single map item, w/o the ":"
|
||||
" ex. mapchx= ":abc" will save a mapping for "abc"
|
||||
" suffix - a string unique to your plugin
|
||||
" ex. suffix= "DrawIt"
|
||||
fun! SaveUserMaps(mapmode,maplead,mapchx,suffix)
|
||||
" call Dfunc("SaveUserMaps(mapmode<".a:mapmode."> maplead<".a:maplead."> mapchx<".a:mapchx."> suffix<".a:suffix.">)")
|
||||
|
||||
if !exists("s:restoremap_{a:suffix}")
|
||||
" initialize restoremap_suffix to null string
|
||||
let s:restoremap_{a:suffix}= ""
|
||||
endif
|
||||
|
||||
" set up dounmap: if 1, then save and unmap (a:mapmode leads with a "u")
|
||||
" if 0, save only
|
||||
if a:mapmode =~ '^u'
|
||||
let dounmap= 1
|
||||
let mapmode= strpart(a:mapmode,1)
|
||||
else
|
||||
let dounmap= 0
|
||||
let mapmode= a:mapmode
|
||||
endif
|
||||
|
||||
" save single map :...something...
|
||||
if strpart(a:mapchx,0,1) == ':'
|
||||
let amap= strpart(a:mapchx,1)
|
||||
if amap == "|" || amap == "\<c-v>"
|
||||
let amap= "\<c-v>".amap
|
||||
endif
|
||||
let amap = a:maplead.amap
|
||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:silent! ".mapmode."unmap ".amap
|
||||
if maparg(amap,mapmode) != ""
|
||||
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
|
||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:".mapmode."map ".amap." ".maprhs
|
||||
endif
|
||||
if dounmap
|
||||
exe "silent! ".mapmode."unmap ".amap
|
||||
endif
|
||||
|
||||
" save single map <something>
|
||||
elseif strpart(a:mapchx,0,1) == '<'
|
||||
let amap = a:mapchx
|
||||
if amap == "|" || amap == "\<c-v>"
|
||||
let amap= "\<c-v>".amap
|
||||
endif
|
||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".amap
|
||||
if maparg(a:mapchx,mapmode) != ""
|
||||
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
|
||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".maprhs
|
||||
endif
|
||||
if dounmap
|
||||
exe "silent! ".mapmode."unmap ".amap
|
||||
endif
|
||||
|
||||
" save multiple maps
|
||||
else
|
||||
let i= 1
|
||||
while i <= strlen(a:mapchx)
|
||||
let amap= a:maplead.strpart(a:mapchx,i-1,1)
|
||||
if amap == "|" || amap == "\<c-v>"
|
||||
let amap= "\<c-v>".amap
|
||||
endif
|
||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".amap
|
||||
if maparg(amap,mapmode) != ""
|
||||
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
|
||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".maprhs
|
||||
endif
|
||||
if dounmap
|
||||
exe "silent! ".mapmode."unmap ".amap
|
||||
endif
|
||||
let i= i + 1
|
||||
endwhile
|
||||
endif
|
||||
" call Dret("SaveUserMaps : restoremap_".a:suffix.": ".s:restoremap_{a:suffix})
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" RestoreUserMaps: {{{1
|
||||
" Used to restore user maps saved by SaveUserMaps()
|
||||
fun! RestoreUserMaps(suffix)
|
||||
" call Dfunc("RestoreUserMaps(suffix<".a:suffix.">)")
|
||||
if exists("s:restoremap_{a:suffix}")
|
||||
let s:restoremap_{a:suffix}= substitute(s:restoremap_{a:suffix},'|\s*$','','e')
|
||||
if s:restoremap_{a:suffix} != ""
|
||||
" call Decho("exe ".s:restoremap_{a:suffix})
|
||||
exe "silent! ".s:restoremap_{a:suffix}
|
||||
endif
|
||||
unlet s:restoremap_{a:suffix}
|
||||
endif
|
||||
" call Dret("RestoreUserMaps")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Restore: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Modelines: {{{1
|
||||
" vim: ts=4 fdm=marker
|
@ -1,38 +1,38 @@
|
||||
" ---------------------------------------------------------------------
|
||||
" getscriptPlugin.vim
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Jul 18, 2006
|
||||
" Installing: :help glvs-install
|
||||
" Usage: :help glvs
|
||||
"
|
||||
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
|
||||
"
|
||||
" (Rom 15:11 WEB) Again, "Praise the Lord, all you Gentiles! Let
|
||||
" all the peoples praise Him."
|
||||
" ---------------------------------------------------------------------
|
||||
" Initialization: {{{1
|
||||
" if you're sourcing this file, surely you can't be
|
||||
" expecting vim to be in its vi-compatible mode
|
||||
if &cp || exists("g:loaded_getscriptPlugin")
|
||||
if &verbose
|
||||
echo "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
|
||||
endif
|
||||
finish
|
||||
endif
|
||||
let g:loaded_getscriptPlugin = 1
|
||||
let s:keepfo = &fo
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Public Interface: {{{1
|
||||
com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
|
||||
com! -nargs=0 GetScripts call getscript#GetLatestVimScripts()
|
||||
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
|
||||
|
||||
" Restore Options: {{{1
|
||||
let &fo = s:keepfo
|
||||
let &cpo= s:keepcpo
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" vim: ts=8 sts=2 fdm=marker nowrap
|
||||
" ---------------------------------------------------------------------
|
||||
" getscriptPlugin.vim
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Jan 07, 2008
|
||||
" Installing: :help glvs-install
|
||||
" Usage: :help glvs
|
||||
"
|
||||
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
|
||||
"
|
||||
" (Rom 15:11 WEB) Again, "Praise the Lord, all you Gentiles! Let
|
||||
" all the peoples praise Him."
|
||||
" ---------------------------------------------------------------------
|
||||
" Initialization: {{{1
|
||||
" if you're sourcing this file, surely you can't be
|
||||
" expecting vim to be in its vi-compatible mode
|
||||
if &cp || exists("g:loaded_getscriptPlugin")
|
||||
if &verbose
|
||||
echo "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
|
||||
endif
|
||||
finish
|
||||
endif
|
||||
let g:loaded_getscriptPlugin = "v29"
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Public Interface: {{{1
|
||||
com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
|
||||
com! -nargs=0 GetScripts call getscript#GetLatestVimScripts()
|
||||
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Restore Options: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" vim: ts=8 sts=2 fdm=marker nowrap
|
||||
|
@ -1,7 +1,7 @@
|
||||
" matchit.vim: (global plugin) Extended "%" matching
|
||||
" Last Change: Sun Sep 09 09:00 AM 2007 EDT
|
||||
" Last Change: Fri Jan 25 10:00 AM 2008 EST
|
||||
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
|
||||
" Version: 1.13.1, for Vim 6.3+
|
||||
" Version: 1.13.2, for Vim 6.3+
|
||||
" URL: http://www.vim.org/script.php?script_id=39
|
||||
|
||||
" Documentation:
|
||||
@ -398,6 +398,7 @@ fun! s:ParseWords(groups)
|
||||
endwhile " Now, tail has been used up.
|
||||
let parsed = parsed . ","
|
||||
endwhile " groups =~ '[^,:]'
|
||||
let parsed = substitute(parsed, ',$', '', '')
|
||||
return parsed
|
||||
endfun
|
||||
|
||||
|
@ -1,5 +1,15 @@
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" svndiff 2.0 (C) 2007 Ico Doornekamp
|
||||
" svndiff (C) 2007 Ico Doornekamp
|
||||
"
|
||||
" This program is free software; you can redistribute it and/or modify it
|
||||
" under the terms of the GNU General Public License as published by the Free
|
||||
" Software Foundation; either version 2 of the License, or (at your option)
|
||||
" any later version.
|
||||
"
|
||||
" 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.
|
||||
"
|
||||
" Introduction
|
||||
" ------------
|
||||
@ -8,34 +18,32 @@
|
||||
"
|
||||
" An small vim 7.0 plugin for showing svn diff information in a file while
|
||||
" editing. This plugin runs a diff between the current buffer and the original
|
||||
" subversion file, and shows coloured tags indicating where the buffer differs
|
||||
" from the original file from the subversion repository. The original text is
|
||||
" not shown, only signs are used to indicate where changes were made.
|
||||
" subversion file, and shows coloured signs indicating where the buffer
|
||||
" differs from the original file from the subversion repository. The original
|
||||
" text is not shown, only signs are used to indicate where changes were made.
|
||||
"
|
||||
" The following symbols and syntax highlight groups are used for the tags:
|
||||
" The following symbols and syntax highlight groups are used for the signs:
|
||||
"
|
||||
" > DiffAdd: Newly added lines. (default=blue)
|
||||
"
|
||||
" ! DiffChange: Lines which are changed from the original. (default=cyan)
|
||||
"
|
||||
" < DiffDel: Applied to the lines directly above and below a deleted block
|
||||
" (default=magenta)
|
||||
" (default=magenta)
|
||||
" Usage
|
||||
" -----
|
||||
"
|
||||
" The plugin defines one function: Svndiff(). This function figures out the
|
||||
" difference between the current file and it's subversion original, and adds
|
||||
" the tags at the places where the buffer differs from the original file from
|
||||
" difference between the current buffer and it's subversion original, and adds
|
||||
" the signs at the places where the buffer differs from the original file from
|
||||
" subversion. You'll need to call this function after making changes to update
|
||||
" the highlighting.
|
||||
"
|
||||
"
|
||||
" The function takes an optional argument specifying an additional action to
|
||||
" perform:
|
||||
" The function takes one argument specifying an additional action to perform:
|
||||
"
|
||||
" "prev" : jump to the previous different block
|
||||
" "next" : jump to the next different block
|
||||
" "clear" : clean up all tags
|
||||
" "clear" : clean up all signs
|
||||
"
|
||||
" You might want to map some keys to run the Svndiff function. For
|
||||
" example, add to your .vimrc:
|
||||
@ -44,6 +52,33 @@
|
||||
" noremap <F4> :call Svndiff("next")<CR>
|
||||
" noremap <F5> :call Svndiff("clear")<CR>
|
||||
"
|
||||
"
|
||||
" Configuration
|
||||
" -------------
|
||||
"
|
||||
" The following configuration variables are availabe:
|
||||
"
|
||||
" * g:svndiff_autoupdate
|
||||
"
|
||||
" If this variable is defined, svndiff will automatically update the signs
|
||||
" when the user stops typing for a short while, and when leaving insert
|
||||
" mode. This might slow things down on large files, so use with caution.
|
||||
" The vim variable 'updatetime' can be used to set the auto-update intervar,
|
||||
" but not that changing this variable other effects as well. (refer to the
|
||||
" vim docs for more info)
|
||||
" To use, add to your .vimrc:
|
||||
"
|
||||
" let g:svndiff_autoupdate = 1
|
||||
"
|
||||
" * g:svndiff_one_sign_delete
|
||||
"
|
||||
" Normally, two 'delete' signs are placed around the location where
|
||||
" text was deleted. When this variable is defined, only one sign is
|
||||
" placed, above the location of the deleted text.
|
||||
" To use, add to your .vimrc:
|
||||
"
|
||||
" let g:svndiff_one_sign_delete = 1
|
||||
"
|
||||
" Colors
|
||||
" ------
|
||||
"
|
||||
@ -64,54 +99,75 @@
|
||||
"
|
||||
" 1.2 2007-06-14 Updated diff arguments from -u0 (obsolete) to -U0
|
||||
"
|
||||
" 2.0 2007-08-16 Changed from syntax highlighting to using tags, thanks
|
||||
" 2.0 2007-08-16 Changed from syntax highlighting to using signs, thanks
|
||||
" to Noah Spurrier for the idea. NOTE: the name of the
|
||||
" function changed from Svndiff_show() to Svndiff(), so
|
||||
" you might need to update your .vimrc mappings!
|
||||
"
|
||||
" 3.0 2008-02-02 Redesign with some ideas from Jan Bezdekovsky. The
|
||||
" diff is only updated when the buffer actually changes,
|
||||
" cleanup of signs is now done properly and some info
|
||||
" about each diff block is printed in the status line.
|
||||
"
|
||||
" 3.1 2008-02-04 Fixed bug that broke plugin in non-english locales, thanks
|
||||
" to Bernhard Walle for the patch
|
||||
"
|
||||
" 3.2 2008-02-27 The latest rewrite broke vim 6 compatiblity. The plugin
|
||||
" is now simply disabled for older vim versions to avoid
|
||||
" a lot of warnings when loading.
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
if v:version < 700
|
||||
finish
|
||||
endif
|
||||
|
||||
function! Svndiff(...)
|
||||
|
||||
let cmd = exists("a:1") ? a:1 : ''
|
||||
let s:sign_base = 200000 " Base for our sign id's, hoping to avoid colisions
|
||||
let s:is_active = {} " dictionary with buffer names that have svndiff active
|
||||
let s:diff_signs = {} " dict with list of ids of all signs, per file
|
||||
let s:diff_blocks = {} " dict with list of ids of first line of each diff block, per file
|
||||
let s:changedtick = {} " dict with changedticks of each buffer since last invocation
|
||||
|
||||
"
|
||||
" Do the diff and update signs.
|
||||
"
|
||||
|
||||
function s:Svndiff_update(...)
|
||||
|
||||
let fname = bufname("%")
|
||||
let jump_to = 0
|
||||
|
||||
if ! exists("s:is_active[fname]")
|
||||
return 0
|
||||
end
|
||||
|
||||
" Check if this file is managed by subversion, exit otherwise
|
||||
|
||||
let info = system("svn info " . fname)
|
||||
let info = system("LANG=C svn info " . fname)
|
||||
if match(info, "Path") == -1
|
||||
echom "Svndiff: Warning, file " . fname . " is not managed by subversion, or error running svn."
|
||||
return
|
||||
unlet s:is_active[fname]
|
||||
return 0
|
||||
end
|
||||
|
||||
" Check if the changedticks changed since the last invocation of this
|
||||
" function. If nothing changed, there's no need to update the signs.
|
||||
|
||||
" Remove all signs. If the cmd is 'clear', return right away. NOTE: this
|
||||
" command removes all signs from the file, also if they were not placed by
|
||||
" the this plugin. If this bothers your, tell me and I'll fix it.
|
||||
|
||||
sign unplace *
|
||||
|
||||
if cmd == 'clear'
|
||||
return
|
||||
endif
|
||||
|
||||
|
||||
" Define sign characters and colors
|
||||
|
||||
sign define svnadd text=> texthl=diffAdd
|
||||
sign define svndelete text=< texthl=diffDelete
|
||||
sign define svnchange text=! texthl=diffChange
|
||||
|
||||
if exists("s:changedtick[fname]") && s:changedtick[fname] == b:changedtick
|
||||
return 1
|
||||
end
|
||||
let s:changedtick[fname] = b:changedtick
|
||||
|
||||
" The diff has changed since the last time, so we need to update the signs.
|
||||
" This is where the magic happens: pipe the current buffer contents to a
|
||||
" shell command calculating the diff in a friendly parsable format.
|
||||
|
||||
let contents = join(getbufline("%", 1, "$"), "\n")
|
||||
let diff = system("diff -U0 <(svn cat " . fname . ") <(cat;echo)", contents)
|
||||
|
||||
" clear the old signs
|
||||
|
||||
call s:Svndiff_clear()
|
||||
|
||||
" Parse the output of the diff command and put signs at changed, added and
|
||||
" removed lines
|
||||
@ -131,56 +187,150 @@ function! Svndiff(...)
|
||||
if old_count == 0
|
||||
let from = new_from
|
||||
let to = new_from + new_count - 1
|
||||
let name = 'svnadd'
|
||||
let name = 'svndiff_add'
|
||||
let info = new_count . " lines added"
|
||||
elseif new_count == 0
|
||||
let from = new_from
|
||||
let to = new_from + 1
|
||||
let name = 'svndelete'
|
||||
let to = new_from
|
||||
let name = 'svndiff_delete'
|
||||
let info = old_count . " lines deleted"
|
||||
if ! exists("g:svndiff_one_sign_delete")
|
||||
let to += 1
|
||||
endif
|
||||
else
|
||||
let from = new_from
|
||||
let to = new_from + new_count - 1
|
||||
let name = 'svnchange'
|
||||
let name = 'svndiff_change'
|
||||
let info = new_count . " lines changed"
|
||||
endif
|
||||
|
||||
let id = from + s:sign_base
|
||||
let s:diff_blocks[fname] += [{ 'id': id, 'info': info }]
|
||||
|
||||
" Add signs to mark the changed lines
|
||||
|
||||
let line = from
|
||||
while line <= to
|
||||
exec 'sign place ' . from . ' line=' . line . ' name=' . name . ' file=' . fname
|
||||
let id = line + s:sign_base
|
||||
exec 'sign place ' . id . ' line=' . line . ' name=' . name . ' file=' . fname
|
||||
let s:diff_signs[fname] += [id]
|
||||
let line = line + 1
|
||||
endwhile
|
||||
|
||||
|
||||
" Check if we need to jump to prev/next diff block
|
||||
|
||||
if cmd == 'prev'
|
||||
if from < line(".")
|
||||
let jump_to = from
|
||||
endif
|
||||
endif
|
||||
|
||||
if cmd == 'next'
|
||||
if from > line(".")
|
||||
if jump_to == 0
|
||||
let jump_to = from
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
endfor
|
||||
|
||||
endfunction
|
||||
|
||||
" Set the cursor to the new position, if requested
|
||||
|
||||
if jump_to > 0
|
||||
call setpos(".", [ 0, jump_to, 1, 0 ])
|
||||
|
||||
"
|
||||
" Remove all signs we placed earlier
|
||||
"
|
||||
|
||||
function s:Svndiff_clear(...)
|
||||
let fname = bufname("%")
|
||||
if exists("s:diff_signs[fname]")
|
||||
for id in s:diff_signs[fname]
|
||||
exec 'sign unplace ' . id . ' file=' . fname
|
||||
endfor
|
||||
end
|
||||
let s:diff_blocks[fname] = []
|
||||
let s:diff_signs[fname] = []
|
||||
endfunction
|
||||
|
||||
|
||||
"
|
||||
" Jump to previous diff block sign above the current line
|
||||
"
|
||||
|
||||
function s:Svndiff_prev(...)
|
||||
let fname = bufname("%")
|
||||
let diff_blocks_reversed = reverse(copy(s:diff_blocks[fname]))
|
||||
for block in diff_blocks_reversed
|
||||
let line = block.id - s:sign_base
|
||||
if line < line(".")
|
||||
call setpos(".", [ 0, line, 1, 0 ])
|
||||
echom 'svndiff: ' . block.info
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
echom 'svndiff: no more diff blocks above cursor'
|
||||
endfunction
|
||||
|
||||
|
||||
"
|
||||
" Jump to next diff block sign below the current line
|
||||
"
|
||||
|
||||
function s:Svndiff_next(...)
|
||||
let fname = bufname("%")
|
||||
for block in s:diff_blocks[fname]
|
||||
let line = block.id - s:sign_base
|
||||
if line > line(".")
|
||||
call setpos(".", [ 0, line, 1, 0 ])
|
||||
echom 'svndiff: ' . block.info
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
echom 'svndiff: no more diff blocks below cursor'
|
||||
endfunction
|
||||
|
||||
|
||||
"
|
||||
" Wrapper function: Takes one argument, which is the action to perform:
|
||||
" {next|prev|clear}
|
||||
"
|
||||
|
||||
function Svndiff(...)
|
||||
|
||||
let cmd = exists("a:1") ? a:1 : ''
|
||||
let fname = bufname("%")
|
||||
if fname == ""
|
||||
echom "Buffer has no file name, can not do a svn diff"
|
||||
return
|
||||
endif
|
||||
|
||||
if cmd == 'clear'
|
||||
let s:changedtick[fname] = 0
|
||||
if exists("s:is_active[fname]")
|
||||
unlet s:is_active[fname]
|
||||
endif
|
||||
call s:Svndiff_clear()
|
||||
end
|
||||
|
||||
if cmd == 'prev'
|
||||
let s:is_active[fname] = 1
|
||||
let ok = s:Svndiff_update()
|
||||
if ok
|
||||
call s:Svndiff_prev()
|
||||
endif
|
||||
endif
|
||||
|
||||
if cmd == 'next'
|
||||
let s:is_active[fname] = 1
|
||||
let ok = s:Svndiff_update()
|
||||
if ok
|
||||
call s:Svndiff_next()
|
||||
endif
|
||||
endif
|
||||
|
||||
endfunction
|
||||
|
||||
|
||||
" Define sign characters and colors
|
||||
|
||||
sign define svndiff_add text=> texthl=diffAdd
|
||||
sign define svndiff_delete text=< texthl=diffDelete
|
||||
sign define svndiff_change text=! texthl=diffChange
|
||||
|
||||
|
||||
" Define autocmds if autoupdate is enabled
|
||||
|
||||
if exists("g:svndiff_autoupdate")
|
||||
autocmd CursorHold,CursorHoldI * call s:Svndiff_update()
|
||||
autocmd InsertLeave * call s:Svndiff_update()
|
||||
endif
|
||||
|
||||
" vi: ts=2 sw=2
|
||||
|
||||
|
@ -1,73 +1,88 @@
|
||||
" visincrPlugin.vim: Visual-block incremented lists
|
||||
" Author: Charles E. Campbell, Jr. Ph.D.
|
||||
" Date: Jul 18, 2006
|
||||
" Public Interface Only
|
||||
"
|
||||
" (James 2:19,20 WEB) You believe that God is one. You do well!
|
||||
" The demons also believe, and shudder.
|
||||
" But do you want to know, vain man, that
|
||||
" faith apart from works is dead?
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Load Once: {{{1
|
||||
if &cp || exists("g:loaded_visincrPlugin")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_visincrPlugin = 1
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Methods: {{{1
|
||||
let s:I = 0
|
||||
let s:II = 1
|
||||
let s:IMDY = 2
|
||||
let s:IYMD = 3
|
||||
let s:IDMY = 4
|
||||
let s:ID = 5
|
||||
let s:IM = 6
|
||||
let s:IA = 7
|
||||
let s:IX = 8
|
||||
let s:IIX = 9
|
||||
let s:IO = 10
|
||||
let s:IIO = 11
|
||||
let s:IR = 12
|
||||
let s:IIR = 13
|
||||
let s:RI = 14
|
||||
let s:RII = 15
|
||||
let s:RIMDY = 16
|
||||
let s:RIYMD = 17
|
||||
let s:RIDMY = 18
|
||||
let s:RID = 19
|
||||
let s:RIM = 20
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
" Public Interface: {{{1
|
||||
com! -ra -complete=expression -na=? I call visincr#VisBlockIncr(s:I , <f-args>)
|
||||
com! -ra -complete=expression -na=* II call visincr#VisBlockIncr(s:II , <f-args>)
|
||||
com! -ra -complete=expression -na=* IMDY call visincr#VisBlockIncr(s:IMDY , <f-args>)
|
||||
com! -ra -complete=expression -na=* IYMD call visincr#VisBlockIncr(s:IYMD , <f-args>)
|
||||
com! -ra -complete=expression -na=* IDMY call visincr#VisBlockIncr(s:IDMY , <f-args>)
|
||||
com! -ra -complete=expression -na=? ID call visincr#VisBlockIncr(s:ID , <f-args>)
|
||||
com! -ra -complete=expression -na=? IM call visincr#VisBlockIncr(s:IM , <f-args>)
|
||||
com! -ra -complete=expression -na=? IA call visincr#VisBlockIncr(s:IA , <f-args>)
|
||||
com! -ra -complete=expression -na=? IX call visincr#VisBlockIncr(s:IX , <f-args>)
|
||||
com! -ra -complete=expression -na=? IIX call visincr#VisBlockIncr(s:IIX , <f-args>)
|
||||
com! -ra -complete=expression -na=? IO call visincr#VisBlockIncr(s:IO , <f-args>)
|
||||
com! -ra -complete=expression -na=? IIO call visincr#VisBlockIncr(s:IIO , <f-args>)
|
||||
com! -ra -complete=expression -na=? IR call visincr#VisBlockIncr(s:IR , <f-args>)
|
||||
com! -ra -complete=expression -na=? IIR call visincr#VisBlockIncr(s:IIR , <f-args>)
|
||||
|
||||
com! -ra -complete=expression -na=? RI call visincr#VisBlockIncr(s:RI , <f-args>)
|
||||
com! -ra -complete=expression -na=* RII call visincr#VisBlockIncr(s:RII , <f-args>)
|
||||
com! -ra -complete=expression -na=* RIMDY call visincr#VisBlockIncr(s:RIMDY, <f-args>)
|
||||
com! -ra -complete=expression -na=* RIYMD call visincr#VisBlockIncr(s:RIYMD, <f-args>)
|
||||
com! -ra -complete=expression -na=* RIDMY call visincr#VisBlockIncr(s:RIDMY, <f-args>)
|
||||
com! -ra -complete=expression -na=? RID call visincr#VisBlockIncr(s:RID , <f-args>)
|
||||
com! -ra -complete=expression -na=? RIM call visincr#VisBlockIncr(s:RIM , <f-args>)
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Restoration And Modelines: {{{1
|
||||
" vim: ts=4 fdm=marker
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
" visincrPlugin.vim: Visual-block incremented lists
|
||||
" Author: Charles E. Campbell, Jr. Ph.D.
|
||||
" Date: Jul 18, 2006
|
||||
" Public Interface Only
|
||||
"
|
||||
" (James 2:19,20 WEB) You believe that God is one. You do well!
|
||||
" The demons also believe, and shudder.
|
||||
" But do you want to know, vain man, that
|
||||
" faith apart from works is dead?
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Load Once: {{{1
|
||||
if &cp || exists("g:loaded_visincrPlugin")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_visincrPlugin = "v19"
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Methods: {{{1
|
||||
let s:I = 0
|
||||
let s:II = 1
|
||||
let s:IMDY = 2
|
||||
let s:IYMD = 3
|
||||
let s:IDMY = 4
|
||||
let s:ID = 5
|
||||
let s:IM = 6
|
||||
let s:IA = 7
|
||||
let s:IX = 8
|
||||
let s:IIX = 9
|
||||
let s:IO = 10
|
||||
let s:IIO = 11
|
||||
let s:IR = 12
|
||||
let s:IIR = 13
|
||||
let s:IPOW = 14
|
||||
let s:IIPOW = 15
|
||||
let s:RI = 16
|
||||
let s:RII = 17
|
||||
let s:RIMDY = 18
|
||||
let s:RIYMD = 19
|
||||
let s:RIDMY = 20
|
||||
let s:RID = 21
|
||||
let s:RIM = 22
|
||||
let s:RIA = 23
|
||||
let s:RIX = 24
|
||||
let s:RIIX = 25
|
||||
let s:RIO = 26
|
||||
let s:RIIO = 27
|
||||
let s:RIR = 28
|
||||
let s:RIIR = 29
|
||||
let s:RIPOW = 30
|
||||
let s:RIIPOW = 31
|
||||
|
||||
" ------------------------------------------------------------------------------
|
||||
" Public Interface: {{{1
|
||||
com! -ra -complete=expression -na=? I call visincr#VisBlockIncr(s:I , <f-args>)
|
||||
com! -ra -complete=expression -na=* II call visincr#VisBlockIncr(s:II , <f-args>)
|
||||
com! -ra -complete=expression -na=* IMDY call visincr#VisBlockIncr(s:IMDY , <f-args>)
|
||||
com! -ra -complete=expression -na=* IYMD call visincr#VisBlockIncr(s:IYMD , <f-args>)
|
||||
com! -ra -complete=expression -na=* IDMY call visincr#VisBlockIncr(s:IDMY , <f-args>)
|
||||
com! -ra -complete=expression -na=? ID call visincr#VisBlockIncr(s:ID , <f-args>)
|
||||
com! -ra -complete=expression -na=? IM call visincr#VisBlockIncr(s:IM , <f-args>)
|
||||
com! -ra -complete=expression -na=? IA call visincr#VisBlockIncr(s:IA , <f-args>)
|
||||
com! -ra -complete=expression -na=? IX call visincr#VisBlockIncr(s:IX , <f-args>)
|
||||
com! -ra -complete=expression -na=? IIX call visincr#VisBlockIncr(s:IIX , <f-args>)
|
||||
com! -ra -complete=expression -na=? IO call visincr#VisBlockIncr(s:IO , <f-args>)
|
||||
com! -ra -complete=expression -na=? IIO call visincr#VisBlockIncr(s:IIO , <f-args>)
|
||||
com! -ra -complete=expression -na=? IR call visincr#VisBlockIncr(s:IR , <f-args>)
|
||||
com! -ra -complete=expression -na=? IIR call visincr#VisBlockIncr(s:IIR , <f-args>)
|
||||
com! -ra -complete=expression -na=? IPOW call visincr#VisBlockIncr(s:IPOW , <f-args>)
|
||||
com! -ra -complete=expression -na=? IIPOW call visincr#VisBlockIncr(s:IIPOW , <f-args>)
|
||||
|
||||
com! -ra -complete=expression -na=? RI call visincr#VisBlockIncr(s:RI , <f-args>)
|
||||
com! -ra -complete=expression -na=* RII call visincr#VisBlockIncr(s:RII , <f-args>)
|
||||
com! -ra -complete=expression -na=* RIMDY call visincr#VisBlockIncr(s:RIMDY , <f-args>)
|
||||
com! -ra -complete=expression -na=* RIYMD call visincr#VisBlockIncr(s:RIYMD , <f-args>)
|
||||
com! -ra -complete=expression -na=* RIDMY call visincr#VisBlockIncr(s:RIDMY , <f-args>)
|
||||
com! -ra -complete=expression -na=? RID call visincr#VisBlockIncr(s:RID , <f-args>)
|
||||
com! -ra -complete=expression -na=? RIM call visincr#VisBlockIncr(s:RIM , <f-args>)
|
||||
com! -ra -complete=expression -na=? RIPOW call visincr#VisBlockIncr(s:RIPOW , <f-args>)
|
||||
com! -ra -complete=expression -na=* RIIPOW call visincr#VisBlockIncr(s:RIIPOW , <f-args>)
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Restoration And Modelines: {{{1
|
||||
" vim: ts=4 fdm=marker
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
@ -1,7 +1,7 @@
|
||||
" Language : Netrw Remote-Directory Listing Syntax
|
||||
" Maintainer : Charles E. Campbell, Jr.
|
||||
" Last change: Aug 08, 2007
|
||||
" Version : 10
|
||||
" Last change: Feb 06, 2008
|
||||
" Version : 12
|
||||
" ---------------------------------------------------------------------
|
||||
|
||||
" Syntax Clearing: {{{1
|
||||
@ -13,23 +13,24 @@ endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Directory List Syntax Highlighting: {{{1
|
||||
syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt
|
||||
syn cluster NetrwGroup contains=netrwHide,netrwSortBy,netrwSortSeq,netrwQuickHelp,netrwVersion,netrwCopyTgt
|
||||
syn cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe
|
||||
|
||||
syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify
|
||||
syn match netrwDir "\.\{1,2}/" contains=netrwClassify
|
||||
syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify
|
||||
syn match netrwDir "^\S*/" contains=netrwClassify
|
||||
syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" contains=netrwDateSep skipwhite nextgroup=netrwTime
|
||||
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify
|
||||
syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,netrwTreeIgnore
|
||||
syn match netrwTreeIgnore contained "^\%(| \)*"
|
||||
syn match netrwSpecial "\%(\S\+ \)*\S\+[*|=]\ze\%(\s\{2,}\|$\)" contains=netrwClassify
|
||||
syn match netrwDir "\.\{1,2}/" contains=netrwClassify
|
||||
syn match netrwDir "\%(\S\+ \)*\S\+/" contains=netrwClassify
|
||||
syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" contains=netrwDateSep skipwhite nextgroup=netrwTime
|
||||
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify
|
||||
syn match netrwExe "\%(\S\+ \)*\S\+\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify
|
||||
syn match netrwTreeBar "^\%(| \)*" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
|
||||
syn match netrwTreeBarSpace " " contained
|
||||
|
||||
syn match netrwClassify "[*=|@/]\ze\%(\s\{2,}\|$\)" contained
|
||||
syn match netrwDateSep "/" contained
|
||||
syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep
|
||||
syn match netrwTime "\d\{1,2}:\d\{2}:\d\{2}" contained contains=netrwTimeSep
|
||||
syn match netrwTimeSep ":"
|
||||
|
||||
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
|
||||
syn match netrwComment '".*\%(\t\|$\)' contains=@NetrwGroup
|
||||
syn match netrwHide '^"\s*\(Hid\|Show\)ing:' skipwhite nextgroup=netrwHidePat
|
||||
syn match netrwSlash "/" contained
|
||||
syn match netrwHidePat "[^,]\+" contained skipwhite nextgroup=netrwHideSep
|
||||
@ -37,14 +38,31 @@ syn match netrwHideSep "," contained transparent skipwhite nextgroup=netrwH
|
||||
syn match netrwSortBy "Sorted by" contained transparent skipwhite nextgroup=netrwList
|
||||
syn match netrwSortSeq "Sort sequence:" contained transparent skipwhite nextgroup=netrwList
|
||||
syn match netrwCopyTgt "Copy/Move Tgt:" contained transparent skipwhite nextgroup=netrwList
|
||||
syn match netrwList ".*$" contained contains=netrwComma
|
||||
syn match netrwList ".*$" contained contains=netrwComma
|
||||
syn match netrwComma "," contained
|
||||
syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend contained
|
||||
syn region netrwQuickHelp matchgroup=Comment start="Quick Help:\s\+" end="$" contains=netrwHelpCmd keepend contained
|
||||
syn match netrwHelpCmd "\S\ze:" contained skipwhite nextgroup=netrwCmdSep
|
||||
syn match netrwCmdSep ":" contained nextgroup=netrwCmdNote
|
||||
syn match netrwCmdNote ".\{-}\ze " contained
|
||||
syn match netrwVersion "(netrw.*)" contained
|
||||
|
||||
" -----------------------------
|
||||
" Special filetype highlighting {{{1
|
||||
" -----------------------------
|
||||
if exists("g:netrw_special_syntax") && netrw_special_syntax
|
||||
syn match netrwBak "\(\S\+ \)*\S\+\.bak\>"
|
||||
syn match netrwCompress "\(\S\+ \)*\S\+\.\%(gz\|bz2\|Z\|zip\)\>"
|
||||
syn match netrwData "\(\S\+ \)*\S\+\.dat\>"
|
||||
syn match netrwHdr "\(\S\+ \)*\S\+\.h\>"
|
||||
syn match netrwLib "\(\S\+ \)*\S*\.\%(a\|so\|lib\|dll\)\>"
|
||||
syn match netrwMakeFile "\<[mM]akefile\>\|\(\S\+ \)*\S\+\.mak\>"
|
||||
syn match netrwObj "\(\S\+ \)*\S*\.\%(o\|obj\)\>"
|
||||
syn match netrwTags "\<tags\>"
|
||||
syn match netrwTags "\<\(ANmenu\|ANtags\)\>"
|
||||
syn match netrwTilde "\(\S\+ \)*\S\+\~\>"
|
||||
syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>"
|
||||
endif
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Highlighting Links: {{{1
|
||||
if !exists("did_drchip_netrwlist_syntax")
|
||||
@ -57,14 +75,26 @@ if !exists("did_drchip_netrwlist_syntax")
|
||||
hi link netrwHidePat Statement
|
||||
hi link netrwList Statement
|
||||
hi link netrwVersion Identifier
|
||||
hi link netrwSymLink Special
|
||||
hi link netrwSymLink Question
|
||||
hi link netrwExe PreProc
|
||||
hi link netrwDateSep Delimiter
|
||||
|
||||
hi link netrwTreeBar Special
|
||||
hi link netrwTimeSep netrwDateSep
|
||||
hi link netrwComma netrwComment
|
||||
hi link netrwHide netrwComment
|
||||
hi link netrwMarkFile Identifier
|
||||
|
||||
" special syntax highlighting (see :he g:netrw_special_syntax)
|
||||
hi link netrwBak NonText
|
||||
hi link netrwCompress Folded
|
||||
hi link netrwData DiffChange
|
||||
hi link netrwLib DiffChange
|
||||
hi link netrwMakefile DiffChange
|
||||
hi link netrwObj Folded
|
||||
hi link netrwTilde Folded
|
||||
hi link netrwTmp Folded
|
||||
hi link netrwTags Folded
|
||||
endif
|
||||
|
||||
" Current Syntax: {{{1
|
||||
|
Loading…
x
Reference in New Issue
Block a user