Closed poetaman closed 3 years ago
are your sure this issue is realted to nvim-web-devicon and not vim-startify ? This plugin only provide a simple function, the rest is left to the plugin developers to implement.
@kyazdani42 I would think more a nvim-web-devicon question. vim-startify developer could argue its just a start-screen that can be used to open MRU or other important files. What can he do wrong in opening files? If there is an interest in fixing this then one of you will have to decide to debug a bit. @mhinz, any opinion? I think it is worthwhile as vim-startify & nvim-web-devicons are a good combination, and each worth using in its own right.
waiting for @mhinz before going on further investigation, i'm not sure why most plugins would work as expected using this lib but not vim-startify ? If this issue comes from nvim-web-devicon, i will fix it.
By default, startify isn't using nvim-web-devicons. Following the steps above, I see nothing happening in startify.
What else do I have to do to reproduce this issue?
if vim-startify doesn't use nvim-web-devicons, how is this issue relevant ?
I have a mp4 video, and minimal example. It could most likely be a problem of nvim-bufferline.lua. Adding @akinsho. Am sorry I forgot there are 3 packages involved here. Please keep your eyes on the command I send to nvim, and the icon that gets show in the bufferline on top.
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath=&runtimepath
call plug#begin('~/.vim/plugged')
Plug 'mhinz/vim-startify'
Plug 'kyazdani42/nvim-web-devicons'
Plug 'akinsho/nvim-bufferline.lua'
call plug#end()
let &t_8f="\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b="\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
lua require'bufferline'.setup{}
lua <<EOF
require'nvim-web-devicons'.setup {
-- your personnal icons can go here (to override)
-- DevIcon will be appended to `name`
override = {
zsh = {
icon = "",
color = "#cb4b16",
name = "zsh",
},
vim = {
icon = "",
color = "#719e07",
name = "vim",
},
-- vimrc = {
-- icon = "",
-- color = "#719e07",
-- name = "vim",
-- },
lua = {
icon = "",
color = "#b58900",
name = "lua",
},
pdf = {
icon = "",
color = "#719e07",
name = "pdf",
},
tex = {
icon = "ﭨ",
color = "#dc322f",
name = "tex",
},
};
-- globally enable default icons (default to false)
-- will get overriden by `get_icons` option
default = true;
}
EOF
MP4 video:
As can be seen from the video, then the files are opened with path like :e ~/.zshrc
, buffer line does not show correct icons. I guess I associated it with Startify was because for some MRU entries hitting <CR>
on them would have used a full path like one above, and produced different result.
i think it's because you initialize nvim-web-devicons after bufferline which already have initialized it. Try to put your nvim-web-devicon setup before all other plugins initializations if you want changes to take effect properly.
@kyazdani42 I tried couple of refactorings, it didn't change anything. Can you please check if/how these lines need to be rearranged? Please post it too...
after looking at the video you sent, i'm completely sure this issue should be addressed to bufferline. I'm closing this because it's out of the scope of this library.
PS: feel free to reference your issue to this one
The devicons for files like
.vimrc
,.zshrc
is incorrect when file is opened from vim-startify screen. The icons are correct if these files are opened directly using commands like:e .vimrc<CR>
/:e.zshrc<CR>
. The same problem does not occur for most of the other file types (including files that end in.vim
).Steps to recreate:
.vimrc
file using usual command:e .vimrc<CR>
..vimrc
file by pressing<CR>
on.vimrc
file in the MRU buffer list of vim-startify's startup screen.