Skip to content

Getting Startify to work with nvim-web-devicons #175

Answered by D00mch
Rizhiy asked this question in Q&A
Discussion options

You must be logged in to vote

There is an answer on reddit:

Web Devicons wrapper in lua:

function _G.webDevIcons(path)
  local filename = vim.fn.fnamemodify(path, ':t')
  local extension = vim.fn.fnamemodify(path, ':e')
  return require'nvim-web-devicons'.get_icon(filename, extension, { default = true })
end

This is the vim function for startify

function! StartifyEntryFormat() abort
  return 'v:lua.webDevIcons(absolute_path) . " " . entry_path'
endfunction

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Rizhiy
Comment options

@alex-courtis
Comment options

@D00mch
Comment options

@D00mch
Comment options

@alex-courtis
Comment options

Answer selected by gegoune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #154 on November 19, 2022 01:10.