/defx-icons

Filetype icons for https://github.com/Shougo/defx.nvim

Primary LanguageVim scriptMIT LicenseMIT

Defx icons

Custom implementation of vim-devicons for defx.nvim.

screenshot from 2018-11-22 23-39-41

Usage

:Defx -columns=icons:indent:filename:type

This 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 = 1
let g:defx_icons_directory_icon = ''
let g:defx_icons_mark_icon = '*'
let g:defx_icons_copy_icon = ''
let g:defx_icons_link_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 DefxIconsLinkIcon 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 Directory

For 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=#FF0000

Or link it to something else that you want:

hi link DefxIconsOpenedTreeIcon Error

Thanks to