README
coc-explorer
Explorer extension for coc.nvim
Note: This project is still under development and may be broken.
Screenshot
Requirements
>= vim 8.1.1418
or >= neovim 0.3.1
Usage
- Install by coc.nvim command:
:CocInstall coc-explorer
- Configuration custom vim mapping
:nmap <space>e <Cmd>CocCommand explorer<CR>
- Open explorer
<space>e
- Press
?
to show mappings help
More at Quickstart
Feature
- Buffer source
- Highlight visible buffers in real time
- File tree source
- Basic actions
- Open file in select / vsplit / tab
explorer.openAction.strategy
options:- select: Open action use selection UI
- vsplit: Open action use vsplit
- split: Open action use split
- tab: Open action use tab
- previousBuffer: Open action use last used buffer
- previousWindow: Open action use last used window
- sourceWindow: Open action use the window where explorer opened
- Selection
- Cut / Copy / Paste
- Delete action use trash by default
- Other actions, press
?
in explorer to check out the all actions
- Open file in select / vsplit / tab
- Git status
- Automatically reveal the current file
- Icons, use nerdfont
- Search files by Coc-list
- Preview file attributes by floating window
- LSP
- diagnostic
- file rename (won't support, use watchman)
- Exrename, like defx
- Archive file (use
lsar / unar
) - SSH
- Basic actions
Bookmark source (DEPRECATED) (require coc-bookmark)- Git source
- Git actions
- Show help
Command
:CocCommand explorer [options] [root-uri]
User events
CocExplorerOpenPre
: triggered before open explorerCocExplorerOpenPost
: triggered after open explorerCocExplorerQuitPre
: triggered before quit explorerCocExplorerQuitPost
: triggered after quit explorer
Example
:CocCommand explorer
\ --toggle
\ --sources=buffer+,file+
\ /root/path
Reveal to current buffer for closest coc-explorer
nmap <Leader>er <Cmd>call CocAction('runCommand', 'explorer.doAction', 'closest', ['reveal:0'], [['relative', 0, 'file']])<CR>
Presets
let g:coc_explorer_global_presets = {
\ '.vim': {
\ 'root-uri': '~/.vim',
\ },
\ 'cocConfig': {
\ 'root-uri': '~/.config/coc',
\ },
\ 'tab': {
\ 'position': 'tab',
\ 'quit-on-open': v:true,
\ },
\ 'tab: