Comments (7)
Attempted replication with freshly built master neovim 05be00a2d
however it looks to be working:
What do you see? Above uses the nvim-tree minimal configuration bug report template - it would be great if you tried that.
from nvim-web-devicons.
Sorry I did not see the bug report template, it seems this option was not there when I created the issue .. but here it is a minimal version I'm testing right now:
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
-- ft
"nathom/filetype.nvim",
-- icons
"nvim-tree/nvim-web-devicons",
"nvim-tree/nvim-tree.lua"
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
-- add anything else here
require("nvim-tree").setup()
require'nvim-web-devicons'.setup {
override = {
zsh = {
icon = "",
color = "#428850",
cterm_color = "65",
name = "Zsh"
}
};
color_icons = true;
default = true;
strict = true;
override_by_filename = {
[".gitignore"] = {
icon = "x",
color = "#f1502f",
name = "Gitignore"
},
};
-- same as `override` but specifically for overrides by extension
-- takes effect when `strict` is true
override_by_extension = {
["log"] = {
icon = "",
color = "#81e043",
name = "Log"
},
["py"] = {
icon = "x",
color = "#f1502f",
name = "Python"
}
};
-- same as `override` but specifically for operating system
-- takes effect when `strict` is true
override_by_operating_system = {
["apple"] = {
icon = "",
color = "#A2AAAD",
cterm_color = "248",
name = "Apple",
},
};
}
I mean, the plugin works but it shows only the default icons, it's not showing up customized icons such as the Python
I've included in the template above or the .gitignore
.
For me it uses the normal icons not the "x".
from nvim-web-devicons.
Replace the ;
with ,
in the table you pass to setup, remove strict and it should work for you.
from nvim-web-devicons.
Hmm not sure where those ;
came from .. in my main config I don't have any, for some reason I added those ;
while building this minimal config.
Am I missing something else? Because with this minimal config I still don't see customized icons for python / .gitignore.
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"rcarriga/nvim-notify",
-- ft
"nathom/filetype.nvim",
-- icons
"nvim-tree/nvim-web-devicons",
"nvim-tree/nvim-tree.lua"
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
-- add anything else here
require("nvim-tree").setup()
require'nvim-web-devicons'.setup {
override = {
zsh = {
icon = "",
color = "#428850",
cterm_color = "65",
name = "Zsh"
}
},
color_icons = true,
default = true,
strict = false,
override_by_filename = {
[".gitignore"] = {
icon = "x",
color = "#f1502f",
name = "Gitignore"
},
},
-- same as `override` but specifically for overrides by extension
-- takes effect when `strict` is true
override_by_extension = {
["log"] = {
icon = "",
color = "#81e043",
name = "Log"
},
["py"] = {
icon = "x",
color = "#f1502f",
name = "Python"
}
},
-- same as `override` but specifically for operating system
-- takes effect when `strict` is true
override_by_operating_system = {
["apple"] = {
icon = "",
color = "#A2AAAD",
cterm_color = "248",
name = "Apple",
},
},
}
Thanks
from nvim-web-devicons.
It looks like a lazy plugin loading issue. I do NOT recommend using lazy loading.
Move nvim-tree setup to the end and see how you go.
from nvim-web-devicons.
Hmmm that's a good point
Added this to the minimal config in order to force the plugin to not lazy load:
-- icons
{"nvim-tree/nvim-web-devicons", lazy = false},
{"nvim-tree/nvim-tree.lua", lazy = false}
Yet it keeps using only the default icons. Then after moving Nvim-Tree to the end, it worked
It's weird that setting lazy
to false
didn't do the trick .. but at least we know it's working fine now
This issue happened only after updating to the latest Nvim btw .. if I use the previous one this issue doesn't happen, not really sure what happened here but it's working fine after moving to the bottom
from nvim-web-devicons.
Thank you!
from nvim-web-devicons.
Related Issues (20)
- Cannot override some icons by filename HOT 7
- TeX icon incorrect HOT 1
- [QUESTION]: how to add custom icon to laravel blade files HOT 4
- Invalid highlight name HOT 15
- change only icon color HOT 1
- W18 invalid character in a group name HOT 2
- Default icon is not working correctly HOT 12
- FR: differentiate `.d.ts` from `.ts` files (typescript) HOT 3
- Add known issue to README
- Gulpfile and Gruntfile incorrect icon HOT 12
- Add issue template HOT 6
- Cannot override Lua icon color HOT 9
- Add gleam icon HOT 2
- Feature: Allow setup to be run multiple times
- set_icon not work HOT 3
- Cannot install nvim-web-devicons properly on Nvim 0.7.2 HOT 2
- feat: Allow overrides by patterns HOT 1
- Make files in `diagnostics` use `TroubleFileName` color HOT 2
- Issue with file extension matching
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.
from nvim-web-devicons.