GithubHelp home page GithubHelp logo

lambdalisue / glyph-palette.vim Goto Github PK

View Code? Open in Web Editor NEW
123.0 5.0 11.0 54 KB

๐ŸŽจ An universal palette for Nerd Fonts

License: MIT License

Vim Script 100.00%
vim neovim colors nerdfont vim-devicons

glyph-palette.vim's Introduction

๐ŸŽจ glyph-palette

Support Vim 8.1 or above Support Neovim 0.4 or above MIT License Doc

glyph-palette

glyph-palette (Glyph palette) is a plugin to universally apply colors on Nerd Fonts.

With this plugin, the following (and potentially more) Nerd Fonts integrations will be nicely highlighted.

Usage

First of all, make sure that you are using one of Nerd Fonts patched fonts (e.g. Fonts in Patched Fonts or Cica for Japanese). Visit Nerd Fonts homepage for more detail.

After that, call glyph_palette#apply() function on a target buffer like:

augroup my-glyph-palette
  autocmd! *
  autocmd FileType fern call glyph_palette#apply()
  autocmd FileType nerdtree,startify call glyph_palette#apply()
augroup END

Then glyphs in g:glyph_palette#palette on the buffer will be highlighted by predefined highlight groups.

See :help glyph-palette-usage for more details

Screenshots

With nerdfont.vim + fern.vim + fern-renderer-nerdfont.vim

With nerdfont.vim + fern.vim + fern-renderer-nerdfont.vim

Provide us your nice screenshots!

Special thanks

An initial implementation has written by @zeorin at ryanoasis/vim-devicons#158

glyph-palette.vim's People

Contributors

creativenull avatar get-me-power avatar lambdalisue avatar milly avatar yuki-yano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

glyph-palette.vim's Issues

Icons are narrowed in mintty

Hi, if I use the plugin in mintty the characters get narrowed after applying palette:

Screenshot 2023-03-19 204830
This may be related to the following issue: mintty/mintty#1104
I'm not sure if it is 100% correct way, but if I apply following update to function! s:apply():

@@ -43,7 +43,7 @@ function! s:apply() abort
   endif
   let w:glyph_palette_matches = map(
         \ copy(b:glyph_palette_palette),
-        \ { -> matchadd(v:key, v:val) },
+        \ { -> matchadd(v:key, v:val.' ') },
         \)
endfunction

the issue gets fixed:

Screenshot 2023-03-19 204706

Thank you!

E121: Undefined variable: g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols

If I include the following

Plugin 'ryanoasis/vim-devicons'
Plugin 'lambdalisue/glyph-palette.vim.git'
...

let g:pippo = glyph_palette#tools#palette_from_devicons({
    	      \ 'GlyphPalette9': ['license', 'png', 'vim', 'key'],
    	      \ 'GlyphPalette5': ['py', 'yml', 'toml'],
    	      \})
   
let g:glyph_palette#palette = copy(g:pippo)

augroup my-glyph-palette
  autocmd! * 
  autocmd FileType nerdtree call glyph_palette#apply()
augroup END

in my .vimrc then I got the following message error at startup

Messages maintainer: Bram Moolenaar <[email protected]>
Error detected while processing C:\Users\yt75534\.vimrc[148]..function glyph_palette#tools#palette_from_devicons:
line    2:
E121: Undefined variable: g:WebDevIconsUnicodeDecorateFileNodesExtensionSymbols

Running Vim9 on Windows 10.

Autocmd to call glyph_palette#apply not working on draw open

Hi ๐Ÿ‘‹ , thanks for this great plugin! This might not be a plugin problem, but a user error ๐Ÿ˜… Hoping you can point me in the right direction. I am having an issue with the recommended autocmd not working as expected.

augroup my-glyph-palette
  autocmd!
  autocmd FileType fern call glyph_palette#apply()
augroup END

When I load a Fern buffer using either :Fern or vim . from the command line, I get glyph icons in just one colour. When I move my cursor to a different window, and then move back to the fern window, the glyph icons change to use highlighted colours. This tells me that the autocmd is there, but perhaps is happening out of order, or too early in some cases.

Have you seen this behavour before? Are you able to suggest an fixes? Thanks for your time ๐Ÿ™
Screen Shot 2020-11-01 at 3 11 14 pm
Screen Shot 2020-11-01 at 3 11 18 pm

Glyphs appear offset in nerd tree

Hello,

I am on Arch Linux, kernel version 5.10.35-1-lts. My Nvim is in version v0.4.4

The following occurs in NerdTree when I install and use the glyph-palette.

offset

Any idea as to why this happens?

Use palette from the default colorscheme

Thank you for the awesome plugin. I would like to suggest to use user's colorscheme for colors by default. Of course I can overwrite it in configuration, but just to make default colors more universal.

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.