NLKNguyen / papercolor-theme

:art: Light & Dark Vim color schemes inspired by Google's Material Design
MIT License
2.72k stars 239 forks source link

How can I change cursor color in Neovim Lua? #194

Open jeschkies opened 2 years ago

jeschkies commented 2 years ago

:wave: I'm using Neovim and love this theme. However, the cursor is too light. How can I change its color via Lua?

NLKNguyen commented 2 years ago

You can do it in VimL. I'm not sure how to do it via Lua in NeoVim. There is instruction for overriding colors in README. You can look up names of colors you want to override here https://github.com/NLKNguyen/papercolor-theme/blob/master/colors/PaperColor.vim#L126 or here https://github.com/NLKNguyen/papercolor-theme/blob/master/DESIGN.md#color-names

Example:

let g:PaperColor_Theme_Options = {
  \   'theme': {
  \     'default.dark': {
  \       'override' : {
  \           'cursor_fg' : ['#1c1c1c', '234'],
  \           'cursor_bg' : ['#c6c6c6', '251'],
  \       }
  \     }
  \   }
  \ }
dusty-phillips commented 1 year ago

For anyone stumbling across this issue while looking for lua to dict syntax (as I did), I think it would look something like this:

vim.g.PaperColor_Theme_Options = {
     theme = {
       ['default.dark'] = {
         override = {
             cursor_fg = {'#1c1c1c', '234'},
             cursor_bg = {'#c6c6c6', '251'},
         }
       }
     }
   }

Key differences:

jeschkies commented 1 year ago

Thanks it worked. Except that I had to correct the second line to theme =.