diff --git a/bundle/nvim-plug/README.md b/bundle/nvim-plug/README.md index c995db4bf..ff05d6950 100644 --- a/bundle/nvim-plug/README.md +++ b/bundle/nvim-plug/README.md @@ -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) ## 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. diff --git a/bundle/nvim-plug/lua/plug/ui.lua b/bundle/nvim-plug/lua/plug/ui.lua index 10d1713fd..94c9b7cf0 100644 --- a/bundle/nvim-plug/lua/plug/ui.lua +++ b/bundle/nvim-plug/lua/plug/ui.lua @@ -101,11 +101,21 @@ M.open = function() vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, build_context()) end --- setup highlight - vim.cmd('hi def link PlugTitle TODO') - vim.cmd('hi def link PlugProcess Repeat') - vim.cmd('hi def link PlugDone Type') - vim.cmd('hi def link PlugFailed WarningMsg') - vim.cmd('hi def link PlugDoing Number') + 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 })