new nvim changes
This commit is contained in:
parent
d14e84eae8
commit
6198cf14d4
11 changed files with 1115 additions and 663 deletions
|
|
@ -12,4 +12,16 @@ vim.g.lazyvim_blink_main = true
|
|||
vim.g.snacks_animate = false
|
||||
vim.o.termguicolors = true
|
||||
|
||||
-- Minimal UI borders for floats
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
float = { border = "none" },
|
||||
})
|
||||
|
||||
-- Use crisp single-line borders in LSP handlers
|
||||
local border = "none"
|
||||
local handlers = vim.lsp.handlers
|
||||
handlers["textDocument/hover"] = vim.lsp.with(handlers.hover, { border = border })
|
||||
handlers["textDocument/signatureHelp"] = vim.lsp.with(handlers.signature_help, { border = border })
|
||||
|
||||
vim.g.lazyvim_prettier_needs_config = true
|
||||
|
|
|
|||
|
|
@ -14,6 +14,82 @@ return {
|
|||
module.get = module.get_theme
|
||||
end
|
||||
opts.transparent_background = true
|
||||
opts.flavour = "mocha"
|
||||
opts.no_bold = true
|
||||
opts.no_italic = true
|
||||
opts.dim_inactive = {
|
||||
enabled = true,
|
||||
percentage = 0.75,
|
||||
}
|
||||
opts.integrations = vim.tbl_deep_extend("force", opts.integrations or {}, {
|
||||
noice = true,
|
||||
blink_cmp = true,
|
||||
notify = true,
|
||||
treesitter = true,
|
||||
lsp_trouble = true,
|
||||
telescope = true,
|
||||
which_key = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
inlay_hints = {
|
||||
background = false,
|
||||
},
|
||||
},
|
||||
indent_blankline = {
|
||||
enabled = true,
|
||||
scope_color = "overlay0",
|
||||
colored_indent_levels = false,
|
||||
},
|
||||
})
|
||||
opts.custom_highlights = function(colors)
|
||||
return {
|
||||
Normal = { bg = "NONE" },
|
||||
NormalNC = { bg = "NONE" },
|
||||
NormalFloat = { bg = "NONE" },
|
||||
FloatBorder = { fg = "NONE", bg = "NONE" },
|
||||
FloatTitle = { fg = colors.subtext0, bg = "NONE" },
|
||||
-- WinSeparator = { fg = colors.surface1 },
|
||||
-- CursorLine = { bg = colors.mantle },
|
||||
-- Visual = { bg = colors.surface0 },
|
||||
-- Pmenu = { bg = colors.bg, fg = colors.text },
|
||||
-- PmenuSel = { bg = colors.surface0, fg = colors.text },
|
||||
-- PmenuSbar = { bg = colors.bg },
|
||||
-- PmenuThumb = { bg = colors.surface1 },
|
||||
-- StatusLine = { bg = colors.bg, fg = colors.subtext0 },
|
||||
-- StatusLineNC = { bg = colors.bg, fg = colors.overlay0 },
|
||||
-- TabLine = { bg = colors.bg, fg = colors.overlay1 },
|
||||
-- TabLineSel = { bg = colors.bg, fg = colors.text },
|
||||
-- TabLineFill = { bg = colors.bg },
|
||||
-- SignColumn = { bg = colors.bg },
|
||||
-- LineNr = { fg = colors.overlay1 },
|
||||
DiagnosticUnderlineError = { sp = colors.red, undercurl = true },
|
||||
DiagnosticUnderlineWarn = { sp = colors.yellow, undercurl = true },
|
||||
DiagnosticUnderlineInfo = { sp = colors.teal, undercurl = true },
|
||||
DiagnosticUnderlineHint = { sp = colors.sky, undercurl = true },
|
||||
-- Noice popup and cmdline transparent, borderless
|
||||
NoiceCmdlinePopup = { bg = "NONE", fg = colors.text },
|
||||
NoiceCmdlinePopupBorder = { fg = "NONE", bg = "NONE" },
|
||||
NoiceCmdlinePopupTitle = { bg = "NONE", fg = colors.subtext0 },
|
||||
NoicePopup = { bg = "NONE", fg = colors.text },
|
||||
NoicePopupBorder = { fg = "NONE", bg = "NONE" },
|
||||
-- Blink.cmp: flat boxes with padding and pop colors
|
||||
BlinkCmpMenu = { bg = "NONE", fg = colors.text },
|
||||
BlinkCmpMenuBorder = { fg = "NONE", bg = "NONE" },
|
||||
BlinkCmpMenuSelection = { bg = colors.surface0, fg = colors.text },
|
||||
BlinkCmpMenuMatch = { fg = colors.mauve },
|
||||
BlinkCmpDoc = { bg = "NONE" },
|
||||
BlinkCmpDocBorder = { fg = "NONE", bg = "NONE" },
|
||||
BlinkCmpDocSelection = { bg = colors.surface0 },
|
||||
BlinkCmpKind = { fg = colors.sky },
|
||||
BlinkCmpSource = { fg = colors.subtext0 },
|
||||
-- Reduce scope highlighting prominence
|
||||
IlluminatedWordText = { bg = colors.mantle },
|
||||
IlluminatedWordRead = { bg = colors.mantle },
|
||||
IlluminatedWordWrite = { bg = colors.mantle },
|
||||
TreesitterContext = { bg = colors.mantle },
|
||||
TreesitterContextLineNumber = { fg = colors.subtext0, bg = colors.mantle },
|
||||
}
|
||||
end
|
||||
return opts
|
||||
end,
|
||||
-- config = function()
|
||||
|
|
@ -50,7 +126,7 @@ return {
|
|||
-- end,
|
||||
-- color_overrides = {
|
||||
-- mocha = {
|
||||
-- base = "#11111b",
|
||||
-- bg = "#11111b",
|
||||
-- mantle = "#11111b",
|
||||
-- crust = "#11111b",
|
||||
-- },
|
||||
|
|
@ -138,8 +214,80 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
--- minimal crisp single-line borders for LSP windows
|
||||
inlay_hints = { enabled = true },
|
||||
diagnostics = { virtual_text = false },
|
||||
},
|
||||
},
|
||||
-- Minimal Noice styling
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
opts = function(_, opts)
|
||||
opts = opts or {}
|
||||
opts.presets = vim.tbl_deep_extend("force", opts.presets or {}, {
|
||||
bottom_search = false,
|
||||
command_palette = false,
|
||||
long_message_to_split = true,
|
||||
inc_rename = false,
|
||||
lsp_doc_border = false,
|
||||
})
|
||||
opts.cmdline = vim.tbl_deep_extend("force", opts.cmdline or {}, {
|
||||
view = "cmdline_popup",
|
||||
})
|
||||
opts.views = vim.tbl_deep_extend("force", opts.views or {}, {
|
||||
cmdline_popup = {
|
||||
border = { style = "none", padding = { 1, 2 } },
|
||||
win_options = {
|
||||
-- winhighlight = { "Normal:NoiceCmdlinePopup,FloatBorder:NoiceCmdlinePopupBorder,FloatTitle:NoiceCmdlinePopupTitle" },
|
||||
winhighlight = {
|
||||
Normal = "NoiceCmdlinePopup",
|
||||
FloatBorder = "NoiceCmdlinePopupBorder",
|
||||
FloatTitle = "NoiceCmdlinePopupTitle",
|
||||
},
|
||||
winblend = 0,
|
||||
},
|
||||
position = { row = "40%", col = "50%" },
|
||||
size = { width = 60 },
|
||||
},
|
||||
popupmenu = {
|
||||
border = { style = "none", padding = { 1, 2 } },
|
||||
win_options = { winblend = 0, winhighlight = "Normal:NoicePopup,FloatBorder:NoicePopupBorder" },
|
||||
},
|
||||
mini = {
|
||||
border = { style = "none", padding = { 1, 2 } },
|
||||
win_options = { winblend = 0, winhighlight = "Normal:NoicePopup,FloatBorder:NoicePopupBorder" },
|
||||
},
|
||||
})
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
-- Minimal bufferline (if present in LazyVim)
|
||||
{
|
||||
"akinsho/bufferline.nvim",
|
||||
opts = function(_, opts)
|
||||
opts = opts or {}
|
||||
opts.options = vim.tbl_deep_extend("force", opts.options or {}, {
|
||||
separator_style = "none",
|
||||
show_buffer_close_icons = false,
|
||||
show_close_icon = false,
|
||||
always_show_bufferline = false,
|
||||
indicator = { style = "underline" },
|
||||
})
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
-- Minimal indent guides
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
opts = function(_, opts)
|
||||
opts = opts or {}
|
||||
opts.indent = { char = "│" }
|
||||
opts.scope = { enabled = false }
|
||||
opts.whitespace = { remove_blankline_trail = true }
|
||||
return opts
|
||||
end,
|
||||
},
|
||||
"pimalaya/himalaya-vim",
|
||||
{
|
||||
"rachartier/tiny-inline-diagnostic.nvim",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,24 @@ return {
|
|||
-- Author: shadmansaleh
|
||||
-- Credit: glepnir
|
||||
local lualine = require("lualine")
|
||||
local ctp = require("catppuccin.palettes").get_palette("mocha")
|
||||
local ctp = require("catppuccin.palettes").get_palette("macchiato")
|
||||
|
||||
-- Utility to blend two hex colors: result = (1 - alpha) * a + alpha * b
|
||||
local function blend_hex(hex_a, hex_b, alpha)
|
||||
local function hex_to_rgb(h)
|
||||
h = h:gsub("#", "")
|
||||
return tonumber(h:sub(1, 2), 16), tonumber(h:sub(3, 4), 16), tonumber(h:sub(5, 6), 16)
|
||||
end
|
||||
local function rgb_to_hex(r, g, b)
|
||||
return string.format("#%02x%02x%02x", math.floor(r + 0.5), math.floor(g + 0.5), math.floor(b + 0.5))
|
||||
end
|
||||
local ar, ag, ab = hex_to_rgb(hex_a)
|
||||
local br, bg, bb = hex_to_rgb(hex_b)
|
||||
local r = ar * (1 - alpha) + br * alpha
|
||||
local g = ag * (1 - alpha) + bg * alpha
|
||||
local b = ab * (1 - alpha) + bb * alpha
|
||||
return rgb_to_hex(r, g, b)
|
||||
end
|
||||
|
||||
local conditions = {
|
||||
buffer_not_empty = function()
|
||||
|
|
@ -24,15 +41,11 @@ return {
|
|||
-- Config
|
||||
local config = {
|
||||
options = {
|
||||
-- Disable sections and component separators
|
||||
component_separators = "",
|
||||
section_separators = "",
|
||||
theme = {
|
||||
-- We are going to use lualine_c an lualine_x as left and
|
||||
-- right section. Both are highlighted by c theme . So we
|
||||
-- are just setting default looks o statusline
|
||||
normal = { c = { fg = ctp.text, bg = ctp.base } },
|
||||
inactive = { c = { fg = ctp.overlay0, bg = ctp.base } },
|
||||
normal = { c = { fg = ctp.text, bg = "NONE" } },
|
||||
inactive = { c = { fg = ctp.overlay0, bg = "NONE" } },
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
|
|
@ -164,6 +177,41 @@ return {
|
|||
return mode_colors[current_mode] or ctp.subtext0 -- Default to a neutral color if mode not found
|
||||
end
|
||||
|
||||
-- Human-readable mode labels
|
||||
local function get_mode_label()
|
||||
local m = vim.api.nvim_get_mode().mode
|
||||
local normal = {
|
||||
n = true,
|
||||
no = true,
|
||||
nov = true,
|
||||
["noV"] = true,
|
||||
["no\22"] = true,
|
||||
niI = true,
|
||||
niR = true,
|
||||
niV = true,
|
||||
nt = true,
|
||||
}
|
||||
if normal[m] then
|
||||
return "NORM"
|
||||
end
|
||||
if m == "i" or m == "ic" or m == "ix" then
|
||||
return "INS"
|
||||
end
|
||||
if m == "v" or m == "V" or m == "\22" or m == "vs" or m == "Vs" or m == "\22s" then
|
||||
return "VIS"
|
||||
end
|
||||
if m == "R" or m == "Rc" or m == "Rx" or m == "Rv" or m == "Rvc" or m == "Rvx" then
|
||||
return "REPL"
|
||||
end
|
||||
if m == "c" or m == "cv" or m == "ce" then
|
||||
return "CMD"
|
||||
end
|
||||
if m == "t" or m == "!" then
|
||||
return "TERM"
|
||||
end
|
||||
return "?"
|
||||
end
|
||||
|
||||
-- Inserts a component in lualine_c at left section
|
||||
local function ins_left(component)
|
||||
table.insert(config.sections.lualine_c, component)
|
||||
|
|
@ -176,13 +224,14 @@ return {
|
|||
|
||||
ins_left({
|
||||
function()
|
||||
return get_mode_abbr()
|
||||
return get_mode_label()
|
||||
end,
|
||||
color = function()
|
||||
local color = get_mode_color()
|
||||
return { fg = ctp.base, bg = color, gui = "bold" }
|
||||
end, -- Sets highlighting of component
|
||||
padding = { left = 1, right = 1 }, -- We don't need space before this
|
||||
local mode_color = get_mode_color()
|
||||
local mode_bg = blend_hex(ctp.base, mode_color, 0.254)
|
||||
return { fg = mode_color, bg = mode_bg, gui = "bold" }
|
||||
end,
|
||||
padding = { left = 1, right = 1 },
|
||||
})
|
||||
|
||||
ins_left({
|
||||
|
|
@ -191,19 +240,13 @@ return {
|
|||
color = { fg = ctp.subtext0 },
|
||||
})
|
||||
|
||||
ins_left({
|
||||
-- filesize component
|
||||
"filesize",
|
||||
cond = conditions.buffer_not_empty,
|
||||
color = { fg = ctp.subtext1 },
|
||||
})
|
||||
|
||||
ins_left({ "location", color = { fg = ctp.subtext1 } })
|
||||
-- visual separation using color only, no ASCII separators
|
||||
ins_left({ "location", color = { fg = ctp.overlay1 } })
|
||||
|
||||
ins_left({
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = { error = " ", warn = " ", info = " " },
|
||||
symbols = { error = "", warn = "", info = "" },
|
||||
diagnostics_color = {
|
||||
error = { fg = ctp.red },
|
||||
warn = { fg = ctp.yellow },
|
||||
|
|
@ -219,14 +262,13 @@ return {
|
|||
end,
|
||||
})
|
||||
|
||||
-- LSP client indicator (badge)
|
||||
ins_right({
|
||||
-- Lsp server name .
|
||||
function()
|
||||
local msg = "none"
|
||||
local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 })
|
||||
local clients = vim.lsp.get_clients()
|
||||
if next(clients) == nil then
|
||||
return msg
|
||||
return ""
|
||||
end
|
||||
for _, client in ipairs(clients) do
|
||||
local filetypes = client.config.filetypes
|
||||
|
|
@ -234,42 +276,41 @@ return {
|
|||
return client.name
|
||||
end
|
||||
end
|
||||
return msg
|
||||
end,
|
||||
icon = "",
|
||||
color = { fg = ctp.overlay1, gui = "bold" },
|
||||
})
|
||||
|
||||
-- Add components to right sections
|
||||
ins_right({
|
||||
"branch",
|
||||
icon = "",
|
||||
color = { fg = ctp.mauve, gui = "bold" },
|
||||
})
|
||||
|
||||
ins_right({
|
||||
"diff",
|
||||
-- Is it me or the symbol for modified us really weird
|
||||
symbols = { added = " ", modified = " ", removed = " " },
|
||||
diff_color = {
|
||||
added = { fg = ctp.green },
|
||||
modified = { fg = ctp.peach },
|
||||
removed = { fg = ctp.red },
|
||||
},
|
||||
cond = conditions.hide_in_width,
|
||||
})
|
||||
|
||||
ins_right({
|
||||
function()
|
||||
return "▊"
|
||||
return ""
|
||||
end,
|
||||
color = function()
|
||||
local color = get_mode_color()
|
||||
return { fg = color }
|
||||
end, -- Sets highlighting of component
|
||||
padding = { left = 1 },
|
||||
return { fg = ctp.sapphire, bg = blend_hex(ctp.base, ctp.sapphire, 0.254), gui = "bold" }
|
||||
end,
|
||||
padding = { left = 1, right = 1 },
|
||||
})
|
||||
|
||||
-- CMP badge (visible in insert mode)
|
||||
ins_right({
|
||||
function()
|
||||
return "CMP"
|
||||
end,
|
||||
cond = function()
|
||||
local mode = vim.api.nvim_get_mode().mode
|
||||
return mode == "i" or mode == "ic" or mode == "ix"
|
||||
end,
|
||||
color = { fg = ctp.base, bg = ctp.teal },
|
||||
padding = { left = 1, right = 1 },
|
||||
})
|
||||
|
||||
-- Language/filetype badge
|
||||
ins_right({
|
||||
"filetype",
|
||||
colored = false,
|
||||
icon_only = false,
|
||||
color = function()
|
||||
return { fg = ctp.text, ctp.surface0, gui = "bold" }
|
||||
end,
|
||||
padding = { left = 1, right = 1 },
|
||||
})
|
||||
|
||||
-- Minimal right side
|
||||
ins_right({ "progress", color = { fg = ctp.overlay1 } })
|
||||
|
||||
-- Now don't forget to initialize lualine
|
||||
lualine.setup(config)
|
||||
end,
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ in {
|
|||
enable = true;
|
||||
extraConfig = ''
|
||||
set -g @catppuccin_window_status_style "basic"
|
||||
set -g @catppuccin_status_background "#11111b"
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue