1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-14 05:17:59 +08:00

feat(nvim-plug): check hlexists

This commit is contained in:
Eric Wong 2025-02-12 23:13:03 +08:00
parent 1e2b5afcf7
commit 25e3c692d4
No known key found for this signature in database
GPG Key ID: 41BB7053E835C848
2 changed files with 19 additions and 8 deletions

View File

@ -14,14 +14,15 @@
- [Commands](#commands)
- [Default UI](#default-ui)
- [Custom Plugin UI](#custom-plugin-ui)
- [Plugin priority](#plugin-priority)
- [Plugin priority](#plugin-priority)
- [Feedback](#feedback)
<!-- vim-markdown-toc -->
## Intro
nvim-plug is an asynchronous Neovim plugin manager written in Lua. There is also a [Chinese introduction](https://wsdjeg.net/neovim-plugin-manager-nvim-plug/) about nvim-plug.
nvim-plug is an asynchronous Neovim plugin manager written in Lua.
There is also a [Chinese introduction](https://wsdjeg.net/neovim-plugin-manager-nvim-plug/) about this plugin.
## Features
@ -184,7 +185,7 @@ require('plug').setup({
})
```
### Plugin priority
## Plugin priority
By default this feature is disabled, plugins will be loaded when run `add({plugins})` function.
To enable plugin priority feature, you need to call `plug.load()` after `plug.add()` function.

View File

@ -101,11 +101,21 @@ M.open = function()
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, build_context())
end
--- setup highlight
if vim.fn.hlexists('PlugTitle') == 0 then
vim.cmd('hi def link PlugTitle TODO')
end
if vim.fn.hlexists('PlugProcess') == 0 then
vim.cmd('hi def link PlugProcess Repeat')
end
if vim.fn.hlexists('PlugDone') == 0 then
vim.cmd('hi def link PlugDone Type')
end
if vim.fn.hlexists('PlugFailed') == 0 then
vim.cmd('hi def link PlugFailed WarningMsg')
end
if vim.fn.hlexists('PlugDoing') == 0 then
vim.cmd('hi def link PlugDoing Number')
end
vim.fn.matchadd('PlugTitle', '^Plugins.*', 2, -1, { window = winid })
vim.fn.matchadd('PlugProcess', '^\\[\\zs=*', 2, -1, { window = winid })
vim.fn.matchadd('PlugDone', '^√.*', 2, -1, { window = winid })