Comments (11)
It is very likely when you run nvim_set_hl the vim.o.ft was not detected.
You can do that in yamlls on_attach(), or more recommended
in after/ftplugin/yaml.vim
lua <<EOF
vim.api.nvim_set_hl(0, '@string', {fg='#59E343'})
vim.api.nvim_set_hl(0, '@field', {fg='#f93393'})
vim.api.nvim_set_hl(0, '@number', {fg='#e933e3'})
EOF
from aurora.
1> Are you using neovim 0.7.x +
2> Are you using treesitter for yml?
The yaml only used for vim users.
Suppose you are using both.
Then you may need to adjust the treesitter setup for
@string @field @Number etc
So in you setup with lua
if vim.o.ft == 'yaml' then
vim.api.nvim_set_hl(0, '@string', {fg='#59E343'})
vim.api.nvim_set_hl(0, '@field', {fg='#f93393'})
vim.api.nvim_set_hl(0, '@number', {fg='#e933e3'})
end
Check nvim-treesitter/queries/yaml/highlights.scm for all available color groups.
from aurora.
Hi Ray,
Thanks for your prompt response. I tried using your method, but I still couldn't get it to work.
In the image below:
- The yaml file which has the current color scheme
- Showed the set up script for aurora with your script
- That's ~/.local/share/nvim/site/pack/packer/start/nvim-treesitter/queries/yaml/highlights.scm. But I couldn't see any color group here.
- That's what show up when I do :version. So Neovim version is v0.8.1
from aurora.
Did you install yaml parser?
TSInstall yaml
from aurora.
Hi Ray,
Yes, it is installed. I use mason and also added it to my lspconfig like so:
require("lspconfig").yamlls.setup({
on_attach = require("wpham.lsp.handlers").on_attach,
capabilities = require("wpham.lsp.handlers").capabilities,
settings = {
yaml = {
--[[ format = { ]]
--[[ enable = true ]]
--[[ }, ]]
schemas = {
--[[ ["https://raw.githubusercontent.com/quantumblacklabs/kedro/develop/static/jsonschema/kedro-catalog-0.17.json"] = "conf/**/*catalog*", ]]
--[[ ["https://json.schemastore.org/github-workflow.json"] = "/.github/workflows/*", ]]
kubernetes = "/*.yaml",
},
},
},
})
The language server is there. I also tried TSInstall yaml
like you suggested, and it also said yaml is already installed. I reinstalled it but nothing've changed.
from aurora.
How about you run
vim.api.nvim_set_hl(0, '@string', {fg='#59E343'})
after yml file loaded?
from aurora.
I got this error: E194: No alternate file name to substitue for '#'
from aurora.
should be like this:
:lua vim.api.nvim_set_hl(0, '@string', {fg='#59E343'})
from aurora.
That works.
How would I automatically load it up?
Not sure if this is the issue:
When I tried :lua vim.o.ft
, based on your script, I would expect it to be "yaml", but I got E5107: Error loading lua [string ":lua"]:1: '=' expected near '<eof>'
from aurora.
Worked perfectly!!!! Thanks for your assist Ray
from aurora.
Oh btw, I have been curios about this, what's this sidebar package name? Or is this a custom thing.
from aurora.
Related Issues (14)
- Missing LICENSE file HOT 1
- Airline/Lightline compatibility HOT 4
- fix new treesitter broken syntax hightlighting HOT 3
- Error processing `aurora.vim` HOT 1
- Add highlight for WinSeparator HOT 1
- Broken colors on any terminal HOT 2
- Failed to run ''config" for aurora HOT 1
- How to config aurora using lazy.nvim style ??? HOT 2
- Cannot allocate color 0 HOT 6
- [Color Issue] Am I missing something? HOT 2
- Could you add a transparent background option like this: let g:aurora_transparent = 'true' HOT 11
- Report error message when launched HOT 5
- italic not working anymore HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aurora.