netrw: move netrw_home to XDA_DATA_HOME (#13939)

This commit is contained in:
Jakub Łuczyński 2021-02-17 03:21:43 +01:00 committed by GitHub
parent 03383ee27b
commit 4bc74c2431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 19 deletions

View File

@ -5781,22 +5781,7 @@ fun! s:NetrwHome()
if exists("g:netrw_home")
let home= expand(g:netrw_home)
else
" go to vim plugin home
for home in split(&rtp,',') + ['']
if isdirectory(s:NetrwFile(home)) && filewritable(s:NetrwFile(home)) | break | endif
let basehome= substitute(home,'[/\\]\.vim$','','')
if isdirectory(s:NetrwFile(basehome)) && filewritable(s:NetrwFile(basehome))
let home= basehome."/.vim"
break
endif
endfor
if home == ""
" just pick the first directory
let home= substitute(&rtp,',.*$','','')
endif
if (has("win32") || has("win95") || has("win64") || has("win16"))
let home= substitute(home,'/','\\','g')
endif
let home = stdpath('data')
endif
" insure that the home directory exists
if g:netrw_dirhistmax > 0 && !isdirectory(s:NetrwFile(home))

View File

@ -2744,9 +2744,8 @@ your browsing preferences. (see also: |netrw-settings|)
*g:netrw_home* The home directory for where bookmarks and
history are saved (as .netrwbook and
.netrwhist).
Netrw uses |expand()|on the string.
default: the first directory on the
|'runtimepath'|
Netrw uses |expand()| on the string.
default: stdpath('data') (see |stdpath()|)
*g:netrw_keepdir* =1 (default) keep current directory immune from
the browsing directory.