Compare commits
13
Commits
f74d475dfb
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f58fc6411 | ||
|
|
d750bb2da1 | ||
|
|
50dbf88e19 | ||
|
|
65be670447 | ||
|
|
64f10cea52 | ||
|
|
16e44a8f42 | ||
|
|
37197ed4ae | ||
|
|
4275967e0a | ||
|
|
ca015f90f9 | ||
|
|
10ef727e6f | ||
|
|
1356ec1860 | ||
|
|
5e8d29a82b | ||
|
|
75e4e77dba |
@@ -0,0 +1,2 @@
|
||||
tmux/.config/tmux/plugins
|
||||
.DS_Store
|
||||
@@ -1,4 +1,4 @@
|
||||
Zenful Dotfiles
|
||||
|
||||
Daily Driving:
|
||||
Ghostty (With Neovim and Tmux) and Zen Browser for development
|
||||
Ghostty (With Neovim and Tmux)
|
||||
Vendored
BIN
Binary file not shown.
@@ -3,16 +3,17 @@ font-family = "JetBrainsMono Nerd Font Medium"
|
||||
font-thicken = true
|
||||
font-size = 14
|
||||
|
||||
scrollback-limit = 10000
|
||||
macos-titlebar-style = transparent
|
||||
macos-titlebar-proxy-icon = hidden
|
||||
macos-option-as-alt = true
|
||||
title = " "
|
||||
background-opacity = 0.92
|
||||
background-opacity = 0.90
|
||||
background-blur = 64
|
||||
confirm-close-surface = false
|
||||
window-padding-x = 15
|
||||
window-padding-y = 15
|
||||
mouse-hide-while-typing = true
|
||||
adjust-cell-height = 5%
|
||||
adjust-cell-width = -5%
|
||||
alpha-blending = linear-corrected
|
||||
mouse-hide-while-typing = true
|
||||
copy-on-select = true
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,342 @@
|
||||
vim.cmd('highlight clear')
|
||||
if vim.fn.exists('syntax_on') then
|
||||
vim.cmd.syntax('reset')
|
||||
end
|
||||
vim.o.background = 'dark'
|
||||
vim.g.colors_name = 'min-kanso'
|
||||
|
||||
---@class PaletteColors
|
||||
local palette = {
|
||||
zenBg0 = '#090E13',
|
||||
zenBg1 = '#1C1E25',
|
||||
zenBg2 = '#22262D',
|
||||
inkBg2 = '#22262D',
|
||||
inkBg3 = '#393B44',
|
||||
altBlue1 = '#223249',
|
||||
altBlue2 = '#2D4F67',
|
||||
diffGreen = '#2B3328',
|
||||
diffYellow = '#49443C',
|
||||
diffRed = '#43242B',
|
||||
diffBlue = '#252535',
|
||||
gitGreen = '#76946A',
|
||||
gitRed = '#C34043',
|
||||
gitYellow = '#DCA561',
|
||||
red = '#C34043',
|
||||
red2 = '#E46876',
|
||||
red3 = '#c4746e',
|
||||
yellow = '#DCA561',
|
||||
yellow2 = '#E6C384',
|
||||
yellow3 = '#c4b28a',
|
||||
green = '#98BB6C',
|
||||
green2 = '#87a987',
|
||||
green3 = '#8a9a7b',
|
||||
green4 = '#6A9589',
|
||||
green5 = '#7AA89F',
|
||||
blue = '#7FB4CA',
|
||||
blue2 = '#658594',
|
||||
blue3 = '#8ba4b0',
|
||||
violet = '#938AA9',
|
||||
violet2 = '#8992a7',
|
||||
pink = '#a292a3',
|
||||
orange = '#b6927b',
|
||||
orange2 = '#b98d7b',
|
||||
aqua = '#8ea4a2',
|
||||
fg = '#C5C9C7',
|
||||
fg2 = '#f2f1ef',
|
||||
gray = '#717C7C',
|
||||
gray2 = '#A4A7A4',
|
||||
gray3 = '#909398',
|
||||
gray4 = '#75797f',
|
||||
gray5 = '#5C6066',
|
||||
}
|
||||
|
||||
local theme = {
|
||||
ui = {
|
||||
none = 'NONE',
|
||||
fg = palette.fg,
|
||||
fg_dim = palette.gray2,
|
||||
fg_reverse = palette.altBlue1,
|
||||
bg_dim = palette.zenBg1,
|
||||
bg_m3 = palette.zenBg0,
|
||||
bg_m2 = palette.zenBg0,
|
||||
bg_m1 = palette.zenBg0,
|
||||
bg = palette.zenBg0,
|
||||
bg_p1 = palette.zenBg1,
|
||||
bg_p2 = palette.zenBg2,
|
||||
special = palette.gray5,
|
||||
indent_line = palette.inkBg2,
|
||||
active_indent_line = palette.inkBg3,
|
||||
whitespace = palette.inkBg3,
|
||||
nontext = palette.gray5,
|
||||
bg_visual = palette.inkBg3,
|
||||
bg_search = palette.altBlue2,
|
||||
cursor_line_nr_foreground = palette.gray5,
|
||||
cursor_line_nr_active_foreground = palette.fg2,
|
||||
cursor_bg = palette.fg2,
|
||||
cursor_fg = palette.zenBg0,
|
||||
pmenu = {
|
||||
fg = palette.fg2,
|
||||
fg_sel = 'NONE',
|
||||
bg = palette.zenBg0,
|
||||
bg_sel = palette.inkBg3,
|
||||
bg_thumb = palette.inkBg3,
|
||||
bg_sbar = palette.zenBg0,
|
||||
},
|
||||
float = {
|
||||
fg = palette.gray2,
|
||||
bg = palette.zenBg0,
|
||||
fg_border = palette.zenBg2,
|
||||
bg_border = palette.zenBg0,
|
||||
},
|
||||
},
|
||||
syn = {
|
||||
string = palette.green3,
|
||||
variable = 'NONE',
|
||||
number = palette.pink,
|
||||
constant = palette.orange,
|
||||
identifier = palette.violet2,
|
||||
parameter = palette.gray3,
|
||||
fun = palette.blue3,
|
||||
statement = palette.violet2,
|
||||
keyword = palette.violet2,
|
||||
operator = palette.gray3,
|
||||
preproc = palette.gray3,
|
||||
type = palette.aqua,
|
||||
regex = palette.red3,
|
||||
deprecated = palette.gray,
|
||||
punct = palette.gray3,
|
||||
comment = palette.gray4,
|
||||
special1 = palette.yellow3,
|
||||
special2 = palette.violet2,
|
||||
special3 = palette.violet2,
|
||||
},
|
||||
diag = {
|
||||
error = palette.red,
|
||||
ok = palette.green,
|
||||
warning = palette.yellow,
|
||||
info = palette.blue2,
|
||||
hint = palette.green4,
|
||||
},
|
||||
diff = {
|
||||
add = palette.diffGreen,
|
||||
delete = palette.diffRed,
|
||||
change = palette.diffBlue,
|
||||
text = palette.diffYellow,
|
||||
},
|
||||
vcs = {
|
||||
added = palette.gitGreen,
|
||||
removed = palette.gitRed,
|
||||
changed = palette.gitYellow,
|
||||
untracked = palette.gray4,
|
||||
},
|
||||
}
|
||||
|
||||
-- Helper function to batch-apply highlights
|
||||
local function set_highlights(highlights)
|
||||
for group, opts in pairs(highlights) do
|
||||
vim.api.nvim_set_hl(0, group, opts)
|
||||
end
|
||||
end
|
||||
|
||||
-- =========================================================================
|
||||
-- Highlights Map
|
||||
-- =========================================================================
|
||||
set_highlights({
|
||||
-- Editor Highlights
|
||||
ColorColumn = { bg = theme.ui.bg_p1 },
|
||||
Conceal = { fg = theme.ui.special, bold = true },
|
||||
CurSearch = { fg = theme.ui.fg, bg = theme.ui.bg_search, bold = true },
|
||||
Cursor = { fg = theme.ui.cursor_fg, bg = theme.ui.cursor_bg },
|
||||
lCursor = { link = 'Cursor' },
|
||||
CursorIM = { link = 'Cursor' },
|
||||
CursorColumn = { link = 'CursorLine' },
|
||||
CursorLine = { bg = theme.ui.bg_p2 },
|
||||
Directory = { fg = theme.syn.fun },
|
||||
DiffAdd = { bg = theme.diff.add },
|
||||
DiffChange = { bg = theme.diff.change },
|
||||
DiffDelete = { fg = theme.vcs.removed, bg = theme.diff.delete },
|
||||
DiffText = { bg = theme.diff.text },
|
||||
EndOfBuffer = { fg = theme.ui.bg },
|
||||
ErrorMsg = { fg = theme.diag.error },
|
||||
WinSeparator = { fg = theme.ui.bg_m3, bg = theme.ui.none },
|
||||
VertSplit = { link = 'WinSeparator' },
|
||||
Folded = { fg = theme.ui.special, bg = theme.ui.bg_p1 },
|
||||
FoldColumn = { fg = theme.ui.nontext, bg = theme.ui.none },
|
||||
SignColumn = { fg = theme.ui.special, bg = theme.ui.none },
|
||||
IncSearch = { fg = theme.ui.fg_reverse, bg = theme.diag.warning },
|
||||
Substitute = { fg = theme.ui.fg, bg = theme.vcs.removed },
|
||||
LineNr = { fg = theme.ui.cursor_line_nr_foreground, bg = theme.ui.none },
|
||||
CursorLineNr = { fg = theme.ui.cursor_line_nr_active_foreground, bg = theme.ui.none },
|
||||
MatchParen = { fg = theme.diag.warning, bold = true },
|
||||
ModeMsg = { fg = theme.diag.warning, bold = true },
|
||||
MsgArea = vim.o.cmdheight == 0 and { link = 'StatusLine' } or { fg = theme.ui.fg_dim },
|
||||
MsgSeparator = { bg = vim.o.cmdheight == 0 and theme.ui.bg or theme.ui.bg_m3 },
|
||||
MoreMsg = { fg = theme.diag.info },
|
||||
NonText = { fg = theme.ui.nontext },
|
||||
Normal = { fg = theme.ui.fg, bg = theme.ui.bg },
|
||||
NormalFloat = { fg = theme.ui.float.fg, bg = theme.ui.float.bg },
|
||||
FloatBorder = { fg = theme.ui.float.fg_border, bg = theme.ui.float.bg_border },
|
||||
FloatTitle = { fg = theme.ui.special, bg = theme.ui.float.bg_border, bold = true },
|
||||
FloatFooter = { fg = theme.ui.nontext, bg = theme.ui.float.bg_border },
|
||||
NormalNC = { link = 'Normal' },
|
||||
Pmenu = { fg = theme.ui.pmenu.fg, bg = theme.ui.pmenu.bg },
|
||||
PmenuSel = { fg = theme.ui.pmenu.fg_sel, bg = theme.ui.pmenu.bg_sel },
|
||||
PmenuKind = { fg = theme.ui.fg_dim, bg = theme.ui.pmenu.bg },
|
||||
PmenuKindSel = { fg = theme.ui.fg_dim, bg = theme.ui.pmenu.bg_sel },
|
||||
PmenuExtra = { fg = theme.ui.special, bg = theme.ui.pmenu.bg },
|
||||
PmenuExtraSel = { fg = theme.ui.special, bg = theme.ui.pmenu.bg_sel },
|
||||
PmenuSbar = { bg = theme.ui.pmenu.bg_sbar },
|
||||
PmenuThumb = { bg = theme.ui.pmenu.bg_thumb },
|
||||
Question = { link = 'MoreMsg' },
|
||||
QuickFixLine = { bg = theme.ui.bg_p1 },
|
||||
Search = { fg = theme.ui.fg, bg = theme.ui.bg_search },
|
||||
SpecialKey = { fg = theme.ui.special },
|
||||
SpellBad = { undercurl = true, sp = theme.diag.error },
|
||||
SpellCap = { undercurl = true, sp = theme.diag.warning },
|
||||
SpellLocal = { undercurl = true, sp = theme.diag.warning },
|
||||
SpellRare = { undercurl = true, sp = theme.diag.warning },
|
||||
StatusLine = { fg = theme.ui.fg_dim, bg = theme.ui.none },
|
||||
StatusLineNC = { fg = theme.ui.nontext, bg = theme.ui.none },
|
||||
TabLine = { bg = theme.ui.none, fg = theme.ui.special },
|
||||
TabLineFill = { bg = theme.ui.none },
|
||||
TabLineSel = { fg = theme.ui.fg_dim, bg = theme.ui.bg_p1, bold = true },
|
||||
Title = { fg = theme.syn.fun, bold = true },
|
||||
Visual = { bg = theme.ui.bg_visual },
|
||||
VisualNOS = { link = 'Visual' },
|
||||
WarningMsg = { fg = theme.diag.warning },
|
||||
Whitespace = { fg = theme.ui.whitespace },
|
||||
WildMenu = { link = 'Pmenu' },
|
||||
WinBar = { fg = theme.ui.fg_dim, bg = theme.ui.none },
|
||||
WinBarNC = { fg = theme.ui.fg_dim, bg = theme.ui.none },
|
||||
|
||||
debugPC = { bg = theme.diff.delete },
|
||||
debugBreakpoint = { fg = theme.syn.special1, bg = theme.ui.none },
|
||||
|
||||
LspReferenceText = { bg = theme.ui.bg_p2 },
|
||||
LspReferenceRead = { link = 'LspReferenceText' },
|
||||
LspReferenceWrite = { bg = theme.ui.bg_p2, underline = true },
|
||||
|
||||
-- Diagnostics
|
||||
DiagnosticError = { fg = theme.diag.error },
|
||||
DiagnosticWarn = { fg = theme.diag.warning },
|
||||
DiagnosticInfo = { fg = theme.diag.info },
|
||||
DiagnosticHint = { fg = theme.diag.hint },
|
||||
DiagnosticOk = { fg = theme.diag.ok },
|
||||
DiagnosticFloatingError = { fg = theme.diag.error },
|
||||
DiagnosticFloatingWarn = { fg = theme.diag.warning },
|
||||
DiagnosticFloatingInfo = { fg = theme.diag.info },
|
||||
DiagnosticFloatingHint = { fg = theme.diag.hint },
|
||||
DiagnosticFloatingOk = { fg = theme.diag.ok },
|
||||
DiagnosticSignError = { fg = theme.diag.error, bg = theme.ui.none },
|
||||
DiagnosticSignWarn = { fg = theme.diag.warning, bg = theme.ui.none },
|
||||
DiagnosticSignInfo = { fg = theme.diag.info, bg = theme.ui.none },
|
||||
DiagnosticSignHint = { fg = theme.diag.hint, bg = theme.ui.none },
|
||||
DiagnosticVirtualTextError = { link = 'DiagnosticError' },
|
||||
DiagnosticVirtualTextWarn = { link = 'DiagnosticWarn' },
|
||||
DiagnosticVirtualTextInfo = { link = 'DiagnosticInfo' },
|
||||
DiagnosticVirtualTextHint = { link = 'DiagnosticHint' },
|
||||
DiagnosticUnderlineError = { undercurl = true, sp = theme.diag.error },
|
||||
DiagnosticUnderlineWarn = { undercurl = true, sp = theme.diag.warning },
|
||||
DiagnosticUnderlineInfo = { undercurl = true, sp = theme.diag.info },
|
||||
DiagnosticUnderlineHint = { undercurl = true, sp = theme.diag.hint },
|
||||
|
||||
LspSignatureActiveParameter = { fg = theme.diag.warning },
|
||||
LspCodeLens = { fg = theme.syn.comment },
|
||||
|
||||
-- Diff / VCS
|
||||
diffAdded = { fg = theme.vcs.added },
|
||||
diffRemoved = { fg = theme.vcs.removed },
|
||||
diffDeleted = { fg = theme.vcs.removed },
|
||||
diffChanged = { fg = theme.vcs.changed },
|
||||
diffOldFile = { fg = theme.vcs.removed },
|
||||
diffNewFile = { fg = theme.vcs.added },
|
||||
|
||||
-- Syntax Highlights
|
||||
Comment = { fg = theme.syn.comment, italic = true },
|
||||
Constant = { fg = theme.syn.constant },
|
||||
String = { fg = theme.syn.string },
|
||||
Character = { link = 'String' },
|
||||
Number = { fg = theme.syn.number },
|
||||
Boolean = { fg = theme.syn.constant },
|
||||
Float = { link = 'Number' },
|
||||
Identifier = { fg = theme.syn.identifier },
|
||||
Function = { fg = theme.syn.fun },
|
||||
Statement = { fg = theme.syn.statement },
|
||||
Operator = { fg = theme.syn.operator },
|
||||
Keyword = { fg = theme.syn.keyword, italic = true },
|
||||
Exception = { fg = theme.syn.special2 },
|
||||
PreProc = { fg = theme.syn.preproc },
|
||||
Type = { fg = theme.syn.type },
|
||||
Special = { fg = theme.syn.special1 },
|
||||
Delimiter = { fg = theme.syn.punct },
|
||||
Underlined = { fg = theme.syn.special1, underline = true },
|
||||
Bold = { bold = true },
|
||||
Italic = { italic = true },
|
||||
Ignore = { link = 'NonText' },
|
||||
Error = { fg = theme.diag.error },
|
||||
Todo = { fg = theme.ui.fg_reverse, bg = theme.diag.info, bold = true },
|
||||
qfLineNr = { link = 'LineNr' },
|
||||
qfFileName = { link = 'Directory' },
|
||||
markdownCode = { fg = theme.syn.string },
|
||||
markdownCodeBlock = { fg = theme.syn.string },
|
||||
markdownEscape = { fg = theme.ui.none },
|
||||
|
||||
-- Treesitter Highlights
|
||||
['@variable'] = { fg = theme.ui.fg },
|
||||
['@variable.builtin'] = { fg = theme.syn.special2, italic = true },
|
||||
['@variable.parameter'] = { fg = theme.syn.parameter },
|
||||
['@variable.member'] = { fg = theme.syn.identifier },
|
||||
['@string.regexp'] = { fg = theme.syn.regex },
|
||||
['@string.escape'] = { fg = theme.syn.regex },
|
||||
['@string.special.symbol'] = { fg = theme.syn.identifier },
|
||||
['@type'] = { link = 'Type' },
|
||||
['@type.builtin'] = { fg = theme.syn.type },
|
||||
['@attribute'] = { link = 'Constant' },
|
||||
['@property'] = { fg = theme.syn.identifier },
|
||||
['@function'] = { link = 'Function' },
|
||||
['@function.builtin'] = { link = 'Function' },
|
||||
['@function.call'] = { link = 'Function' },
|
||||
['@function.method'] = { link = 'Function' },
|
||||
['@function.method.call'] = { link = 'Function' },
|
||||
['@constructor'] = { fg = theme.syn.special1 },
|
||||
['@constructor.lua'] = { fg = theme.syn.keyword },
|
||||
['@operator'] = { link = 'Operator' },
|
||||
['@keyword.coroutine'] = { fg = theme.syn.keyword },
|
||||
['@keyword.function'] = { fg = theme.syn.keyword },
|
||||
['@keyword.operator'] = { fg = theme.syn.operator },
|
||||
['@keyword.import'] = { link = 'PreProc' },
|
||||
['@keyword.modifier'] = { fg = theme.syn.keyword },
|
||||
['@keyword.storage'] = { fg = theme.syn.keyword },
|
||||
['@keyword.return'] = { fg = theme.syn.special3, italic = true },
|
||||
['@keyword.exception'] = { fg = theme.syn.special3 },
|
||||
['@keyword.conditional'] = { fg = theme.syn.keyword },
|
||||
['@punctuation.delimiter'] = { fg = theme.syn.punct },
|
||||
['@punctuation.bracket'] = { fg = theme.syn.punct },
|
||||
['@punctuation.special'] = { fg = theme.syn.special1 },
|
||||
['@comment.error'] = { fg = theme.ui.fg, bg = theme.diag.error, bold = true },
|
||||
['@comment.warning'] = { fg = theme.ui.fg_reverse, bg = theme.diag.warning, bold = true },
|
||||
['@comment.note'] = { fg = theme.ui.fg_reverse, bg = theme.diag.hint, bold = true },
|
||||
-- ['@comment.documentation'] = { link = '@tag' },
|
||||
['@markup.strong'] = { bold = true },
|
||||
['@markup.italic'] = { italic = true },
|
||||
['@markup.strikethrough'] = { strikethrough = true },
|
||||
['@markup.underline'] = { underline = true },
|
||||
['@markup.heading'] = { link = 'Function' },
|
||||
['@markup.quote'] = { link = '@variable.parameter' },
|
||||
['@markup.math'] = { link = 'Constant' },
|
||||
['@markup.environment'] = { link = 'Keyword' },
|
||||
['@markup.raw'] = { link = 'String' },
|
||||
['@diff.plus'] = { fg = theme.vcs.added },
|
||||
['@diff.minus'] = { fg = theme.vcs.removed },
|
||||
['@diff.delta'] = { fg = theme.vcs.changed },
|
||||
['@tag.attribute'] = { fg = theme.syn.identifier },
|
||||
['@tag.delimiter'] = { fg = theme.syn.punct },
|
||||
['@lsp.type.keyword.lua'] = { fg = theme.syn.regex },
|
||||
|
||||
-- Plugins (Blink/Cmp, etc.)
|
||||
BlinkCmpMenu = { link = 'Pmenu' },
|
||||
BlinkCmpMenuSelection = { link = 'PmenuSel' },
|
||||
BlinkCmpMenuBorder = { fg = theme.ui.bg_search, bg = theme.ui.pmenu.bg },
|
||||
BlinkCmpLabel = { fg = theme.ui.pmenu.fg },
|
||||
BlinkCmpLabelMatch = { fg = theme.syn.fun },
|
||||
})
|
||||
@@ -1,5 +1,8 @@
|
||||
vim.loader.enable()
|
||||
require('DarthMooMancer.opts')
|
||||
vim.cmd.colorscheme('min-kanso')
|
||||
|
||||
require('DarthMooMancer.plugins')
|
||||
require('DarthMooMancer.keymaps')
|
||||
require('DarthMooMancer.ui')
|
||||
require('DarthMooMancer.statusline')
|
||||
require('DarthMooMancer.lsp')
|
||||
|
||||
@@ -1,63 +1,46 @@
|
||||
vim.keymap.set('v', 'J', ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set('v', 'K', ":m '<-2<CR>gv=gv")
|
||||
vim.keymap.set('n', '<leader>ff', function()
|
||||
local map = vim.keymap.set
|
||||
|
||||
map('v', 'J', ":m '>+1<CR>gv=gv")
|
||||
map('v', 'K', ":m '<-2<CR>gv=gv")
|
||||
map('n', '<leader>ff', function()
|
||||
require('conform').format({ async = true, lsp_format = 'never' })
|
||||
end)
|
||||
vim.keymap.set('n', '<leader>vs', ':vsplit<CR>')
|
||||
vim.keymap.set('n', '<leader>ss', ':split<CR>')
|
||||
vim.keymap.set('n', '<leader>E', ':Ex<CR>')
|
||||
vim.keymap.set('n', '<C-u>', '<C-u>zz')
|
||||
vim.keymap.set('n', '<C-d>', '<C-d>zz')
|
||||
vim.keymap.set('n', 'n', 'nzzzv')
|
||||
vim.keymap.set('n', 'N', 'Nzzzv')
|
||||
vim.keymap.set('x', '<leader>p', [["_dP]])
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader><leader>',
|
||||
function() Snacks.picker.files() end
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fh',
|
||||
function() Snacks.picker.help() end
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fg',
|
||||
function() Snacks.picker.grep() end
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>fm',
|
||||
function() Snacks.picker.man() end
|
||||
)
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>xn',
|
||||
function() Snacks.picker.notifications() end
|
||||
)
|
||||
map('n', '<leader>vs', ':vsplit<CR>')
|
||||
map('n', '<leader>ss', ':split<CR>')
|
||||
map('n', '<C-u>', '<C-u>zz')
|
||||
map('n', '<C-d>', '<C-d>zz')
|
||||
map('n', 'n', 'nzzzv')
|
||||
map('n', 'N', 'Nzzzv')
|
||||
map('x', '<leader>p', [["_dP]])
|
||||
map('n', '<leader><leader>', function()
|
||||
Snacks.picker.files()
|
||||
end)
|
||||
map('n', '<leader>fh', function()
|
||||
Snacks.picker.help()
|
||||
end)
|
||||
map('n', '<leader>fg', function()
|
||||
Snacks.picker.grep()
|
||||
end)
|
||||
map('n', '<leader>uu', function()
|
||||
Snacks.picker.undo()
|
||||
end)
|
||||
|
||||
vim.keymap.set(
|
||||
'n',
|
||||
'<leader>uu',
|
||||
function() Snacks.picker.undo() end
|
||||
)
|
||||
|
||||
vim.keymap.set('n', '<leader>fs', vim.lsp.buf.document_symbol)
|
||||
vim.keymap.set('n', '<leader>gd', vim.lsp.buf.definition)
|
||||
vim.keymap.set('n', '<leader>gr', vim.lsp.buf.references)
|
||||
vim.keymap.set('n', '<leader>gR', vim.lsp.buf.rename)
|
||||
vim.keymap.set('n', '<leader>gc', vim.lsp.buf.code_action)
|
||||
vim.keymap.set('n', '<leader>[', '<c-w>H', { silent = true, noremap = true })
|
||||
vim.keymap.set('n', '<leader>]', '<c-w>K', { silent = true, noremap = true })
|
||||
vim.keymap.set('n', '[q', ':cprev<CR>zz', { desc = 'Previous Quickfix Item' })
|
||||
vim.keymap.set('n', ']q', ':cnext<CR>zz', { desc = 'Next Quickfix Item' })
|
||||
vim.keymap.set('n', '<leader>qo', ':copen<CR>', { desc = 'Open Quickfix' })
|
||||
vim.keymap.set('n', '<leader>qc', ':cclose<CR>', { desc = 'Close Quickfix' })
|
||||
vim.keymap.set('n', '<leader>lp', ':LivePreview pick<cr>')
|
||||
vim.keymap.set('n', '<C-h>', ':NvimTmuxNavigateLeft<CR>', { silent = true })
|
||||
vim.keymap.set('n', '<C-j>', ':NvimTmuxNavigateDown<CR>', { silent = true })
|
||||
vim.keymap.set('n', '<C-k>', ':NvimTmuxNavigateUp<CR>', { silent = true })
|
||||
vim.keymap.set('n', '<C-l>', ':NvimTmuxNavigateRight<CR>', { silent = true })
|
||||
vim.keymap.set('n', '<leader>xx', ':Trouble diagnostics toggle<cr>')
|
||||
vim.keymap.set('n', '<leader>zz', function() Snacks.zen() end)
|
||||
map('n', '<leader>E', ':Ex<CR>')
|
||||
map('n', '<leader>fs', vim.lsp.buf.document_symbol)
|
||||
map('n', '<leader>gd', vim.lsp.buf.definition)
|
||||
map('n', '<leader>gr', vim.lsp.buf.references)
|
||||
map('n', '<leader>gR', vim.lsp.buf.rename)
|
||||
map('n', '<leader>gc', vim.lsp.buf.code_action)
|
||||
map('n', '<leader>[', '<c-w>H', { silent = true, noremap = true })
|
||||
map('n', '<leader>]', '<c-w>K', { silent = true, noremap = true })
|
||||
map('n', '<leader>lp', '<cmd>LivePreview pick<cr>')
|
||||
map('n', '<C-h>', '<cmd>NvimTmuxNavigateLeft<CR>', { silent = true })
|
||||
map('n', '<C-j>', '<cmd>NvimTmuxNavigateDown<CR>', { silent = true })
|
||||
map('n', '<C-k>', '<cmd>NvimTmuxNavigateUp<CR>', { silent = true })
|
||||
map('n', '<C-l>', '<cmd>NvimTmuxNavigateRight<CR>', { silent = true })
|
||||
map('n', '<leader>xx', function()
|
||||
vim.diagnostic.jump({ count = 1, float = false })
|
||||
end)
|
||||
map('n', '<leader>zz', function()
|
||||
Snacks.zen()
|
||||
end)
|
||||
|
||||
@@ -1,16 +1,33 @@
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
require('lazydev').setup({
|
||||
library = {
|
||||
{ path = '${3rd}/luv/library', words = { 'vim%.uv' } },
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config('*', { capabilities = require('blink.cmp').get_lsp_capabilities() })
|
||||
vim.lsp.config('lua_ls', {
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { 'vim' } },
|
||||
completion = { callSnippet = 'Replace' },
|
||||
hint = { enable = true },
|
||||
codeLens = {
|
||||
enable = true,
|
||||
},
|
||||
type = {
|
||||
checkTableShape = true, -- Warns if you pass a table missing required fields
|
||||
inferParamType = true, -- Tries to figure out argument types from usage
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
didChangeWatchedFiles = {
|
||||
dynamicRegistration = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config('vtsls', {
|
||||
settings = {
|
||||
typescript = {
|
||||
@@ -23,18 +40,13 @@ vim.lsp.config('vtsls', {
|
||||
},
|
||||
})
|
||||
|
||||
vim.lsp.config('html', {
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
vim.lsp.enable({
|
||||
'lua_ls',
|
||||
'clangd',
|
||||
'rust-analyzer',
|
||||
'vtsls',
|
||||
'tailwindcss-language-server',
|
||||
'cssls',
|
||||
'html',
|
||||
'gopls',
|
||||
'pylsp'
|
||||
'pylsp',
|
||||
-- 'rust-analyzer',
|
||||
-- 'vtsls',
|
||||
-- 'tailwindcss-language-server',
|
||||
-- 'cssls',
|
||||
-- 'html',
|
||||
})
|
||||
|
||||
@@ -2,77 +2,42 @@ vim.opt.termguicolors = true
|
||||
vim.g.mapleader = ' '
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.tabstop = 8 -- Number of spaces a <Tab> counts for
|
||||
vim.opt.shiftwidth = 8 -- Number of spaces for autoindent (>>, <<, etc.)
|
||||
vim.opt.softtabstop = 8 -- Number of spaces for <Tab> in insert mode (backspace deletes 4 spaces)
|
||||
vim.opt.expandtab = true -- Use spaces instead of tabs
|
||||
vim.opt.colorcolumn = '100'
|
||||
local shifts = {
|
||||
lua = 4,
|
||||
python = 4,
|
||||
|
||||
rust = 4,
|
||||
dart = 2,
|
||||
html = 2,
|
||||
javascript = 2,
|
||||
typescript = 2,
|
||||
}
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = vim.tbl_keys(shifts),
|
||||
callback = function(ev)
|
||||
local map = {
|
||||
rust = { ts = 4, sw = 4, sts = 4 },
|
||||
lua = { ts = 4, sw = 4, sts = 4 },
|
||||
python = { ts = 4, sw = 4, sts = 4 },
|
||||
dart = { ts = 2, sw = 2, sts = 2 },
|
||||
html = { ts = 2, sw = 2, sts = 2 },
|
||||
javascript = { ts = 2, sw = 2, sts = 2 },
|
||||
typescript = { ts = 2, sw = 2, sts = 2 },
|
||||
}
|
||||
local ft = map[ev.match]
|
||||
if ft then
|
||||
vim.bo[ev.buf].tabstop = ft.ts
|
||||
vim.bo[ev.buf].shiftwidth = ft.sw
|
||||
vim.bo[ev.buf].softtabstop = ft.sts
|
||||
vim.bo[ev.buf].expandtab = ft.et ~= nil and ft.et or true
|
||||
end
|
||||
local size = shifts[ev.match]
|
||||
vim.bo[ev.buf].tabstop = size
|
||||
vim.bo[ev.buf].shiftwidth = size
|
||||
vim.bo[ev.buf].softtabstop = size
|
||||
vim.bo[ev.buf].expandtab = true
|
||||
end,
|
||||
})
|
||||
vim.opt.autoindent = true -- Copy indent from current line when starting a new line
|
||||
vim.opt.wrap = false
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.signcolumn = 'yes'
|
||||
vim.opt.signcolumn = 'number'
|
||||
vim.opt.undofile = true -- Keeps undo history even after we close a file
|
||||
vim.opt.scrolloff = 4
|
||||
vim.opt.sidescrolloff = 8
|
||||
vim.opt.scrolloff = 15
|
||||
vim.opt.sidescrolloff = 15
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.completeopt = { 'menuone', 'noselect', 'popup' }
|
||||
vim.opt.cursorline = true -- enable cursorline
|
||||
vim.opt.cursorlineopt = { 'screenline', 'number' } -- cursorline look
|
||||
vim.g.netrw_browse_split = 0
|
||||
vim.g.netrw_banner = 0
|
||||
vim.g.netrw_liststyle = 3
|
||||
vim.g.netrw_winsize = 25
|
||||
vim.opt.wrapscan = true -- begin search from top of the file when nothng is found
|
||||
vim.opt.cursorline = true -- enable cursorline
|
||||
vim.opt.cursorlineopt = { 'screenline', 'number' } -- cursorline look
|
||||
vim.opt.foldmethod = 'indent'
|
||||
vim.opt.foldcolumn = '1'
|
||||
vim.opt.foldenable = false
|
||||
vim.opt.shortmess = 'aF' -- abbreviates messages and prevents file name being echoed when opened
|
||||
vim.opt.ignorecase = false -- ignore cases when searching
|
||||
vim.opt.smartcase = true -- However if we use a capital in search string we then consider case-sensitivity, ignorecase is disabled
|
||||
vim.opt.smartindent = false -- smarter indentation
|
||||
vim.opt.smarttab = true -- make tab behaviour smarter
|
||||
vim.opt.laststatus = 3
|
||||
vim.opt.showmode = false
|
||||
vim.opt.cmdheight = 0
|
||||
vim.opt.smoothscroll = true
|
||||
vim.opt.spell = true
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true, -- This is the magic line
|
||||
signs = true, -- Shows icons in the gutter
|
||||
underline = true,
|
||||
update_in_insert = false, -- Don't clutter the screen while typing
|
||||
severity_sort = true,
|
||||
})
|
||||
vim.diagnostic.config({ severity_sort = true })
|
||||
vim.o.winborder = 'rounded'
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'text', 'plaintex' },
|
||||
callback = function()
|
||||
-- Enable visual soft-wrapping
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.linebreak = true
|
||||
vim.opt_local.breakindent = true
|
||||
|
||||
-- Remap j/k to visual lines only inside this buffer
|
||||
vim.keymap.set('n', 'j', 'gj', { buffer = true })
|
||||
vim.keymap.set('n', 'k', 'gk', { buffer = true })
|
||||
end,
|
||||
})
|
||||
vim.opt.updatetime = 250
|
||||
|
||||
@@ -1,12 +1,38 @@
|
||||
require('DarthMooMancer.plugins.utils')
|
||||
vim.pack.add({
|
||||
{ src = 'https://github.com/folke/snacks.nvim' },
|
||||
{ src = 'https://github.com/nvim-mini/mini.nvim.git', version = vim.version.range('*') },
|
||||
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter' },
|
||||
{ src = 'https://github.com/windwp/nvim-ts-autotag' },
|
||||
{ src = 'https://github.com/saghen/blink.cmp', version = vim.version.range('*') },
|
||||
{ src = 'https://github.com/folke/lazydev.nvim' },
|
||||
{ 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/stevearc/conform.nvim' },
|
||||
{ src = 'https://git.moomancer.xyz/DarthMooMancer/mason-conform.nvim.git' },
|
||||
{ src = 'https://github.com/alexghergh/nvim-tmux-navigation' },
|
||||
{ src = 'https://github.com/brianhuster/live-preview.nvim' },
|
||||
{ src = 'https://github.com/rachartier/tiny-inline-diagnostic.nvim' },
|
||||
})
|
||||
|
||||
vim.opt.rtp:append('/Users/andrew/personal/Projects/Lua/vern-nvim')
|
||||
require('nvim-tmux-navigation').setup({
|
||||
disable_when_zoomed = true, -- defaults to false
|
||||
})
|
||||
|
||||
require('tiny-inline-diagnostic').setup({
|
||||
preset = 'minimal',
|
||||
options = {
|
||||
multilines = {
|
||||
enabled = true,
|
||||
always_show = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require('DarthMooMancer.plugins.blink-cmp')
|
||||
require('DarthMooMancer.plugins.kanso')
|
||||
require('DarthMooMancer.plugins.mini-nvim')
|
||||
require('DarthMooMancer.plugins.polydev')
|
||||
require('DarthMooMancer.plugins.vern')
|
||||
require('DarthMooMancer.plugins.treesitter')
|
||||
require('DarthMooMancer.plugins.incline')
|
||||
require('DarthMooMancer.plugins.mason')
|
||||
require('DarthMooMancer.plugins.noice')
|
||||
require('DarthMooMancer.plugins.snacks')
|
||||
require('DarthMooMancer.plugins.trouble')
|
||||
require('DarthMooMancer.plugins.conform')
|
||||
|
||||
@@ -1,30 +1,21 @@
|
||||
vim.pack.add({
|
||||
{
|
||||
src = 'https://github.com/saghen/blink.cmp',
|
||||
version = vim.version.range('*'),
|
||||
}
|
||||
})
|
||||
|
||||
require('blink.cmp').setup({
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
auto_show_delay_ms = 100,
|
||||
window = {
|
||||
winhighlight = 'Normal:NormalFloat,FloatBorder:SnacksPickerBorder,CursorLine:Visual,Search:None',
|
||||
},
|
||||
auto_show_delay_ms = 150,
|
||||
},
|
||||
menu = {
|
||||
draw = {
|
||||
columns = {
|
||||
{ "label", "label_description", gap = 1 },
|
||||
{ "kind_icon", "kind", gap = 1 },
|
||||
{ "source_name", gap = 1 },
|
||||
},
|
||||
},
|
||||
scrollbar = false,
|
||||
winhighlight =
|
||||
'Pmenu:NormalFloat,FloatBorder:SnacksPickerBorder,PmenuSel:Visual,CursorLine:Visual,Search:None',
|
||||
},
|
||||
},
|
||||
sources = {
|
||||
default = { 'lazydev', 'lsp', 'buffer', 'snippets', 'path' },
|
||||
providers = {
|
||||
lazydev = {
|
||||
name = 'LazyDev',
|
||||
module = 'lazydev.integrations.blink',
|
||||
score_offset = 100,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
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' },
|
||||
python = { 'ruff_fix', 'ruff_format' },
|
||||
['_'] = { 'trim_whitespace' },
|
||||
},
|
||||
format_on_save = {
|
||||
|
||||
@@ -1,50 +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 },
|
||||
},
|
||||
render = function(props)
|
||||
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,
|
||||
})
|
||||
@@ -1,19 +0,0 @@
|
||||
vim.pack.add({'https://github.com/webhooked/kanso.nvim' })
|
||||
|
||||
require('kanso').setup({
|
||||
transparent = true,
|
||||
overrides = function(colors)
|
||||
local theme = colors.theme
|
||||
return {
|
||||
Normal = { bg = "none" },
|
||||
NormalFloat = { bg = "none" },
|
||||
FloatBorder = { bg = "none" },
|
||||
FloatTitle = { bg = "none" },
|
||||
SnacksPickerBorder = { fg = theme.ui.special, bg = "none" },
|
||||
SnacksPickerTitle = { fg = theme.ui.special, bg = "none" },
|
||||
SnacksInputBorder = { fg = theme.ui.special, bg = "none" },
|
||||
}
|
||||
end,
|
||||
})
|
||||
|
||||
vim.cmd.colorscheme('kanso-zen')
|
||||
@@ -1,19 +1,12 @@
|
||||
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' },
|
||||
})
|
||||
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = {
|
||||
'vtsls',
|
||||
'lua_ls',
|
||||
'pylsp',
|
||||
'gopls',
|
||||
'html',
|
||||
'cssls',
|
||||
'bashls',
|
||||
},
|
||||
automatic_enable = false,
|
||||
})
|
||||
require('mason-conform').setup()
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
vim.pack.add({
|
||||
{
|
||||
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',
|
||||
@@ -31,4 +23,5 @@ hipatterns.setup({
|
||||
})
|
||||
|
||||
require('mini.pairs').setup()
|
||||
-- require('mini.icons').setup()
|
||||
require('mini.surround').setup()
|
||||
require('mini.icons').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,3 +0,0 @@
|
||||
vim.pack.add({'https://git.moomancer.xyz/DarthMooMancer/polydev.git' })
|
||||
|
||||
require('Polydev').setup()
|
||||
@@ -1,5 +1,3 @@
|
||||
vim.pack.add({ 'https://github.com/folke/snacks.nvim' })
|
||||
|
||||
require('snacks').setup({
|
||||
notifier = {
|
||||
enabled = true,
|
||||
@@ -15,17 +13,28 @@ require('snacks').setup({
|
||||
selected = ' ',
|
||||
},
|
||||
},
|
||||
|
||||
layout = {
|
||||
preview = false,
|
||||
},
|
||||
dim = {
|
||||
scope = {
|
||||
min_size = 3, -- Lower minimum so short loops/branches don't get ignored
|
||||
max_size = 40, -- Allow slightly larger blocks (functions/structs) to stay lit
|
||||
siblings = false, -- Set to false so only the exact active scope is highlighted
|
||||
},
|
||||
animate = {
|
||||
enabled = vim.fn.has('nvim-0.10') == 1,
|
||||
easing = 'outCubic',
|
||||
duration = {
|
||||
step = 15, -- ms per step
|
||||
total = 180, -- maximum duration
|
||||
},
|
||||
},
|
||||
},
|
||||
zen = {
|
||||
enabled = true,
|
||||
toggles = {
|
||||
dim = false,
|
||||
dim = true,
|
||||
diagnostics = true,
|
||||
inlay_hints = true,
|
||||
inlay_hints = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,24 +1,18 @@
|
||||
vim.pack.add({
|
||||
{
|
||||
src = 'https://github.com/nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
},
|
||||
{ src = 'https://github.com/windwp/nvim-ts-autotag' },
|
||||
})
|
||||
|
||||
require('nvim-treesitter').install({
|
||||
local parsers = {
|
||||
'json',
|
||||
'rust',
|
||||
'c',
|
||||
'cpp',
|
||||
'lua',
|
||||
'javascript',
|
||||
'go',
|
||||
'typescript',
|
||||
'tsx',
|
||||
'css',
|
||||
'html',
|
||||
'python',
|
||||
'yaml',
|
||||
})
|
||||
}
|
||||
require('nvim-treesitter').install(parsers)
|
||||
|
||||
require('nvim-ts-autotag').setup({
|
||||
opts = {
|
||||
@@ -28,22 +22,16 @@ require('nvim-ts-autotag').setup({
|
||||
},
|
||||
})
|
||||
|
||||
local group = vim.api.nvim_create_augroup('UserTreesitter', { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = {
|
||||
'c',
|
||||
'cpp',
|
||||
'rust',
|
||||
'lua',
|
||||
'typescript',
|
||||
'javascript',
|
||||
'css',
|
||||
'html',
|
||||
'python',
|
||||
'go',
|
||||
'yaml',
|
||||
},
|
||||
callback = function()
|
||||
vim.treesitter.start()
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
group = group,
|
||||
desc = 'Start treesitter highlighting when a parser is installed',
|
||||
callback = function(ev)
|
||||
local lang = vim.treesitter.language.get_lang(ev.match) or ev.match
|
||||
if not vim.treesitter.language.add(lang) then
|
||||
return
|
||||
end
|
||||
vim.treesitter.start(ev.buf, lang)
|
||||
end,
|
||||
})
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
vim.pack.add({ 'https://github.com/folke/trouble.nvim' })
|
||||
require('trouble').setup({})
|
||||
@@ -1,13 +0,0 @@
|
||||
vim.pack.add({
|
||||
{ src = 'https://github.com/nvim-tree/nvim-web-devicons' },
|
||||
{ src = 'https://github.com/alexghergh/nvim-tmux-navigation' },
|
||||
|
||||
{ src = 'https://github.com/brianhuster/live-preview.nvim' },
|
||||
{ src = 'https://github.com/m4xshen/hardtime.nvim' },
|
||||
})
|
||||
|
||||
require('nvim-tmux-navigation').setup({
|
||||
disable_when_zoomed = true, -- defaults to false
|
||||
})
|
||||
|
||||
require("hardtime").setup()
|
||||
@@ -0,0 +1,12 @@
|
||||
require('vern-nvim').setup({
|
||||
workspace_root = '~/personal/Projects_Testing',
|
||||
c = {
|
||||
templates = {
|
||||
extras = {
|
||||
linter = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,71 @@
|
||||
local icon_cache = {}
|
||||
|
||||
local diagnostic_configs = {
|
||||
{ sev = vim.diagnostic.severity.ERROR, label = 'E', hl = 'DiagnosticError' },
|
||||
{ sev = vim.diagnostic.severity.WARN, label = 'W', hl = 'DiagnosticWarn' },
|
||||
{ sev = vim.diagnostic.severity.HINT, label = 'H', hl = 'DiagnosticHint' },
|
||||
}
|
||||
|
||||
function _G.Status()
|
||||
local win = tonumber(vim.g.statusline_winid)
|
||||
local buf = (win and vim.api.nvim_win_is_valid(win)) and vim.api.nvim_win_get_buf(win)
|
||||
or vim.api.nvim_get_current_buf()
|
||||
local bufname = vim.api.nvim_buf_get_name(buf)
|
||||
local display_path = vim.fn.fnamemodify(bufname, ':.')
|
||||
if display_path == '' then
|
||||
display_path = '[No Name]'
|
||||
end
|
||||
|
||||
local ext = vim.fn.fnamemodify(bufname, ':e')
|
||||
if ext == '' then
|
||||
ext = display_path
|
||||
end
|
||||
local icon, hl = icon_cache[ext]
|
||||
if not icon then
|
||||
icon, hl = MiniIcons.get('file', display_path)
|
||||
icon_cache[ext] = { icon, hl }
|
||||
else
|
||||
icon, hl = icon[1], icon[2]
|
||||
end
|
||||
|
||||
local nm = (icon ~= '' and hl ~= '') and ('%#' .. hl .. '#' .. icon .. '%* ' .. display_path)
|
||||
or (' ' .. display_path)
|
||||
|
||||
local counts = vim.diagnostic.count(buf)
|
||||
local parts = {}
|
||||
|
||||
for _, cfg in ipairs(diagnostic_configs) do
|
||||
local n = counts[cfg.sev]
|
||||
if n and n > 0 then
|
||||
parts[#parts + 1] = ('%%#%s#%s%d%%*'):format(cfg.hl, cfg.label, n)
|
||||
end
|
||||
end
|
||||
local dg = #parts > 0 and (table.concat(parts, ' ') .. ' ') or ''
|
||||
|
||||
local clients = vim.lsp.get_clients({ bufnr = buf })
|
||||
local lsp_clients = ''
|
||||
if #clients > 0 then
|
||||
local names = vim.tbl_map(function(c)
|
||||
return c.name
|
||||
end, clients)
|
||||
lsp_clients = ' ' .. table.concat(names, '/') .. ' '
|
||||
end
|
||||
|
||||
local lsp_progress = vim.lsp.status()
|
||||
local progress_str = lsp_progress ~= '' and ('%#DiagnosticInfo#' .. lsp_progress .. '%* ') or ''
|
||||
|
||||
return nm .. '%m%r %=' .. dg .. lsp_clients .. progress_str
|
||||
end
|
||||
|
||||
vim.opt.statusline = '%!v:lua.Status()'
|
||||
|
||||
local augroup = vim.api.nvim_create_augroup('CustomStatusline', { clear = true })
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ 'DiagnosticChanged', 'LspAttach', 'LspDetach', 'BufEnter', 'LspProgress' },
|
||||
{
|
||||
group = augroup,
|
||||
callback = function()
|
||||
vim.cmd.redrawstatus()
|
||||
end,
|
||||
}
|
||||
)
|
||||
@@ -1,337 +0,0 @@
|
||||
local function derive_hl(name, opts)
|
||||
local base = opts.base and vim.api.nvim_get_hl(0, { name = opts.base })
|
||||
or {}
|
||||
local fg = opts.fg and vim.api.nvim_get_hl(0, { name = opts.fg }) or {}
|
||||
local bg = opts.bg and vim.api.nvim_get_hl(0, { name = opts.bg }) or {}
|
||||
vim.api.nvim_set_hl(0, name, {
|
||||
fg = fg.fg or base.fg,
|
||||
bg = bg.bg or base.bg,
|
||||
bold = opts.bold,
|
||||
})
|
||||
end
|
||||
|
||||
local function derive_mode_hl(name, color_group)
|
||||
local color = vim.api.nvim_get_hl(0, { name = color_group })
|
||||
local status_bg = vim.api.nvim_get_hl(0, { name = 'StatusLine' })
|
||||
vim.api.nvim_set_hl(0, name, {
|
||||
bg = color.fg,
|
||||
fg = status_bg.bg or '#191724',
|
||||
bold = true,
|
||||
})
|
||||
end
|
||||
|
||||
local function setup_statusline_highlights()
|
||||
derive_mode_hl('StatusModeNormal', 'Type')
|
||||
derive_mode_hl('StatusModeInsert', 'String')
|
||||
derive_mode_hl('StatusModeVisual', 'Statement')
|
||||
derive_mode_hl('StatusModeCommand', 'PreProc')
|
||||
derive_mode_hl('StatusModeReplace', 'WarningMsg')
|
||||
derive_mode_hl('StatusModeTerminal', 'Special')
|
||||
derive_hl('StatusGit', { base = 'CursorLine', fg = 'Normal' })
|
||||
derive_hl(
|
||||
'StatusLspWorking',
|
||||
{ base = 'StatusLine', fg = 'DiagnosticInfo' }
|
||||
)
|
||||
derive_hl('StatusLspReady', { base = 'StatusLine', fg = 'Constant' })
|
||||
derive_hl('StatusLspNone', { base = 'StatusLine', fg = 'NonText' })
|
||||
derive_hl(
|
||||
'StatusDiagError',
|
||||
{ base = 'StatusLine', fg = 'DiagnosticError' }
|
||||
)
|
||||
derive_hl('StatusDiagWarn', { base = 'StatusLine', fg = 'DiagnosticWarn' })
|
||||
derive_hl('StatusDiagHint', { base = 'StatusLine', fg = 'DiagnosticHint' })
|
||||
derive_hl('StatusCursor', { base = 'CursorLine', fg = 'Normal' })
|
||||
derive_hl('StatusGitAdded', { base = 'StatusLine', fg = 'DiagnosticOk' })
|
||||
derive_hl(
|
||||
'StatusGitRemoved',
|
||||
{ base = 'StatusLine', fg = 'DiagnosticError' }
|
||||
)
|
||||
derive_hl('StatusRecording', { base = 'StatusLine', fg = 'WarningMsg' })
|
||||
end
|
||||
vim.api.nvim_create_autocmd('ColorScheme', {
|
||||
callback = setup_statusline_highlights,
|
||||
})
|
||||
setup_statusline_highlights()
|
||||
|
||||
local mode_map = {
|
||||
n = ' NORM ',
|
||||
i = ' INS ',
|
||||
v = ' VIS ',
|
||||
V = ' V-LINE ',
|
||||
['\22'] = ' V-BLK ',
|
||||
['\19'] = ' V-BLK ',
|
||||
s = ' VIS ',
|
||||
S = ' V-LINE ',
|
||||
R = ' REPL ',
|
||||
c = ' CMD ',
|
||||
r = ' PROMPT ',
|
||||
t = ' TERM ',
|
||||
['!'] = ' SHELL ',
|
||||
}
|
||||
|
||||
local mode_hl_map = {
|
||||
n = 'StatusModeNormal',
|
||||
i = 'StatusModeInsert',
|
||||
v = 'StatusModeVisual',
|
||||
V = 'StatusModeVisual',
|
||||
['^V'] = 'StatusModeVisual',
|
||||
s = 'StatusModeVisual',
|
||||
S = 'StatusModeVisual',
|
||||
['^S'] = 'StatusModeVisual',
|
||||
R = 'StatusModeReplace',
|
||||
c = 'StatusModeCommand',
|
||||
r = 'StatusModeCommand',
|
||||
['!'] = 'StatusModeCommand',
|
||||
t = 'StatusModeTerminal',
|
||||
}
|
||||
|
||||
local function refresh_status(buf)
|
||||
local b = vim.b[buf]
|
||||
local left, right = {}, {}
|
||||
|
||||
if b.git_branch and b.git_branch ~= '' then
|
||||
left[#left + 1] = '%#StatusGit# ' .. b.git_branch .. ' %*'
|
||||
end
|
||||
local diff = b.git_diff
|
||||
if diff then
|
||||
if diff.added > 0 then
|
||||
left[#left + 1] = '%#StatusGitAdded# +' .. diff.added .. '%*'
|
||||
end
|
||||
if diff.removed > 0 then
|
||||
left[#left + 1] = '%#StatusGitRemoved# -' .. diff.removed .. '%*'
|
||||
end
|
||||
end
|
||||
if b.recording then
|
||||
right[#right + 1] = '%#StatusRecording# ' .. b.recording .. ' %*'
|
||||
end
|
||||
if b.diag_str then
|
||||
right[#right + 1] = b.diag_str
|
||||
end
|
||||
if b.lsp_icon and b.lsp_icon ~= '' then
|
||||
right[#right + 1] = '%#'
|
||||
.. b.lsp_hl
|
||||
.. '#'
|
||||
.. b.lsp_icon
|
||||
.. (b.lsp_name or '')
|
||||
.. ' %*'
|
||||
end
|
||||
|
||||
b.status_left = #left > 0 and table.concat(left) or ''
|
||||
b.status_right = #right > 0 and table.concat(right) or ''
|
||||
end
|
||||
|
||||
local lsp_icon = {
|
||||
none = '',
|
||||
starting = '',
|
||||
working = ' ',
|
||||
ready = ' ',
|
||||
}
|
||||
local lsp_hl = {
|
||||
none = 'StatusLspNone',
|
||||
starting = 'StatusLspNone',
|
||||
working = 'StatusLspWorking',
|
||||
ready = 'StatusLspReady',
|
||||
}
|
||||
local active_progress = {}
|
||||
|
||||
local function refresh_lsp(buf)
|
||||
local state = 'ready'
|
||||
local clients = vim.lsp.get_clients({ bufnr = buf })
|
||||
if #clients == 0 then
|
||||
state = 'none'
|
||||
vim.b[buf].lsp_name = ''
|
||||
else
|
||||
local names = {}
|
||||
for _, client in ipairs(clients) do
|
||||
names[#names + 1] = client.name
|
||||
local prog = active_progress[client.id]
|
||||
if prog == 'working' then
|
||||
state = 'working'
|
||||
elseif prog == 'starting' and state ~= 'working' then
|
||||
state = 'starting'
|
||||
end
|
||||
vim.b[buf].lsp_name = table.concat(names, '/')
|
||||
end
|
||||
end
|
||||
vim.b[buf].lsp_icon = lsp_icon[state]
|
||||
vim.b[buf].lsp_hl = lsp_hl[state]
|
||||
refresh_status(buf)
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'LspAttach', 'LspDetach' }, {
|
||||
callback = function(ev)
|
||||
if ev.event == 'LspAttach' then
|
||||
local cid = ev.data.client_id
|
||||
if not active_progress[cid] then
|
||||
active_progress[cid] = 'starting'
|
||||
vim.defer_fn(function()
|
||||
if active_progress[cid] == 'starting' then
|
||||
active_progress[cid] = nil
|
||||
if vim.api.nvim_buf_is_valid(ev.buf) then
|
||||
refresh_lsp(ev.buf)
|
||||
end
|
||||
end
|
||||
end, 500) -- 500ms grace period to wait for LspProgress
|
||||
end
|
||||
elseif ev.event == 'LspDetach' then
|
||||
active_progress[ev.data.client_id] = nil
|
||||
end
|
||||
refresh_lsp(ev.buf)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('LspProgress', {
|
||||
callback = function(ev)
|
||||
local kind = ev.data.params.value and ev.data.params.value.kind
|
||||
if kind == 'begin' or kind == 'report' then
|
||||
active_progress[ev.data.client_id] = 'working'
|
||||
elseif kind == 'end' then
|
||||
active_progress[ev.data.client_id] = nil
|
||||
else
|
||||
return
|
||||
end
|
||||
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||
if client then
|
||||
for buf in pairs(client.attached_buffers) do
|
||||
refresh_lsp(buf)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local BRANCH_ICON = ' '
|
||||
|
||||
local function refresh_branch(buf)
|
||||
local file = vim.api.nvim_buf_get_name(buf)
|
||||
if file == '' or vim.bo[buf].buftype ~= '' then
|
||||
vim.b[buf].git_branch = ''
|
||||
return
|
||||
end
|
||||
local cwd = vim.fs.root(buf, '.git') or vim.fs.dirname(file)
|
||||
|
||||
vim.system(
|
||||
{ 'git', 'branch', '--show-current' },
|
||||
{ text = true, cwd = cwd },
|
||||
vim.schedule_wrap(function(out)
|
||||
if not vim.api.nvim_buf_is_valid(buf) then
|
||||
return
|
||||
end
|
||||
local branch = (out.code == 0 and out.stdout or ''):gsub('%s+', '')
|
||||
vim.b[buf].git_branch = branch ~= '' and (BRANCH_ICON .. branch)
|
||||
or ''
|
||||
refresh_status(buf)
|
||||
end)
|
||||
)
|
||||
end
|
||||
|
||||
local function refresh_diff(buf)
|
||||
local file = vim.api.nvim_buf_get_name(buf)
|
||||
if file == '' or vim.bo[buf].buftype ~= '' then
|
||||
vim.b[buf].git_diff = nil
|
||||
return
|
||||
end
|
||||
local cwd = vim.fs.root(buf, '.git') or vim.fs.dirname(file)
|
||||
vim.system(
|
||||
{ 'git', 'diff', '--numstat', 'HEAD', '--', file },
|
||||
{ text = true, cwd = cwd },
|
||||
vim.schedule_wrap(function(out)
|
||||
if not vim.api.nvim_buf_is_valid(buf) then
|
||||
return
|
||||
end
|
||||
if out.code ~= 0 or out.stdout == '' then
|
||||
vim.b[buf].git_diff = nil
|
||||
else
|
||||
local added, removed = out.stdout:match('(%d+)%s+(%d+)')
|
||||
if added and removed then
|
||||
vim.b[buf].git_diff = {
|
||||
added = tonumber(added) or 0,
|
||||
removed = tonumber(removed) or 0,
|
||||
}
|
||||
else
|
||||
vim.b[buf].git_diff = nil
|
||||
end
|
||||
end
|
||||
refresh_status(buf)
|
||||
end)
|
||||
)
|
||||
end
|
||||
|
||||
local function refresh_diag(buf)
|
||||
local count = vim.diagnostic.count(buf)
|
||||
local sev = vim.diagnostic.severity
|
||||
local parts = {}
|
||||
if (count[sev.ERROR] or 0) > 0 then
|
||||
parts[#parts + 1] = '%#StatusDiagError# E' .. count[sev.ERROR] .. ' %*'
|
||||
end
|
||||
if (count[sev.WARN] or 0) > 0 then
|
||||
parts[#parts + 1] = '%#StatusDiagWarn# W' .. count[sev.WARN] .. ' %*'
|
||||
end
|
||||
if (count[sev.HINT] or 0) > 0 then
|
||||
parts[#parts + 1] = '%#StatusDiagHint# H' .. count[sev.HINT] .. ' %*'
|
||||
end
|
||||
vim.b[buf].diag_str = #parts > 0 and table.concat(parts) or ''
|
||||
refresh_status(buf)
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('DiagnosticChanged', {
|
||||
callback = function(ev)
|
||||
refresh_diag(ev.buf)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufNewFile' }, {
|
||||
callback = function(ev)
|
||||
if vim.bo[ev.buf].buftype == '' then
|
||||
refresh_branch(ev.buf)
|
||||
refresh_diff(ev.buf)
|
||||
end
|
||||
refresh_lsp(ev.buf)
|
||||
refresh_diag(ev.buf)
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd('FocusGained', {
|
||||
callback = function()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
if vim.bo[buf].buftype == '' then
|
||||
refresh_branch(buf)
|
||||
end
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
callback = function(ev)
|
||||
refresh_diff(ev.buf)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('RecordingEnter', {
|
||||
pattern = '*',
|
||||
callback = function(ev)
|
||||
vim.b[ev.buf].recording = 'Rec @' .. vim.fn.reg_recording()
|
||||
refresh_status(ev.buf)
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd('RecordingLeave', {
|
||||
pattern = '*',
|
||||
callback = function(ev)
|
||||
vim.b[ev.buf].recording = nil
|
||||
refresh_status(ev.buf)
|
||||
end,
|
||||
})
|
||||
|
||||
function _G.__statusline()
|
||||
local m = vim.fn.mode()
|
||||
local key = (m == '\22' or m == '\19') and m or m:sub(1, 1)
|
||||
local hl = mode_hl_map[key] or 'StatusModeNormal'
|
||||
local b = vim.b
|
||||
return table.concat({
|
||||
'%#' .. hl .. '#' .. (mode_map[key] or ' ?? ') .. '%*',
|
||||
b.status_left or '',
|
||||
'%=',
|
||||
b.status_right or '',
|
||||
'%#StatusCursor# %l:%c ',
|
||||
'%#' .. hl .. '# %p%% %*',
|
||||
})
|
||||
end
|
||||
|
||||
vim.o.statusline = '%!v:lua.__statusline()'
|
||||
@@ -9,24 +9,20 @@
|
||||
"rev": "016802de402556da54c36bd7359b441266b01cdd",
|
||||
"src": "https://github.com/stevearc/conform.nvim"
|
||||
},
|
||||
"hardtime.nvim": {
|
||||
"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"
|
||||
"lazydev.nvim": {
|
||||
"rev": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d",
|
||||
"src": "https://github.com/folke/lazydev.nvim"
|
||||
},
|
||||
"live-preview.nvim": {
|
||||
"rev": "a6307fa340ed7c0d96f5c567afc8c991aad94ce0",
|
||||
"rev": "dad92ae9599f9b19a7dffe7d597d3376c110b818",
|
||||
"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": "a338f44149f5673882c32629697d67b0c0547aec",
|
||||
"src": "https://github.com/mason-org/mason-lspconfig.nvim"
|
||||
},
|
||||
"mason.nvim": {
|
||||
@@ -38,28 +34,16 @@
|
||||
"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": "3e8d598d3b5f8338a41699c436e5fa11d2666cf0",
|
||||
"rev": "77b7432d4770d23b277d37923e5a08a442d8bb07",
|
||||
"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"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "910fdf6f49e9dee7e7257c7d11a76b040fdfb9de",
|
||||
"rev": "a2f694478be07f89c2d03cc17858a8745a400c4b",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
"nvim-ts-autotag": {
|
||||
@@ -67,20 +51,16 @@
|
||||
"src": "https://github.com/windwp/nvim-ts-autotag"
|
||||
},
|
||||
"nvim-web-devicons": {
|
||||
"rev": "58447c1fca354bbf184425e4a8d01deecbd6f3c4",
|
||||
"rev": "ec309a0eaff6ea967e58c275996155ab5c16938d",
|
||||
"src": "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
"polydev": {
|
||||
"rev": "2b30e36fade3272081f7166bc0ec614b0b7da1c9",
|
||||
"src": "https://git.moomancer.xyz/DarthMooMancer/polydev.git"
|
||||
},
|
||||
"snacks.nvim": {
|
||||
"rev": "882c996cf28183f4d63640de0b4c02ec886d01f2",
|
||||
"src": "https://github.com/folke/snacks.nvim"
|
||||
},
|
||||
"trouble.nvim": {
|
||||
"rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a",
|
||||
"src": "https://github.com/folke/trouble.nvim"
|
||||
"tiny-inline-diagnostic.nvim": {
|
||||
"rev": "46ae9b3c8f3039e96ff4497d190ad0aee091f30d",
|
||||
"src": "https://github.com/rachartier/tiny-inline-diagnostic.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
column_width = 80
|
||||
column_width = 100
|
||||
line_endings = "Unix"
|
||||
indent_type = "Tabs"
|
||||
indent_width = 4
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferSingle"
|
||||
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+21
-23
@@ -2,41 +2,39 @@ unbind M-,
|
||||
set -g prefix C-Space
|
||||
bind C-Space send-prefix
|
||||
|
||||
set -g default-shell $SHELL
|
||||
set -s escape-time 0
|
||||
set -g focus-events on
|
||||
set -g set-clipboard on
|
||||
set -g detach-on-destroy off
|
||||
|
||||
set -ga terminal-features ',xterm-ghostty:RGB'
|
||||
set -as terminal-overrides ',xterm-ghostty:Tc'
|
||||
set-option -g default-shell $SHELL
|
||||
|
||||
set -g status-position top
|
||||
set -g status-justify left
|
||||
set -g status-style 'bg=default' # Completely transparent container
|
||||
|
||||
set -g status-left-length 100
|
||||
set -g status-left "#[fg=#090E13,bg=colour6,bold] #S "
|
||||
|
||||
set -g status-right ""
|
||||
|
||||
set -g window-status-current-format "#[fg=colour1,bg=default] #F#I:#W "
|
||||
set -g window-status-format "#[fg=colour7,bg=default] #I:#W "
|
||||
|
||||
set -g message-style 'fg=colour3 bg=default bold'
|
||||
|
||||
set -g base-index 1
|
||||
set -g pane-base-index 1
|
||||
set -g detach-on-destroy off
|
||||
set -g renumber-windows on
|
||||
set -g set-clipboard on
|
||||
set -s escape-time 0
|
||||
|
||||
set -g status off
|
||||
set -g status-position top
|
||||
set -g status-justify centre
|
||||
set -g status-style bg=default
|
||||
|
||||
set -g status-left-length 40
|
||||
set -g status-left "#{?client_prefix,#[fg=colour234]#[bg=colour6]#[bold] #S #[bg=default]#[nobold],#[fg=color242]#[bg=default]#S }"
|
||||
set -g status-right ""
|
||||
|
||||
set -g window-status-separator " "
|
||||
set -g window-status-format "#[fg=color242]#I:#W"
|
||||
set -g window-status-current-format "#[fg=colour3 bold]#I:#W"
|
||||
|
||||
set -g message-style 'fg=colour3 bg=default bold'
|
||||
|
||||
bind-key h previous-window
|
||||
bind-key l next-window
|
||||
bind -r v run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
|
||||
bind-key z resize-pane -Z
|
||||
bind -n C-h select-pane -L
|
||||
bind -n C-j select-pane -D
|
||||
bind -n C-k select-pane -U
|
||||
bind -n C-l select-pane -R
|
||||
bind-key b set-option -g status
|
||||
bind -r v run-shell "tmux neww ~/.local/bin/tmux-sessionizer"
|
||||
bind -n C-S-h resize-pane -L 5
|
||||
bind -n C-S-j resize-pane -D 5
|
||||
bind -n C-S-k resize-pane -U 5
|
||||
|
||||
@@ -1,62 +1,182 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# 1. Get active tmux sessions
|
||||
sessions=$(tmux list-sessions -F "#S" 2>/dev/null)
|
||||
# Ensure Homebrew and standard paths are accessible inside fzf's preview subshell
|
||||
export PATH="/opt/homebrew/bin:/usr/local/bin:$HOME/.local/bin:$PATH"
|
||||
|
||||
# 2. Get directories from key work paths
|
||||
dirs=$(find ~ ~/.config ~/Projects ~/dotfiles ~/personal \
|
||||
-mindepth 1 -maxdepth 4 \
|
||||
\( -name ".git" -o -name "node_modules" -o -name ".cache" -o -name "Library" \) -prune \
|
||||
-o -type d -print 2>/dev/null)
|
||||
# Tabs definition
|
||||
TABS=("All" "Projects" "Dotfiles" "Blank Session")
|
||||
TOTAL=${#TABS[@]}
|
||||
ACTIVE_TAB=0
|
||||
|
||||
# 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='
|
||||
if [ -d {} ]; then
|
||||
if command -v eza &>/dev/null; then
|
||||
eza --tree --level=2 --icons --color=always {}
|
||||
elif command -v tree &>/dev/null; then
|
||||
tree -C -L 2 {}
|
||||
if [ "{}" = "[Create Blank Session in ~]" ]; then
|
||||
echo "Will spawn an empty session in ~/"
|
||||
elif [ -d {} ]; then
|
||||
if command -v eza >/dev/null 2>&1; then
|
||||
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
|
||||
ls -la --color=always {}
|
||||
fi
|
||||
else
|
||||
tmux list-windows -t {} 2>/dev/null
|
||||
tmux list-windows -t {} 2>/dev/null || echo "Session or path: {}"
|
||||
fi'
|
||||
|
||||
# 4. Kanagawa Wave Themed FZF Selector
|
||||
selected=$(printf "%s\n%s" "$sessions" "$dirs" | grep -v '^$' | fzf \
|
||||
get_projects() {
|
||||
if command -v fd &>/dev/null; then
|
||||
[ -d "$HOME/Projects" ] && fd --type d --max-depth 2 . "$HOME/Projects" 2>/dev/null | sed 's:/*$::'
|
||||
[ -d "$HOME/personal/Projects" ] && fd --type d --min-depth 2 --max-depth 2 . "$HOME/personal/Projects" 2>/dev/null | sed 's:/*$::'
|
||||
else
|
||||
if [ -d "$HOME/Projects" ]; then
|
||||
find "$HOME/Projects" -mindepth 1 -maxdepth 2 \
|
||||
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
|
||||
-o -type d -print 2>/dev/null | sed 's:/*$::'
|
||||
fi
|
||||
if [ -d "$HOME/personal/Projects" ]; then
|
||||
find "$HOME/personal/Projects" -mindepth 2 -maxdepth 2 \
|
||||
\( -name ".git" -o -name "node_modules" -o -name "build" -o -name ".cache" \) -prune \
|
||||
-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=1 \
|
||||
--padding=1 \
|
||||
--margin=15 \
|
||||
--padding=0 \
|
||||
--height=100% \
|
||||
--prompt=" " \
|
||||
--color="bg:#1F1F28,bg+:#223249,fg:#DCD7BA,fg+:#DCD7BA" \
|
||||
--color="hl:#2D4F67,hl+:#7E9CD8,prompt:#957FB8,pointer:#7E9CD8" \
|
||||
--color="info:#98BB6C,spinner:#957FB8,header:#7AA89F,border:#54546D" \
|
||||
--color="marker:#98BB6C" \
|
||||
--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")
|
||||
|
||||
# Exit if fzf was cancelled
|
||||
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
|
||||
|
||||
[[ -z "$selected" ]] && exit 0
|
||||
|
||||
# 5. Handle Session Creation / Switching
|
||||
if [[ -d "$selected" ]]; then
|
||||
# Selection is a DIRECTORY -> Create session named after folder
|
||||
session_name=$(basename "$selected" | tr '.: ' '_')
|
||||
# Strip trailing slash if present
|
||||
selected="${selected%/}"
|
||||
|
||||
# ---------------------------------------------------------
|
||||
# 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
|
||||
tmux new-session -d -s "$session_name" -c "$selected"
|
||||
fi
|
||||
else
|
||||
# Selection is an EXISTING SESSION -> Connect directly
|
||||
session_name="$selected"
|
||||
fi
|
||||
|
||||
# 6. Attach or Switch
|
||||
if [[ -z "$TMUX" ]]; then
|
||||
exec tmux attach-session -t "$session_name"
|
||||
else
|
||||
tmux switch-client -t "$session_name"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user