Giter Club home page Giter Club logo

Comments (7)

alex-courtis avatar alex-courtis commented on July 25, 2024

Attempted replication with freshly built master neovim 05be00a2d however it looks to be working:

20240429_101834

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.

rodhash avatar rodhash commented on July 25, 2024

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.

alex-courtis avatar alex-courtis commented on July 25, 2024

Replace the ; with , in the table you pass to setup, remove strict and it should work for you.

from nvim-web-devicons.

rodhash avatar rodhash commented on July 25, 2024

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.

alex-courtis avatar alex-courtis commented on July 25, 2024

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.

rodhash avatar rodhash commented on July 25, 2024

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.

rodhash avatar rodhash commented on July 25, 2024

Thank you!

from nvim-web-devicons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.