-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Color cannot be overwritten #2
Comments
Does it change when you run
highlight! is not a command, I think you're confusing it with hi! |
After the plugin is loaded, it will change if run it with vim running. |
Are you calling it after setting the colorscheme? |
Yes, give it a try |
I add vim.api.nvim_command('autocmd Colorscheme * highlight Normal guibg=#FF0000') to the end of my |
Yes i know. |
Sorry I misunderstood, inside highlight ALEErrorSign guifg=#E06C75 where nvim is the root directory of your nvim folder. |
I'm sorry in poor English😅
I tried with this path and all the other syntax broke |
Just to verify, if you are on linux, if you run cat ~/.config/nvim/after/colors/one-nvim.vim you get highlight ALEErrorSign guifg=#E06C75 Is that right? |
After setting
reference: |
I think I have it now " ~/.config/nvim/after/colors/one-nvim.vim
highlight ALEErrorSign guifg=#E06C75 -- end of init.lua
vim.api.nvim_command("runtime! after/colors/one-nvim.vim") |
After all it did not work. The original purpose was just to overwrite the highlights with a simple setup. |
That's strange. It worked on my computer. I think you're probably best off using the autocmd since you said that worked. |
Worked this out with the creator of nvim-highlite vim.api.nvim_command("augroup Highlight")
vim.api.nvim_command("autocmd!")
vim.api.nvim_command("autocmd ColorScheme one-nvim hi! Normal guifg=#000000 guibg=#FFFFFF")
vim.api.nvim_command("augroup end")
vim.api.nvim_command("colorscheme one-nvim") |
Or you could do local vim, api, cmd = vim, vim.api, vim.cmd
local function augroups(definitions)
for group_name, definition in pairs(definitions) do
api.nvim_command("augroup " .. group_name)
api.nvim_command("autocmd!")
for _, def in ipairs(definition) do
local command = table.concat(vim.tbl_flatten {"autocmd", def}, " ")
api.nvim_command(command)
end
api.nvim_command("augroup END")
end
end
local autocmds = {
Highlight = {
{"ColorScheme", "one-nvim", "hi! Normal guifg=#000000 guibg=#FFFFFF"}
}
}
augroups(autocmds)
cmd 'colorscheme one-nvim' It will do the same thing. |
I know I can change it with autocmd but I don't want to use autocmd just to overwrite colors. |
If want to change the color of a particular highlight group, can't overwrite it in the usual way.
For example, it cannot be changed by the following method
Onebuddy could change this way.
If want to do the same with one-nvim, have to do the following
Can fix it?
The text was updated successfully, but these errors were encountered: