runtime(netrw): upstream snapshot of v175
Relevant commits: - release: netrw v175 - fix: prevent netrw to load into the built-in terminal - fix: restore correctly cpo settings - fix(docs): mispelled original authors name - chore: move viml files to new formatting standard fixes: #16463 closes: #16465 Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
87f65f3857
commit
d402ba81e2
@ -35,7 +35,7 @@ if exists("s:needspatches")
|
|||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let g:loaded_netrw = "v174"
|
let g:loaded_netrw = "v175"
|
||||||
|
|
||||||
let s:keepcpo= &cpo
|
let s:keepcpo= &cpo
|
||||||
setl cpo&vim
|
setl cpo&vim
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
" Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
|
" Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
|
||||||
" Former Maintainer: Charles E Campbell
|
" Former Maintainer: Charles E Campbell
|
||||||
" Upstream: <https://github.com/saccarosium/netrw.vim>
|
" Upstream: <https://github.com/saccarosium/netrw.vim>
|
||||||
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1
|
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{
|
||||||
" 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,
|
||||||
@ -9,13 +9,13 @@
|
|||||||
" warranty of any kind, either expressed or implied. By using
|
" warranty of any kind, either expressed or implied. By using
|
||||||
" this plugin, you agree that in no event will the copyright
|
" this 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. }}}
|
||||||
|
|
||||||
" Load Once: {{{1
|
if &cp || exists("g:loaded_netrwSettings")
|
||||||
if exists("g:loaded_netrwSettings") || &cp
|
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_netrwSettings = "v174"
|
|
||||||
|
let g:loaded_netrwSettings = "v175"
|
||||||
if v:version < 700
|
if v:version < 700
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echo "***warning*** this version of netrwSettings needs vim 7.0"
|
echo "***warning*** this version of netrwSettings needs vim 7.0"
|
||||||
@ -23,13 +23,15 @@ if v:version < 700
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" NetrwSettings: {{{
|
||||||
" NetrwSettings: {{{1
|
|
||||||
fun! netrwSettings#NetrwSettings()
|
function! netrwSettings#NetrwSettings()
|
||||||
" this call is here largely just to insure that netrw has been loaded
|
" this call is here largely just to insure that netrw has been loaded
|
||||||
call netrw#WinPath("")
|
call netrw#WinPath("")
|
||||||
if !exists("g:loaded_netrw")
|
if !exists("g:loaded_netrw")
|
||||||
echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
|
echohl WarningMsg
|
||||||
|
echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings"
|
||||||
|
echohl None
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -198,28 +200,27 @@ fun! netrwSettings#NetrwSettings()
|
|||||||
silent %s/= $/= ''/e
|
silent %s/= $/= ''/e
|
||||||
1
|
1
|
||||||
|
|
||||||
call setline(decompressline,"let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1',''))
|
call setline(decompressline, "let g:netrw_decompress = ".substitute(string(g:netrw_decompress),"^'\\(.*\\)'$",'\1',''))
|
||||||
call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'")
|
call setline(fnameescline, "let g:netrw_fname_escape = '".escape(g:netrw_fname_escape,"'")."'")
|
||||||
call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'")
|
call setline(globescline, "let g:netrw_glob_escape = '".escape(g:netrw_glob_escape,"'")."'")
|
||||||
call setline(tmpfileescline,"let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'")
|
call setline(tmpfileescline, "let g:netrw_tmpfile_escape = '".escape(g:netrw_tmpfile_escape,"'")."'")
|
||||||
|
|
||||||
set nomod
|
set nomod
|
||||||
|
|
||||||
nmap <buffer> <silent> <F1> :call NetrwSettingHelp()<cr>
|
nmap <buffer> <silent> <F1> :call NetrwSettingHelp()<cr>
|
||||||
nnoremap <buffer> <silent> <leftmouse> <leftmouse>:call NetrwSettingHelp()<cr>
|
nnoremap <buffer> <silent> <leftmouse> <leftmouse> :call NetrwSettingHelp()<cr>
|
||||||
let tmpfile= tempname()
|
let tmpfile= tempname()
|
||||||
exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod'
|
exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod'
|
||||||
endfun
|
endfunction
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" }}}
|
||||||
" NetrwSettingHelp: {{{2
|
" NetrwSettingHelp: {{{
|
||||||
fun! NetrwSettingHelp()
|
|
||||||
" call Dfunc("NetrwSettingHelp()")
|
function! NetrwSettingHelp()
|
||||||
let curline = getline(".")
|
let curline = getline(".")
|
||||||
if curline =~ '='
|
if curline =~ '='
|
||||||
let varhelp = substitute(curline,'^\s*let ','','e')
|
let varhelp = substitute(curline,'^\s*let ','','e')
|
||||||
let varhelp = substitute(varhelp,'\s*=.*$','','e')
|
let varhelp = substitute(varhelp,'\s*=.*$','','e')
|
||||||
" call Decho("trying help ".varhelp)
|
|
||||||
try
|
try
|
||||||
exe "he ".varhelp
|
exe "he ".varhelp
|
||||||
catch /^Vim\%((\a\+)\)\=:E149/
|
catch /^Vim\%((\a\+)\)\=:E149/
|
||||||
@ -234,9 +235,8 @@ fun! NetrwSettingHelp()
|
|||||||
else
|
else
|
||||||
he netrw-browse-var
|
he netrw-browse-var
|
||||||
endif
|
endif
|
||||||
" call Dret("NetrwSettingHelp")
|
endfunction
|
||||||
endfun
|
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" }}}
|
||||||
" Modelines: {{{1
|
|
||||||
" vim:ts=8 fdm=marker
|
" vim:ts=8 sts=4 sw=4 et fdm=marker
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
" let g:netrw_list_hide = netrw_gitignore#Hide()
|
" let g:netrw_list_hide = netrw_gitignore#Hide()
|
||||||
" let g:netrw_list_hide = netrw_gitignore#Hide() . 'more,hide,patterns'
|
" let g:netrw_list_hide = netrw_gitignore#Hide() . 'more,hide,patterns'
|
||||||
"
|
"
|
||||||
" Copyright: Copyright (C) 2013 Bruno Sutic {{{1
|
" Copyright: Copyright (C) 2013 Bruno Sutic {{{
|
||||||
" 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,
|
||||||
@ -20,7 +20,10 @@
|
|||||||
" warranty of any kind, either expressed or implied. By using
|
" warranty of any kind, either expressed or implied. By using
|
||||||
" this plugin, you agree that in no event will the copyright
|
" this 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. }}}
|
||||||
|
|
||||||
function! netrw_gitignore#Hide(...)
|
function! netrw_gitignore#Hide(...)
|
||||||
return substitute(substitute(system('git ls-files --other --ignored --exclude-standard --directory'), '\n', ',', 'g'), ',$', '', '')
|
return substitute(substitute(system('git ls-files --other --ignored --exclude-standard --directory'), '\n', ',', 'g'), ',$', '', '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" vim:ts=8 sts=4 sw=4 et fdm=marker
|
||||||
|
|||||||
2
runtime/pack/dist/opt/netrw/doc/netrw.txt
vendored
2
runtime/pack/dist/opt/netrw/doc/netrw.txt
vendored
@ -1,7 +1,7 @@
|
|||||||
*netrw.txt*
|
*netrw.txt*
|
||||||
|
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
NETRW REFERENCE MANUAL by Charles E.Cambell
|
NETRW REFERENCE MANUAL by Charles E. Campbell
|
||||||
------------------------------------------------
|
------------------------------------------------
|
||||||
Original Author: Charles E. Campbell
|
Original Author: Charles E. Campbell
|
||||||
|
|
||||||
|
|||||||
146
runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim
vendored
146
runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim
vendored
@ -1,7 +1,7 @@
|
|||||||
" Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
|
" Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
|
||||||
" Former Maintainer: Charles E Campbell
|
" Former Maintainer: Charles E Campbell
|
||||||
" Upstream: <https://github.com/saccarosium/netrw.vim>
|
" Upstream: <https://github.com/saccarosium/netrw.vim>
|
||||||
" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{1
|
" Copyright: Copyright (C) 1999-2021 Charles E. Campbell {{{
|
||||||
" 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,
|
||||||
@ -9,25 +9,25 @@
|
|||||||
" *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. }}}
|
||||||
|
|
||||||
" Load Once: {{{1
|
|
||||||
if &cp || exists("g:loaded_netrwPlugin")
|
if &cp || exists("g:loaded_netrwPlugin")
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_netrwPlugin = "v174"
|
|
||||||
|
let g:loaded_netrwPlugin = "v175"
|
||||||
|
|
||||||
let s:keepcpo = &cpo
|
let s:keepcpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
"DechoRemOn
|
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" Commands Launch/URL: {{{
|
||||||
" Public Interface: {{{1
|
|
||||||
|
|
||||||
" Commands Launch/URL {{{2
|
|
||||||
command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim(<q-args>))
|
command -complete=shellcmd -nargs=1 Launch call netrw#Launch(trim(<q-args>))
|
||||||
command -complete=file -nargs=1 Open call netrw#Open(trim(<q-args>))
|
command -complete=file -nargs=1 Open call netrw#Open(trim(<q-args>))
|
||||||
" " }}}
|
|
||||||
" Local Browsing Autocmds: {{{2
|
" }}}
|
||||||
|
" Local Browsing Autocmds: {{{
|
||||||
|
|
||||||
augroup FileExplorer
|
augroup FileExplorer
|
||||||
au!
|
au!
|
||||||
au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif
|
au BufLeave * if &ft != "netrw"|let w:netrw_prvfile= expand("%:p")|endif
|
||||||
@ -38,7 +38,9 @@ augroup FileExplorer
|
|||||||
endif
|
endif
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Network Browsing Reading Writing: {{{2
|
" }}}
|
||||||
|
" Network Browsing Reading Writing: {{{
|
||||||
|
|
||||||
augroup Network
|
augroup Network
|
||||||
au!
|
au!
|
||||||
au BufReadCmd file://* call netrw#FileUrlEdit(expand("<amatch>"))
|
au BufReadCmd file://* call netrw#FileUrlEdit(expand("<amatch>"))
|
||||||
@ -53,28 +55,36 @@ augroup Network
|
|||||||
endtry
|
endtry
|
||||||
augroup END
|
augroup END
|
||||||
|
|
||||||
" Commands: :Nread, :Nwrite, :NetUserPass {{{2
|
" }}}
|
||||||
com! -count=1 -nargs=* Nread let s:svpos= winsaveview()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call winrestview(s:svpos)
|
" Commands: :Nread, :Nwrite, :NetUserPass {{{
|
||||||
com! -range=% -nargs=* Nwrite let s:svpos= winsaveview()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call winrestview(s:svpos)
|
|
||||||
com! -nargs=* NetUserPass call NetUserPass(<f-args>)
|
|
||||||
com! -nargs=* Nsource let s:svpos= winsaveview()<bar>call netrw#NetSource(<f-args>)<bar>call winrestview(s:svpos)
|
|
||||||
com! -nargs=? Ntree call netrw#SetTreetop(1,<q-args>)
|
|
||||||
|
|
||||||
" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2
|
command! -count=1 -nargs=* Nread let s:svpos= winsaveview()<bar>call netrw#NetRead(<count>,<f-args>)<bar>call winrestview(s:svpos)
|
||||||
com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
|
command! -range=% -nargs=* Nwrite let s:svpos= winsaveview()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call winrestview(s:svpos)
|
||||||
com! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(<count>,1,0+<bang>0,<q-args>)
|
command! -nargs=* NetUserPass call NetUserPass(<f-args>)
|
||||||
com! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(<count>,1,2+<bang>0,<q-args>)
|
command! -nargs=* Nsource let s:svpos= winsaveview()<bar>call netrw#NetSource(<f-args>)<bar>call winrestview(s:svpos)
|
||||||
com! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<count>,1,4+<bang>0,<q-args>)
|
command! -nargs=? Ntree call netrw#SetTreetop(1,<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 Pexplore call netrw#Explore(-2,0,0,<q-args>)
|
|
||||||
com! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(<count>,<bang>0,<q-args>)
|
|
||||||
|
|
||||||
" Commands: NetrwSettings {{{2
|
" }}}
|
||||||
com! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings()
|
" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{
|
||||||
com! -bang NetrwClean call netrw#Clean(<bang>0)
|
|
||||||
|
command! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>, 0, 0+<bang>0, <q-args>)
|
||||||
|
command! -nargs=* -bar -bang -count=0 -complete=dir Sexplore call netrw#Explore(<count>, 1, 0+<bang>0, <q-args>)
|
||||||
|
command! -nargs=* -bar -bang -count=0 -complete=dir Hexplore call netrw#Explore(<count>, 1, 2+<bang>0, <q-args>)
|
||||||
|
command! -nargs=* -bar -bang -count=0 -complete=dir Vexplore call netrw#Explore(<count>, 1, 4+<bang>0, <q-args>)
|
||||||
|
command! -nargs=* -bar -count=0 -complete=dir Texplore call netrw#Explore(<count>, 0, 6, <q-args>)
|
||||||
|
command! -nargs=* -bar -bang -count=0 -complete=dir Lexplore call netrw#Lexplore(<count>, <bang>0, <q-args>)
|
||||||
|
command! -nargs=* -bar -bang Nexplore call netrw#Explore(-1, 0, 0, <q-args>)
|
||||||
|
command! -nargs=* -bar -bang Pexplore call netrw#Explore(-2, 0, 0, <q-args>)
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
" Commands: NetrwSettings {{{
|
||||||
|
|
||||||
|
command! -nargs=0 NetrwSettings call netrwSettings#NetrwSettings()
|
||||||
|
command! -bang NetrwClean call netrw#Clean(<bang>0)
|
||||||
|
|
||||||
|
" }}}
|
||||||
|
" Maps: {{{
|
||||||
|
|
||||||
" Maps:
|
|
||||||
if !exists("g:netrw_nogx")
|
if !exists("g:netrw_nogx")
|
||||||
if maparg('gx','n') == ""
|
if maparg('gx','n') == ""
|
||||||
if !hasmapto('<Plug>NetrwBrowseX')
|
if !hasmapto('<Plug>NetrwBrowseX')
|
||||||
@ -89,6 +99,7 @@ if !exists("g:netrw_nogx")
|
|||||||
xno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr>
|
xno <silent> <Plug>NetrwBrowseXVis :<c-u>call netrw#BrowseXVis()<cr>
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if exists("g:netrw_usetab") && g:netrw_usetab
|
if exists("g:netrw_usetab") && g:netrw_usetab
|
||||||
if maparg('<c-tab>','n') == ""
|
if maparg('<c-tab>','n') == ""
|
||||||
nmap <unique> <c-tab> <Plug>NetrwShrink
|
nmap <unique> <c-tab> <Plug>NetrwShrink
|
||||||
@ -96,62 +107,50 @@ if exists("g:netrw_usetab") && g:netrw_usetab
|
|||||||
nno <silent> <Plug>NetrwShrink :call netrw#Shrink()<cr>
|
nno <silent> <Plug>NetrwShrink :call netrw#Shrink()<cr>
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" }}}
|
||||||
" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{2
|
" LocalBrowse: invokes netrw#LocalBrowseCheck() on directory buffers {{{
|
||||||
fun! s:LocalBrowse(dirname)
|
|
||||||
" Unfortunate interaction -- only DechoMsg debugging calls can be safely used here.
|
function! s:LocalBrowse(dirname)
|
||||||
" Otherwise, the BufEnter event gets triggered when attempts to write to
|
" do not trigger in the terminal
|
||||||
" the DBG buffer are made.
|
" https://github.com/vim/vim/issues/16463
|
||||||
|
if &buftype ==# 'terminal'
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
if !exists("s:vimentered")
|
if !exists("s:vimentered")
|
||||||
" If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will,
|
" If s:vimentered doesn't exist, then the VimEnter event hasn't fired. It will,
|
||||||
" and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined.
|
" and so s:VimEnter() will then be calling this routine, but this time with s:vimentered defined.
|
||||||
" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered doesn't exist)")
|
|
||||||
" call Dret("s:LocalBrowse")
|
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" call Dfunc("s:LocalBrowse(dirname<".a:dirname.">) (s:vimentered=".s:vimentered.")")
|
|
||||||
|
|
||||||
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.
|
||||||
" call Decho("(LocalBrowse) dirname<".a:dirname."> (isdirectory, amiga)")
|
|
||||||
if a:dirname != '' && isdirectory(a:dirname)
|
if a:dirname != '' && isdirectory(a:dirname)
|
||||||
sil! call netrw#LocalBrowseCheck(a:dirname)
|
sil! call netrw#LocalBrowseCheck(a:dirname)
|
||||||
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
|
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
|
||||||
exe w:netrw_bannercnt
|
exe w:netrw_bannercnt
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
elseif isdirectory(a:dirname)
|
elseif isdirectory(a:dirname)
|
||||||
" call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)")
|
|
||||||
" call Dredir("LocalBrowse ft last set: ","verbose set ft")
|
|
||||||
" Jul 13, 2021: for whatever reason, preceding the following call with
|
" Jul 13, 2021: for whatever reason, preceding the following call with
|
||||||
" a sil! causes an unbalanced if-endif vim error
|
" a sil! causes an unbalanced if-endif vim error
|
||||||
call netrw#LocalBrowseCheck(a:dirname)
|
call netrw#LocalBrowseCheck(a:dirname)
|
||||||
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
|
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
|
||||||
exe w:netrw_bannercnt
|
exe w:netrw_bannercnt
|
||||||
endif
|
endif
|
||||||
|
|
||||||
else
|
|
||||||
" not a directory, ignore it
|
|
||||||
" call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...")
|
|
||||||
endif
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
" call Dret("s:LocalBrowse")
|
" }}}
|
||||||
endfun
|
" s:VimEnter: after all vim startup stuff is done, this function is called. {{{
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
|
||||||
" s:VimEnter: after all vim startup stuff is done, this function is called. {{{2
|
|
||||||
" Its purpose: to look over all windows and run s:LocalBrowse() on
|
" Its purpose: to look over all windows and run s:LocalBrowse() on
|
||||||
" them, which checks if they're directories and will create a directory
|
" them, which checks if they're directories and will create a directory
|
||||||
" listing when appropriate.
|
" listing when appropriate.
|
||||||
" It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter()
|
" It also sets s:vimentered, letting s:LocalBrowse() know that s:VimEnter()
|
||||||
" has already been called.
|
" has already been called.
|
||||||
fun! s:VimEnter(dirname)
|
function! s:VimEnter(dirname)
|
||||||
" call Dfunc("s:VimEnter(dirname<".a:dirname.">) expand(%)<".expand("%").">")
|
|
||||||
if has('nvim') || v:version < 802
|
if has('nvim') || v:version < 802
|
||||||
" Johann Höchtl: reported that the call range... line causes an E488: Trailing characters
|
" Johann Höchtl: reported that the call range... line causes an E488: Trailing characters
|
||||||
" error with neovim. I suspect its because neovim hasn't updated with recent
|
" error with neovim. I suspect its because neovim hasn't updated with recent
|
||||||
@ -168,55 +167,48 @@ fun! s:VimEnter(dirname)
|
|||||||
let s:vimentered = 1
|
let s:vimentered = 1
|
||||||
call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')})
|
call range(1, winnr('$'))->map({_, v -> win_execute(win_getid(v), 'call expand("%:p")->s:LocalBrowse()')})
|
||||||
endif
|
endif
|
||||||
" call Dret("s:VimEnter")
|
endfunction
|
||||||
endfun
|
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" }}}
|
||||||
" NetrwStatusLine: {{{1
|
" NetrwStatusLine: {{{
|
||||||
fun! NetrwStatusLine()
|
|
||||||
" let g:stlmsg= "Xbufnr=".w:netrw_explore_bufnr." bufnr=".bufnr("%")." Xline#".w:netrw_explore_line." line#".line(".")
|
function! NetrwStatusLine()
|
||||||
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
|
unlet! w:netrw_explore_bufnr w:netrw_explore_line
|
||||||
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
|
endfunction
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
" }}}
|
||||||
" NetUserPass: set username and password for subsequent ftp transfer {{{1
|
" NetUserPass: set username and password for subsequent ftp transfer {{{
|
||||||
" 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(...)
|
function! NetUserPass(...)
|
||||||
|
|
||||||
" get/set userid
|
" get/set userid
|
||||||
if a:0 == 0
|
if a:0 == 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.">) {")
|
|
||||||
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:")
|
|
||||||
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.">")
|
|
||||||
let g:netrw_passwd=a:2
|
let g:netrw_passwd=a:2
|
||||||
endif
|
endif
|
||||||
" call Dret("NetUserPass")
|
endfunction
|
||||||
endfun
|
|
||||||
|
" }}}
|
||||||
|
|
||||||
" ------------------------------------------------------------------------
|
|
||||||
" Modelines And Restoration: {{{1
|
|
||||||
let &cpo= s:keepcpo
|
let &cpo= s:keepcpo
|
||||||
unlet s:keepcpo
|
unlet s:keepcpo
|
||||||
" vim:ts=8 sts=2 sw=2 et fdm=marker
|
|
||||||
|
" vim:ts=8 sts=4 sw=4 et fdm=marker
|
||||||
|
|||||||
44
runtime/pack/dist/opt/netrw/syntax/netrw.vim
vendored
44
runtime/pack/dist/opt/netrw/syntax/netrw.vim
vendored
@ -7,7 +7,10 @@ if exists("b:current_syntax")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Directory List Syntax Highlighting: {{{1
|
let b:current_syntax = "netrwlist"
|
||||||
|
|
||||||
|
" Directory List Syntax Highlighting: {{{
|
||||||
|
|
||||||
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 cluster NetrwTreeGroup contains=netrwDir,netrwSymLink,netrwExe
|
||||||
|
|
||||||
@ -19,9 +22,9 @@ syn match netrwSizeDate "\<\d\+\s\d\{1,2}/\d\{1,2}/\d\{4}\s" skipwhite contains
|
|||||||
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
|
syn match netrwSymLink "\%(\S\+ \)*\S\+@\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
|
||||||
syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
|
syn match netrwExe "\%(\S\+ \)*\S*[^~]\*\ze\%(\s\{2,}\|$\)" contains=netrwClassify,@NoSpell
|
||||||
if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4')
|
if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4')
|
||||||
syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
|
syn match netrwTreeBar "^\%([-+|│] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
|
||||||
else
|
else
|
||||||
syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
|
syn match netrwTreeBar "^\%([-+|] \)\+" contains=netrwTreeBarSpace nextgroup=@netrwTreeGroup
|
||||||
endif
|
endif
|
||||||
syn match netrwTreeBarSpace " " contained
|
syn match netrwTreeBarSpace " " contained
|
||||||
|
|
||||||
@ -48,9 +51,9 @@ syn match netrwCmdNote ".\{-}\ze " contained contains=@NoSpell
|
|||||||
syn match netrwVersion "(netrw.*)" contained contains=@NoSpell
|
syn match netrwVersion "(netrw.*)" contained contains=@NoSpell
|
||||||
syn match netrwLink "-->" contained skipwhite
|
syn match netrwLink "-->" contained skipwhite
|
||||||
|
|
||||||
" -----------------------------
|
" }}}
|
||||||
" Special filetype highlighting {{{1
|
" Special filetype highlighting {{{
|
||||||
" -----------------------------
|
|
||||||
if exists("g:netrw_special_syntax") && g:netrw_special_syntax
|
if exists("g:netrw_special_syntax") && g:netrw_special_syntax
|
||||||
if exists("+suffixes") && &suffixes != ""
|
if exists("+suffixes") && &suffixes != ""
|
||||||
let suflist= join(split(&suffixes,','))
|
let suflist= join(split(&suffixes,','))
|
||||||
@ -77,8 +80,9 @@ if exists("g:netrw_special_syntax") && g:netrw_special_syntax
|
|||||||
syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell
|
syn match netrwTmp "\<tmp\(\S\+ \)*\S\+\>\|\(\S\+ \)*\S*tmp\>" contains=netrwTreeBar,@NoSpell
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" ---------------------------------------------------------------------
|
" }}}
|
||||||
" Highlighting Links: {{{1
|
" Highlighting Links: {{{
|
||||||
|
|
||||||
if !exists("did_drchip_netrwlist_syntax")
|
if !exists("did_drchip_netrwlist_syntax")
|
||||||
let did_drchip_netrwlist_syntax= 1
|
let did_drchip_netrwlist_syntax= 1
|
||||||
hi default link netrwClassify Function
|
hi default link netrwClassify Function
|
||||||
@ -121,13 +125,14 @@ if !exists("did_drchip_netrwlist_syntax")
|
|||||||
hi default link netrwTmp netrwGray
|
hi default link netrwTmp netrwGray
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" set up netrwGray to be understated (but not Ignore'd or Conceal'd, as those
|
" set up netrwGray to be understated (but not Ignore'd or Conceal'd, as those
|
||||||
" can be hard/impossible to read). Users may override this in a colorscheme by
|
" can be hard/impossible to read). Users may override this in a colorscheme by
|
||||||
" specifying netrwGray highlighting.
|
" specifying netrwGray highlighting.
|
||||||
redir => s:netrwgray
|
redir => s:netrwgray
|
||||||
sil hi netrwGray
|
sil hi netrwGray
|
||||||
redir END
|
redir END
|
||||||
if s:netrwgray !~ 'guifg'
|
|
||||||
|
if s:netrwgray !~ 'guifg'
|
||||||
if has("gui") && has("gui_running")
|
if has("gui") && has("gui_running")
|
||||||
if &bg == "dark"
|
if &bg == "dark"
|
||||||
exe "hi netrwGray gui=NONE guifg=gray30"
|
exe "hi netrwGray gui=NONE guifg=gray30"
|
||||||
@ -137,9 +142,8 @@ endif
|
|||||||
else
|
else
|
||||||
hi link netrwGray Folded
|
hi link netrwGray Folded
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Current Syntax: {{{1
|
" }}}
|
||||||
let b:current_syntax = "netrwlist"
|
|
||||||
" ---------------------------------------------------------------------
|
" vim:ts=8 sts=4 sw=4 et fdm=marker
|
||||||
" vim: ts=8 fdm=marker
|
|
||||||
|
|||||||
Reference in New Issue
Block a user