GithubHelp home page GithubHelp logo

No devicons for .txt files about barbar.nvim HOT 14 CLOSED

m147 avatar m147 commented on May 29, 2024
No devicons for .txt files

from barbar.nvim.

Comments (14)

Iron-E avatar Iron-E commented on May 29, 2024 1

vim.pretty_print as that is deprecated

Yeah, pretty printing is the old way of doing that. := and vim.print are the new ways

I tried making a file foo.text rather that .txt the icon shows properly

My present ideas as to a cause are:

  • It might due to an update (devicons, font, etc);
  • Devicons allows icon overrides during setup (could either be causing it or fix it);
  • ftdetect issue (since since you said .text works)

Does this line show in Neovim properly? If so, that eliminates the notion that this is a font issue and makes it more likely to be a filetype error.

from barbar.nvim.

m147 avatar m147 commented on May 29, 2024 1

It seems this is an issue with nvim-web-devicons and not barbar.

I should have read this notice on its GitHub page:

Notice
Nerd fonts moved some symbols with version 3.0. Version 2.3 is meant for transition, supporting both version 2 and version 3 icons.
Nvim-web-devicons requires version 2.3 or above to work properly. If you are unable to update please use your plugin manager to pin version of nvim-web-dev icons to nerd-v2-compat tag.

Plug 'kyazdani42/nvim-web-devicons', { 'tag': 'nerd-v2-compat' }
solves the issue.

One way or another, you helped me track down where the issue lies. Thank you.

from barbar.nvim.

Iron-E avatar Iron-E commented on May 29, 2024

I wasn't able to reproduce. Does this icon appear when using nvim-web-devicons in other plugins?

from barbar.nvim.

m147 avatar m147 commented on May 29, 2024

I don't think I have any other plugins that use nvim-web-devicons.
I have NERDTree which uses another devicon plugin.
I tried removing that plugin to see if there is a conflict but that was not the issue.

from barbar.nvim.

Iron-E avatar Iron-E commented on May 29, 2024

Can you run this from a txt file and share the result?

require('nvim-web-devicons').get_icon_by_filetype(vim.api.nvim_get_option_value('filetype', {}))

(I'm on a phone so the syntax might not be 100% accurate, if it doesn't work I'll post a working version tomorrow)

from barbar.nvim.

m147 avatar m147 commented on May 29, 2024

Can you run this from a txt file and share the result?

require('nvim-web-devicons').get_icon_by_filetype(vim.api.nvim_get_option_value('filetype', {}))

(I'm on a phone so the syntax might not be 100% accurate, if it doesn't work I'll post a working version tomorrow)

You mean open a text file and run the above as a vim commad?

from barbar.nvim.

Iron-E avatar Iron-E commented on May 29, 2024

Can you run this from a txt file and share the result?

require('nvim-web-devicons').get_icon_by_filetype(vim.api.nvim_get_option_value('filetype', {}))

(I'm on a phone so the syntax might not be 100% accurate, if it doesn't work I'll post a working version tomorrow)

You mean open a text file and run the above as a vim commad?

Yeah; whenever a file is currently focused that has the bug from the screenshot.

You can do := some_lua_code_here in recent Neovim versions for that.

Sorry for any confusion!

from barbar.nvim.

m147 avatar m147 commented on May 29, 2024

No worries, I hadn't included the = when running the command.
This doesn't do anything that I can see.

from barbar.nvim.

Iron-E avatar Iron-E commented on May 29, 2024

No worries, I hadn't included the = when running the command.
This doesn't do anything that I can see.

What version are you on? It might be necessary to do :lua vim.pretty_print(expression_goes_here) instead.

Alternatively, checking :messages might reveal the output

from barbar.nvim.

m147 avatar m147 commented on May 29, 2024

Version:
NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1702233742

I tried the above, first it warned me to use vim.print instead of vim.pretty_print as that is deprecated. The output was

devicon

from barbar.nvim.

m147 avatar m147 commented on May 29, 2024

I tried making a file foo.text rather that .txt the icon shows properly.
Not sure why it doesn't work with .txt.
Also, I'm quite sure this is recent. I don't remember seeing this before.

from barbar.nvim.

m147 avatar m147 commented on May 29, 2024

It does not. Shows the same box as in barbar

from barbar.nvim.

m147 avatar m147 commented on May 29, 2024

I'm able to get the icon working properly with:

require'nvim-web-devicons'.setup { override_by_extension = { ["txt"] = { icon = "", color = "#81e043", name = "txt" } }; }
in init.vim

from barbar.nvim.

Iron-E avatar Iron-E commented on May 29, 2024

Happy to help!

from barbar.nvim.

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.