Skip to content

Commit

Permalink
feat(nvim): reconfigure lsp cmp and statusline
Browse files Browse the repository at this point in the history
  • Loading branch information
r17x committed Jan 13, 2025
1 parent 378bfdd commit c7276c6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 25 deletions.
7 changes: 4 additions & 3 deletions nvim.nix/config/ai.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ rec {
plugins.avante.settings.copilot.model = "claude-3.5-sonnet";
plugins.avante.settings.copilot.temperature = 0;
plugins.avante.settings.copilot.max_tokens = 4096;

plugins.copilot-lua.enable = true;
plugins.copilot-lua.settings.suggestion.enabled = false;
plugins.copilot-lua.settings.panel.enabled = false;

plugins.avante.settings.vendors.ollama = {
local = true;
Expand Down Expand Up @@ -71,9 +74,7 @@ rec {
];

plugins.cmp.settings.sources =
[
]
++ lib.optionals plugins.codeium-nvim.enable [
lib.optionals plugins.codeium-nvim.enable [
{ name = "codeium"; }
]
++ lib.optionals plugins.copilot-lua.enable [
Expand Down
2 changes: 1 addition & 1 deletion nvim.nix/config/lsp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
''
function()
local bufnr = vim.api.nvim_get_current_buf()
local clients = vim.lsp.get_active_clients()
local clients = vim.lsp.buf_get_clients()
local is_biome_active = function()
for _, client in ipairs(clients) do
if client.name == "biome" and client.attached_buffers[bufnr] then
Expand Down
51 changes: 30 additions & 21 deletions nvim.nix/config/ui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -279,28 +279,37 @@ in
plugins.lualine.settings.sections.lualine_y = [
{
__unkeyed-1.__raw =
helpers.mkLuaFun # lua
''
return require('lsp-progress').progress({
max_size = 80,
format = function(messages)
local active_clients =
vim.lsp.get_active_clients()
if #messages > 0 then
return table.concat(messages, " ")
end
local client_names = {}
for _, client in ipairs(active_clients) do
if client and client.name ~= "" then
table.insert(client_names, 1, client.name)
end
end
return table.concat(client_names, "⎹")
end,
})
'';
# lua
''
(function()
local ft = require('lualine.components.filetype'):extend()
local lsp_progress = require('lsp-progress')
function ft:update_status()
local data = ft.super.update_status(self)
return lsp_progress.progress({
max_size = 50,
format = function(messages)
-- @TODO: add active clients
-- local active_clients = vim.lsp.buf_get_clients()
-- local client_names = {}
-- for _, client in ipairs(active_clients) do
-- if client and client.name ~= "" then
-- table.insert(client_names, 1, client.name)
-- end
-- end
if #messages > 0 then
return table.concat(messages, " ")
end
return data
end,
})
end
return ft
end)()
'';
}
"filetype"
"progress"
];
plugins.lualine.settings.sections.lualine_z = [
Expand Down

0 comments on commit c7276c6

Please sign in to comment.