weirongxu / coc-explorer

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

Sync current open file with the tree #493

Closed arshadpakkali closed 2 years ago

arshadpakkali commented 2 years ago

TLDR :

To reproduce:

  1. Open nvim in a folder and coc-explorer ,
  2. go to a file eg:( app.js) from the explorer ,
  3. let the Explorer be open
  4. from that file ( app.js ) navigate to other file ( repo.js ) By FZF or gF or Lsp gd etc
  5. Now the File Explorer shows open file as the previous one ( app.js ) not the current one ( ie the open file is not in sync )
  6. If we close and open the explorer its back in sync Question
    • it would be great if there is an option to make the current file open on left side too
    • or a command like refresh but something like findCurrentFile so that we can put it on autocommand Buffenter

sorry if this is already there and im blind , i've searched through the issues and wiki and didnt find quite similar

weirongxu commented 2 years ago

https://github.com/weirongxu/coc-explorer#example

Example for reveal key mapping.

nmap <Leader>er <Cmd>call CocAction('runCommand', 'explorer.doAction', 'closest', ['reveal:0'], [['relative', 0, 'file']])<CR>

more CocAction

Or set explorer.file.reveal.auto option to true

arshadpakkali commented 2 years ago

Thank you so much.