neorg
neorg copied to clipboard
Any suggestions for web devicons?
Issues
- [X] 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 |
---|---|
![]() |
![]() |
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",
},
Help
No
Implementation help
No response
Found this
https://github.com/devicons/devicon/pull/1346
Color updated to: #4878be
Yep the norg icon exists officially in devicons (very epic). Closing because the issue has a solution :)
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
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.
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.)
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:
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 :)
Also wanted to mention some related issues/discussions:
- https://github.com/ryanoasis/nerd-fonts/issues/615
- https://github.com/devicons/devicon/issues/1420
- https://github.com/ryanoasis/nerd-fonts/discussions/1095