Follow XDG base dir specs for nerdtree bookmarks

This commit is contained in:
ItsDrike 2021-10-03 10:10:13 +02:00
parent fd245c7758
commit cfe07183ee
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843
2 changed files with 11 additions and 0 deletions

View file

@ -27,3 +27,13 @@ autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTr
" If another buffer tries to replace NerdTree, put it in another window, and bring back NerdTree. " If another buffer tries to replace NerdTree, put it in another window, and bring back NerdTree.
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif \ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
" Use $NERDTREE_BOOKMARKS environment variable for the location of .NERDTreeBookmarks file
if ! empty($NERDTREE_BOOKMARKS)
if ! filereadable($NERDTREE_BOOKMARKS)
let dir = system('dirname $NERDTREE_BOOKMARKS')
let x = system('mkdir -p ' . dir)
let x = system('touch $NERDTREE_BOOKMARKS')
endif
let g:NERDTreeBookmarksFile = $NERDTREE_BOOKMARKS
endif

View file

@ -35,6 +35,7 @@ export SQLITE_HISTORY="$XDG_DATA_HOME/sqlite_history"
export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime" export WAKATIME_HOME="$XDG_CONFIG_HOME/wakatime"
export GOPATH="$XDG_DATA_HOME/go" export GOPATH="$XDG_DATA_HOME/go"
export IPYTHONDIR="$XDG_CONFIG_HOME/ipython" export IPYTHONDIR="$XDG_CONFIG_HOME/ipython"
export NERDTREE_BOOKMARKS="$XDG_CONFIG_HOME/NERDTreeBookmarks"
#export PYLINTHOME="$XDG_CACHE_HOME/pylint" #export PYLINTHOME="$XDG_CACHE_HOME/pylint"
#export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker" #export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
#export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv" #export CUDA_CACHE_PATH="$XDG_CACHE_HOME/nv"