weirongxu / coc-explorer

📁 Explorer for coc.nvim
MIT License
1.14k stars 45 forks source link

Workspace argument support #497

Closed andyrichardson closed 2 years ago

andyrichardson commented 2 years ago

About

Hi there, first off, thanks for making this!

It would be dope if workspace root support worked out of the box! I've been looking into root strategies but can't seem to get functionality that is default on other explorers (see below).

Reproduction(s)

Default (netrw)

Reproduction

Result

Nerdtree

Reproduction

Result

Coc explorer

Reproduction

Result

Expected

FahimAnayet commented 2 years ago

Put this in your init.vim file. It will work as expected.

"will open coc-explorer rather than netrw
augroup MyCocExplorer
  autocmd!
  autocmd VimEnter * sil! au! FileExplorer *
  autocmd BufEnter * let d = expand('%') | if isdirectory(d) | silent! bd | exe 'CocCommand explorer ' . d | endif
augroup END
weirongxu commented 2 years ago

Duplicate of #123