Closed cabaalexander closed 3 years ago
You can configure the root directory using root-strategies
https://github.com/weirongxu/coc-explorer#--root-strategies-root-strategies
Oh, okay. So my next question is, where do I need to set up that configuration in the coc-settings.json
file or in the file I have my coc-explorer
presets ?
This is how my presets look (my config for coc-explorer
):
" coc-explorer
autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif
let g:coc_explorer_global_presets = {
\ 'floating': {
\ 'position': 'floating',
\ 'root-strategies': 'keep',
\ },
\ 'floatingLeftside': {
\ 'position': 'floating',
\ 'floating-position': 'left-center',
\ 'floating-width': 50,
\ },
\ 'floatingRightside': {
\ 'position': 'floating',
\ 'floating-position': 'right-center',
\ 'floating-width': 50,
\ }
\ }
Oh, sorry I misunderstood you at first, you should be trying to diable the reveal behavior?
{
"explorer.file.reveal.whenOpen": false
}
Oh, thank you very much @weirongxu it worked like a charm. 😬 closing this.
Sorry for bringing this up again but... 😅
Can this settings be activated by a flag like --reveal-when-open
on mappings, an example would be this:
nnoremap <silent><leader>k :CocCommand explorer --preset floating<CR> " this wont reveal the file
nnoremap <silent><leader>K :CocCommand explorer --reveal-when-open --preset floating<CR> " this will reveal the file
I realize that sometimes I do want to reveal the file to do some action on it but not always 😅
Now the current behavior is that when you open the explorer it will focus the current file wherever it is on your project tree.
I want for the explorer just open up showing me the tree of my project and with the explorer open if I open directories and do stuffs and I close it, it should remember how I left it the last time it was opened.
Is there an option to do such thing ? Thanks