Auf Linux angepasst
git-svn-id: https://vimsuite.svn.sourceforge.net/svnroot/vimsuite/trunk@155 eb2d0018-73a3-4aeb-bfe9-1def61c9ec69
This commit is contained in:
parent
6673e71a02
commit
e84a79573b
File diff suppressed because it is too large
Load Diff
@ -1,41 +1,41 @@
|
|||||||
" AlignPlugin: tool to align multiple fields based on one or more separators
|
" AlignPlugin: tool to align multiple fields based on one or more separators
|
||||||
" Author: Charles E. Campbell, Jr.
|
" Author: Charles E. Campbell, Jr.
|
||||||
" Date: Nov 15, 2007
|
" Date: Nov 15, 2007
|
||||||
" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
|
" GetLatestVimScripts: 294 1 :AutoInstall: Align.vim
|
||||||
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
|
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
|
||||||
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
|
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell, Jr. {{{1
|
||||||
" Permission is hereby granted to use and distribute this code,
|
" Permission is hereby granted to use and distribute this code,
|
||||||
" with or without modifications, provided that this copyright
|
" with or without modifications, provided that this copyright
|
||||||
" notice is copied with it. Like anything else that's free,
|
" notice is copied with it. Like anything else that's free,
|
||||||
" Align.vim is provided *as is* and comes with no warranty
|
" Align.vim is provided *as is* and comes with no warranty
|
||||||
" of any kind, either expressed or implied. By using this
|
" of any kind, either expressed or implied. By using this
|
||||||
" plugin, you agree that in no event will the copyright
|
" plugin, you agree that in no event will the copyright
|
||||||
" holder be liable for any damages resulting from the use
|
" holder be liable for any damages resulting from the use
|
||||||
" of this software.
|
" of this software.
|
||||||
"
|
"
|
||||||
" Romans 1:16,17a : For I am not ashamed of the gospel of Christ, for it is {{{1
|
" 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,
|
" 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
|
" and also for the Greek. For in it is revealed God's righteousness from
|
||||||
" faith to faith.
|
" faith to faith.
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Load Once: {{{1
|
" Load Once: {{{1
|
||||||
if &cp || exists("g:loaded_alignPlugin")
|
if &cp || exists("g:loaded_alignPlugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_alignPlugin = 1
|
let g:loaded_alignPlugin = 1
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Public Interface: {{{1
|
" Public Interface: {{{1
|
||||||
com! -bang -range -nargs=* Align <line1>,<line2>call Align#Align(<bang>0,<q-args>)
|
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! -range -nargs=0 AlignReplaceQuotedSpaces <line1>,<line2>call Align#AlignReplaceQuotedSpaces()
|
||||||
com! -nargs=* AlignCtrl call Align#AlignCtrl(<q-args>)
|
com! -nargs=* AlignCtrl call Align#AlignCtrl(<q-args>)
|
||||||
com! -nargs=0 AlignPush call Align#AlignPush()
|
com! -nargs=0 AlignPush call Align#AlignPush()
|
||||||
com! -nargs=0 AlignPop call Align#AlignPop()
|
com! -nargs=0 AlignPop call Align#AlignPop()
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Restore: {{{1
|
" Restore: {{{1
|
||||||
let &cpo= s:keepcpo
|
let &cpo= s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
" vim: ts=4 fdm=marker
|
" vim: ts=4 fdm=marker
|
||||||
|
@ -1,482 +1,482 @@
|
|||||||
" cecutil.vim : save/restore window position
|
" cecutil.vim : save/restore window position
|
||||||
" save/restore mark position
|
" save/restore mark position
|
||||||
" save/restore selected user maps
|
" save/restore selected user maps
|
||||||
" Author: Charles E. Campbell, Jr.
|
" Author: Charles E. Campbell, Jr.
|
||||||
" Version: 17
|
" Version: 17
|
||||||
" Date: Sep 04, 2007
|
" Date: Sep 04, 2007
|
||||||
"
|
"
|
||||||
" Saving Restoring Destroying Marks: {{{1
|
" Saving Restoring Destroying Marks: {{{1
|
||||||
" call SaveMark(markname) let savemark= SaveMark(markname)
|
" call SaveMark(markname) let savemark= SaveMark(markname)
|
||||||
" call RestoreMark(markname) call RestoreMark(savemark)
|
" call RestoreMark(markname) call RestoreMark(savemark)
|
||||||
" call DestroyMark(markname)
|
" call DestroyMark(markname)
|
||||||
" commands: SM RM DM
|
" commands: SM RM DM
|
||||||
"
|
"
|
||||||
" Saving Restoring Destroying Window Position: {{{1
|
" Saving Restoring Destroying Window Position: {{{1
|
||||||
" call SaveWinPosn() let winposn= SaveWinPosn()
|
" call SaveWinPosn() let winposn= SaveWinPosn()
|
||||||
" call RestoreWinPosn() call RestoreWinPosn(winposn)
|
" call RestoreWinPosn() call RestoreWinPosn(winposn)
|
||||||
" \swp : save current window/buffer's position
|
" \swp : save current window/buffer's position
|
||||||
" \rwp : restore current window/buffer's previous position
|
" \rwp : restore current window/buffer's previous position
|
||||||
" commands: SWP RWP
|
" commands: SWP RWP
|
||||||
"
|
"
|
||||||
" Saving And Restoring User Maps: {{{1
|
" Saving And Restoring User Maps: {{{1
|
||||||
" call SaveUserMaps(mapmode,maplead,mapchx,suffix)
|
" call SaveUserMaps(mapmode,maplead,mapchx,suffix)
|
||||||
" call RestoreUserMaps(suffix)
|
" call RestoreUserMaps(suffix)
|
||||||
"
|
"
|
||||||
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
|
" GetLatestVimScripts: 1066 1 :AutoInstall: cecutil.vim
|
||||||
"
|
"
|
||||||
" You believe that God is one. You do well. The demons also {{{1
|
" 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
|
" believe, and shudder. But do you want to know, vain man, that
|
||||||
" faith apart from works is dead? (James 2:19,20 WEB)
|
" faith apart from works is dead? (James 2:19,20 WEB)
|
||||||
|
|
||||||
" Load Once: {{{1
|
" Load Once: {{{1
|
||||||
if &cp || exists("g:loaded_cecutil")
|
if &cp || exists("g:loaded_cecutil")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_cecutil = "v17"
|
let g:loaded_cecutil = "v17"
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
"DechoVarOn
|
"DechoVarOn
|
||||||
|
|
||||||
" -----------------------
|
" -----------------------
|
||||||
" Public Interface: {{{1
|
" Public Interface: {{{1
|
||||||
" -----------------------
|
" -----------------------
|
||||||
|
|
||||||
" Map Interface: {{{2
|
" Map Interface: {{{2
|
||||||
if !hasmapto('<Plug>SaveWinPosn')
|
if !hasmapto('<Plug>SaveWinPosn')
|
||||||
map <unique> <Leader>swp <Plug>SaveWinPosn
|
map <unique> <Leader>swp <Plug>SaveWinPosn
|
||||||
endif
|
endif
|
||||||
if !hasmapto('<Plug>RestoreWinPosn')
|
if !hasmapto('<Plug>RestoreWinPosn')
|
||||||
map <unique> <Leader>rwp <Plug>RestoreWinPosn
|
map <unique> <Leader>rwp <Plug>RestoreWinPosn
|
||||||
endif
|
endif
|
||||||
nmap <silent> <Plug>SaveWinPosn :call SaveWinPosn()<CR>
|
nmap <silent> <Plug>SaveWinPosn :call SaveWinPosn()<CR>
|
||||||
nmap <silent> <Plug>RestoreWinPosn :call RestoreWinPosn()<CR>
|
nmap <silent> <Plug>RestoreWinPosn :call RestoreWinPosn()<CR>
|
||||||
|
|
||||||
" Command Interface: {{{2
|
" Command Interface: {{{2
|
||||||
com! -bar -nargs=0 SWP call SaveWinPosn()
|
com! -bar -nargs=0 SWP call SaveWinPosn()
|
||||||
com! -bar -nargs=0 RWP call RestoreWinPosn()
|
com! -bar -nargs=0 RWP call RestoreWinPosn()
|
||||||
com! -bar -nargs=1 SM call SaveMark(<q-args>)
|
com! -bar -nargs=1 SM call SaveMark(<q-args>)
|
||||||
com! -bar -nargs=1 RM call RestoreMark(<q-args>)
|
com! -bar -nargs=1 RM call RestoreMark(<q-args>)
|
||||||
com! -bar -nargs=1 DM call DestroyMark(<q-args>)
|
com! -bar -nargs=1 DM call DestroyMark(<q-args>)
|
||||||
|
|
||||||
if v:version < 630
|
if v:version < 630
|
||||||
let s:modifier= "sil "
|
let s:modifier= "sil "
|
||||||
else
|
else
|
||||||
let s:modifier= "sil keepj "
|
let s:modifier= "sil keepj "
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" SaveWinPosn: {{{1
|
" SaveWinPosn: {{{1
|
||||||
" let winposn= SaveWinPosn() will save window position in winposn variable
|
" let winposn= SaveWinPosn() will save window position in winposn variable
|
||||||
" call SaveWinPosn() will save window position in b:cecutil_winposn{b:cecutil_iwinposn}
|
" 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)
|
" let winposn= SaveWinPosn(0) will *only* save window position in winposn variable (no stacking done)
|
||||||
fun! SaveWinPosn(...)
|
fun! SaveWinPosn(...)
|
||||||
" call Dfunc("SaveWinPosn() a:0=".a:0)
|
" call Dfunc("SaveWinPosn() a:0=".a:0)
|
||||||
if line(".") == 1 && getline(1) == ""
|
if line(".") == 1 && getline(1) == ""
|
||||||
" call Dfunc("SaveWinPosn : empty buffer")
|
" call Dfunc("SaveWinPosn : empty buffer")
|
||||||
return ""
|
return ""
|
||||||
endif
|
endif
|
||||||
let so_keep = &so
|
let so_keep = &so
|
||||||
let siso_keep = &siso
|
let siso_keep = &siso
|
||||||
let ss_keep = &ss
|
let ss_keep = &ss
|
||||||
set so=0 siso=0 ss=0
|
set so=0 siso=0 ss=0
|
||||||
|
|
||||||
let swline = line(".")
|
let swline = line(".")
|
||||||
let swcol = col(".")
|
let swcol = col(".")
|
||||||
let swwline = winline() - 1
|
let swwline = winline() - 1
|
||||||
let swwcol = virtcol(".") - wincol()
|
let swwcol = virtcol(".") - wincol()
|
||||||
let savedposn = "call GoWinbufnr(".winbufnr(0).")|silent ".swline
|
let savedposn = "call GoWinbufnr(".winbufnr(0).")|silent ".swline
|
||||||
let savedposn = savedposn."|".s:modifier."norm! 0z\<cr>"
|
let savedposn = savedposn."|".s:modifier."norm! 0z\<cr>"
|
||||||
if swwline > 0
|
if swwline > 0
|
||||||
let savedposn= savedposn.":".s:modifier."norm! ".swwline."\<c-y>\<cr>"
|
let savedposn= savedposn.":".s:modifier."norm! ".swwline."\<c-y>\<cr>"
|
||||||
endif
|
endif
|
||||||
if swwcol > 0
|
if swwcol > 0
|
||||||
let savedposn= savedposn.":".s:modifier."norm! 0".swwcol."zl\<cr>"
|
let savedposn= savedposn.":".s:modifier."norm! 0".swwcol."zl\<cr>"
|
||||||
endif
|
endif
|
||||||
let savedposn = savedposn.":".s:modifier."call cursor(".swline.",".swcol.")\<cr>"
|
let savedposn = savedposn.":".s:modifier."call cursor(".swline.",".swcol.")\<cr>"
|
||||||
|
|
||||||
" save window position in
|
" save window position in
|
||||||
" b:cecutil_winposn_{iwinposn} (stack)
|
" b:cecutil_winposn_{iwinposn} (stack)
|
||||||
" only when SaveWinPosn() is used
|
" only when SaveWinPosn() is used
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
if !exists("b:cecutil_iwinposn")
|
if !exists("b:cecutil_iwinposn")
|
||||||
let b:cecutil_iwinposn= 1
|
let b:cecutil_iwinposn= 1
|
||||||
else
|
else
|
||||||
let b:cecutil_iwinposn= b:cecutil_iwinposn + 1
|
let b:cecutil_iwinposn= b:cecutil_iwinposn + 1
|
||||||
endif
|
endif
|
||||||
" call Decho("saving posn to SWP stack")
|
" call Decho("saving posn to SWP stack")
|
||||||
let b:cecutil_winposn{b:cecutil_iwinposn}= savedposn
|
let b:cecutil_winposn{b:cecutil_iwinposn}= savedposn
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &so = so_keep
|
let &so = so_keep
|
||||||
let &siso = siso_keep
|
let &siso = siso_keep
|
||||||
let &ss = ss_keep
|
let &ss = ss_keep
|
||||||
|
|
||||||
" if exists("b:cecutil_iwinposn") " Decho
|
" if exists("b:cecutil_iwinposn") " Decho
|
||||||
" call Decho("b:cecutil_winpos{".b:cecutil_iwinposn."}[".b:cecutil_winposn{b:cecutil_iwinposn}."]")
|
" call Decho("b:cecutil_winpos{".b:cecutil_iwinposn."}[".b:cecutil_winposn{b:cecutil_iwinposn}."]")
|
||||||
" else " Decho
|
" else " Decho
|
||||||
" call Decho("b:cecutil_iwinposn doesn't exist")
|
" call Decho("b:cecutil_iwinposn doesn't exist")
|
||||||
" endif " Decho
|
" endif " Decho
|
||||||
" call Dret("SaveWinPosn [".savedposn."]")
|
" call Dret("SaveWinPosn [".savedposn."]")
|
||||||
return savedposn
|
return savedposn
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" RestoreWinPosn: {{{1
|
" RestoreWinPosn: {{{1
|
||||||
fun! RestoreWinPosn(...)
|
fun! RestoreWinPosn(...)
|
||||||
" call Dfunc("RestoreWinPosn() a:0=".a:0)
|
" call Dfunc("RestoreWinPosn() a:0=".a:0)
|
||||||
" call Decho("getline(1)<".getline(1).">")
|
" call Decho("getline(1)<".getline(1).">")
|
||||||
" call Decho("line(.)=".line("."))
|
" call Decho("line(.)=".line("."))
|
||||||
if line(".") == 1 && getline(1) == ""
|
if line(".") == 1 && getline(1) == ""
|
||||||
" call Dfunc("RestoreWinPosn : empty buffer")
|
" call Dfunc("RestoreWinPosn : empty buffer")
|
||||||
return ""
|
return ""
|
||||||
endif
|
endif
|
||||||
let so_keep = &so
|
let so_keep = &so
|
||||||
let siso_keep = &siso
|
let siso_keep = &siso
|
||||||
let ss_keep = &ss
|
let ss_keep = &ss
|
||||||
set so=0 siso=0 ss=0
|
set so=0 siso=0 ss=0
|
||||||
|
|
||||||
if a:0 == 0 || a:1 == ""
|
if a:0 == 0 || a:1 == ""
|
||||||
" use saved window position in b:cecutil_winposn{b:cecutil_iwinposn} if it exists
|
" 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}")
|
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}.">")
|
" call Decho("using stack b:cecutil_winposn{".b:cecutil_iwinposn."}<".b:cecutil_winposn{b:cecutil_iwinposn}.">")
|
||||||
try
|
try
|
||||||
exe "silent! ".b:cecutil_winposn{b:cecutil_iwinposn}
|
exe "silent! ".b:cecutil_winposn{b:cecutil_iwinposn}
|
||||||
catch /^Vim\%((\a\+)\)\=:E749/
|
catch /^Vim\%((\a\+)\)\=:E749/
|
||||||
" ignore empty buffer error messages
|
" ignore empty buffer error messages
|
||||||
endtry
|
endtry
|
||||||
" normally drop top-of-stack by one
|
" normally drop top-of-stack by one
|
||||||
" but while new top-of-stack doesn't exist
|
" but while new top-of-stack doesn't exist
|
||||||
" drop top-of-stack index by one again
|
" drop top-of-stack index by one again
|
||||||
if b:cecutil_iwinposn >= 1
|
if b:cecutil_iwinposn >= 1
|
||||||
unlet b:cecutil_winposn{b:cecutil_iwinposn}
|
unlet b:cecutil_winposn{b:cecutil_iwinposn}
|
||||||
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
|
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
|
||||||
while b:cecutil_iwinposn >= 1 && !exists("b:cecutil_winposn{b:cecutil_iwinposn}")
|
while b:cecutil_iwinposn >= 1 && !exists("b:cecutil_winposn{b:cecutil_iwinposn}")
|
||||||
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
|
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1
|
||||||
endwhile
|
endwhile
|
||||||
if b:cecutil_iwinposn < 1
|
if b:cecutil_iwinposn < 1
|
||||||
unlet b:cecutil_iwinposn
|
unlet b:cecutil_iwinposn
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echomsg "***warning*** need to SaveWinPosn first!"
|
echomsg "***warning*** need to SaveWinPosn first!"
|
||||||
echohl None
|
echohl None
|
||||||
endif
|
endif
|
||||||
|
|
||||||
else " handle input argument
|
else " handle input argument
|
||||||
" call Decho("using input a:1<".a:1.">")
|
" call Decho("using input a:1<".a:1.">")
|
||||||
" use window position passed to this function
|
" use window position passed to this function
|
||||||
exe "silent ".a:1
|
exe "silent ".a:1
|
||||||
" remove a:1 pattern from b:cecutil_winposn{b:cecutil_iwinposn} stack
|
" remove a:1 pattern from b:cecutil_winposn{b:cecutil_iwinposn} stack
|
||||||
if exists("b:cecutil_iwinposn")
|
if exists("b:cecutil_iwinposn")
|
||||||
let jwinposn= b:cecutil_iwinposn
|
let jwinposn= b:cecutil_iwinposn
|
||||||
while jwinposn >= 1 " search for a:1 in iwinposn..1
|
while jwinposn >= 1 " search for a:1 in iwinposn..1
|
||||||
if exists("b:cecutil_winposn{jwinposn}") " if it exists
|
if exists("b:cecutil_winposn{jwinposn}") " if it exists
|
||||||
if a:1 == b:cecutil_winposn{jwinposn} " and the pattern matches
|
if a:1 == b:cecutil_winposn{jwinposn} " and the pattern matches
|
||||||
unlet b:cecutil_winposn{jwinposn} " unlet it
|
unlet b:cecutil_winposn{jwinposn} " unlet it
|
||||||
if jwinposn == b:cecutil_iwinposn " if at top-of-stack
|
if jwinposn == b:cecutil_iwinposn " if at top-of-stack
|
||||||
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1 " drop stacktop by one
|
let b:cecutil_iwinposn= b:cecutil_iwinposn - 1 " drop stacktop by one
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
let jwinposn= jwinposn - 1
|
let jwinposn= jwinposn - 1
|
||||||
endwhile
|
endwhile
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" seems to be something odd: vertical motions after RWP
|
" seems to be something odd: vertical motions after RWP
|
||||||
" cause jump to first column. Following fixes that
|
" cause jump to first column. Following fixes that
|
||||||
if wincol() > 1
|
if wincol() > 1
|
||||||
silent norm! hl
|
silent norm! hl
|
||||||
elseif virtcol(".") < virtcol("$")
|
elseif virtcol(".") < virtcol("$")
|
||||||
silent norm! lh
|
silent norm! lh
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &so = so_keep
|
let &so = so_keep
|
||||||
let &siso = siso_keep
|
let &siso = siso_keep
|
||||||
let &ss = ss_keep
|
let &ss = ss_keep
|
||||||
|
|
||||||
" call Dret("RestoreWinPosn")
|
" call Dret("RestoreWinPosn")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" GoWinbufnr: go to window holding given buffer (by number) {{{1
|
" GoWinbufnr: go to window holding given buffer (by number) {{{1
|
||||||
" Prefers current window; if its buffer number doesn't match,
|
" Prefers current window; if its buffer number doesn't match,
|
||||||
" then will try from topleft to bottom right
|
" then will try from topleft to bottom right
|
||||||
fun! GoWinbufnr(bufnum)
|
fun! GoWinbufnr(bufnum)
|
||||||
" call Dfunc("GoWinbufnr(".a:bufnum.")")
|
" call Dfunc("GoWinbufnr(".a:bufnum.")")
|
||||||
if winbufnr(0) == a:bufnum
|
if winbufnr(0) == a:bufnum
|
||||||
" call Dret("GoWinbufnr : winbufnr(0)==a:bufnum")
|
" call Dret("GoWinbufnr : winbufnr(0)==a:bufnum")
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
winc t
|
winc t
|
||||||
let first=1
|
let first=1
|
||||||
while winbufnr(0) != a:bufnum && (first || winnr() != 1)
|
while winbufnr(0) != a:bufnum && (first || winnr() != 1)
|
||||||
winc w
|
winc w
|
||||||
let first= 0
|
let first= 0
|
||||||
endwhile
|
endwhile
|
||||||
" call Dret("GoWinbufnr")
|
" call Dret("GoWinbufnr")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" SaveMark: sets up a string saving a mark position. {{{1
|
" SaveMark: sets up a string saving a mark position. {{{1
|
||||||
" For example, SaveMark("a")
|
" For example, SaveMark("a")
|
||||||
" Also sets up a global variable, g:savemark_{markname}
|
" Also sets up a global variable, g:savemark_{markname}
|
||||||
fun! SaveMark(markname)
|
fun! SaveMark(markname)
|
||||||
" call Dfunc("SaveMark(markname<".a:markname.">)")
|
" call Dfunc("SaveMark(markname<".a:markname.">)")
|
||||||
let markname= a:markname
|
let markname= a:markname
|
||||||
if strpart(markname,0,1) !~ '\a'
|
if strpart(markname,0,1) !~ '\a'
|
||||||
let markname= strpart(markname,1,1)
|
let markname= strpart(markname,1,1)
|
||||||
endif
|
endif
|
||||||
" call Decho("markname=".markname)
|
" call Decho("markname=".markname)
|
||||||
|
|
||||||
let lzkeep = &lz
|
let lzkeep = &lz
|
||||||
set lz
|
set lz
|
||||||
|
|
||||||
if 1 <= line("'".markname) && line("'".markname) <= line("$")
|
if 1 <= line("'".markname) && line("'".markname) <= line("$")
|
||||||
let winposn = SaveWinPosn(0)
|
let winposn = SaveWinPosn(0)
|
||||||
exe s:modifier."norm! `".markname
|
exe s:modifier."norm! `".markname
|
||||||
let savemark = SaveWinPosn(0)
|
let savemark = SaveWinPosn(0)
|
||||||
let g:savemark_{markname} = savemark
|
let g:savemark_{markname} = savemark
|
||||||
let savemark = markname.savemark
|
let savemark = markname.savemark
|
||||||
call RestoreWinPosn(winposn)
|
call RestoreWinPosn(winposn)
|
||||||
else
|
else
|
||||||
let g:savemark_{markname} = ""
|
let g:savemark_{markname} = ""
|
||||||
let savemark = ""
|
let savemark = ""
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let &lz= lzkeep
|
let &lz= lzkeep
|
||||||
|
|
||||||
" call Dret("SaveMark : savemark<".savemark.">")
|
" call Dret("SaveMark : savemark<".savemark.">")
|
||||||
return savemark
|
return savemark
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" RestoreMark: {{{1
|
" RestoreMark: {{{1
|
||||||
" call RestoreMark("a") -or- call RestoreMark(savemark)
|
" call RestoreMark("a") -or- call RestoreMark(savemark)
|
||||||
fun! RestoreMark(markname)
|
fun! RestoreMark(markname)
|
||||||
" call Dfunc("RestoreMark(markname<".a:markname.">)")
|
" call Dfunc("RestoreMark(markname<".a:markname.">)")
|
||||||
|
|
||||||
if strlen(a:markname) <= 0
|
if strlen(a:markname) <= 0
|
||||||
" call Dret("RestoreMark : no such mark")
|
" call Dret("RestoreMark : no such mark")
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let markname= strpart(a:markname,0,1)
|
let markname= strpart(a:markname,0,1)
|
||||||
if markname !~ '\a'
|
if markname !~ '\a'
|
||||||
" handles 'a -> a styles
|
" handles 'a -> a styles
|
||||||
let markname= strpart(a:markname,1,1)
|
let markname= strpart(a:markname,1,1)
|
||||||
endif
|
endif
|
||||||
" call Decho("markname=".markname." strlen(a:markname)=".strlen(a:markname))
|
" call Decho("markname=".markname." strlen(a:markname)=".strlen(a:markname))
|
||||||
|
|
||||||
let lzkeep = &lz
|
let lzkeep = &lz
|
||||||
set lz
|
set lz
|
||||||
let winposn = SaveWinPosn(0)
|
let winposn = SaveWinPosn(0)
|
||||||
|
|
||||||
if strlen(a:markname) <= 2
|
if strlen(a:markname) <= 2
|
||||||
if exists("g:savemark_{markname}") && strlen(g:savemark_{markname}) != 0
|
if exists("g:savemark_{markname}") && strlen(g:savemark_{markname}) != 0
|
||||||
" use global variable g:savemark_{markname}
|
" use global variable g:savemark_{markname}
|
||||||
" call Decho("use savemark list")
|
" call Decho("use savemark list")
|
||||||
call RestoreWinPosn(g:savemark_{markname})
|
call RestoreWinPosn(g:savemark_{markname})
|
||||||
exe "norm! m".markname
|
exe "norm! m".markname
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
" markname is a savemark command (string)
|
" markname is a savemark command (string)
|
||||||
" call Decho("use savemark command")
|
" call Decho("use savemark command")
|
||||||
let markcmd= strpart(a:markname,1)
|
let markcmd= strpart(a:markname,1)
|
||||||
call RestoreWinPosn(markcmd)
|
call RestoreWinPosn(markcmd)
|
||||||
exe "norm! m".markname
|
exe "norm! m".markname
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call RestoreWinPosn(winposn)
|
call RestoreWinPosn(winposn)
|
||||||
let &lz = lzkeep
|
let &lz = lzkeep
|
||||||
|
|
||||||
" call Dret("RestoreMark")
|
" call Dret("RestoreMark")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" DestroyMark: {{{1
|
" DestroyMark: {{{1
|
||||||
" call DestroyMark("a") -- destroys mark
|
" call DestroyMark("a") -- destroys mark
|
||||||
fun! DestroyMark(markname)
|
fun! DestroyMark(markname)
|
||||||
" call Dfunc("DestroyMark(markname<".a:markname.">)")
|
" call Dfunc("DestroyMark(markname<".a:markname.">)")
|
||||||
|
|
||||||
" save options and set to standard values
|
" save options and set to standard values
|
||||||
let reportkeep= &report
|
let reportkeep= &report
|
||||||
let lzkeep = &lz
|
let lzkeep = &lz
|
||||||
set lz report=10000
|
set lz report=10000
|
||||||
|
|
||||||
let markname= strpart(a:markname,0,1)
|
let markname= strpart(a:markname,0,1)
|
||||||
if markname !~ '\a'
|
if markname !~ '\a'
|
||||||
" handles 'a -> a styles
|
" handles 'a -> a styles
|
||||||
let markname= strpart(a:markname,1,1)
|
let markname= strpart(a:markname,1,1)
|
||||||
endif
|
endif
|
||||||
" call Decho("markname=".markname)
|
" call Decho("markname=".markname)
|
||||||
|
|
||||||
let curmod = &mod
|
let curmod = &mod
|
||||||
let winposn = SaveWinPosn(0)
|
let winposn = SaveWinPosn(0)
|
||||||
1
|
1
|
||||||
let lineone = getline(".")
|
let lineone = getline(".")
|
||||||
exe "k".markname
|
exe "k".markname
|
||||||
d
|
d
|
||||||
put! =lineone
|
put! =lineone
|
||||||
let &mod = curmod
|
let &mod = curmod
|
||||||
call RestoreWinPosn(winposn)
|
call RestoreWinPosn(winposn)
|
||||||
|
|
||||||
" restore options to user settings
|
" restore options to user settings
|
||||||
let &report = reportkeep
|
let &report = reportkeep
|
||||||
let &lz = lzkeep
|
let &lz = lzkeep
|
||||||
|
|
||||||
" call Dret("DestroyMark")
|
" call Dret("DestroyMark")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" QArgSplitter: to avoid \ processing by <f-args>, <q-args> is needed. {{{1
|
" 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
|
" 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.
|
" with splits at all whitespace (only!), plus a leading length-of-list.
|
||||||
" The resulting list: qarglist[0] corresponds to a:0
|
" The resulting list: qarglist[0] corresponds to a:0
|
||||||
" qarglist[i] corresponds to a:{i}
|
" qarglist[i] corresponds to a:{i}
|
||||||
fun! QArgSplitter(qarg)
|
fun! QArgSplitter(qarg)
|
||||||
" call Dfunc("QArgSplitter(qarg<".a:qarg.">)")
|
" call Dfunc("QArgSplitter(qarg<".a:qarg.">)")
|
||||||
let qarglist = split(a:qarg)
|
let qarglist = split(a:qarg)
|
||||||
let qarglistlen = len(qarglist)
|
let qarglistlen = len(qarglist)
|
||||||
let qarglist = insert(qarglist,qarglistlen)
|
let qarglist = insert(qarglist,qarglistlen)
|
||||||
" call Dret("QArgSplitter ".string(qarglist))
|
" call Dret("QArgSplitter ".string(qarglist))
|
||||||
return qarglist
|
return qarglist
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" ListWinPosn:
|
" ListWinPosn:
|
||||||
"fun! ListWinPosn() " Decho
|
"fun! ListWinPosn() " Decho
|
||||||
" if !exists("b:cecutil_iwinposn") || b:cecutil_iwinposn == 0 " Decho
|
" if !exists("b:cecutil_iwinposn") || b:cecutil_iwinposn == 0 " Decho
|
||||||
" call Decho("nothing on SWP stack") " Decho
|
" call Decho("nothing on SWP stack") " Decho
|
||||||
" else " Decho
|
" else " Decho
|
||||||
" let jwinposn= b:cecutil_iwinposn " Decho
|
" let jwinposn= b:cecutil_iwinposn " Decho
|
||||||
" while jwinposn >= 1 " Decho
|
" while jwinposn >= 1 " Decho
|
||||||
" if exists("b:cecutil_winposn{jwinposn}") " Decho
|
" if exists("b:cecutil_winposn{jwinposn}") " Decho
|
||||||
" call Decho("winposn{".jwinposn."}<".b:cecutil_winposn{jwinposn}.">") " Decho
|
" call Decho("winposn{".jwinposn."}<".b:cecutil_winposn{jwinposn}.">") " Decho
|
||||||
" else " Decho
|
" else " Decho
|
||||||
" call Decho("winposn{".jwinposn."} -- doesn't exist") " Decho
|
" call Decho("winposn{".jwinposn."} -- doesn't exist") " Decho
|
||||||
" endif " Decho
|
" endif " Decho
|
||||||
" let jwinposn= jwinposn - 1 " Decho
|
" let jwinposn= jwinposn - 1 " Decho
|
||||||
" endwhile " Decho
|
" endwhile " Decho
|
||||||
" endif " Decho
|
" endif " Decho
|
||||||
"endfun " Decho
|
"endfun " Decho
|
||||||
"com! -nargs=0 LWP call ListWinPosn() " Decho
|
"com! -nargs=0 LWP call ListWinPosn() " Decho
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" SaveUserMaps: this function sets up a script-variable (s:restoremap) {{{1
|
" SaveUserMaps: this function sets up a script-variable (s:restoremap) {{{1
|
||||||
" which can be used to restore user maps later with
|
" which can be used to restore user maps later with
|
||||||
" call RestoreUserMaps()
|
" call RestoreUserMaps()
|
||||||
"
|
"
|
||||||
" mapmode - see :help maparg for its list
|
" mapmode - see :help maparg for its list
|
||||||
" ex. "n" = Normal
|
" ex. "n" = Normal
|
||||||
" If the first letter is u, then unmapping will be done
|
" If the first letter is u, then unmapping will be done
|
||||||
" ex. "un" = Normal + unmapping
|
" ex. "un" = Normal + unmapping
|
||||||
" maplead - see mapchx
|
" maplead - see mapchx
|
||||||
" mapchx - "<something>" handled as a single map item.
|
" mapchx - "<something>" handled as a single map item.
|
||||||
" ex. "<left>"
|
" ex. "<left>"
|
||||||
" - "string" a string of single letters which are actually
|
" - "string" a string of single letters which are actually
|
||||||
" multiple two-letter maps (using the maplead:
|
" multiple two-letter maps (using the maplead:
|
||||||
" maplead . each_character_in_string)
|
" maplead . each_character_in_string)
|
||||||
" ex. maplead="\" and mapchx="abc" saves user mappings for
|
" ex. maplead="\" and mapchx="abc" saves user mappings for
|
||||||
" \a, \b, and \c
|
" \a, \b, and \c
|
||||||
" Of course, if maplead is "", then for mapchx="abc",
|
" Of course, if maplead is "", then for mapchx="abc",
|
||||||
" mappings for a, b, and c are saved.
|
" mappings for a, b, and c are saved.
|
||||||
" - :something handled as a single map item, w/o the ":"
|
" - :something handled as a single map item, w/o the ":"
|
||||||
" ex. mapchx= ":abc" will save a mapping for "abc"
|
" ex. mapchx= ":abc" will save a mapping for "abc"
|
||||||
" suffix - a string unique to your plugin
|
" suffix - a string unique to your plugin
|
||||||
" ex. suffix= "DrawIt"
|
" ex. suffix= "DrawIt"
|
||||||
fun! SaveUserMaps(mapmode,maplead,mapchx,suffix)
|
fun! SaveUserMaps(mapmode,maplead,mapchx,suffix)
|
||||||
" call Dfunc("SaveUserMaps(mapmode<".a:mapmode."> maplead<".a:maplead."> mapchx<".a:mapchx."> suffix<".a:suffix.">)")
|
" call Dfunc("SaveUserMaps(mapmode<".a:mapmode."> maplead<".a:maplead."> mapchx<".a:mapchx."> suffix<".a:suffix.">)")
|
||||||
|
|
||||||
if !exists("s:restoremap_{a:suffix}")
|
if !exists("s:restoremap_{a:suffix}")
|
||||||
" initialize restoremap_suffix to null string
|
" initialize restoremap_suffix to null string
|
||||||
let s:restoremap_{a:suffix}= ""
|
let s:restoremap_{a:suffix}= ""
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" set up dounmap: if 1, then save and unmap (a:mapmode leads with a "u")
|
" set up dounmap: if 1, then save and unmap (a:mapmode leads with a "u")
|
||||||
" if 0, save only
|
" if 0, save only
|
||||||
if a:mapmode =~ '^u'
|
if a:mapmode =~ '^u'
|
||||||
let dounmap= 1
|
let dounmap= 1
|
||||||
let mapmode= strpart(a:mapmode,1)
|
let mapmode= strpart(a:mapmode,1)
|
||||||
else
|
else
|
||||||
let dounmap= 0
|
let dounmap= 0
|
||||||
let mapmode= a:mapmode
|
let mapmode= a:mapmode
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" save single map :...something...
|
" save single map :...something...
|
||||||
if strpart(a:mapchx,0,1) == ':'
|
if strpart(a:mapchx,0,1) == ':'
|
||||||
let amap= strpart(a:mapchx,1)
|
let amap= strpart(a:mapchx,1)
|
||||||
if amap == "|" || amap == "\<c-v>"
|
if amap == "|" || amap == "\<c-v>"
|
||||||
let amap= "\<c-v>".amap
|
let amap= "\<c-v>".amap
|
||||||
endif
|
endif
|
||||||
let amap = a:maplead.amap
|
let amap = a:maplead.amap
|
||||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:silent! ".mapmode."unmap ".amap
|
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:silent! ".mapmode."unmap ".amap
|
||||||
if maparg(amap,mapmode) != ""
|
if maparg(amap,mapmode) != ""
|
||||||
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
|
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
|
||||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:".mapmode."map ".amap." ".maprhs
|
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|:".mapmode."map ".amap." ".maprhs
|
||||||
endif
|
endif
|
||||||
if dounmap
|
if dounmap
|
||||||
exe "silent! ".mapmode."unmap ".amap
|
exe "silent! ".mapmode."unmap ".amap
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" save single map <something>
|
" save single map <something>
|
||||||
elseif strpart(a:mapchx,0,1) == '<'
|
elseif strpart(a:mapchx,0,1) == '<'
|
||||||
let amap = a:mapchx
|
let amap = a:mapchx
|
||||||
if amap == "|" || amap == "\<c-v>"
|
if amap == "|" || amap == "\<c-v>"
|
||||||
let amap= "\<c-v>".amap
|
let amap= "\<c-v>".amap
|
||||||
endif
|
endif
|
||||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".amap
|
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".amap
|
||||||
if maparg(a:mapchx,mapmode) != ""
|
if maparg(a:mapchx,mapmode) != ""
|
||||||
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
|
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
|
||||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".maprhs
|
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".maprhs
|
||||||
endif
|
endif
|
||||||
if dounmap
|
if dounmap
|
||||||
exe "silent! ".mapmode."unmap ".amap
|
exe "silent! ".mapmode."unmap ".amap
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" save multiple maps
|
" save multiple maps
|
||||||
else
|
else
|
||||||
let i= 1
|
let i= 1
|
||||||
while i <= strlen(a:mapchx)
|
while i <= strlen(a:mapchx)
|
||||||
let amap= a:maplead.strpart(a:mapchx,i-1,1)
|
let amap= a:maplead.strpart(a:mapchx,i-1,1)
|
||||||
if amap == "|" || amap == "\<c-v>"
|
if amap == "|" || amap == "\<c-v>"
|
||||||
let amap= "\<c-v>".amap
|
let amap= "\<c-v>".amap
|
||||||
endif
|
endif
|
||||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".amap
|
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|silent! ".mapmode."unmap ".amap
|
||||||
if maparg(amap,mapmode) != ""
|
if maparg(amap,mapmode) != ""
|
||||||
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
|
let maprhs = substitute(maparg(amap,mapmode),'|','<bar>','ge')
|
||||||
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".maprhs
|
let s:restoremap_{a:suffix} = s:restoremap_{a:suffix}."|".mapmode."map ".amap." ".maprhs
|
||||||
endif
|
endif
|
||||||
if dounmap
|
if dounmap
|
||||||
exe "silent! ".mapmode."unmap ".amap
|
exe "silent! ".mapmode."unmap ".amap
|
||||||
endif
|
endif
|
||||||
let i= i + 1
|
let i= i + 1
|
||||||
endwhile
|
endwhile
|
||||||
endif
|
endif
|
||||||
" call Dret("SaveUserMaps : restoremap_".a:suffix.": ".s:restoremap_{a:suffix})
|
" call Dret("SaveUserMaps : restoremap_".a:suffix.": ".s:restoremap_{a:suffix})
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" RestoreUserMaps: {{{1
|
" RestoreUserMaps: {{{1
|
||||||
" Used to restore user maps saved by SaveUserMaps()
|
" Used to restore user maps saved by SaveUserMaps()
|
||||||
fun! RestoreUserMaps(suffix)
|
fun! RestoreUserMaps(suffix)
|
||||||
" call Dfunc("RestoreUserMaps(suffix<".a:suffix.">)")
|
" call Dfunc("RestoreUserMaps(suffix<".a:suffix.">)")
|
||||||
if exists("s:restoremap_{a:suffix}")
|
if exists("s:restoremap_{a:suffix}")
|
||||||
let s:restoremap_{a:suffix}= substitute(s:restoremap_{a:suffix},'|\s*$','','e')
|
let s:restoremap_{a:suffix}= substitute(s:restoremap_{a:suffix},'|\s*$','','e')
|
||||||
if s:restoremap_{a:suffix} != ""
|
if s:restoremap_{a:suffix} != ""
|
||||||
" call Decho("exe ".s:restoremap_{a:suffix})
|
" call Decho("exe ".s:restoremap_{a:suffix})
|
||||||
exe "silent! ".s:restoremap_{a:suffix}
|
exe "silent! ".s:restoremap_{a:suffix}
|
||||||
endif
|
endif
|
||||||
unlet s:restoremap_{a:suffix}
|
unlet s:restoremap_{a:suffix}
|
||||||
endif
|
endif
|
||||||
" call Dret("RestoreUserMaps")
|
" call Dret("RestoreUserMaps")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Restore: {{{1
|
" Restore: {{{1
|
||||||
let &cpo= s:keepcpo
|
let &cpo= s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Modelines: {{{1
|
" Modelines: {{{1
|
||||||
" vim: ts=4 fdm=marker
|
" vim: ts=4 fdm=marker
|
||||||
|
@ -1,38 +1,38 @@
|
|||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" getscriptPlugin.vim
|
" getscriptPlugin.vim
|
||||||
" Author: Charles E. Campbell, Jr.
|
" Author: Charles E. Campbell, Jr.
|
||||||
" Date: Jan 07, 2008
|
" Date: Jan 07, 2008
|
||||||
" Installing: :help glvs-install
|
" Installing: :help glvs-install
|
||||||
" Usage: :help glvs
|
" Usage: :help glvs
|
||||||
"
|
"
|
||||||
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
|
" GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim
|
||||||
"
|
"
|
||||||
" (Rom 15:11 WEB) Again, "Praise the Lord, all you Gentiles! Let
|
" (Rom 15:11 WEB) Again, "Praise the Lord, all you Gentiles! Let
|
||||||
" all the peoples praise Him."
|
" all the peoples praise Him."
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Initialization: {{{1
|
" Initialization: {{{1
|
||||||
" if you're sourcing this file, surely you can't be
|
" if you're sourcing this file, surely you can't be
|
||||||
" expecting vim to be in its vi-compatible mode
|
" expecting vim to be in its vi-compatible mode
|
||||||
if &cp || exists("g:loaded_getscriptPlugin")
|
if &cp || exists("g:loaded_getscriptPlugin")
|
||||||
if &verbose
|
if &verbose
|
||||||
echo "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
|
echo "GetLatestVimScripts is not vi-compatible; not loaded (you need to set nocp)"
|
||||||
endif
|
endif
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_getscriptPlugin = "v29"
|
let g:loaded_getscriptPlugin = "v29"
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Public Interface: {{{1
|
" Public Interface: {{{1
|
||||||
com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
|
com! -nargs=0 GetLatestVimScripts call getscript#GetLatestVimScripts()
|
||||||
com! -nargs=0 GetScripts call getscript#GetLatestVimScripts()
|
com! -nargs=0 GetScripts call getscript#GetLatestVimScripts()
|
||||||
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
|
silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts()
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Restore Options: {{{1
|
" Restore Options: {{{1
|
||||||
let &cpo= s:keepcpo
|
let &cpo= s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" vim: ts=8 sts=2 fdm=marker nowrap
|
" vim: ts=8 sts=2 fdm=marker nowrap
|
||||||
|
@ -1,180 +1,180 @@
|
|||||||
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
|
" netrwPlugin.vim: Handles file transfer and remote directory listing across a network
|
||||||
" PLUGIN SECTION
|
" PLUGIN SECTION
|
||||||
" Date: Aug 09, 2007
|
" Date: Aug 09, 2007
|
||||||
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
" Maintainer: Charles E Campbell, Jr <NdrOchip@ScampbellPfamily.AbizM-NOSPAM>
|
||||||
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
" GetLatestVimScripts: 1075 1 :AutoInstall: netrw.vim
|
||||||
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
||||||
" Permission is hereby granted to use and distribute this code,
|
" Permission is hereby granted to use and distribute this code,
|
||||||
" with or without modifications, provided that this copyright
|
" with or without modifications, provided that this copyright
|
||||||
" notice is copied with it. Like anything else that's free,
|
" notice is copied with it. Like anything else that's free,
|
||||||
" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided
|
" netrw.vim, netrwPlugin.vim, and netrwSettings.vim are provided
|
||||||
" *as is* and comes with no warranty of any kind, either
|
" *as is* and comes with no warranty of any kind, either
|
||||||
" expressed or implied. By using this plugin, you agree that
|
" expressed or implied. By using this plugin, you agree that
|
||||||
" in no event will the copyright holder be liable for any damages
|
" in no event will the copyright holder be liable for any damages
|
||||||
" resulting from the use of this software.
|
" resulting from the use of this software.
|
||||||
"
|
"
|
||||||
" But be doers of the Word, and not only hearers, deluding your own selves {{{1
|
" But be doers of the Word, and not only hearers, deluding your own selves {{{1
|
||||||
" (James 1:22 RSV)
|
" (James 1:22 RSV)
|
||||||
" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
" =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Load Once: {{{1
|
" Load Once: {{{1
|
||||||
if &cp || exists("g:loaded_netrwPlugin")
|
if &cp || exists("g:loaded_netrwPlugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_netrwPlugin = "v123"
|
let g:loaded_netrwPlugin = "v123"
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
if v:version < 700
|
if v:version < 700
|
||||||
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 for this version of netrw" | echohl None
|
echohl WarningMsg | echo "***netrw*** you need vim version 7.0 for this version of netrw" | echohl None
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let s:keepcpo= &cpo
|
let s:keepcpo= &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Public Interface: {{{1
|
" Public Interface: {{{1
|
||||||
|
|
||||||
" Local Browsing: {{{2
|
" Local Browsing: {{{2
|
||||||
augroup FileExplorer
|
augroup FileExplorer
|
||||||
au!
|
au!
|
||||||
au BufEnter * silent! call s:LocalBrowse(expand("<amatch>"))
|
au BufEnter * silent! call s:LocalBrowse(expand("<amatch>"))
|
||||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||||
au BufEnter .* silent! call s:LocalBrowse(expand("<amatch>"))
|
au BufEnter .* silent! call s:LocalBrowse(expand("<amatch>"))
|
||||||
endif
|
endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Network Browsing Reading Writing: {{{2
|
" Network Browsing Reading Writing: {{{2
|
||||||
augroup Network
|
augroup Network
|
||||||
au!
|
au!
|
||||||
if has("win32") || has("win95") || has("win64") || has("win16")
|
if has("win32") || has("win95") || has("win64") || has("win16")
|
||||||
au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "bwipe ".expand("<amatch>")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
|
au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "bwipe ".expand("<amatch>")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
|
||||||
else
|
else
|
||||||
au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "bwipe ".expand("<amatch>")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
|
au BufReadCmd file://* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://\(.*\)','\1',"")|exe "bwipe ".expand("<amatch>")|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
|
||||||
au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',"")|exe "bwipe ".substitute(expand("<amatch>"),'file://\(\k\+@\)\=','','')|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
|
au BufReadCmd file://localhost/* exe "silent doau BufReadPre ".netrw#RFC2396(expand("<amatch>"))|exe 'e '.substitute(netrw#RFC2396(expand("<amatch>")),'file://localhost/\(.*\)','\1',"")|exe "bwipe ".substitute(expand("<amatch>"),'file://\(\k\+@\)\=','','')|exe "silent doau BufReadPost ".netrw#RFC2396(expand("<amatch>"))
|
||||||
endif
|
endif
|
||||||
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe '2Nread "'.expand("<amatch>").'"'|exe "silent doau BufReadPost ".expand("<amatch>")
|
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau BufReadPre ".expand("<amatch>")|exe '2Nread "'.expand("<amatch>").'"'|exe "silent doau BufReadPost ".expand("<amatch>")
|
||||||
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau FileReadPre ".expand("<amatch>")|exe 'Nread "' .expand("<amatch>").'"'|exe "silent doau FileReadPost ".expand("<amatch>")
|
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe "silent doau FileReadPre ".expand("<amatch>")|exe 'Nread "' .expand("<amatch>").'"'|exe "silent doau FileReadPost ".expand("<amatch>")
|
||||||
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<amatch>")|exe 'Nwrite "' .expand("<amatch>").'"'|exe "silent doau BufWritePost ".expand("<amatch>")
|
au BufWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau BufWritePre ".expand("<amatch>")|exe 'Nwrite "' .expand("<amatch>").'"'|exe "silent doau BufWritePost ".expand("<amatch>")
|
||||||
au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau FileWritePre ".expand("<amatch>")|exe "'[,']".'Nwrite "' .expand("<amatch>").'"'|exe "silent doau FileWritePost ".expand("<amatch>")
|
au FileWriteCmd ftp://*,rcp://*,scp://*,dav://*,rsync://*,sftp://* exe "silent doau FileWritePre ".expand("<amatch>")|exe "'[,']".'Nwrite "' .expand("<amatch>").'"'|exe "silent doau FileWritePost ".expand("<amatch>")
|
||||||
try
|
try
|
||||||
au SourceCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe 'Nsource "'.expand("<amatch>").'"'
|
au SourceCmd ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe 'Nsource "'.expand("<amatch>").'"'
|
||||||
catch /^Vim\%((\a\+)\)\=:E216/
|
catch /^Vim\%((\a\+)\)\=:E216/
|
||||||
au SourcePre ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe 'Nsource "'.expand("<amatch>").'"'
|
au SourcePre ftp://*,rcp://*,scp://*,http://*,dav://*,rsync://*,sftp://* exe 'Nsource "'.expand("<amatch>").'"'
|
||||||
endtry
|
endtry
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Commands: :Nread, :Nwrite, :NetUserPass {{{2
|
" Commands: :Nread, :Nwrite, :NetUserPass {{{2
|
||||||
com! -count=1 -nargs=* Nread call netrw#NetrwSavePosn()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call netrw#NetrwRestorePosn()
|
com! -count=1 -nargs=* Nread call netrw#NetrwSavePosn()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call netrw#NetrwRestorePosn()
|
||||||
com! -range=% -nargs=* Nwrite call netrw#NetrwSavePosn()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call netrw#NetrwRestorePosn()
|
com! -range=% -nargs=* Nwrite call netrw#NetrwSavePosn()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call netrw#NetrwRestorePosn()
|
||||||
com! -nargs=* NetUserPass call NetUserPass(<f-args>)
|
com! -nargs=* NetUserPass call NetUserPass(<f-args>)
|
||||||
com! -nargs=* Nsource call netrw#NetrwSavePosn()<bar>call netrw#NetSource(<f-args>)<bar>call netrw#NetrwRestorePosn()
|
com! -nargs=* Nsource call netrw#NetrwSavePosn()<bar>call netrw#NetSource(<f-args>)<bar>call netrw#NetrwRestorePosn()
|
||||||
|
|
||||||
" Commands: :Explore, :Sexplore, Hexplore, Vexplore {{{2
|
" Commands: :Explore, :Sexplore, Hexplore, Vexplore {{{2
|
||||||
com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
|
com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
|
||||||
com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(<count>,1,0+<bang>0,<q-args>)
|
com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(<count>,1,0+<bang>0,<q-args>)
|
||||||
com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(<count>,1,2+<bang>0,<q-args>)
|
com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(<count>,1,2+<bang>0,<q-args>)
|
||||||
com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<count>,1,4+<bang>0,<q-args>)
|
com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<count>,1,4+<bang>0,<q-args>)
|
||||||
com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(<count>,0,6 ,<q-args>)
|
com! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(<count>,0,6 ,<q-args>)
|
||||||
com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,<q-args>)
|
com! -nargs=* -bar -bang Nexplore call netrw#Explore(-1,0,0,<q-args>)
|
||||||
com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>)
|
com! -nargs=* -bar -bang Pexplore call netrw#Explore(-2,0,0,<q-args>)
|
||||||
|
|
||||||
" Commands: NetrwSettings {{{2
|
" Commands: NetrwSettings {{{2
|
||||||
com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings()
|
com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings()
|
||||||
com! -bang NetrwClean call netrw#NetrwClean(<bang>0)
|
com! -bang NetrwClean call netrw#NetrwClean(<bang>0)
|
||||||
|
|
||||||
" Maps:
|
" Maps:
|
||||||
if !exists("g:netrw_nogx") && maparg('g','n') == ""
|
if !exists("g:netrw_nogx") && maparg('g','n') == ""
|
||||||
if !hasmapto('<Plug>NetrwBrowseX')
|
if !hasmapto('<Plug>NetrwBrowseX')
|
||||||
nmap <unique> gx <Plug>NetrwBrowseX
|
nmap <unique> gx <Plug>NetrwBrowseX
|
||||||
endif
|
endif
|
||||||
nno <silent> <Plug>NetrwBrowseX :call netrw#NetBrowseX(expand("<cWORD>"),0)<cr>
|
nno <silent> <Plug>NetrwBrowseX :call netrw#NetBrowseX(expand("<cWORD>"),0)<cr>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" LocalBrowse: {{{2
|
" LocalBrowse: {{{2
|
||||||
fun! s:LocalBrowse(dirname)
|
fun! s:LocalBrowse(dirname)
|
||||||
" unfortunate interaction -- debugging calls can't be used here;
|
" unfortunate interaction -- debugging calls can't be used here;
|
||||||
" the BufEnter event causes triggering when attempts to write to
|
" the BufEnter event causes triggering when attempts to write to
|
||||||
" the DBG buffer are made.
|
" the DBG buffer are made.
|
||||||
" echomsg "dirname<".a:dirname.">"
|
" echomsg "dirname<".a:dirname.">"
|
||||||
if has("amiga")
|
if has("amiga")
|
||||||
" The check against '' is made for the Amiga, where the empty
|
" The check against '' is made for the Amiga, where the empty
|
||||||
" string is the current directory and not checking would break
|
" string is the current directory and not checking would break
|
||||||
" things such as the help command.
|
" things such as the help command.
|
||||||
if a:dirname != '' && isdirectory(a:dirname)
|
if a:dirname != '' && isdirectory(a:dirname)
|
||||||
silent! call netrw#LocalBrowseCheck(a:dirname)
|
silent! call netrw#LocalBrowseCheck(a:dirname)
|
||||||
endif
|
endif
|
||||||
elseif isdirectory(a:dirname)
|
elseif isdirectory(a:dirname)
|
||||||
" echomsg "dirname<".dirname."> isdir"
|
" echomsg "dirname<".dirname."> isdir"
|
||||||
silent! call netrw#LocalBrowseCheck(a:dirname)
|
silent! call netrw#LocalBrowseCheck(a:dirname)
|
||||||
endif
|
endif
|
||||||
" not a directory, ignore it
|
" not a directory, ignore it
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" NetrwStatusLine: {{{1
|
" NetrwStatusLine: {{{1
|
||||||
fun! NetrwStatusLine()
|
fun! NetrwStatusLine()
|
||||||
" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".")
|
" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".")
|
||||||
if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
|
if !exists("w:netrw_explore_bufnr") || w:netrw_explore_bufnr != bufnr("%") || !exists("w:netrw_explore_line") || w:netrw_explore_line != line(".") || !exists("w:netrw_explore_list")
|
||||||
let &stl= s:netrw_explore_stl
|
let &stl= s:netrw_explore_stl
|
||||||
if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
|
if exists("w:netrw_explore_bufnr")|unlet w:netrw_explore_bufnr|endif
|
||||||
if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
|
if exists("w:netrw_explore_line")|unlet w:netrw_explore_line|endif
|
||||||
return ""
|
return ""
|
||||||
else
|
else
|
||||||
return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen
|
return "Match ".w:netrw_explore_mtchcnt." of ".w:netrw_explore_listlen
|
||||||
endif
|
endif
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
" NetUserPass: set username and password for subsequent ftp transfer {{{1
|
" NetUserPass: set username and password for subsequent ftp transfer {{{1
|
||||||
" Usage: :call NetUserPass() -- will prompt for userid and password
|
" Usage: :call NetUserPass() -- will prompt for userid and password
|
||||||
" :call NetUserPass("uid") -- will prompt for password
|
" :call NetUserPass("uid") -- will prompt for password
|
||||||
" :call NetUserPass("uid","password") -- sets global userid and password
|
" :call NetUserPass("uid","password") -- sets global userid and password
|
||||||
fun! NetUserPass(...)
|
fun! NetUserPass(...)
|
||||||
|
|
||||||
" get/set userid
|
" get/set userid
|
||||||
if a:0 == 0
|
if a:0 == 0
|
||||||
" call Dfunc("NetUserPass(a:0<".a:0.">)")
|
" call Dfunc("NetUserPass(a:0<".a:0.">)")
|
||||||
if !exists("g:netrw_uid") || g:netrw_uid == ""
|
if !exists("g:netrw_uid") || g:netrw_uid == ""
|
||||||
" via prompt
|
" via prompt
|
||||||
let g:netrw_uid= input('Enter username: ')
|
let g:netrw_uid= input('Enter username: ')
|
||||||
endif
|
endif
|
||||||
else " from command line
|
else " from command line
|
||||||
" call Dfunc("NetUserPass(a:1<".a:1.">) {")
|
" call Dfunc("NetUserPass(a:1<".a:1.">) {")
|
||||||
let g:netrw_uid= a:1
|
let g:netrw_uid= a:1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" get password
|
" get password
|
||||||
if a:0 <= 1 " via prompt
|
if a:0 <= 1 " via prompt
|
||||||
" call Decho("a:0=".a:0." case <=1:")
|
" call Decho("a:0=".a:0." case <=1:")
|
||||||
let g:netrw_passwd= inputsecret("Enter Password: ")
|
let g:netrw_passwd= inputsecret("Enter Password: ")
|
||||||
else " from command line
|
else " from command line
|
||||||
" call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
|
" call Decho("a:0=".a:0." case >1: a:2<".a:2.">")
|
||||||
let g:netrw_passwd=a:2
|
let g:netrw_passwd=a:2
|
||||||
endif
|
endif
|
||||||
" call Dret("NetUserPass")
|
" call Dret("NetUserPass")
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
" NetReadFixup: this sort of function is typically written by the user {{{1
|
" NetReadFixup: this sort of function is typically written by the user {{{1
|
||||||
" to handle extra junk that their system's ftp dumps
|
" to handle extra junk that their system's ftp dumps
|
||||||
" into the transfer. This function is provided as an
|
" into the transfer. This function is provided as an
|
||||||
" example and as a fix for a Windows 95 problem: in my
|
" example and as a fix for a Windows 95 problem: in my
|
||||||
" experience, win95's ftp always dumped four blank lines
|
" experience, win95's ftp always dumped four blank lines
|
||||||
" at the end of the transfer.
|
" at the end of the transfer.
|
||||||
if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
|
if has("win95") && exists("g:netrw_win95ftp") && g:netrw_win95ftp
|
||||||
fun! NetReadFixup(method, line1, line2)
|
fun! NetReadFixup(method, line1, line2)
|
||||||
" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
|
" call Dfunc("NetReadFixup(method<".a:method."> line1=".a:line1." line2=".a:line2.")")
|
||||||
if method == 3 " ftp (no <.netrc>)
|
if method == 3 " ftp (no <.netrc>)
|
||||||
let fourblanklines= line2 - 3
|
let fourblanklines= line2 - 3
|
||||||
silent fourblanklines.",".line2."g/^\s*/d"
|
silent fourblanklines.",".line2."g/^\s*/d"
|
||||||
endif
|
endif
|
||||||
" call Dret("NetReadFixup")
|
" call Dret("NetReadFixup")
|
||||||
endfun
|
endfun
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
" ------------------------------------------------------------------------
|
||||||
" Modelines And Restoration: {{{1
|
" Modelines And Restoration: {{{1
|
||||||
let &cpo= s:keepcpo
|
let &cpo= s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
" vim:ts=8 fdm=marker
|
" vim:ts=8 fdm=marker
|
||||||
|
@ -1,88 +1,88 @@
|
|||||||
" visincrPlugin.vim: Visual-block incremented lists
|
" visincrPlugin.vim: Visual-block incremented lists
|
||||||
" Author: Charles E. Campbell, Jr. Ph.D.
|
" Author: Charles E. Campbell, Jr. Ph.D.
|
||||||
" Date: Jul 18, 2006
|
" Date: Jul 18, 2006
|
||||||
" Public Interface Only
|
" Public Interface Only
|
||||||
"
|
"
|
||||||
" (James 2:19,20 WEB) You believe that God is one. You do well!
|
" (James 2:19,20 WEB) You believe that God is one. You do well!
|
||||||
" The demons also believe, and shudder.
|
" The demons also believe, and shudder.
|
||||||
" But do you want to know, vain man, that
|
" But do you want to know, vain man, that
|
||||||
" faith apart from works is dead?
|
" faith apart from works is dead?
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Load Once: {{{1
|
" Load Once: {{{1
|
||||||
if &cp || exists("g:loaded_visincrPlugin")
|
if &cp || exists("g:loaded_visincrPlugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_visincrPlugin = "v19"
|
let g:loaded_visincrPlugin = "v19"
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Methods: {{{1
|
" Methods: {{{1
|
||||||
let s:I = 0
|
let s:I = 0
|
||||||
let s:II = 1
|
let s:II = 1
|
||||||
let s:IMDY = 2
|
let s:IMDY = 2
|
||||||
let s:IYMD = 3
|
let s:IYMD = 3
|
||||||
let s:IDMY = 4
|
let s:IDMY = 4
|
||||||
let s:ID = 5
|
let s:ID = 5
|
||||||
let s:IM = 6
|
let s:IM = 6
|
||||||
let s:IA = 7
|
let s:IA = 7
|
||||||
let s:IX = 8
|
let s:IX = 8
|
||||||
let s:IIX = 9
|
let s:IIX = 9
|
||||||
let s:IO = 10
|
let s:IO = 10
|
||||||
let s:IIO = 11
|
let s:IIO = 11
|
||||||
let s:IR = 12
|
let s:IR = 12
|
||||||
let s:IIR = 13
|
let s:IIR = 13
|
||||||
let s:IPOW = 14
|
let s:IPOW = 14
|
||||||
let s:IIPOW = 15
|
let s:IIPOW = 15
|
||||||
let s:RI = 16
|
let s:RI = 16
|
||||||
let s:RII = 17
|
let s:RII = 17
|
||||||
let s:RIMDY = 18
|
let s:RIMDY = 18
|
||||||
let s:RIYMD = 19
|
let s:RIYMD = 19
|
||||||
let s:RIDMY = 20
|
let s:RIDMY = 20
|
||||||
let s:RID = 21
|
let s:RID = 21
|
||||||
let s:RIM = 22
|
let s:RIM = 22
|
||||||
let s:RIA = 23
|
let s:RIA = 23
|
||||||
let s:RIX = 24
|
let s:RIX = 24
|
||||||
let s:RIIX = 25
|
let s:RIIX = 25
|
||||||
let s:RIO = 26
|
let s:RIO = 26
|
||||||
let s:RIIO = 27
|
let s:RIIO = 27
|
||||||
let s:RIR = 28
|
let s:RIR = 28
|
||||||
let s:RIIR = 29
|
let s:RIIR = 29
|
||||||
let s:RIPOW = 30
|
let s:RIPOW = 30
|
||||||
let s:RIIPOW = 31
|
let s:RIIPOW = 31
|
||||||
|
|
||||||
" ------------------------------------------------------------------------------
|
" ------------------------------------------------------------------------------
|
||||||
" Public Interface: {{{1
|
" Public Interface: {{{1
|
||||||
com! -ra -complete=expression -na=? I call visincr#VisBlockIncr(s:I , <f-args>)
|
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=* 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=* 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=* 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=* 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=? 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=? 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=? 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=? 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=? 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=? 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=? 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=? 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=? 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=? 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=? 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=? 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=* 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=* 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=* 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=* 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=? 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=? 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=? RIPOW call visincr#VisBlockIncr(s:RIPOW , <f-args>)
|
||||||
com! -ra -complete=expression -na=* RIIPOW call visincr#VisBlockIncr(s:RIIPOW , <f-args>)
|
com! -ra -complete=expression -na=* RIIPOW call visincr#VisBlockIncr(s:RIIPOW , <f-args>)
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" ---------------------------------------------------------------------
|
||||||
" Restoration And Modelines: {{{1
|
" Restoration And Modelines: {{{1
|
||||||
" vim: ts=4 fdm=marker
|
" vim: ts=4 fdm=marker
|
||||||
let &cpo= s:keepcpo
|
let &cpo= s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user