bluz71 / vim-moonfly-colors

A dark charcoal theme for modern Neovim & classic Vim
MIT License
814 stars 65 forks source link

Kindly Request #61

Closed jacknicklenson closed 2 months ago

jacknicklenson commented 2 months ago

I love your theme so much but i am using vim instead of nvim and i also use CoC becuase there is no built-in lsp client in vim. Your colorscheme written in neovim in mind. when i open nvim side-by-side colors not matched. Can you add coc highlight groups for Coc users :(

If you accept it, here is all coc sematic highlight groups:

CocSemModDeprecated      CocSemTypeEvent          CocSemTypeNamespace      CocSemTypeStruct
CocSemTypeBoolean        CocSemTypeFunction       CocSemTypeNumber         CocSemTypeType
CocSemTypeClass          CocSemTypeInterface      CocSemTypeOperator       CocSemTypeTypeParameter
CocSemTypeComment        CocSemTypeKeyword        CocSemTypeParameter      CocSemTypeVariable
CocSemTypeDecorator      CocSemTypeMacro          CocSemTypeProperty
CocSemTypeEnum           CocSemTypeMethod         CocSemTypeRegexp
CocSemTypeEnumMember     CocSemTypeModifier       CocSemTypeString

For example, below image, simulate function's parameter, []Particle struct type and struct member field which is p_.x have repeated colors, not distinguishable.

image

bluz71 commented 2 months ago

Hello @jacknicklenson,

I will have a look into this.

I will need to setup Vim and CoC, give me some time.

jacknicklenson commented 2 months ago

thank you so much

jacknicklenson commented 2 months ago

btw sorry i forgot to say, to enable semantic highlighting, you have to add this setting to your coc-settings.json (which can be open via :CocConfig comand):

{
      "semanticTokens.enable": true,
}

Here is my full coc-settings.json:

{
  "semanticTokens.enable": true,
  "diagnostic.virtualText": true,
  "diagnostic.virtualTextCurrentLineOnly": false,
  "rust-analyzer.semanticHighlighting.operator.specialization.enable": true,
  "rust-analyzer.semanticHighlighting.punctuation.enable": true,
  "rust-analyzer.semanticHighlighting.punctuation.separate.macro.bang": true,
  "rust-analyzer.semanticHighlighting.punctuation.specialization.enable": true,
  "workspace.ignoredFolders": [
    "$HOME",
    "$HOME/.cargo/**",
    "$HOME/.rustup/**"
  ],
  "go.goplsOptions": {
  "semanticTokens": true,
    "hints": {
      "assignVariableTypes": true,
      "compositeLiteralFields": true,
      "compositeLiteralTypes": true,
      "constantValues": true,
      "functionTypeParameters": true,
      "parameterNames": true,
      "rangeVariableTypes": true
    }
  },
  "zig.enabled": true,
  "zig.startUpMessage": true,
  "zig.path": "zls",
  "zig.debugLog": false,
  "clangd.arguments": [
    "--background-index",
    "--clang-tidy",
    "--all-scopes-completion",
    "--completion-style=detailed",
    "--header-insertion-decorators",
    "--header-insertion=never"
  ],
  "git.enableGutters": true
}
bluz71 commented 2 months ago

Thanks for that, it will help me setup CoC with normal Vim.

At some point this week I will dedicate time for this specific issue.

My intention is to have the same colorization as Neovim (which itself supports Tree-sitter and LSP semantic highlighting).

We will see how it goes.

bluz71 commented 2 months ago

Ok @jacknicklenson , most Coc semantic tokens are already highlighted reasonably well (good defaults).

There were about 8 tokens that were highlighted differently than the equivalent Neovim LSP semantic highlighter. I have now changed those highlights.

I think this should now work for you with the result being almost identical of my Neovim LSP semantic highlights.

Best regards.