Explorer extension for coc.nvim
Note: This project is still under development and may be broken.
>= vim 8.1.1418
or >= neovim 0.3.1
- 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
- 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
:CocCommand explorer [options] [root-uri]
CocExplorerOpenPre
: triggered before open explorerCocExplorerOpenPost
: triggered after open explorerCocExplorerQuitPre
: triggered before quit explorerCocExplorerQuitPost
: triggered after quit explorer
: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>
let g:coc_explorer_global_presets = {
\ '.vim': {
\ 'root-uri': '~/.vim',
\ },
\ 'cocConfig': {
\ 'root-uri': '~/.config/coc',
\ },
\ 'tab': {
\ 'position': 'tab',
\ 'quit-on-open': v:true,
\ },
\ '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]'
\ },
\ 'buffer': {
\ 'sources': [{'name': 'buffer', 'expand': v:true}]
\ },
\ }
" Use preset argument to open it
nmap <space>ed <Cmd>CocCommand explorer --preset .vim<CR>
nmap <space>ef <Cmd>CocCommand explorer --preset floating<CR>
nmap <space>ec <Cmd>CocCommand explorer --preset cocConfig<CR>
nmap <space>eb <Cmd>CocCommand explorer --preset buffer<CR>
" List all presets
nmap <space>el <Cmd>CocList explPresets<CR>
Explorer root, default is use root-strategies
Strategies for root uri, types list of (keep | workspace | cwd | sourceBuffer | reveal | custom:name)
keep
: never change the root pathworkspace
:workspace.root
cwd
:getcwd()
sourceBuffer
: directory of bufferreveal
: directory of reveal path
default is: workspace,cwd,sourceBuffer,reveal
or "explorer.root.strategies" of coc-settings
Custom root patterns settings
{
"explorer.root.customRules": {
"vcs": {
"patterns": [".git", ".hg", ".projections.json"],
},
"vcs-r": {
"patterns": [".git", ".hg", ".projections.json"],
"bottomUp": true,
},
},
}
Using custom root patterns
{
"explorer.root.strategies": ["workspace", "custom:vcs", "custom:vcs-r"],
}
or :CocCommand explorer --root-strategies workspace,custom:vcs,custom:vcs-r
Open explorer use presets
Close the explorer if it exists, default: --toggle
Focus to explorer when opened, default: --focus
Strategy for open action, types: select | vsplit | split | tab | previousBuffer | previousWindow | sourceWindow
, default: select
quit explorer when open action, default: --no-quit-on-open
Explorer sources, example: buffer+,file+
, default: buffer-,file+
expand
collapsed โ
โ โ
buffer-,file+
โโโโฌโโ โโโฌโ
buffer source โ
file source
Explorer position, supported position: left
, right
, tab
, tab:0
, tab:$
, floating
, default: left
Width of Explorer window for open in left or right side, default: 40
Content width, default: 0
Type of content width, types: win-width
, vim-width
, , default: vim-width
Explorer position for floating window, positions:
left-center
center
right-center
center-top
<number for left>,<number for top>
default: center
Width of Explorer window when position is floating, use negative value or zero to as width - value
, default: 0
Height of Explorer window when position is floating, use negative value or zero to as height - value
, default: 0
Width of content when position is floating, use negative value or zero to as width - value
, default: 0
Template for root node of buffer source
Columns:
- icon
- hidden
- title
default: [icon] [title] [hidden & 1]
Template for child node of buffer source
Columns:
- selection
- name
- bufname
- modified
- bufnr
- readonly
- fullpath
- relativePath
default: [selection | 1] [bufnr] [name][modified][readonly] [fullpath]
Labeling template for child node of buffer source, use for preview when previewAction is labeling
Columns: same with --buffer-child-template
default: [name][bufname][fullpath][modified][readonly]
Template for root node of file source
Columns:
- icon
- hidden
- title
- root
- fullpath
default: [icon] [title] [hidden & 1][root] [fullpath]
Labeling template for root node of file source, use for preview when previewAction is labeling
Columns: same with --file-root-template
default: [fullpath]
Template for child node file source
Columns:
- git
- selection
- icon
- filename
- linkIcon
- link
- fullpath
- indent
- clip
- size
- readonly
- modified
- timeModified
- timeCreated
- timeAccessed
- diagnosticError
- diagnosticWarning
default: [git | 2] [selection | clip | 1] [indent][icon | 1] [diagnosticError & 1][filename omitCenter 1][modified][readonly] [linkIcon & 1][link growRight 1 omitCenter 5][size]
Labeling template for child node of file source, use for preview when previewAction is labeling
Columns: same with --file-child-template
default: [fullpath][link][diagnosticWarning][diagnosticError][size][timeAccessed][timeModified][timeCreated][readonly][modified]
Template for root node of bookmark source
Columns:
- icon
- hidden
- title
default: [icon] [title] [hidden & 1]
Template for child node of bookmark source
Columns:
- selection
- position
- filename
- fullpath
- line
- annotation
default: [selection | 1] [filename] [position]
Labeling template for child node of bookmark source, use for preview when previewAction is labeling
Columns: same with --bookmark-child-template
default: [filename][fullpath][position][line][annotation]
Explorer will expand to this filepath, default: current buffer
Explorer will automatically reveal to the current buffer when open explorer, default: "explorer.file.reveal.whenOpen"
Example:
[git | 2] [selection | clip | 1] [diagnosticError & 1][filename growRight 1 omitCenter 5]
[git]
- Display
git
.
- Display
[git | 2]
- If
git
is not empty, displaygit
, otherwise display2 spaces
.
- If
[selection | clip | 1]
- Checking
selection
andclip
in turn, if one is not empty, display it, otherwise display1 spaces
.
- Checking
[diagnosticError & 1]
- If
diagnosticError
is empty, display nothing. otherwise displaydiagnosticError
and1 space
.
- If
[filename growRight 1 omitCenter 5]
- Flexible to display
filename
, grow right column volume is 1, omit center volume is 5
- Flexible to display
Grammar:
block
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
โโโโโโโโโโดโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโ
[selection | clip | 1] [filename growRight 1 omitCenter 5]
โ
plain string
column
โโโโโโโโโโโดโโโโโโโโโโโโ
โ โ volume of modifier
โ โโโโโโฌโโโโโโโโโโโโโโโโโโดโโโโโฌโโโโโโโโโโโโโ
โโโโโดโโโโ โโโดโ โ โโโโดโโโโ โ โ
[selection | clip | 1] [filename growRight 1 omitCenter 5]
โ โ โโโโโฌโโโโ โโโโโโฌโโโโ
โโโโโโโโดโโโโโโโโโโโโฌโโโโโโโดโโโโโโโโโโโโโ
modifier
You can use ?
to view all actions of current source
// coc-settings.json
{
"explorer.keyMappings.global": {
"i": false, // cancel default mapkey
"<c-o>": "noop",
"*": "toggleSelection",
"<tab>": "actionMenu",
"gk": ["wait", "expandablePrev"],
"gj": ["wait", "expandableNext"],
"h": ["wait", "collapse"],
"l": ["wait", "expandable?", "expand", "open"],
"J": ["wait", "toggleSelection", "normal:j"],
"K": ["wait", "toggleSelection", "normal:k"],
"gl": ["wait", "expand:recursive"],
"gh": ["wait", "collapse:recursive"],
"<2-LeftMouse>": [
"expandable?",
["expanded?", "collapse", "expand"],
"open",
],
"o": ["wait", "expanded?", "collapse", "expand"],
"<cr>": ["wait", "expandable?", "cd", "open"],
"e": "open",
"s": "open:split",
"E": "open:vsplit",
"t": "open:tab",
"<bs>": ["wait", "gotoParent"],
"gs": ["wait", "reveal:select"],
"il": "preview:labeling",
"ic": "preview:content",
"Il": "previewOnHover:toggle:labeling",
"Ic": "previewOnHover:toggle:content",
"II": "previewOnHover:disable",
"yp": "copyFilepath",
"yn": "copyFilename",
"yy": "copyFile",
"dd": "cutFile",
"p": "pasteFile",
"df": "delete",
"dF": "deleteForever",
"a": "addFile",
"A": "addDirectory",
"r": "rename",
"zh": "toggleHidden",
"g<dot>": "toggleHidden",
"R": "refresh",
"?": "help",
"q": "quit",
"<esc>": "esc",
"X": "systemExecute",
"gd": "listDrive",
"f": "search",
"F": "searchRecursive",
"gf": "gotoSource:file",
"gb": "gotoSource:buffer",
"[[": ["wait", "sourcePrev"],
"]]": ["wait", "sourceNext"],
"[i": ["wait", "indentPrev"],
"]i": ["wait", "indentNext"],
"[m": ["wait", "markPrev:modified"],
"]m": ["wait", "markNext:modified"],
"[d": ["wait", "markPrev:diagnosticError:diagnosticWarning"],
"]d": ["wait", "markNext:diagnosticError:diagnosticWarning"],
"[D": ["wait", "markPrev:diagnosticError"],
"]D": ["wait", "markNext:diagnosticError"],
"[c": ["wait", "markPrev:git"],
"]c": ["wait", "markNext:git"],
"<<": "gitStage",
">>": "gitUnstage",
},
}
- https://github.com/weirongxu/coc-explorer/wiki/FAQ
- https://github.com/weirongxu/coc-explorer/issues?q=is%3Aissue+sort%3Aupdated-desc+label%3Aquestion
function! s:explorer_cur_dir()
let node_info = CocAction('runCommand', 'explorer.getNodeInfo', 0)
return fnamemodify(node_info['fullpath'], ':h')
endfunction
function! s:exec_cur_dir(cmd)
let dir = s:explorer_cur_dir()
execute 'cd ' . dir
execute a:cmd
endfunction
function! s:init_explorer()
set winblend=10
" Integration with other plugins
" CocList
nmap <buffer> <Leader>fg <Cmd>call <SID>exec_cur_dir('CocList -I grep')<CR>
nmap <buffer> <Leader>fG <Cmd>call <SID>exec_cur_dir('CocList -I grep -regex')<CR>
nmap <buffer> <C-p> <Cmd>call <SID>exec_cur_dir('CocList files')<CR>
" vim-floaterm
nmap <buffer> <Leader>ft <Cmd>call <SID>exec_cur_dir('FloatermNew --wintype=floating')<CR>
endfunction
function! s:enter_explorer()
if &filetype == 'coc-explorer'
" statusline
setl statusline=coc-explorer
endif
endfunction
augroup CocExplorerCustom
autocmd!
autocmd BufEnter * call <SID>enter_explorer()
autocmd FileType coc-explorer call <SID>init_explorer()
augroup END
more API: https://github.com/weirongxu/coc-explorer/wiki/Vim-API
explorer
: Open explorer.Definitions
Explorer1
: Explorer1.
Type: {
/**
* Explorer source name
*/
name: 'bookmark' | 'buffer' | 'file';
/**
* Whether to expand it by default
*/
expand: boolean;
[k: string]: unknown | undefined;
}[]
Position
: Position.
Type: 'left' | 'right' | 'tab' | 'floating'
MappingActionExp
: MappingActionExp.
Type: MappingAction | MappingActionExp[]
MappingAction
: MappingAction.
Type: string | {
name?: string;
args?: string[];
[k: string]: unknown | undefined;
}
PreviewActionStrategy
: PreviewActionStrategy.
Type: 'labeling' | 'content'
RootStrategy
: RootStrategy.
Type: 'keep' | 'workspace' | 'cwd' | 'sourceBuffer' | 'reveal'
explorer.presets
: Explorer presets.
Type: {
[k: string]: {
'root-uri'?: string;
/**
* Close the explorer if it exists
*/
toggle?: boolean;
/**
* Focus to explorer when opened
*/
focus?: boolean;
/**
* Strategy for open action
*/
'open-action-strategy'?: 'select' | 'split' | 'split.plain' | 'split.intelligent' | 'vsplit' | 'vsplit.plain' | 'vsplit.intelligent' | 'tab' | 'drop.select' | 'drop.tab' | 'previousBuffer' | 'previousWindow' | 'sourceWindow';
/**
* quit explorer when open action
*/
'quit-on-open'?: boolean;
reveal?: string;
sources?: Explorer1;
/**
* Explorer position
*/
position?: Position | [
Position
] | [
Position,
string
];
/**
* Width of explorer window for open in left or right side
*/
width?: number;
/**
* Content width, use negative value or zero to as `width - value`
*/
'content-width'?: number;
/**
* Type of content width
*/
'content-width-type'?: 'win-width' | 'vim-width';
/**
* Position of Explorer for floating window
*/
'floating-position'?: ('left-center' | 'right-center' | 'center' | 'center-top') | [
number,
number
];
/**
* Width of explorer window when position is floating, use negative value or zero to as `width - value`
*/
'floating-width'?: number;
/**
* Height of explorer window when position is floating, use negative value or zero to as `height - value`
*/
'floating-height'?: number;
/**
* Width of content when position is floating, use negative value or zero to as `width - value`
*/
'floating-content-width'?: number;
/**
* Template for root node of buffer source
*/
'buffer-root-template'?: string;
/**
* Template for child node of buffer source
*/
'buffer-child-template'?: string;
/**
* Labeling template for child node of buffer source, use for preview when previewAction is labeling
*/
'buffer-child-labeling-template'?: string;
/**
* Template for root node of file source
*/
'file-root-template'?: string;
/**
* Labeling template for root node of file source, use for preview when previewAction is labeling
*/
'file-root-labeling-template'?: string;
/**
* Template for child node file source
*/
'file-child-template'?: string;
/**
* Labeling template for child node of file source, use for preview when previewAction is labeling
*/
'file-child-labeling-template'?: string;
[k: string]: unknown | undefined;
} | undefined;
}
Default: null
explorer.mouseMode
: Mouse mode.
Type: 'none' | 'singleclick' | 'doubleclick'
"doubleclick"
explorer.keyMappingMode
: Keymapping mode.
Type: 'none' | 'default'
"default"
explorer.keyMappings.global
: .
Type: Mapping
{}
explorer.keyMappings.vmap
: .
Type: Mapping1
{}
explorer.keyMappings.sources
: Custom key mappings in source.
Type: {
[k: string]: Mapping2 | undefined;
}
Default: {}
explorer.toggle
: Close the explorer if it exists.
Type: boolean
true
explorer.focus
: Focus to explorer when opened.
Type: boolean
true
explorer.position
: Explorer position.
Type: Position | [
Position
] | [
Position,
string
]
Default: "left"
explorer.width
: Width of explorer window for open in left or right side.
Type: number
40
explorer.contentWidth
: Content width, use negative value or zero to as `width - value`.
Type: number
0
explorer.contentWidthType
: Type of content width.
Type: 'win-width' | 'vim-width'
"vim-width"
explorer.floating.position
: Position of Explorer for floating window.
Type: ('left-center' | 'right-center' | 'center' | 'center-top') | [
number,
number
]
Default: "center"
explorer.floating.width
: Width of explorer window when position is floating, use negative value or zero to as `width - value`.
Type: number
-10
explorer.floating.height
: Height of explorer window when position is floating, use negative value or zero to as `height - value`.
Type: number
-10
explorer.floating.contentWidth
: Width of content when position is floating, use negative value or zero to as `width - value`.
Type: number
0
explorer.floating.border.enable
: .
Type: boolean
true
explorer.floating.border.chars
: Border chars for floating window, their order is top/right/bottom/left/topleft/topright/botright/botleft.
Type: string[]
[
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ",
"โ"
]
explorer.floating.border.title
: .
Type: string
"coc-explorer"
explorer.floating.hideOnCocList
: Hide floating window, when opening CocList.
Type: boolean
true
explorer.autoExpandMaxDepth
: Automatically expand maximum depth of one time.
Type: number
20
explorer.autoExpandOptions
: Automatically expand options.
Type: ('recursive' | 'compact' | 'uncompact' | 'recursiveSingle')[]
[
"compact",
"uncompact"
]
explorer.autoCollapseOptions
: Automatically collapse options.
Type: 'recursive'[]
[
"recursive"
]
explorer.quitOnOpen
: quit explorer when open action.
Type: boolean
false
explorer.previewAction.onHover
: Open preview when hovering over on node.
Type: false | PreviewActionStrategy | [
PreviewActionStrategy,
number
]
Default: false
explorer.previewAction.content.maxHeight
: Preview content maximum height.
Type: number
30
explorer.openAction.strategy
: Strategy for open action.
Type: 'select' | 'split' | 'split.plain' | 'split.intelligent' | 'vsplit' | 'vsplit.plain' | 'vsplit.intelligent' | 'tab' | 'drop.select' | 'drop.tab' | 'previousBuffer' | 'previousWindow' | 'sourceWindow'
"select"
explorer.openAction.select.filter
: Filter windows for select strategy.
Type: BufferFilter & {
/**
* Filter windows for select strategy in source
*/
sources?: {
[k: string]: BufferFilter;
};
[k: string]: unknown | undefined;
}
Default: {
"buftypes": [
"terminal"
],
"filetypes": [
"vista",
"vista_kind",
"qf",
"tagbar",
"coctree"
],
"floatingWindows": true,
"sources": {
"buffer": {
"buftypes": []
}
}
}
explorer.openAction.select.chars
: Chars for select strategy.
Type: string
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
explorer.openAction.for.directory
: The action when you open a directory of file source.
Type: MappingAction | MappingActionExp[]
"cd"
explorer.openAction.relativePath
: Use relative path when open a file with openAction.
Type: boolean
false
explorer.expandStores
: The expand stores of sources.
Type: boolean | {
includes: string[];
} | {
excludes: string[];
}
Default: true
explorer.sources
: .
Type: Explorer1
[
{
"name": "bookmark",
"expand": false
},
{
"name": "buffer",
"expand": false
},
{
"name": "file",
"expand": true
}
]
explorer.root.strategies
: Strategies for root uri.
Type: (RootStrategy | string)[]
[
"workspace",
"cwd",
"sourceBuffer",
"reveal"
]
explorer.root.customRules
: Patterns for root uri.
Type: {
[k: string]: {
patterns: string[];
/**
* Search outward from the current buffer, default is false
*/
bottomUp?: boolean;
[k: string]: unknown | undefined;
} | undefined;
}
Default: null
explorer.enableFloatinput
: Enable integrated with coc-floatinput.
Type: boolean
true
explorer.icon.enableNerdfont
: Enable nerdfont.
Type: boolean
false
explorer.icon.source
: The source or file type icon and color.
Type: 'builtin' | 'vim-devicons' | 'nvim-web-devicons' | 'nerdfont.vim'
"builtin"
explorer.icon.customIcons
: Custom icons and color highlights.
Type: {
/**
* Icons for extension groups
*/
icons?: {
/**
* Icon for an extension group
*/
[k: string]: {
/**
* Group icon
*/
code: string;
/**
* Group icon color
*/
color: string;
[k: string]: unknown | undefined;
} | undefined;
};
/**
* File extension to icon group
*/
extensions?: {
[k: string]: unknown | undefined;
};
/**
* Filename to icon group
*/
filenames?: {
[k: string]: unknown | undefined;
};
/**
* Filename to icon group
*/
dirnames?: {
[k: string]: unknown | undefined;
};
/**
* Pattern to icon group
*/
patternMatches?: {
[k: string]: unknown | undefined;
};
/**
* Pattern to icon group
*/
dirPatternMatches?: {
[k: string]: unknown | undefined;
};
[k: string]: unknown | undefined;
}
Default: {
"icons": {},
"extensions": {},
"filenames": {},
"dirnames": {},
"patternMatches": {},
"dirPatternMatches": {}
}
explorer.icon.expanded
: Icon for expanded node.
Type: string
"-"
explorer.icon.collapsed
: Icon for collapsed node.
Type: string
"+"
explorer.icon.selected
: Selection selected chars for File source.
Type: string
"โ"
explorer.icon.hidden
: Icon for hidden status.
Type: string
"โฅ"
explorer.icon.link
: Icon for soft link.
Type: string
"โ"
explorer.icon.readonly
: Icon for readonly.
Type: string
"RO"
explorer.bookmark.root.template
: Template for root node of bookmark source.
Type: string
"[icon] [title] [hidden & 1]"
explorer.bookmark.child.template
: Template for child node of bookmark source.
Type: string
"[selection | 1] [filename] [position] - [annotation]"
explorer.bookmark.child.labelingTemplate
: Labeling template for child node of bookmark source, use for preview when previewAction is labeling.
Type: string
"[filename][fullpath][position][line][annotation]"
explorer.buffer.showHiddenBuffers
: Default show hidden buffers.
Type: boolean
false
explorer.buffer.tabOnly
: Default only show buffers in current tab.
Type: boolean
false
explorer.buffer.root.template
: Template for root node of buffer source.
Type: string
"[icon] [title] [hidden & 1]"
explorer.buffer.child.template
: Template for child node of buffer source.
Type: string
"[git | 2] [selection | 1] [bufnr] [name][modified][readonly] [relativePath]"
explorer.buffer.child.labelingTemplate
: Labeling template for child node of buffer source, use for preview when previewAction is labeling.
Type: string
"[name][bufname][fullpath][modified][readonly][diagnosticError][diagnosticWarning][git]"
explorer.datetime.format
: Explorer datetime format, check out https://date-fns.org/v2.9.0/docs/format.
Type: string
"yy/MM/dd HH:mm:ss"
explorer.file.reveal.whenOpen
: Explorer will automatically reveal to the current buffer when open explorer.
Type: boolean
true
explorer.file.reveal.auto
: Explorer will automatically reveal to the current buffer when enter a buffer.
Type: boolean
false
explorer.file.reveal.filter
: Exlorer will not automatically reveal to these buffers.
Type: {
/**
* Filter buffer by RegExp
*/
patterns?: string[];
/**
* Filter buffer by literal string
*/
literals?: string[];
[k: string]: unknown | undefined;
}
Default: {}
explorer.file.hiddenRules
: Custom hidden rules for file.
Type: {
extensions?: string[];
filenames?: string[];
/**
* Pattern to icon group
*/
patternMatches?: unknown[];
[k: string]: unknown | undefined;
}
Default: {
"extensions": [
"o",
"a",
"obj",
"pyc"
],
"filenames": [],
"patternMatches": [
"^\\."
]
}
explorer.file.showHiddenFiles
: Default show hidden files.
Type: boolean
false
explorer.file.root.template
: Template for root node of file source.
Type: string
"[icon] [title] [git & 1][hidden & 1][root] [fullpath]"
explorer.file.root.labelingTemplate
: Labeling template for root node of file source, use for preview when previewAction is labeling.
Type: string
"[fullpath][git]"
explorer.file.child.template
: Template for child node file source.
Type: string
"[git | 2] [selection | clip | 1] [indent][icon | 1] [diagnosticError & 1][filename omitCenter 1][modified][readonly] [linkIcon & 1][link growRight 1 omitCenter 5][size]"
explorer.file.child.labelingTemplate
: Labeling template for child node of file source, use for preview when previewAction is labeling.
Type: string
"[fullpath][link][diagnosticError][diagnosticWarning][git][size][timeAccessed][timeModified][timeCreated][readonly][modified]"
explorer.file.column.link.copy
: Whether the file has been copied.
Type: string
null
explorer.file.column.clip.copy
: Whether the file has been copied.
Type: string
null
explorer.file.column.clip.cut
: Whether the file has been cut.
Type: string
null
explorer.file.column.indent.chars
: Indent chars for file source.
Type: string
" "
explorer.file.column.indent.indentLine
: Whether to display the alignment line.
Type: boolean
null
explorer.file.cdCommand
: Change directory when performing the cd action.
Type: false | 'cd' | 'tcd'
false
explorer.filename.colored.enable
: Enable colored filenames based on status.
Type: boolean | {
diagnosticError?: boolean;
diagnosticWarning?: boolean;
git?: boolean;
[k: string]: unknown | undefined;
}
Default: true
explorer.file.git.showUntrackedFiles
: Show untracked file in git.
Type: boolean | 'system'
null
explorer.trash.command
: Trash command template, arguments(%s source filepath, %l source filepath list), example: 'trash-put %l', 'mv --backup=t %l ~/.trash/'.
Type: ('nodejs:module' | 'trash-put %s') | string
"nodejs:module"
explorer.diagnostic.displayMax
: Maximum count of diagnostic column.
Type: number
99
explorer.diagnostic.enableSubscriptNumber
: Subscript number for diagnostic count.
Type: boolean
false
explorer.git.enable
: Enable git.
Type: boolean
true
explorer.git.command
: Git command.
Type: string
"git"
explorer.git.icon.rootStatus.stashed
: Icon for a stash exists for the local repository.
Type: string
"$"
explorer.git.icon.rootStatus.ahead
: Icon for current branch ahead of upstream.
Type: string
"โก"
explorer.git.icon.rootStatus.behind
: Icon for current branch behind upstream.
Type: string
"โฃ"
explorer.git.icon.rootStatus.conflicted
: Icon for current branch has merge conflicts.
Type: string
"="
explorer.git.icon.rootStatus.untracked
: Icon for there are untracked files in the working directory.
Type: string
"?"
explorer.git.icon.rootStatus.modified
: Icon for there are file modifications in the working directory.
Type: string
"~"
explorer.git.icon.rootStatus.added
: Icon for a new file has been added to the staging area.
Type: string
"+"
explorer.git.icon.rootStatus.renamed
: Icon for a renamed file has been added to the staging area.
Type: string
"โ"
explorer.git.icon.rootStatus.deleted
: Icon for a file's deletion has been added to the staging area.
Type: string
"โ"
explorer.git.icon.status.mixed
: Icon for git mixed status.
Type: string
"*"
explorer.git.icon.status.unmodified
: Icon for git unmodified status.
Type: string
" "
explorer.git.icon.status.modified
: Icon for git modified status.
Type: string
"M"
explorer.git.icon.status.added
: Icon for git added status.
Type: string
"A"
explorer.git.icon.status.deleted
: Icon for git removed status.
Type: string
"D"
explorer.git.icon.status.renamed
: Icon for git renamed status.
Type: string
"R"
explorer.git.icon.status.copied
: Icon for git copied status.
Type: string
"C"
explorer.git.icon.status.unmerged
: Icon for git unmerged status.
Type: string
"U"
explorer.git.icon.status.untracked
: Icon for git untracked status.
Type: string
"?"
explorer.git.icon.status.ignored
: Icon for git ignored status.
Type: string
"!"
explorer.git.showIgnored
: Show ignored files in git.
Type: boolean
true
explorer.debug
: Enable debug.
Type: boolean
false
- VSCode Explorer
- Shougo/vimfiler.vim
- Shougo/defx.nvim
- lambdalisue/fern.vim
coc-explorer's People
Forkers
lucianoratamero rcarriga codecopy hoangnghiem itsmaheshkariya yobakashi goldfishpi danilamihailov junyang-tes hdspray gopherj yanlinsun ytian81 zhuzhengyi ahmedshuhel mu-l chau-bao-long timhwang21 zxm66 common-forks motephyr maxgrossman vim-geek vladpetryshyn ogranada awscloudlab wongjiahau jacobmischka unrealapex alwc gjveld statiolake nihhinnihhin abigbright connordeckers zarekvane fjrti nimaps shaneutt wsdjeg gg-big-org nhuzaa nogahighland ryeballar voldikss ic-768coc-explorer's Issues
align of buffer number
it's better to have?:
1
2
8
10
11
[question] open with current buffer path as root
I'm trying to open the explorer with the current buffer as root path.
I first tried the NerdTree wat with no luck on %
:
nnoremap ,, :CocCommand explorer --toggle --sources=buffer+,file+ --file-columns=git,selection,clip,indent,filename %<CR>
Now trying this, also with no luck:
function! ExploreCurrentBufferHead()
return ':CocCommand explorer --sources=buffer+,file+ --file-columns=git,selection,clip,indent,filename ' . expand('%:h')
endfunction
nnoremap <expr> ,, ExploreCurrentBufferHead() <CR>
Could you help me please?
When icons enabled, webpack.config.js file breaks loyout.
[Fearure Request]: prompt input new name if paste file already exists.
No highlight for single file
I dont why highlight dosen
t work for single file (only single file can`t be highlighted)
[Feature Request]: Toggles to show only buffers for this tab or not
When I was thinking about the difference between tab and buffer, I saw this question on stackoverflow: Why do Vim experts prefer buffers over tabs?
Someone said
"Vim experts" don't prefer buffers over tabs: they use buffers as the file proxies they are and tab pages as the workspaces they are
I love this idea. Because of this, I really need a feature that manages buffers of different tabs separately. So far, I only found that bufexplorer can do this.
I really appreciate this extension, could you add a feature like this?
[Feature]: Use partial render in source
When trying to add a file to a folder, `fsMkdir` breaks with EEXIST error
Maximum call stack size exceeded when too many files in directory
When too many files in directory, I means, 21k files in same directiry
so I think there must has a recursive call to list file?
[Feature Request]: option to filter float windows when select window
floating window does not have statusline to mark a label, and I have to make a choice when i have a normal window and a floating window open at the same time.
[Bug]: Vim open action will blinking
Cannot open folder that contain broken symlink file
expected:
showing as highlighted item
actual:
ENOENT: no such file or directory
Development documentation
Hi, this plugin is interesting to me and I want to work on it.
Is there any documentation I can use for local development?
[Feature]: search current directory via coc-list
Focus
Is there any way to focus the explorer window if it's already open ?
Thanks
Using `l` or `enter` key on file opens select window UI
Hello! Thank you for such an awesome plugin! โค๏ธ
When using l
or Enter
key on directory everything works fine, folder opens as intented.
But when I try to open a file with l
or Enter
it shows the select window UI. Here's the screenshot:
How can I figure out what breaks the default l
and Enter
in coc-explorer
buffer? Thanks!
Can it work with FZF?
FZF is a very popular utility.
Follow is a file manager with fzf. I's so good.
https://github.com/mananapr/cfiles
[Feature]: root paths list for coc-explorer
[Feature]: SSH support
How to show hidden file
hidden file such as .vim folder or .bash_profile
Random characters in explorer
[Feature]: Unified asynchronous event to avoid over-render
coc-explorer/src/source/sources/buffer/buffer-source.ts
Lines 60 to 73 in f72e2d3
coc-explorer/src/source/sources/file/file-source.ts
Lines 99 to 155 in f72e2d3
[Feature Request] execute support
Would be nice a feature to execute the system default application for file or directory, something like nerdtree-execute does.
[Feature]: LSP file rename
Match the colorscheme
OpenInVSplit opens to the right of explorer if explorer position is right
When opening a file into a VSplit with E the split will end up to the right, with the explorer in the middle if the explorer position is to the right.
[Feature/request]: open in float window for neovim
[Feature Request] Remove padding after filename column
There is a large amount of white space added after the filename. I'm assuming it's there for a reason but it would be great to be able to turn it off so that columns can be added after the filename. I had a look but couldn't figure out where it is coming from.
This is an example what I'd like to have:
I have a very hacky fix here if more clarification is needed:
[Feature]: Git sources
[Feature]: Display node attribute by floating preview
New format for command and coc-settings.json
--file-columns=git:selection:clip:diagnosticError:indent:icon:filename;fullpath;size;modified;readonly
{
"columns": [
"git",
"selection",
"clip",
"diagnosticError",
"indent",
"icon",
"filename",
["fullpath"],
["size"],
["modified"],
["readonly"],
]
}
Icons not working
Icons are not showing up since the last update. I even tried to install the full nerd fonts package with no luck.
[Doc]: custom mappings documentation, review configuration keywords
Set setting in .vimrc rather than coc-settings.json file
I have vim
and coc
settings, very nicely split up by multiple files per extension. I don't really like an idea of keeping everything in a one file, which I cannot even move into a directory I like.
I would prefer a possibility to write settings, which are currently in coc-settings.json
, right in .vimrc
, so I can break it up as I like.
If that is not currently possible, can I propose a feature request? Thanks.
debug log
[Feature request]: option to close explorer after opening file
In Nerd_tree you can configure it to toggle it after opening a file.
https://github.com/scrooloose/nerdtree/blob/master/doc/NERDTree.txt#L993
Error opening explorer if "explorer.toggle" set to false and explorer already opened
If the explorer is already open doing a ":CocCommand explorer" gives the following error:
[coc.nvim] Error: request error nvim_eval - Vim:E121: Undefined variable: object
Previous versions simply switched back to the explorer window again.
NVIM v0.4.2
coc-explorer 0.1.1
[Bug] Arg parsing error when there is only one argument
When I run something like :CocCommand explorer --toggle
, the --toggle
option is parsed into a directory rather than an option.
The solution is simple though. Removing the unnecessary if statement below should help.
coc-explorer/src/parse-args.ts
Line 66 in 22d0c1a
keyMappings and the control key
When mapping a key using keyMappings, is it possible to use the Control key?
Example coc-settings.json:
{
...
"explorer.keyMappings": {
"<ctrl v>": "toggleSelection"
},
...
}
Thanks!
[Feature Request]: vim-webdevicons support
vim-webdevicons allow to subscribe default icons with customized. So coc-explorer can get these custom icons by filetype and use instead of nerdfont directely.
[Feature]: Exrename
[Bug]: Explorer dies when buffer is deleted or coc is restarted
'Rename' action throws an error when the target file already exists
Hi @weirongxu
Description
Suppose there are two files a.txt
and b.txt
in one directory and I want to rename a.txt
to b.txt
. After executing rename
action the extension throws an error
[coc.nvim] Error: Target file or directory /home/voldikss/dotfiles/README.md already exists
Expected
- If the target file already exist
- If the target file is the source file itself(e.g. rename
a.txt
toa.txt
), do nothing - Otherwise show a prompt with an option such as
override?
and ...
- If the target file is the source file itself(e.g. rename
Error installing on Ubuntu 19.10
Firstly this is such an amazing plugin ๐ thanks for building it ๐
I've tried it on a macbook and it installs and works fine without any issues, but I tried installing it on a laptop using ubuntu 19.10 and I'm getting errors trying to install it.
## versions
vim version: NVIM v0.5.0-dev
node version: v12.13.0
coc.nvim version: 0.0.74
term: tmux-256color
platform: linux
[coc.nvim] Installed extension: coc-explorer
[coc.nvim] Error on load extension coc-explorer from /home/username/.config/coc/extensions/node_modules/coc-explorer/lib/index.js: Error: Cannot find module 'trash'
Require stack:
- /home/username/.config/coc/extensions/node_modules/coc-explorer/lib/index.js
- /home/username/.config/coc/extensions/node_modules/coc-explorer/lib/index.js
I went into the coc-explorer
directory to try and see what happens if I add the trash
module manually and I get
Insufficient number of arguments or no entry found.
Alternatively, run 'webpack(-cli) --help' for usage info.
Hash: 9cd1ba0f17437bf8135b
Version: webpack 4.41.2
Time: 24ms
Built at: 11/02/2019 10:52:26
ERROR in Entry module not found: Error: Can't resolve './src' in '/home/username/.config/coc/extensions/node_modules/coc-explorer'
Not sure if this is the real underlying error or just a different thing. I've tried debugging this myself but I'm not very familiar with how coc extensions work, I'd appreciate any help
[Feature Request] Separate file and folder actions for <cr>
In at least some other tree plugins (ones that have apparently formed a strong muscle memory for me ๐), hitting cr
on a file opens it, and hitting cr
on a folder will expand or collapse it. It would be nice if coc-explorer had an option to enable that behavior; maybe separate file and folder actions for cr
, or an option to change what "open" does by default with folders.
Alignment issue with git icons
Hi,
I have a weird alignment issue when files have a git status different than "nothing":
This is the same with or without nerdfonts enabled.
My config:
"explorer.quitOnOpen": true,
"explorer.file.autoReveal": true,
"explorer.icon.enableNerdfont": true,
"explorer.file.column.indent.topLevel": false,
I tried to set the unmodified icon to a single space to force alignment but it didn't change anything.
Latest neovim on ubuntu 19.10 and kitty
Screenshot
coc-explorer leaves a explorer buffer when 'quitOnOpen' is set
- coc-settings.json:
{
"explorer.sources": [
{
"name": "buffer",
"expand": false
},
{
"name": "file",
"expand": true
}
],
"explorer.quitOnOpen": true, /////////////
"explorer.keyMappings": {
"<space>": "toggleSelection"
},
"explorer.icon.enableNerdfont": false
}
- mini.vim: same as
coc-explorer/mini_vimrc/mini.vim
Steps to reproduce
ge
to open explorer- open a file
:q<CR>
. And then nvim will show an error message "No write since last change for buffer [coc-explorer]..." and redirect me to a buffer which contains the following stuff.
<113|+|113> <112|[BUFFER]|112>
<104|-|104> <102|[FILE]:|102> <103|coc-explorer|103> <105|/home/voldikss/code/coc-explorer|105>
<9|+|9> <9|autoload/|9><10| |10> <95| 4.1 kB|95> <97|19/11/01 16:58:16|97>
<9|+|9> <9|lib/|9><10| |10> <95| 4.1 kB|95> <97|19/11/01 17:07:37|97>
<7|M|7> <9|+|9> <9|mini_vimrc/|9><10| |10> <95| 4.1 kB|95> <97|19/11/01 23:21:47|97>
<9|+|9> <9|node_modules/|9><10| |10> <95| 20.5 kB|95> <97|19/11/01 17:07:37|97>
<9|+|9> <9|scripts/|9><10| |10> <95| 4.1 kB|95> <97|19/11/01 16:58:16|97>
<9|+|9> <9|src/|9><10| |10> <95| 4.1 kB|95> <97|19/11/01 16:58:16|97>
jest.config.js<10| |10> <95| 70 B|95> <97|19/11/01 16:58:16|97>
LICENSE<10| |10> <95| 1.07 kB|95> <97|19/11/01 16:58:16|97>
memos.json<10| |10> <95| 2 B|95> <97|19/11/01 23:17:23|97>
package.json<10| |10> <95| 11 kB|95> <97|19/11/01 16:58:16|97>
readme.md<10| |10> <95| 8.33 kB|95> <97|19/11/01 16:58:16|97>
tsconfig.json<10| |10> <95| 307 B|95> <97|19/11/01 16:58:16|97>
tsconfig.prod.json<10| |10> <95| 78 B|95> <97|19/11/01 16:58:16|97>
tslint.json<10| |10> <95| 344 B|95> <97|19/11/01 16:58:16|97>
webpack.config.js<10| |10> <95| 733 B|95> <97|19/11/01 16:58:16|97>
yarn.lock<10| |10> <95| 233 kB|95> <97|19/11/01 16:58:16|97>
Does coc-explorer support workspace?
hello, does coc-explorer support show a list of workspace that current opened?
[Feature Request] Open in split
Would be nice if there was a way to open in a normal "horizontal" split.
[Feature Request]: VCS Support
Would be nice to support VCS other than Git. I also use Subversion and Mercurial ๐
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.