# coc-explorer **Repository Path**: null_430/coc-explorer ## Basic Information - **Project Name**: coc-explorer - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-17 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # coc-explorer Explorer extension for [coc.nvim](https://github.com/neoclide/coc.nvim) **Note: Still under development, maybe has some breaking changes.** [![Build Status](https://img.shields.io/github/workflow/status/weirongxu/coc-explorer/coc-explorer%20CI)](https://github.com/weirongxu/coc-explorer/actions) ## Screenshot ![image](https://user-images.githubusercontent.com/1709861/76720263-471be100-6777-11ea-82c1-614627097b02.png) ## Requirements `>= vim 8.1.0579` or `>= neovim 0.3.1` ## Usage 1. Install by coc.nvim command: ``` :CocInstall coc-explorer ``` 2. Configuration custom vim mapping ``` :nmap e :CocCommand explorer ``` 3. Open explorer ``` e ``` 4. Press `?` to show mappings help ## Feature - [x] Buffer source - [x] Highlight visible buffers in real time (neovim only) - [x] File tree source - [x] Basic actions - [x] 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 - [x] Selection - [x] Cut / Copy / Paste - [x] Delete action use trash by default - [x] Git status - [x] Reveal current file in real time (neovim only) - [x] Icons, use [nerdfont](https://github.com/ryanoasis/nerd-fonts) - [x] Search files by Coc-list - [x] Preview file attributes by floating window - [ ] LSP - [x] diagnostic - [ ] file rename - [ ] Exrename, like [defx](https://github.com/Shougo/defx.nvim) - [ ] Archive file (use `lsar / unar`) - [ ] SSH - [x] Bookmark source (require [coc-bookmark](https://github.com/voldikss/coc-bookmark)) - [ ] Git source - [ ] Git actions - [x] Show help ## Command ``` :CocCommand explorer [options] [root-uri] ``` ### User events - `CocExplorerOpenPre`: triggered before open explorer - `CocExplorerOpenPost`: triggered after open explorer - `CocExplorerQuitPre`: triggered before quit explorer - `CocExplorerQuitPost`: triggered after quit explorer ### Example ```vim :CocCommand explorer \ --toggle \ --sources=buffer+,file+ \ /root/path ``` ### Presets ```vim let g:coc_explorer_global_presets = { \ '.vim': { \ 'root-uri': '~/.vim', \ }, \ 'tab': { \ 'position': 'tab', \ 'quit-on-open': v:true, \ }, \ 'floating': { \ 'position': 'floating', \ 'open-action-strategy': 'sourceWindow', \ }, \ 'floatingTop': { \ 'position': 'floating', \ 'floating-position': 'center-top', \ 'open-action-strategy': 'sourceWindow', \ }, \ 'floatingLeftside': { \ 'position': 'floating', \ 'floating-position': 'left-center', \ 'floating-width': 50, \ 'open-action-strategy': 'sourceWindow', \ }, \ 'floatingRightside': { \ 'position': 'floating', \ 'floating-position': 'right-center', \ 'floating-width': 50, \ 'open-action-strategy': 'sourceWindow', \ }, \ 'simplify': { \ 'file-child-template': '[selection | clip | 1] [indent][icon | 1] [filename omitCenter 1]' \ } \ } " Use preset argument to open it nmap ed :CocCommand explorer --preset .vim nmap ef :CocCommand explorer --preset floating " List all presets nmap el :CocList explPresets ``` ### Options #### `[root-uri]` Explorer root, default: - `getcwd()` when `buftype` is `nofile` - `workspace.rootPath` #### `--preset ` Open explorer use presets #### `--toggle | --no-toggle` Close the explorer if it exists, default: `--toggle` #### `--focus | --no-focus` Focus to explorer when opened, default: `--focus` #### `--open-action-strategy ` Strategy for open action, types: `select | vsplit | split | tab | previousBuffer | previousWindow | sourceWindow`, default: `select` #### `--quit-on-open | --no-quit-on-open` quit explorer when open action, default: `--no-quit-on-open` #### `--sources ` Explorer sources, example: `buffer+,file+`, default: `buffer-,file+` ``` expand collapsed │ ↓ ↓ buffer-,file+ └──┬─┘ └─┬┘ buffer source │ file source ``` #### `--position ` Explorer position, supported position: `left`, `right`, `tab`, `floating`, default: `left` #### `--width ` Width of Explorer window for open in left or right side, default: `40` #### `--content-width ` Content width, default: `0` #### `--content-width-type ` Type of content width, types: `win-width`, `vim-width`, , default: `vim-width` #### `--floating-position ` Explorer position for floating window, positions: - `left-center` - `center` - `right-center` - `center-top` - `,` default: `center` #### `--floating-width ` Width of Explorer window when position is floating, use negative value or zero to as `width - value`, default: `0` #### `--floating-height ` Height of Explorer window when position is floating, use negative value or zero to as `height - value`, default: `0` #### `--floating-content-width ` Width of content when position is floating, use negative value or zero to as `width - value`, default: `0` #### `--buffer-root-template