Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any suggestions for web devicons? #792

Open
1 task done
pysan3 opened this issue Apr 8, 2023 · 7 comments
Open
1 task done

Any suggestions for web devicons? #792

pysan3 opened this issue Apr 8, 2023 · 7 comments
Labels
feature Issues related to feature proposals. Please attach a module.

Comments

@pysan3
Copy link
Contributor

pysan3 commented Apr 8, 2023

Issues

  • I have checked existing issues and there are no existing ones with the same request.

Feature description

Hi, thanks for the amazing plugin!

nvim-web-devicons is a plugin used in many plugins such as nvimtree, neo-tree, bufferline etc to provide nice looking icons for files depending on their filetype.

User can define their own icons by setting these parameters on setup. And here is an example I define myself for snippet files. It is nice to have a dedicated icon and would be easier to spot the file when many types of files are in the same directory.

require("nvim-web-devicons").setup({
  override = {
    snippets = {
      icon = "",
      color = "#DBC63E",
      name = "Snippets",
    },
  },
})
Default Icons Above Config
Screenshot_20230409_024217 Screenshot_20230409_025142

Issue

However, unfortunately .norg file is not defined in the look up table and the default icons is used in the file tree, which I feel a bit sad.

Therefore, I would like to ask for any suggestion for a good icon (any nerd font) and color to represent norg files.

Creating an PR to web-devicons would be a good option as well.

Here's one I came up with but would love to hear alternatives.

    norg = {
      icon = "", -- Default icon for Header 1
      color = "#4878be",
      name = "Neorg",
    },

Screenshot_20230409_030320

Help

No

Implementation help

No response

@pysan3 pysan3 added the feature Issues related to feature proposals. Please attach a module. label Apr 8, 2023
@pysan3
Copy link
Contributor Author

pysan3 commented Apr 26, 2023

Found this

devicons/devicon#1346

Color updated to: #4878be

@vhyrro
Copy link
Member

vhyrro commented Apr 27, 2023

Yep the norg icon exists officially in devicons (very epic). Closing because the issue has a solution :)

@vhyrro vhyrro closed this as completed Apr 27, 2023
@pysan3
Copy link
Contributor Author

pysan3 commented Apr 27, 2023

Sorry I don't have much knowledge of fonts, but does that mean that it will be usable as a nerd font when it is released?

It seems I can't find it here at the moment.

https://www.nerdfonts.com/cheat-sheet

@vhyrro
Copy link
Member

vhyrro commented Apr 27, 2023

Ah, I just did some research and it's not so simple. Norg is in the devicons repository, but this doesn't necessarily mean it's either in nerdfonts nor nvim-web-devicons. nvim-web-devicons seems to have a static set of icons which aren't pulled from anywhere or autogenerated from anywhere. nerdfonts needs to manually support the icon from what I gather?

Reopening cause maybe someone with more experience can help here.

@vhyrro vhyrro reopened this Apr 27, 2023
@pysan3
Copy link
Contributor Author

pysan3 commented Apr 27, 2023

nvim-web-devicons is a plugin that just has a lookup table mapping file types to its icon (in nerdfont) and color. It does not bring in any icons but the terminal should be rendered with a nerd font supported font.

So basically, when nerd font adds norg icon (I don't know how tho), we can use that instead, but my first intent of this issue was to ask for an idea of any existing nerd font icon to express a norg file.

(For example, the scissors icon is not any official icon for snippets but I'd say it matches pretty well.)

@tamton-aquib
Copy link
Contributor

tamton-aquib commented Aug 12, 2023

Heyyo I was just reading the other issue (from @noornee #1019) regarding this, I had it temporarily working some time ago. So just wanted to share:

image

image

The steps:

  • Upload neorg.svg to icomoon. Note the code point, make sure it doesnt clash with others.

  • Download the zip file and unzip to get the ttf file (or others if you want).

  • Add it into your font directory. (~/.local/share/fonts/ in Linux and ~/Library/Fonts/ in mac OS)

  • Change settings in terminal.
    - Kitty - symbol_map to map the unicode code point to the font that we downloaded and moved. Dont change any other font configurations, just map this single symbol using symbol_map.
    - Wezterm - Add the font file as fallback. I have not done it directly but has seen others do it.
    - Not sure about other terminals

  • Lastly add the icon to your local nvim-web-devicons setup() call. Mine looks something like:

require("nvim-web-devicons").setup({
  override = {
  	norg = {
  		icon = "",		-- This icon probably wont be visible in your browser, but insert your icon here.
  		color = "#4878be",	-- Neorgs official color
  		name = "neorg"
  	}
  }
})

To insert a unicode codepoint in vim, you can do this in insert mode: <C-v>u followed by the point.
In my case it was E420, therefore: <C-v>ue420 in insert mode.

Hope this helps :)

@tamton-aquib
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Issues related to feature proposals. Please attach a module.
Projects
None yet
Development

No branches or pull requests

3 participants