Add: moonfly theme. Upgrade lsp-zero too v4

This commit is contained in:
2026-04-23 20:03:49 -05:00
parent 92e6109ab6
commit 3d16375b54
6 changed files with 77 additions and 43 deletions
+1 -2
View File
@@ -1,5 +1,4 @@
require("cole.remap")
require("cole.lazy")
require("cole.set")
require("cole.filetype")
require("cole.lazy")
+10 -6
View File
@@ -1,16 +1,20 @@
require("lazy").setup({ -- Fuzzy finder
{
require("lazy").setup({{
"bluz71/vim-moonfly-colors",
name = "moonfly",
lazy = false,
priority = 1000
}, {
'nvim-telescope/telescope.nvim',
tag = '0.1.5',
dependencies = {'nvim-lua/plenary.nvim'}
}, -- syntax highlighting
}, -- Fuzzy finder
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate'
}, -- LSP support
}, -- syntax highlighting
{
'VonHeikemen/lsp-zero.nvim',
branch = 'v3.x',
branch = 'v4.x',
dependencies = {{'williamboman/mason.nvim'}, {'williamboman/mason-lspconfig.nvim'}, {'neovim/nvim-lspconfig'},
{'hrsh7th/nvim-cmp'}, {'hrsh7th/cmp-nvim-lsp'}, {'L3MON4D3/LuaSnip'}}
{'hrsh7th/nvim-cmp'}, {'hrsh7th/cmp-nvim-lsp'}, {'L3MON4D3/LuaSnip'}} -- LSP support
}})
+32 -23
View File
@@ -17,7 +17,7 @@ vim.opt.incsearch = true
vim.opt.scrolloff = 8 -- Always 8 lines above
-- Color scheme
vim.cmd.colorscheme("habamax")
vim.cmd.colorscheme("moonfly")
-- Diff: Muted Red on Crimson
vim.api.nvim_set_hl(0, "DiffAdd", {
@@ -45,32 +45,41 @@ vim.api.nvim_create_autocmd("VimEnter", {
return
end
-- Calculate the longest display-width line in the left (current) buffer.
local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false)
local max_len = 0
for _, line in ipairs(lines) do
local len = vim.fn.strdisplaywidth(line)
if len > max_len then
max_len = len
-- Defer execution to unblock the initial UI render
vim.schedule(function()
-- Limit the line check to the first 2000 lines to prevent long startup times on large files
local max_lines_to_check = 2000
local line_count = vim.api.nvim_buf_line_count(0)
local limit = math.min(line_count, max_lines_to_check)
local lines = vim.api.nvim_buf_get_lines(0, 0, limit, false)
local max_len = 0
for _, line in ipairs(lines) do
local len = vim.api.nvim_strwidth(line)
if len > max_len then
max_len = len
end
end
end
-- Account for gutter columns (line numbers, sign column, fold column).
local gutter = 0
if vim.wo.number or vim.wo.relativenumber then
gutter = gutter + vim.wo.numberwidth
end
if vim.wo.signcolumn ~= "no" then
gutter = gutter + 2
end
gutter = gutter + vim.wo.foldcolumn
-- Account for gutter columns (line numbers, sign column, fold column).
local gutter = 0
if vim.wo.number or vim.wo.relativenumber then
gutter = gutter + vim.wo.numberwidth
end
if vim.wo.signcolumn ~= "no" then
gutter = gutter + 2
end
local desired = max_len + gutter + 1 -- +1 for the right edge padding
local fold_col = tonumber(vim.wo.foldcolumn) or 0
gutter = gutter + fold_col
-- Cap at exactly half the terminal width.
local half = math.floor(vim.o.columns / 2)
local width = math.min(desired, half)
local desired = max_len + gutter + 1 -- +1 for the right edge padding
vim.api.nvim_win_set_width(0, width)
-- Cap at exactly half the terminal width.
local half = math.floor(vim.o.columns / 2)
local width = math.min(desired, half)
vim.api.nvim_win_set_width(0, width)
end)
end
})