weirongxu / coc-explorer

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

[Feature] Stay in coc-explorer after opening as optional setting #546

Closed 205g0 closed 1 year ago

205g0 commented 1 year ago

Is your feature request related to a problem? Please describe. I often open many files at the same time and with the current version, I have to go back to the coc-explorer pane every time.

Describe the solution you'd like A setting that allows to let stay the cursor in coc-explorer, something like stayInExplorerAfterOpeningAFile: true, default is false.

Describe alternatives you've considered None, yet.

weirongxu commented 1 year ago
{
   "explorer.keyMappings.global": {
    "<cr>": "open:select:keep"
  }
}
weirongxu commented 1 year ago

You can use <tab> to list all preset action in explorer

205g0 commented 1 year ago

Thanks, I've put the setting above in my coc setting.json and got...

invalid symbol (config)
───────────────────────────────
property name expected (config)

...at "<cr>" and fwiw, the cursor is still going to the the pane.

weirongxu commented 1 year ago

Sorry, it's problem of my input method, I have modified the above content

205g0 commented 1 year ago

all good, sorry that I ask again, what should I do now? The code snippet above is still the same and the one I've added to my settings.json...

weirongxu commented 1 year ago

Actually, they are different, you can check out my edit records

205g0 commented 1 year ago

ah ok, you are right!! Now, there's no error anymore in the editor. But still, after restarting nvim, the cursor goes to the pane with the opened file and won't stay in the coc-explorer pane

weirongxu commented 1 year ago

Try using enter to open the file.

205g0 commented 1 year ago

Great and of course! Thanks. 🙂

One more thing if I press too fast Enter and b (opening a file and putting in into pane b), coc-explorer go away and I see a list of file sizes in the coc-explorer pane:

                531 B
              4.63 kB
                 96 B
                226 B
              1.11 kB
...