Compare commits

..

7 Commits

Author SHA1 Message Date
03282126e3 chore(main): release 2.8.0 ()
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-21 09:25:43 +02:00
1274310e6d feat(copilot): better copilot status colors for lualine 2023-04-21 09:24:12 +02:00
14e708a246 fix: remove unintentional <lt>nop> mapping () 2023-04-21 09:21:34 +02:00
437156a3ae chore(main): release 2.7.0 ()
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-21 08:59:45 +02:00
063f8d6dff chore(build): auto-generate vimdoc 2023-04-21 06:47:24 +00:00
d63c471008 feat(copilot): added lualine component for copilot. Simple icon colored by status. Will add status message when available (warnings) 2023-04-21 08:46:45 +02:00
4042614005 refactor: move lualine fg function to Util 2023-04-21 08:46:05 +02:00
6 changed files with 66 additions and 19 deletions

@ -1,5 +1,24 @@
# Changelog
## [2.8.0](https://github.com/LazyVim/LazyVim/compare/v2.7.0...v2.8.0) (2023-04-21)
### Features
* **copilot:** better copilot status colors for lualine ([1274310](https://github.com/LazyVim/LazyVim/commit/1274310e6da0de56da92ae8e26c8f388cf314a5b))
### Bug Fixes
* remove unintentional `&lt;lt&gt;nop>` mapping ([#651](https://github.com/LazyVim/LazyVim/issues/651)) ([14e708a](https://github.com/LazyVim/LazyVim/commit/14e708a24642cf3926b9b74743c192c3b5c63f3e))
## [2.7.0](https://github.com/LazyVim/LazyVim/compare/v2.6.0...v2.7.0) (2023-04-21)
### Features
* **copilot:** added lualine component for copilot. Simple icon colored by status. Will add status message when available (warnings) ([d63c471](https://github.com/LazyVim/LazyVim/commit/d63c4710083cd2bcab104972bd4a6b3d1b80c3c6))
## [2.6.0](https://github.com/LazyVim/LazyVim/compare/v2.5.0...v2.6.0) (2023-04-20)

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 April 20
*LazyVim.txt* For Neovim >= 0.8.0 Last change: 2023 April 21
==============================================================================
Table of Contents *LazyVim-table-of-contents*

@ -10,6 +10,34 @@ return {
panel = { enabled = false },
},
},
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
local Util = require("lazyvim.util")
local colors = {
[""] = Util.fg("Special"),
["Normal"] = Util.fg("Special"),
["Warning"] = Util.fg("DiagnosticError"),
["InProgress"] = Util.fg("DiagnosticWarn"),
}
table.insert(opts.sections.lualine_x, 2, {
function()
local icon = require("lazyvim.config").icons.kinds.Copilot
local status = require("copilot.api").status.data
return icon .. (status.message or "")
end,
cond = function()
local clients = vim.lsp.get_active_clients({ name = "copilot", bufnr = 0 })
return #clients > 0
end,
color = function()
local status = require("copilot.api").status.data
return colors[status.status] or colors[""]
end,
})
end,
},
-- copilot cmp source
{

@ -60,7 +60,7 @@ return {
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = "<nop>",
scope_incremental = false,
node_decremental = "<bs>",
},
},

@ -85,14 +85,7 @@ return {
event = "VeryLazy",
opts = function()
local icons = require("lazyvim.config").icons
local function fg(name)
return function()
---@type {foreground?:number}?
local hl = vim.api.nvim_get_hl_by_name(name, true)
return hl and hl.foreground and { fg = string.format("#%06x", hl.foreground) }
end
end
local Util = require("lazyvim.util")
return {
options = {
@ -122,25 +115,25 @@ return {
},
},
lualine_x = {
-- stylua: ignore
{
function() return "" .. require("dap").status() end,
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
color = fg("Debug"),
},
-- stylua: ignore
{
function() return require("noice").api.status.command.get() end,
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
color = fg("Statement"),
color = Util.fg("Statement"),
},
-- stylua: ignore
{
function() return require("noice").api.status.mode.get() end,
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
color = fg("Constant"),
color = Util.fg("Constant"),
},
{ require("lazy.status").updates, cond = require("lazy.status").has_updates, color = fg("Special") },
-- stylua: ignore
{
function() return "" .. require("dap").status() end,
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
color = Util.fg("Debug"),
},
{ require("lazy.status").updates, cond = require("lazy.status").has_updates, color = Util.fg("Special") },
{
"diff",
symbols = {

@ -20,6 +20,13 @@ function M.has(plugin)
return require("lazy.core.config").plugins[plugin] ~= nil
end
function M.fg(name)
---@type {foreground?:number}?
local hl = vim.api.nvim_get_hl and vim.api.nvim_get_hl(0, { name = name }) or vim.api.nvim_get_hl_by_name(name, true)
local fg = hl and hl.fg or hl.foreground
return fg and { fg = string.format("#%06x", fg) }
end
---@param fn fun()
function M.on_very_lazy(fn)
vim.api.nvim_create_autocmd("User", {