Ⅰ. 插件描述
Filetype icons for https://github.com/Shougo/defx.nvimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'kristijanhusak/defx-icons'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'kristijanhusak/defx-icons'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'kristijanhusak/defx-icons'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/kristijanhusak/defx-icons
Ⅳ. 文档说明
# Defx icons
Custom implementation of vim-devicons for defx.nvim.

Usage
:Defx -columns=icons:indent:filename:typeThis column is a replacement for mark column. It will properly highlight selected files.
Configuration
This is the default configuration:
let g:defx_icons_enable_syntax_highlight = 1
let g:defx_icons_column_length = 2
let g:defx_icons_directory_icon = ''
let g:defx_icons_mark_icon = '*'
let g:defx_icons_copy_icon = ''
let g:defx_icons_move_icon = ''
let g:defx_icons_parent_icon = ''
let g:defx_icons_default_icon = ''
let g:defx_icons_directory_symlink_icon = ''
" Options below are applicable only when using "tree" feature
let g:defx_icons_root_opened_tree_icon = ''
let g:defx_icons_nested_opened_tree_icon = ''
let g:defx_icons_nested_closed_tree_icon = ''Note: Syntax highlighting can cause some performance issues in defx window. Just disable it with the let g:defx_icons_enable_syntax_highlight = 0
Override colors
If you want to override some of the colors, you can do it this way:
For gui:
let g:defx_icons_gui_colors = {
\ 'red': 'FFFFFF'
\ }For term:
let g:defx_icons_term_colors = {
\ 'red': 2
\ }For directory icons these highlight groups are defined:
hi default link DefxIconsMarkIcon Statement
hi default link DefxIconsCopyIcon WarningMsg
hi default link DefxIconsMoveIcon ErrorMsg
hi default link DefxIconsDirectory Directory
hi default link DefxIconsParentDirectory Directory
hi default link DefxIconsSymlinkDirectory Directory
hi default link DefxIconsOpenedTreeIcon Directory
hi default link DefxIconsNestedTreeIcon Directory
hi default link DefxIconsClosedTreeIcon DirectoryFor example, to change color of the directory icon when it's opened in tree to red color, you would do something like this:
hi DefxIconsOpenedTreeIcon guifg=#FF0000Or link it to something else that you want:
hi link DefxIconsOpenedTreeIcon ErrorThanks to
- vim-devicons for icons
- vim-nerdtree-syntax-highlight for colors