CHORE: CLeaned up neovim config

This commit is contained in:
2026-10-12 14:31:39 -04:00
parent 64f10cea52
commit 65be670447
14 changed files with 277 additions and 335 deletions
+30 -29
View File
@@ -1,40 +1,41 @@
local capabilities = require('blink.cmp').get_lsp_capabilities()
vim.lsp.config('lua_ls', {
capabilities = capabilities,
settings = {
Lua = {
diagnostics = { globals = { 'vim' } },
workspace = {
library = vim.api.nvim_get_runtime_file('', true),
checkThirdParty = false,
},
},
},
capabilities = capabilities,
settings = {
Lua = {
diagnostics = { globals = { 'vim' } },
workspace = {
library = vim.api.nvim_get_runtime_file('', true),
checkThirdParty = false,
},
},
},
})
vim.lsp.config('vtsls', {
settings = {
typescript = {
updateImportsOnFileMove = { enabled = 'always' },
inlayHints = {
parameterNames = { enabled = 'all' },
variableTypes = { enabled = true },
},
},
},
capabilities = capabilities,
settings = {
typescript = {
updateImportsOnFileMove = { enabled = 'always' },
inlayHints = {
parameterNames = { enabled = 'all' },
variableTypes = { enabled = true },
},
},
},
})
vim.lsp.config('html', {
capabilities = capabilities,
capabilities = capabilities,
})
vim.lsp.enable({
'lua_ls',
'clangd',
'rust-analyzer',
'vtsls',
'tailwindcss-language-server',
'cssls',
'html',
'gopls',
'pylsp'
'lua_ls',
'clangd',
'rust-analyzer',
'vtsls',
'tailwindcss-language-server',
'cssls',
'html',
'gopls',
'pylsp',
})
@@ -8,3 +8,4 @@ require('DarthMooMancer.plugins.mason')
require('DarthMooMancer.plugins.snacks')
require('DarthMooMancer.plugins.trouble')
require('DarthMooMancer.plugins.conform')
require('DarthMooMancer.plugins.mason-conform')
@@ -1,23 +1,21 @@
vim.pack.add({ 'https://github.com/stevearc/conform.nvim' })
require('conform').setup({
formatters_by_ft = {
rust = { 'rustfmt', lsp_format = 'fallback' },
lua = { 'stylua', lsp_format = 'fallback' },
javascript = { 'prettier', stop_after_first = true },
typescript = { 'prettier', stop_after_first = true },
json = { 'prettier' },
html = { 'prettier' },
go = { 'goimports' },
c = { 'clang-format' },
cpp = { 'clang-format' },
css = { 'csskit' },
dart = { 'dart_format', lsp_format = 'fallback' },
python = { 'autopep8' },
['_'] = { 'trim_whitespace' },
},
format_on_save = {
timeout_ms = 2000,
lsp_format = 'fallback',
},
formatters_by_ft = {
rust = { 'rustfmt', lsp_format = 'fallback' },
lua = { 'stylua', lsp_format = 'fallback' },
javascript = { 'prettier', stop_after_first = true },
typescript = { 'prettier', stop_after_first = true },
json = { 'prettier' },
html = { 'prettier' },
c = { 'clang-format' },
cpp = { 'clang-format' },
css = { 'csskit' },
python = { 'autopep8' },
['_'] = { 'trim_whitespace' },
},
format_on_save = {
timeout_ms = 2000,
lsp_format = 'fallback',
},
})
@@ -1,97 +0,0 @@
vim.pack.add({
{ src = 'https://github.com/b0o/incline.nvim' },
{ src = 'https://github.com/SmiteshP/nvim-navic' },
})
local helpers = require('incline.helpers')
local navic = require('nvim-navic')
local devicons = require('nvim-web-devicons')
vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('UserNavicAttach', { clear = true }),
callback = function(args)
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client and client.server_capabilities.documentSymbolProvider then
navic.attach(client, args.buf)
end
end,
})
require('incline').setup({
window = {
padding = 0,
margin = { horizontal = 0, vertical = 0 },
},
ignore = {
floating_wins = false,
wintypes = function(winid, wintype)
-- Check if snacks.zen is active anywhere in this tabpage
for _, w in ipairs(vim.api.nvim_tabpage_list_wins(0)) do
if vim.w[w].snacks_main then
return true -- Hide from ALL windows during Zen mode
end
end
-- Default incline behavior (ignore non-normal windows)
return wintype ~= ''
end,
},
render = function(props)
-- 1. Count normal splits in the current tabpage
local wins = vim.api.nvim_tabpage_list_wins(0)
local normal_splits = 0
for _, win in ipairs(wins) do
-- Also check for snacks.zen here as an immediate guard
if vim.w[win].snacks_main then
return ''
end
local config = vim.api.nvim_win_get_config(win)
if config.relative == '' then
normal_splits = normal_splits + 1
end
end
-- Hide if 2 or fewer normal splits are open (requires 3+)
if normal_splits <= 2 then
return ''
end
-- 2. Build the visual statusline
local filename =
vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ':t')
if filename == '' then
filename = '[No Name]'
end
local ft_icon, ft_color = devicons.get_icon_color(filename)
local modified = vim.bo[props.buf].modified
local res = {
ft_icon and {
' ',
ft_icon,
' ',
guibg = ft_color,
guifg = helpers.contrast_color(ft_color),
} or '',
' ',
{ filename, gui = modified and 'bold,italic' or 'bold' },
guibg = 'none',
}
if props.focused then
for _, item in ipairs(navic.get_data(props.buf) or {}) do
table.insert(res, {
{ ' > ', group = 'NavicSeparator' },
{ item.icon, group = 'NavicIcons' .. item.type },
{ item.name, group = 'NavicText' },
})
end
end
table.insert(res, ' ')
return res
end,
})
@@ -0,0 +1,6 @@
vim.pack.add({
{ src = 'https://git.moomancer.xyz/DarthMooMancer/mason-conform.nvim.git' },
})
require('mason-conform').setup({
ignore_install = {},
})
@@ -1,19 +1,19 @@
vim.pack.add({
{ src = 'https://github.com/mason-org/mason.nvim' },
{ src = 'https://github.com/mason-org/mason-lspconfig.nvim' },
{ src = 'https://github.com/neovim/nvim-lspconfig' },
{ src = 'https://github.com/mason-org/mason.nvim' },
{ src = 'https://github.com/mason-org/mason-lspconfig.nvim' },
{ src = 'https://github.com/neovim/nvim-lspconfig' },
})
require('mason').setup()
require('mason-lspconfig').setup({
ensure_installed = {
'vtsls',
'lua_ls',
'pylsp',
'gopls',
'html',
'cssls',
'bashls',
},
automatic_enable = false,
ensure_installed = {
'vtsls',
'lua_ls',
'pylsp',
'gopls',
'html',
'cssls',
'bashls',
},
automatic_enable = false,
})
@@ -1,34 +1,33 @@
vim.pack.add({
{
src = 'https://github.com/nvim-mini/mini.nvim.git',
version = vim.version.range('*')
}
{
src = 'https://github.com/nvim-mini/mini.nvim.git',
version = vim.version.range('*'),
},
})
local hipatterns = require('mini.hipatterns')
hipatterns.setup({
highlighters = {
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
fixme = {
pattern = '%f[%w]()FIXME()%f[%W]',
group = 'MiniHipatternsFixme',
},
hack = {
pattern = '%f[%w]()HACK()%f[%W]',
group = 'MiniHipatternsHack',
},
todo = {
pattern = '%f[%w]()TODO()%f[%W]',
group = 'MiniHipatternsTodo',
},
note = {
pattern = '%f[%w]()NOTE()%f[%W]',
group = 'MiniHipatternsNote',
},
highlighters = {
fixme = {
pattern = '%f[%w]()FIXME()%f[%W]',
group = 'MiniHipatternsFixme',
},
hack = {
pattern = '%f[%w]()HACK()%f[%W]',
group = 'MiniHipatternsHack',
},
todo = {
pattern = '%f[%w]()TODO()%f[%W]',
group = 'MiniHipatternsTodo',
},
note = {
pattern = '%f[%w]()NOTE()%f[%W]',
group = 'MiniHipatternsNote',
},
hex_color = hipatterns.gen_highlighter.hex_color(),
},
hex_color = hipatterns.gen_highlighter.hex_color(),
},
})
require('mini.pairs').setup()
-- require('mini.icons').setup()
require('mini.surround').setup()
@@ -1,20 +0,0 @@
vim.pack.add({
{ src = 'https://github.com/folke/noice.nvim' },
{ src = 'https://github.com/MunifTanjim/nui.nvim' },
})
require('noice').setup({
lsp = {
override = {
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
['vim.lsp.util.stylize_markdown'] = true,
},
},
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
})
@@ -1,25 +0,0 @@
vim.pack.add({
'https://github.com/sphamba/smear-cursor.nvim',
})
-- require('smear_cursor').setup({
-- matrix_pixel_threshold = 0.5,
-- stiffness = 0.8, -- 0.6 [0, 1]
-- trailing_stiffness = 0.6, -- 0.45 [0, 1]
-- stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
-- trailing_stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
-- damping = 0.95, -- 0.85 [0, 1]
-- damping_insert_mode = 0.95, -- 0.9 [0, 1]
-- distance_stop_animating = 0.5, -- 0.1 > 0
-- time_interval = 7,
-- })
--
require('smear_cursor').setup({
stiffness = 0.8, -- 0.6 [0, 1]
trailing_stiffness = 0.6, -- 0.45 [0, 1]
stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
trailing_stiffness_insert_mode = 0.7, -- 0.5 [0, 1]
damping = 0.95, -- 0.85 [0, 1]
damping_insert_mode = 0.95, -- 0.9 [0, 1]
distance_stop_animating = 0.5, -- 0.1 > 0
})
@@ -1,16 +0,0 @@
vim.pack.add({
{
src = 'https://github.com/blackhat-7/vellum.nvim',
},
})
vim.api.nvim_create_autocmd('FileType', {
pattern = 'markdown',
once = true,
callback = function()
local ok, vellum = pcall(require, 'vellum')
if ok then
vellum.setup({})
end
end,
})
@@ -1,34 +1,28 @@
local D = require('nvim-web-devicons')
local a, S = vim.api, vim.diagnostic.severity
local now = (vim.uv or vim.loop).now
local C = a.nvim_get_current_buf
local D, a, S = require('nvim-web-devicons'), vim.api, vim.diagnostic.severity
local now, cur = (vim.uv or vim.loop).now, a.nvim_get_current_buf
local function cn(c)
return c.name
end
local R = function()
vim.cmd.redrawstatus()
end
local T, JOB = {}, nil
local IV, LAST = 750, 0
local T, JOB, LAST = {}, nil, 0
local function snap(bb)
local nm = ' %F'
local i, hl = D.get_icon(a.nvim_buf_get_name(bb), nil, { default = true })
if i then
nm = ' %#' .. hl .. '#' .. i .. ' %*%F'
end
local x = vim.diagnostic.count(bb)
local function snap(b)
local i, hl = D.get_icon(a.nvim_buf_get_name(b), nil, { default = true })
local nm = i and ('%#' .. hl .. '#' .. i .. ' %*%t') or ' %t'
local x = vim.diagnostic.count(b)
local e, w, h = x[S.ERROR] or 0, x[S.WARN] or 0, x[S.HINT] or 0
local dg = (e > 0 and ('%#DiagnosticError#E' .. e .. '%* ') or '')
.. (w > 0 and ('%#DiagnosticWarn#W' .. w .. '%* ') or '')
.. (h > 0 and ('%#DiagnosticHint#H' .. h .. '%* ') or '')
local cs = vim.lsp.get_clients({ bufnr = bb })
local dg = (e > 0 and '%#DiagnosticError#E' .. e .. '%* ' or '')
.. (w > 0 and '%#DiagnosticWarn#W' .. w .. '%* ' or '')
.. (h > 0 and '%#DiagnosticHint#H' .. h .. '%* ' or '')
local cs = vim.lsp.get_clients({ bufnr = b })
local rd = #cs > 0 and ('󰄭 ' .. table.concat(vim.tbl_map(cn, cs), '/') .. ' ') or ''
return nm .. '%m%r %=' .. dg, rd
end
local function touch(bb, redraw)
vim.b[bb].d = true
local function touch(b, redraw)
vim.b[b].d = true
if redraw then
R()
end
@@ -44,7 +38,7 @@ local function sync(force)
break
end
end
if JOB ~= prev and (force or now() - LAST >= IV) then
if JOB ~= prev and (force or now() - LAST >= 750) then
LAST = now()
R()
end
@@ -59,8 +53,9 @@ au({ 'BufEnter', 'BufFilePost' }, function(e)
touch(e.buf, true)
end)
au('DiagnosticChanged', function(e)
touch(e.buf, e.buf == C())
touch(e.buf, e.buf == cur())
end)
au('FocusGained', R)
au({ 'LspAttach', 'LspDetach' }, function(e)
if e.event == 'LspDetach' then
T[e.data.client_id] = nil
@@ -69,27 +64,26 @@ au({ 'LspAttach', 'LspDetach' }, function(e)
touch(e.buf, true)
end)
au('LspProgress', function(e)
local v = e.data.params.value
local id, tk = e.data.client_id, e.data.params.token or 'default'
local v, id, tk = e.data.params.value, e.data.client_id, e.data.params.token or 'default'
T[id] = T[id] or {}
if v.kind == 'end' or (v.kind == 'report' and v.percentage == 100) then
T[id][tk] = nil
sync(true)
else
local title = (v.title and v.title ~= '') and v.title or nil
local msg = (v.message and v.message ~= '') and v.message or nil
T[id][tk] = (title and msg and (title .. ' ' .. msg)) or title or msg or 'Loading...'
local title = (v.title and v.title ~= '') and v.title
local msg = (v.message and v.message ~= '') and v.message
T[id][tk] = (title and msg and title .. ' ' .. msg) or title or msg or 'Loading...'
sync()
end
end)
au('FocusGained', R)
function _G.Status()
local v = vim.b
local buf = vim.g.statusline_winid and a.nvim_win_get_buf(vim.g.statusline_winid) or a.nvim_get_current_buf()
local v = vim.b[buf]
if not v.h or v.d then
v.h, v.r = snap(C())
v.h, v.r = snap(buf)
v.stl, v.d = v.h .. v.r, nil
end
return JOB and (v.h .. '%#DiagnosticInfo#' .. JOB .. '%* ') or v.stl
return JOB and (v.h .. '%#DiagnosticInfo#' .. JOB .. '%*') or v.stl
end
vim.opt.statusline = '%!v:lua.Status()'
+6 -26
View File
@@ -13,10 +13,6 @@
"rev": "721a75b9a0c2eb1fb811d34507708ee315cb04eb",
"src": "https://github.com/m4xshen/hardtime.nvim"
},
"incline.nvim": {
"rev": "debd628e9395f7a9da57bdc31ce75ca6b40a880b",
"src": "https://github.com/b0o/incline.nvim"
},
"kanso.nvim": {
"rev": "1afbbb449aa0254823dbe1932e3cbb51886ff9fe",
"src": "https://github.com/webhooked/kanso.nvim"
@@ -25,8 +21,12 @@
"rev": "a6307fa340ed7c0d96f5c567afc8c991aad94ce0",
"src": "https://github.com/brianhuster/live-preview.nvim"
},
"mason-conform.nvim": {
"rev": "132a3d0630de4bdb80e96ccd62b740fcf5754bdc",
"src": "https://git.moomancer.xyz/DarthMooMancer/mason-conform.nvim.git"
},
"mason-lspconfig.nvim": {
"rev": "b3298993d55fa194279b5eb9dbfb3a43da65cadf",
"rev": "e17625cdc8c2650787467398e02c5d63a2cde966",
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
},
"mason.nvim": {
@@ -38,22 +38,10 @@
"src": "https://github.com/nvim-mini/mini.nvim.git",
"version": ">=0.0.0"
},
"noice.nvim": {
"rev": "7bfd942445fb63089b59f97ca487d605e715f155",
"src": "https://github.com/folke/noice.nvim"
},
"nui.nvim": {
"rev": "10fc361835c856ba4233ef5ea135b919bf3dce97",
"src": "https://github.com/MunifTanjim/nui.nvim"
},
"nvim-lspconfig": {
"rev": "910f0c4d46aa186641518395bc7e6fffb4d23baf",
"rev": "c59fc922f718fa055f69f5f3bc888f23211571eb",
"src": "https://github.com/neovim/nvim-lspconfig"
},
"nvim-navic": {
"rev": "455808fd0fae06e6d70fadfd61432275db8f34ce",
"src": "https://github.com/SmiteshP/nvim-navic"
},
"nvim-tmux-navigation": {
"rev": "4898c98702954439233fdaf764c39636681e2861",
"src": "https://github.com/alexghergh/nvim-tmux-navigation"
@@ -74,10 +62,6 @@
"rev": "2b30e36fade3272081f7166bc0ec614b0b7da1c9",
"src": "https://git.moomancer.xyz/DarthMooMancer/polydev.git"
},
"smear-cursor.nvim": {
"rev": "f6cb57c342268177f719acc3968b9d8de3ecc969",
"src": "https://github.com/sphamba/smear-cursor.nvim"
},
"snacks.nvim": {
"rev": "882c996cf28183f4d63640de0b4c02ec886d01f2",
"src": "https://github.com/folke/snacks.nvim"
@@ -85,10 +69,6 @@
"trouble.nvim": {
"rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a",
"src": "https://github.com/folke/trouble.nvim"
},
"vellum.nvim": {
"rev": "c9a8665c5d306bf56c6df89896fed8bfaf3110b3",
"src": "https://github.com/blackhat-7/vellum.nvim"
}
}
}