Compare commits
4
Commits
37197ed4ae
...
50dbf88e19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50dbf88e19 | ||
|
|
65be670447 | ||
|
|
64f10cea52 | ||
|
|
16e44a8f42 |
@@ -6,6 +6,7 @@ font-size = 14
|
|||||||
scrollback-limit = 10000
|
scrollback-limit = 10000
|
||||||
macos-titlebar-style = transparent
|
macos-titlebar-style = transparent
|
||||||
macos-titlebar-proxy-icon = hidden
|
macos-titlebar-proxy-icon = hidden
|
||||||
|
macos-option-as-alt = true
|
||||||
title = " "
|
title = " "
|
||||||
background-opacity = 0.90
|
background-opacity = 0.90
|
||||||
background-blur = 64
|
background-blur = 64
|
||||||
|
|||||||
@@ -1,40 +1,41 @@
|
|||||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||||
vim.lsp.config('lua_ls', {
|
vim.lsp.config('lua_ls', {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
diagnostics = { globals = { 'vim' } },
|
diagnostics = { globals = { 'vim' } },
|
||||||
workspace = {
|
workspace = {
|
||||||
library = vim.api.nvim_get_runtime_file('', true),
|
library = vim.api.nvim_get_runtime_file('', true),
|
||||||
checkThirdParty = false,
|
checkThirdParty = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
vim.lsp.config('vtsls', {
|
vim.lsp.config('vtsls', {
|
||||||
settings = {
|
capabilities = capabilities,
|
||||||
typescript = {
|
settings = {
|
||||||
updateImportsOnFileMove = { enabled = 'always' },
|
typescript = {
|
||||||
inlayHints = {
|
updateImportsOnFileMove = { enabled = 'always' },
|
||||||
parameterNames = { enabled = 'all' },
|
inlayHints = {
|
||||||
variableTypes = { enabled = true },
|
parameterNames = { enabled = 'all' },
|
||||||
},
|
variableTypes = { enabled = true },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.config('html', {
|
vim.lsp.config('html', {
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.enable({
|
vim.lsp.enable({
|
||||||
'lua_ls',
|
'lua_ls',
|
||||||
'clangd',
|
'clangd',
|
||||||
'rust-analyzer',
|
'rust-analyzer',
|
||||||
'vtsls',
|
'vtsls',
|
||||||
'tailwindcss-language-server',
|
'tailwindcss-language-server',
|
||||||
'cssls',
|
'cssls',
|
||||||
'html',
|
'html',
|
||||||
'gopls',
|
'gopls',
|
||||||
'pylsp'
|
'pylsp',
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,3 +8,4 @@ require('DarthMooMancer.plugins.mason')
|
|||||||
require('DarthMooMancer.plugins.snacks')
|
require('DarthMooMancer.plugins.snacks')
|
||||||
require('DarthMooMancer.plugins.trouble')
|
require('DarthMooMancer.plugins.trouble')
|
||||||
require('DarthMooMancer.plugins.conform')
|
require('DarthMooMancer.plugins.conform')
|
||||||
|
require('DarthMooMancer.plugins.mason-conform')
|
||||||
|
|||||||
@@ -1,23 +1,21 @@
|
|||||||
vim.pack.add({ 'https://github.com/stevearc/conform.nvim' })
|
vim.pack.add({ 'https://github.com/stevearc/conform.nvim' })
|
||||||
|
|
||||||
require('conform').setup({
|
require('conform').setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
rust = { 'rustfmt', lsp_format = 'fallback' },
|
rust = { 'rustfmt', lsp_format = 'fallback' },
|
||||||
lua = { 'stylua', lsp_format = 'fallback' },
|
lua = { 'stylua', lsp_format = 'fallback' },
|
||||||
javascript = { 'prettier', stop_after_first = true },
|
javascript = { 'prettier', stop_after_first = true },
|
||||||
typescript = { 'prettier', stop_after_first = true },
|
typescript = { 'prettier', stop_after_first = true },
|
||||||
json = { 'prettier' },
|
json = { 'prettier' },
|
||||||
html = { 'prettier' },
|
html = { 'prettier' },
|
||||||
go = { 'goimports' },
|
c = { 'clang-format' },
|
||||||
c = { 'clang-format' },
|
cpp = { 'clang-format' },
|
||||||
cpp = { 'clang-format' },
|
css = { 'csskit' },
|
||||||
css = { 'csskit' },
|
python = { 'autopep8' },
|
||||||
dart = { 'dart_format', lsp_format = 'fallback' },
|
['_'] = { 'trim_whitespace' },
|
||||||
python = { 'autopep8' },
|
},
|
||||||
['_'] = { 'trim_whitespace' },
|
format_on_save = {
|
||||||
},
|
timeout_ms = 2000,
|
||||||
format_on_save = {
|
lsp_format = 'fallback',
|
||||||
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({
|
vim.pack.add({
|
||||||
{ src = 'https://github.com/mason-org/mason.nvim' },
|
{ src = 'https://github.com/mason-org/mason.nvim' },
|
||||||
{ src = 'https://github.com/mason-org/mason-lspconfig.nvim' },
|
{ src = 'https://github.com/mason-org/mason-lspconfig.nvim' },
|
||||||
{ src = 'https://github.com/neovim/nvim-lspconfig' },
|
{ src = 'https://github.com/neovim/nvim-lspconfig' },
|
||||||
})
|
})
|
||||||
|
|
||||||
require('mason').setup()
|
require('mason').setup()
|
||||||
require('mason-lspconfig').setup({
|
require('mason-lspconfig').setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
'vtsls',
|
'vtsls',
|
||||||
'lua_ls',
|
'lua_ls',
|
||||||
'pylsp',
|
'pylsp',
|
||||||
'gopls',
|
'gopls',
|
||||||
'html',
|
'html',
|
||||||
'cssls',
|
'cssls',
|
||||||
'bashls',
|
'bashls',
|
||||||
},
|
},
|
||||||
automatic_enable = false,
|
automatic_enable = false,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,34 +1,33 @@
|
|||||||
vim.pack.add({
|
vim.pack.add({
|
||||||
{
|
{
|
||||||
src = 'https://github.com/nvim-mini/mini.nvim.git',
|
src = 'https://github.com/nvim-mini/mini.nvim.git',
|
||||||
version = vim.version.range('*')
|
version = vim.version.range('*'),
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
local hipatterns = require('mini.hipatterns')
|
local hipatterns = require('mini.hipatterns')
|
||||||
hipatterns.setup({
|
hipatterns.setup({
|
||||||
highlighters = {
|
highlighters = {
|
||||||
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
fixme = {
|
||||||
fixme = {
|
pattern = '%f[%w]()FIXME()%f[%W]',
|
||||||
pattern = '%f[%w]()FIXME()%f[%W]',
|
group = 'MiniHipatternsFixme',
|
||||||
group = 'MiniHipatternsFixme',
|
},
|
||||||
},
|
hack = {
|
||||||
hack = {
|
pattern = '%f[%w]()HACK()%f[%W]',
|
||||||
pattern = '%f[%w]()HACK()%f[%W]',
|
group = 'MiniHipatternsHack',
|
||||||
group = 'MiniHipatternsHack',
|
},
|
||||||
},
|
todo = {
|
||||||
todo = {
|
pattern = '%f[%w]()TODO()%f[%W]',
|
||||||
pattern = '%f[%w]()TODO()%f[%W]',
|
group = 'MiniHipatternsTodo',
|
||||||
group = 'MiniHipatternsTodo',
|
},
|
||||||
},
|
note = {
|
||||||
note = {
|
pattern = '%f[%w]()NOTE()%f[%W]',
|
||||||
pattern = '%f[%w]()NOTE()%f[%W]',
|
group = 'MiniHipatternsNote',
|
||||||
group = 'MiniHipatternsNote',
|
},
|
||||||
},
|
|
||||||
|
|
||||||
hex_color = hipatterns.gen_highlighter.hex_color(),
|
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
require('mini.pairs').setup()
|
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,113 +1,89 @@
|
|||||||
local ok, D = pcall(require, 'nvim-web-devicons')
|
local D, a, S = require('nvim-web-devicons'), vim.api, vim.diagnostic.severity
|
||||||
local a, S = vim.api, vim.diagnostic.severity
|
local now, cur = (vim.uv or vim.loop).now, a.nvim_get_current_buf
|
||||||
local now = (vim.uv or vim.loop).now
|
local function cn(c)
|
||||||
local C = a.nvim_get_current_buf
|
return c.name
|
||||||
|
end
|
||||||
local R = function()
|
local R = function()
|
||||||
vim.cmd.redrawstatus()
|
vim.cmd.redrawstatus()
|
||||||
end -- absorb autocmd ev (.file etc.)
|
|
||||||
local M = '%m%r %='
|
|
||||||
local LOAD = '%#DiagnosticInfo#'
|
|
||||||
local T, JOB = {}, nil
|
|
||||||
local IV = vim.g.statusline_prog_interval or 750 -- ms cap between progress redraws
|
|
||||||
local LAST = 0
|
|
||||||
local function snap(bb)
|
|
||||||
local nm = ' %F' -- native tail: handles [No Name] and escaping in C
|
|
||||||
if ok then
|
|
||||||
local i, hl = D.get_icon(a.nvim_buf_get_name(bb), nil, { default = true })
|
|
||||||
if i then
|
|
||||||
nm = ' %#' .. hl .. '#' .. i .. ' %*%F'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local x = vim.diagnostic.count(bb)
|
|
||||||
local e, w, h = x[S.ERROR] or 0, x[S.WARN] or 0, x[S.HINT] or 0
|
|
||||||
local dg = ''
|
|
||||||
if e + w + h > 0 then
|
|
||||||
dg = (e > 0 and ('%#DiagnosticError#E' .. e .. '%* ') or '')
|
|
||||||
.. (w > 0 and ('%#DiagnosticWarn#W' .. w .. '%* ') or '')
|
|
||||||
.. (h > 0 and ('%#DiagnosticHint#H' .. h .. '%* ') or '')
|
|
||||||
end
|
|
||||||
local rd, cs = '', vim.lsp.get_clients({ bufnr = bb })
|
|
||||||
if #cs > 0 then
|
|
||||||
local nm2 = {}
|
|
||||||
for i = 1, #cs do
|
|
||||||
nm2[i] = cs[i].name
|
|
||||||
end
|
|
||||||
rd = ' ' .. table.concat(nm2, '/') .. ' '
|
|
||||||
end
|
|
||||||
return nm .. M .. dg, rd
|
|
||||||
end
|
end
|
||||||
local function touch(bb, redraw)
|
local T, JOB, LAST = {}, nil, 0
|
||||||
local v = vim.b[bb] -- per-buffer cache; nvim frees b: vars on unload
|
|
||||||
if v then
|
local function snap(b)
|
||||||
v.d = true
|
local i, hl = D.get_icon(a.nvim_buf_get_name(b), nil, { default = true })
|
||||||
end
|
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 = b })
|
||||||
|
local rd = #cs > 0 and (' ' .. table.concat(vim.tbl_map(cn, cs), '/') .. ' ') or ''
|
||||||
|
return nm .. '%m%r %=' .. dg, rd
|
||||||
|
end
|
||||||
|
|
||||||
|
local function touch(b, redraw)
|
||||||
|
vim.b[b].d = true
|
||||||
if redraw then
|
if redraw then
|
||||||
R()
|
R()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local function SYNC(force) -- refresh JOB; redraw only when it changed and (force or gate open)
|
|
||||||
|
local function sync(force)
|
||||||
local prev = JOB
|
local prev = JOB
|
||||||
JOB = nil
|
JOB = nil
|
||||||
for _, t in pairs(T) do
|
for _, t in pairs(T) do
|
||||||
for _, m in pairs(t) do
|
local _, m = next(t)
|
||||||
|
if m then
|
||||||
JOB = m
|
JOB = m
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
if JOB then
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
if JOB ~= prev and (force or now() - LAST >= IV) then
|
if JOB ~= prev and (force or now() - LAST >= 750) then
|
||||||
LAST = now()
|
LAST = now()
|
||||||
R()
|
R()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local G = a.nvim_create_augroup('STL5', { clear = true })
|
local G = a.nvim_create_augroup('STL5', { clear = true })
|
||||||
local function au(ev, cb)
|
local function au(ev, cb)
|
||||||
a.nvim_create_autocmd(ev, { group = G, callback = cb })
|
a.nvim_create_autocmd(ev, { group = G, callback = cb })
|
||||||
end
|
end
|
||||||
|
|
||||||
au({ 'BufEnter', 'BufFilePost' }, function(e)
|
au({ 'BufEnter', 'BufFilePost' }, function(e)
|
||||||
touch(e.buf, true)
|
touch(e.buf, true)
|
||||||
end)
|
end)
|
||||||
au('DiagnosticChanged', function(e)
|
au('DiagnosticChanged', function(e)
|
||||||
touch(e.buf, e.buf == C())
|
touch(e.buf, e.buf == cur())
|
||||||
end)
|
end)
|
||||||
|
au('FocusGained', R)
|
||||||
au({ 'LspAttach', 'LspDetach' }, function(e)
|
au({ 'LspAttach', 'LspDetach' }, function(e)
|
||||||
if e.event == 'LspDetach' then
|
if e.event == 'LspDetach' then
|
||||||
T[e.data.client_id] = nil
|
T[e.data.client_id] = nil
|
||||||
SYNC(true)
|
sync(true)
|
||||||
end
|
end
|
||||||
touch(e.buf, true)
|
touch(e.buf, true)
|
||||||
end)
|
end)
|
||||||
au('LspProgress', function(e)
|
au('LspProgress', function(e)
|
||||||
local v = e.data.params.value
|
local v, id, tk = e.data.params.value, e.data.client_id, e.data.params.token or 'default'
|
||||||
if type(v) ~= 'table' then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local id, tk = e.data.client_id, e.data.params.token or 'default'
|
|
||||||
T[id] = T[id] or {}
|
T[id] = T[id] or {}
|
||||||
if v.kind == 'end' or (v.kind == 'report' and v.percentage == 100) then
|
if v.kind == 'end' or (v.kind == 'report' and v.percentage == 100) then
|
||||||
T[id][tk] = nil
|
T[id][tk] = nil
|
||||||
SYNC(true) -- clear immediately, don't gate
|
sync(true)
|
||||||
else
|
else
|
||||||
local m = (v.title and v.title ~= '' and v.title) or v.message or 'Loading...'
|
local title = (v.title and v.title ~= '') and v.title
|
||||||
if v.title and v.message and v.message ~= '' then
|
local msg = (v.message and v.message ~= '') and v.message
|
||||||
m = v.title .. ' ' .. v.message
|
T[id][tk] = (title and msg and title .. ' ' .. msg) or title or msg or 'Loading...'
|
||||||
end
|
sync()
|
||||||
T[id][tk] = m
|
|
||||||
SYNC() -- gated: at most one redraw per IV ms
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
au('ColorScheme', R)
|
|
||||||
au('FocusGained', R)
|
function _G.Status()
|
||||||
local function Status()
|
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
|
local v = vim.b[buf]
|
||||||
if not v.h or v.d then
|
if not v.h or v.d then
|
||||||
v.h, v.r = snap(C())
|
v.h, v.r = snap(buf)
|
||||||
v.stl = v.h .. v.r
|
v.stl, v.d = v.h .. v.r, nil
|
||||||
v.d = nil
|
|
||||||
end
|
end
|
||||||
return JOB and (v.h .. LOAD .. JOB .. '%* ') or v.stl
|
return JOB and (v.h .. '%#DiagnosticInfo#' .. JOB .. '%*') or v.stl
|
||||||
end
|
end
|
||||||
_G.Status = Status
|
|
||||||
vim.opt.statusline = '%!v:lua.Status()'
|
vim.opt.statusline = '%!v:lua.Status()'
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
"rev": "721a75b9a0c2eb1fb811d34507708ee315cb04eb",
|
"rev": "721a75b9a0c2eb1fb811d34507708ee315cb04eb",
|
||||||
"src": "https://github.com/m4xshen/hardtime.nvim"
|
"src": "https://github.com/m4xshen/hardtime.nvim"
|
||||||
},
|
},
|
||||||
"incline.nvim": {
|
|
||||||
"rev": "debd628e9395f7a9da57bdc31ce75ca6b40a880b",
|
|
||||||
"src": "https://github.com/b0o/incline.nvim"
|
|
||||||
},
|
|
||||||
"kanso.nvim": {
|
"kanso.nvim": {
|
||||||
"rev": "1afbbb449aa0254823dbe1932e3cbb51886ff9fe",
|
"rev": "1afbbb449aa0254823dbe1932e3cbb51886ff9fe",
|
||||||
"src": "https://github.com/webhooked/kanso.nvim"
|
"src": "https://github.com/webhooked/kanso.nvim"
|
||||||
@@ -25,8 +21,12 @@
|
|||||||
"rev": "a6307fa340ed7c0d96f5c567afc8c991aad94ce0",
|
"rev": "a6307fa340ed7c0d96f5c567afc8c991aad94ce0",
|
||||||
"src": "https://github.com/brianhuster/live-preview.nvim"
|
"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": {
|
"mason-lspconfig.nvim": {
|
||||||
"rev": "b3298993d55fa194279b5eb9dbfb3a43da65cadf",
|
"rev": "e17625cdc8c2650787467398e02c5d63a2cde966",
|
||||||
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
||||||
},
|
},
|
||||||
"mason.nvim": {
|
"mason.nvim": {
|
||||||
@@ -38,22 +38,10 @@
|
|||||||
"src": "https://github.com/nvim-mini/mini.nvim.git",
|
"src": "https://github.com/nvim-mini/mini.nvim.git",
|
||||||
"version": ">=0.0.0"
|
"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": {
|
"nvim-lspconfig": {
|
||||||
"rev": "910f0c4d46aa186641518395bc7e6fffb4d23baf",
|
"rev": "c59fc922f718fa055f69f5f3bc888f23211571eb",
|
||||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||||
},
|
},
|
||||||
"nvim-navic": {
|
|
||||||
"rev": "455808fd0fae06e6d70fadfd61432275db8f34ce",
|
|
||||||
"src": "https://github.com/SmiteshP/nvim-navic"
|
|
||||||
},
|
|
||||||
"nvim-tmux-navigation": {
|
"nvim-tmux-navigation": {
|
||||||
"rev": "4898c98702954439233fdaf764c39636681e2861",
|
"rev": "4898c98702954439233fdaf764c39636681e2861",
|
||||||
"src": "https://github.com/alexghergh/nvim-tmux-navigation"
|
"src": "https://github.com/alexghergh/nvim-tmux-navigation"
|
||||||
@@ -74,10 +62,6 @@
|
|||||||
"rev": "2b30e36fade3272081f7166bc0ec614b0b7da1c9",
|
"rev": "2b30e36fade3272081f7166bc0ec614b0b7da1c9",
|
||||||
"src": "https://git.moomancer.xyz/DarthMooMancer/polydev.git"
|
"src": "https://git.moomancer.xyz/DarthMooMancer/polydev.git"
|
||||||
},
|
},
|
||||||
"smear-cursor.nvim": {
|
|
||||||
"rev": "f6cb57c342268177f719acc3968b9d8de3ecc969",
|
|
||||||
"src": "https://github.com/sphamba/smear-cursor.nvim"
|
|
||||||
},
|
|
||||||
"snacks.nvim": {
|
"snacks.nvim": {
|
||||||
"rev": "882c996cf28183f4d63640de0b4c02ec886d01f2",
|
"rev": "882c996cf28183f4d63640de0b4c02ec886d01f2",
|
||||||
"src": "https://github.com/folke/snacks.nvim"
|
"src": "https://github.com/folke/snacks.nvim"
|
||||||
@@ -85,10 +69,6 @@
|
|||||||
"trouble.nvim": {
|
"trouble.nvim": {
|
||||||
"rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a",
|
"rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a",
|
||||||
"src": "https://github.com/folke/trouble.nvim"
|
"src": "https://github.com/folke/trouble.nvim"
|
||||||
},
|
|
||||||
"vellum.nvim": {
|
|
||||||
"rev": "c9a8665c5d306bf56c6df89896fed8bfaf3110b3",
|
|
||||||
"src": "https://github.com/blackhat-7/vellum.nvim"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,62 +1,182 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# 1. Get active tmux sessions
|
# Ensure Homebrew and standard paths are accessible inside fzf's preview subshell
|
||||||
sessions=$(tmux list-sessions -F "#S" 2>/dev/null)
|
export PATH="/opt/homebrew/bin:/usr/local/bin:$HOME/.local/bin:$PATH"
|
||||||
|
|
||||||
# 2. Get directories from key work paths
|
# Tabs definition
|
||||||
dirs=$(find ~ ~/.config ~/Projects ~/dotfiles ~/personal \
|
TABS=("All" "Projects" "Dotfiles" "Blank Session")
|
||||||
-mindepth 1 -maxdepth 4 \
|
TOTAL=${#TABS[@]}
|
||||||
\( -name ".git" -o -name "node_modules" -o -name ".cache" -o -name "Library" \) -prune \
|
ACTIVE_TAB=0
|
||||||
-o -type d -print 2>/dev/null)
|
|
||||||
|
|
||||||
# 3. Dynamic Previewer (Tree view for folders, Window list for sessions)
|
# Terminal Palette Colors for the Tab Header (Ghostty palette 12 and 8)
|
||||||
|
CLR_ACTIVE=$(printf '\033[1;38;5;12m')
|
||||||
|
CLR_INACTIVE=$(printf '\033[38;5;8m')
|
||||||
|
CLR_RESET=$(printf '\033[0m')
|
||||||
|
|
||||||
|
# Dynamic Previewer (Restored exact working structure from your original script)
|
||||||
preview_cmd='
|
preview_cmd='
|
||||||
if [ -d {} ]; then
|
if [ "{}" = "[Create Blank Session in ~]" ]; then
|
||||||
if command -v eza &>/dev/null; then
|
echo "Will spawn an empty session in ~/"
|
||||||
eza --tree --level=2 --icons --color=always {}
|
elif [ -d {} ]; then
|
||||||
elif command -v tree &>/dev/null; then
|
if command -v eza >/dev/null 2>&1; then
|
||||||
tree -C -L 2 {}
|
eza --tree --level=2 --icons --color=always --git-ignore -I "node_modules|build|dist|target|.cache" {}
|
||||||
|
elif command -v tree >/dev/null 2>&1; then
|
||||||
|
tree -C -L 2 --gitignore -I "node_modules|build|dist|target|.cache" {}
|
||||||
else
|
else
|
||||||
ls -la --color=always {}
|
ls -la --color=always {}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
tmux list-windows -t {} 2>/dev/null
|
tmux list-windows -t {} 2>/dev/null || echo "Session or path: {}"
|
||||||
fi'
|
fi'
|
||||||
|
|
||||||
# 4. Kanagawa Wave Themed FZF Selector
|
get_projects() {
|
||||||
selected=$(printf "%s\n%s" "$sessions" "$dirs" | grep -v '^$' | fzf \
|
if command -v fd &>/dev/null; then
|
||||||
--layout=reverse \
|
[ -d "$HOME/Projects" ] && fd --type d --max-depth 2 . "$HOME/Projects" 2>/dev/null | sed 's:/*$::'
|
||||||
--border=rounded \
|
[ -d "$HOME/personal/Projects" ] && fd --type d --min-depth 2 --max-depth 2 . "$HOME/personal/Projects" 2>/dev/null | sed 's:/*$::'
|
||||||
--margin=1 \
|
else
|
||||||
--padding=1 \
|
if [ -d "$HOME/Projects" ]; then
|
||||||
--height=100% \
|
find "$HOME/Projects" -mindepth 1 -maxdepth 2 \
|
||||||
--prompt=" " \
|
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
|
||||||
--color="bg:#1F1F28,bg+:#223249,fg:#DCD7BA,fg+:#DCD7BA" \
|
-o -type d -print 2>/dev/null | sed 's:/*$::'
|
||||||
--color="hl:#2D4F67,hl+:#7E9CD8,prompt:#957FB8,pointer:#7E9CD8" \
|
fi
|
||||||
--color="info:#98BB6C,spinner:#957FB8,header:#7AA89F,border:#54546D" \
|
if [ -d "$HOME/personal/Projects" ]; then
|
||||||
--color="marker:#98BB6C" \
|
find "$HOME/personal/Projects" -mindepth 2 -maxdepth 2 \
|
||||||
--preview="$preview_cmd" \
|
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
|
||||||
--preview-window="right:55%:border-left")
|
-o -type d -print 2>/dev/null | sed 's:/*$::'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
get_dotfiles() {
|
||||||
|
if command -v fd &>/dev/null; then
|
||||||
|
# 1. Standard ~/.config/<app>
|
||||||
|
[ -d "$HOME/.config" ] && fd --type d --max-depth 1 . "$HOME/.config" 2>/dev/null | sed 's:/*$::'
|
||||||
|
|
||||||
|
# 2. ~/dotfiles direct packages (e.g. ~/dotfiles/nvim, ~/dotfiles/tmux)
|
||||||
|
# and stow structures (e.g. ~/dotfiles/nvim/.config/nvim or ~/dotfiles/.config/*)
|
||||||
|
if [ -d "$HOME/dotfiles" ]; then
|
||||||
|
# Top-level dotfile modules (depth 1)
|
||||||
|
fd --type d --max-depth 1 . "$HOME/dotfiles" 2>/dev/null | sed 's:/*$::'
|
||||||
|
|
||||||
|
# Unhide and drill down specifically into any .config folders inside dotfiles
|
||||||
|
fd --type d --hidden --no-ignore --max-depth 4 \
|
||||||
|
--full-path '.*/\.config/[^/]+$' "$HOME/dotfiles" 2>/dev/null | sed 's:/*$::'
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
# Fallback using find
|
||||||
|
if [ -d "$HOME/.config" ]; then
|
||||||
|
find "$HOME/.config" -mindepth 1 -maxdepth 1 -type d 2>/dev/null | sed 's:/*$::'
|
||||||
|
fi
|
||||||
|
if [ -d "$HOME/dotfiles" ]; then
|
||||||
|
# Dotfiles packages + nested .config targets up to 4 levels deep
|
||||||
|
find "$HOME/dotfiles" -mindepth 1 -maxdepth 4 \
|
||||||
|
\( -name ".git" -o -name "node_modules" -o -name ".cache" \) -prune \
|
||||||
|
-o -type d -print 2>/dev/null | grep -E '(dotfiles/[^/]+$|/\.config/[^/]+$)' | sed 's:/*$::'
|
||||||
|
fi
|
||||||
|
fi | sort -u
|
||||||
|
}
|
||||||
|
|
||||||
|
get_items_for_tab() {
|
||||||
|
local tab_idx=$1
|
||||||
|
case "$tab_idx" in
|
||||||
|
1) # Projects only
|
||||||
|
get_projects
|
||||||
|
;;
|
||||||
|
2) # Dotfiles only
|
||||||
|
get_dotfiles
|
||||||
|
;;
|
||||||
|
3) # Blank Session
|
||||||
|
echo "[Create Blank Session in ~]"
|
||||||
|
;;
|
||||||
|
*) # All: tmux sessions + projects + dotfiles + top-level home dirs
|
||||||
|
tmux list-sessions -F "#S" 2>/dev/null
|
||||||
|
get_projects
|
||||||
|
get_dotfiles
|
||||||
|
find "$HOME" -maxdepth 1 -mindepth 1 -type d ! -name "Library" 2>/dev/null | sed 's:/*$::'
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
render_header() {
|
||||||
|
local active=$1
|
||||||
|
local out=""
|
||||||
|
for i in "${!TABS[@]}"; do
|
||||||
|
local name="${TABS[$i]}"
|
||||||
|
if [ "$i" -eq "$active" ]; then
|
||||||
|
out+="${CLR_ACTIVE}[▶ ${name}]${CLR_RESET} "
|
||||||
|
else
|
||||||
|
out+="${CLR_INACTIVE} ${name} ${CLR_RESET} "
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
printf "%s\n" "$out"
|
||||||
|
}
|
||||||
|
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
# Tab Navigation Loop
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
selected=""
|
||||||
|
while true; do
|
||||||
|
fzf_output=$( { render_header "$ACTIVE_TAB"; get_items_for_tab "$ACTIVE_TAB" | grep -v '^$'; } | fzf \
|
||||||
|
--ansi \
|
||||||
|
--header-lines=1 \
|
||||||
|
--expect=tab,btab \
|
||||||
|
--layout=reverse \
|
||||||
|
--border=rounded \
|
||||||
|
--margin=15 \
|
||||||
|
--padding=0 \
|
||||||
|
--height=100% \
|
||||||
|
--prompt=" " \
|
||||||
|
--color="bg:#090E13,bg+:#22262D,fg:#c5c9c7,fg+:#ffffff" \
|
||||||
|
--color="hl:#7fb4ca,hl+:#7fb4ca,prompt:#7fb4ca,pointer:#22262D" \
|
||||||
|
--color="info:#5C6066,spinner:#5C6066,header:#5C6066,border:#2d3139" \
|
||||||
|
--color="label:#7fb4ca" \
|
||||||
|
--preview="$preview_cmd" \
|
||||||
|
--preview-window="right:55%:border-left")
|
||||||
|
|
||||||
|
fzf_status=$?
|
||||||
|
# Cancelled via Escape or Ctrl-C
|
||||||
|
[[ $fzf_status -ne 0 && $fzf_status -ne 1 ]] && exit 0
|
||||||
|
|
||||||
|
key=$(echo "$fzf_output" | head -n 1)
|
||||||
|
selection=$(echo "$fzf_output" | tail -n +2)
|
||||||
|
|
||||||
|
if [ "$key" = "tab" ]; then
|
||||||
|
ACTIVE_TAB=$(( (ACTIVE_TAB + 1) % TOTAL ))
|
||||||
|
elif [ "$key" = "btab" ]; then
|
||||||
|
ACTIVE_TAB=$(( (ACTIVE_TAB - 1 + TOTAL) % TOTAL ))
|
||||||
|
else
|
||||||
|
selected="$selection"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# Exit if fzf was cancelled
|
|
||||||
[[ -z "$selected" ]] && exit 0
|
[[ -z "$selected" ]] && exit 0
|
||||||
|
|
||||||
# 5. Handle Session Creation / Switching
|
# Strip trailing slash if present
|
||||||
if [[ -d "$selected" ]]; then
|
selected="${selected%/}"
|
||||||
# Selection is a DIRECTORY -> Create session named after folder
|
|
||||||
session_name=$(basename "$selected" | tr '.: ' '_')
|
|
||||||
|
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
# Handle Session Creation / Switching
|
||||||
|
# ---------------------------------------------------------
|
||||||
|
if [[ "$selected" == "[Create Blank Session in ~]" ]]; then
|
||||||
|
idx=1
|
||||||
|
while tmux has-session -t "=blank-$idx" 2>/dev/null; do
|
||||||
|
((idx++))
|
||||||
|
done
|
||||||
|
session_name="blank-$idx"
|
||||||
|
tmux new-session -d -s "$session_name" -c "$HOME"
|
||||||
|
elif [[ -d "$selected" ]]; then
|
||||||
|
session_name=$(basename "$selected" | tr '.: ' '_')
|
||||||
if ! tmux has-session -t "=$session_name" 2>/dev/null; then
|
if ! tmux has-session -t "=$session_name" 2>/dev/null; then
|
||||||
tmux new-session -d -s "$session_name" -c "$selected"
|
tmux new-session -d -s "$session_name" -c "$selected"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Selection is an EXISTING SESSION -> Connect directly
|
|
||||||
session_name="$selected"
|
session_name="$selected"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 6. Attach or Switch
|
|
||||||
if [[ -z "$TMUX" ]]; then
|
if [[ -z "$TMUX" ]]; then
|
||||||
exec tmux attach-session -t "$session_name"
|
exec tmux attach-session -t "$session_name"
|
||||||
else
|
else
|
||||||
tmux switch-client -t "$session_name"
|
tmux switch-client -t "$session_name"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user