FIxing all of my problems with the simplest native fix possible

This commit is contained in:
DarthMooMancer committed 2026-11-06 11:06:10 -05:00
1 parent e80f5c03da
commit 707fa47d9d
13 files changed
+546 -565

No files matched your search

+4
View File
@@ -0,0 +1,4 @@
vim.opt_local.tabstop = 8
vim.opt_local.shiftwidth = 8
vim.opt_local.softtabstop = 0
vim.opt_local.expandtab = false
+4
View File
@@ -0,0 +1,4 @@
vim.opt_local.tabstop = 8
vim.opt_local.shiftwidth = 8
vim.opt_local.softtabstop = 0
vim.opt_local.expandtab = false
+4
View File
@@ -0,0 +1,4 @@
vim.opt_local.expandtab = false
vim.opt_local.tabstop = 4
vim.opt_local.shiftwidth = 0 -- fall back to tabstop
vim.opt_local.softtabstop = 0
+311 -311
View File
@@ -1,341 +1,341 @@
vim.cmd('highlight clear') vim.cmd('highlight clear')
if vim.fn.exists('syntax_on') then if vim.fn.exists('syntax_on') then
vim.cmd.syntax('reset') vim.cmd.syntax('reset')
end end
vim.o.background = 'dark' vim.o.background = 'dark'
vim.g.colors_name = 'min-kanso' vim.g.colors_name = 'min-kanso'
---@class PaletteColors ---@class PaletteColors
local palette = { local palette = {
zenBg0 = '#090E13', zenBg0 = '#090E13',
zenBg1 = '#1C1E25', zenBg1 = '#1C1E25',
zenBg2 = '#22262D', zenBg2 = '#22262D',
inkBg2 = '#22262D', inkBg2 = '#22262D',
inkBg3 = '#393B44', inkBg3 = '#393B44',
altBlue1 = '#223249', altBlue1 = '#223249',
altBlue2 = '#2D4F67', altBlue2 = '#2D4F67',
diffGreen = '#2B3328', diffGreen = '#2B3328',
diffYellow = '#49443C', diffYellow = '#49443C',
diffRed = '#43242B', diffRed = '#43242B',
diffBlue = '#252535', diffBlue = '#252535',
gitGreen = '#76946A', gitGreen = '#76946A',
gitRed = '#C34043', gitRed = '#C34043',
gitYellow = '#DCA561', gitYellow = '#DCA561',
red = '#C34043', red = '#C34043',
red2 = '#E46876', red2 = '#E46876',
red3 = '#c4746e', red3 = '#c4746e',
yellow = '#DCA561', yellow = '#DCA561',
yellow2 = '#E6C384', yellow2 = '#E6C384',
yellow3 = '#c4b28a', yellow3 = '#c4b28a',
green = '#98BB6C', green = '#98BB6C',
green2 = '#87a987', green2 = '#87a987',
green3 = '#8a9a7b', green3 = '#8a9a7b',
green4 = '#6A9589', green4 = '#6A9589',
green5 = '#7AA89F', green5 = '#7AA89F',
blue = '#7FB4CA', blue = '#7FB4CA',
blue2 = '#658594', blue2 = '#658594',
blue3 = '#8ba4b0', blue3 = '#8ba4b0',
violet = '#938AA9', violet = '#938AA9',
violet2 = '#8992a7', violet2 = '#8992a7',
pink = '#a292a3', pink = '#a292a3',
orange = '#b6927b', orange = '#b6927b',
orange2 = '#b98d7b', orange2 = '#b98d7b',
aqua = '#8ea4a2', aqua = '#8ea4a2',
fg = '#C5C9C7', fg = '#C5C9C7',
fg2 = '#f2f1ef', fg2 = '#f2f1ef',
gray = '#717C7C', gray = '#717C7C',
gray2 = '#A4A7A4', gray2 = '#A4A7A4',
gray3 = '#909398', gray3 = '#909398',
gray4 = '#75797f', gray4 = '#75797f',
gray5 = '#5C6066', gray5 = '#5C6066',
} }
local theme = { local theme = {
ui = { ui = {
none = 'NONE', none = 'NONE',
fg = palette.fg, fg = palette.fg,
fg_dim = palette.gray2, fg_dim = palette.gray2,
fg_reverse = palette.altBlue1, fg_reverse = palette.altBlue1,
bg_dim = palette.zenBg1, bg_dim = palette.zenBg1,
bg_m3 = palette.zenBg0, bg_m3 = palette.zenBg0,
bg_m2 = palette.zenBg0, bg_m2 = palette.zenBg0,
bg_m1 = palette.zenBg0, bg_m1 = palette.zenBg0,
bg = palette.zenBg0, bg = palette.zenBg0,
bg_p1 = palette.zenBg1, bg_p1 = palette.zenBg1,
bg_p2 = palette.zenBg2, bg_p2 = palette.zenBg2,
special = palette.gray5, special = palette.gray5,
indent_line = palette.inkBg2, indent_line = palette.inkBg2,
active_indent_line = palette.inkBg3, active_indent_line = palette.inkBg3,
whitespace = palette.inkBg3, whitespace = palette.inkBg3,
nontext = palette.gray5, nontext = palette.gray5,
bg_visual = palette.inkBg3, bg_visual = palette.inkBg3,
bg_search = palette.altBlue2, bg_search = palette.altBlue2,
cursor_line_nr_foreground = palette.gray5, cursor_line_nr_foreground = palette.gray5,
cursor_line_nr_active_foreground = palette.fg2, cursor_line_nr_active_foreground = palette.fg2,
cursor_bg = palette.fg2, cursor_bg = palette.fg2,
cursor_fg = palette.zenBg0, cursor_fg = palette.zenBg0,
pmenu = { pmenu = {
fg = palette.fg2, fg = palette.fg2,
fg_sel = 'NONE', fg_sel = 'NONE',
bg = palette.zenBg0, bg = palette.zenBg0,
bg_sel = palette.inkBg3, bg_sel = palette.inkBg3,
bg_thumb = palette.inkBg3, bg_thumb = palette.inkBg3,
bg_sbar = palette.zenBg0, bg_sbar = palette.zenBg0,
}, },
float = { float = {
fg = palette.gray2, fg = palette.gray2,
bg = palette.zenBg0, bg = palette.zenBg0,
fg_border = palette.zenBg2, fg_border = palette.zenBg2,
bg_border = palette.zenBg0, bg_border = palette.zenBg0,
}, },
}, },
syn = { syn = {
string = palette.green3, string = palette.green3,
variable = 'NONE', variable = 'NONE',
number = palette.pink, number = palette.pink,
constant = palette.orange, constant = palette.orange,
identifier = palette.violet2, identifier = palette.violet2,
parameter = palette.gray3, parameter = palette.gray3,
fun = palette.blue3, fun = palette.blue3,
statement = palette.violet2, statement = palette.violet2,
keyword = palette.violet2, keyword = palette.violet2,
operator = palette.gray3, operator = palette.gray3,
preproc = palette.gray3, preproc = palette.gray3,
type = palette.aqua, type = palette.aqua,
regex = palette.red3, regex = palette.red3,
deprecated = palette.gray, deprecated = palette.gray,
punct = palette.gray3, punct = palette.gray3,
comment = palette.gray4, comment = palette.gray4,
special1 = palette.yellow3, special1 = palette.yellow3,
special2 = palette.violet2, special2 = palette.violet2,
special3 = palette.violet2, special3 = palette.violet2,
}, },
diag = { diag = {
error = palette.red, error = palette.red,
ok = palette.green, ok = palette.green,
warning = palette.yellow, warning = palette.yellow,
info = palette.blue2, info = palette.blue2,
hint = palette.green4, hint = palette.green4,
}, },
diff = { diff = {
add = palette.diffGreen, add = palette.diffGreen,
delete = palette.diffRed, delete = palette.diffRed,
change = palette.diffBlue, change = palette.diffBlue,
text = palette.diffYellow, text = palette.diffYellow,
}, },
vcs = { vcs = {
added = palette.gitGreen, added = palette.gitGreen,
removed = palette.gitRed, removed = palette.gitRed,
changed = palette.gitYellow, changed = palette.gitYellow,
untracked = palette.gray4, untracked = palette.gray4,
}, },
} }
-- Helper function to batch-apply highlights -- Helper function to batch-apply highlights
local function set_highlights(highlights) local function set_highlights(highlights)
for group, opts in pairs(highlights) do for group, opts in pairs(highlights) do
vim.api.nvim_set_hl(0, group, opts) vim.api.nvim_set_hl(0, group, opts)
end end
end end
-- ========================================================================= -- =========================================================================
-- Highlights Map -- Highlights Map
-- ========================================================================= -- =========================================================================
set_highlights({ set_highlights({
-- Editor Highlights -- Editor Highlights
ColorColumn = { bg = theme.ui.bg_p1 }, ColorColumn = { bg = theme.ui.bg_p1 },
Conceal = { fg = theme.ui.special, bold = true }, Conceal = { fg = theme.ui.special, bold = true },
CurSearch = { fg = theme.ui.fg, bg = theme.ui.bg_search, 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 }, Cursor = { fg = theme.ui.cursor_fg, bg = theme.ui.cursor_bg },
lCursor = { link = 'Cursor' }, lCursor = { link = 'Cursor' },
CursorIM = { link = 'Cursor' }, CursorIM = { link = 'Cursor' },
CursorColumn = { link = 'CursorLine' }, CursorColumn = { link = 'CursorLine' },
CursorLine = { bg = theme.ui.bg_p2 }, CursorLine = { bg = theme.ui.bg_p2 },
Directory = { fg = theme.syn.fun }, Directory = { fg = theme.syn.fun },
DiffAdd = { bg = theme.diff.add }, DiffAdd = { bg = theme.diff.add },
DiffChange = { bg = theme.diff.change }, DiffChange = { bg = theme.diff.change },
DiffDelete = { fg = theme.vcs.removed, bg = theme.diff.delete }, DiffDelete = { fg = theme.vcs.removed, bg = theme.diff.delete },
DiffText = { bg = theme.diff.text }, DiffText = { bg = theme.diff.text },
EndOfBuffer = { fg = theme.ui.bg }, EndOfBuffer = { fg = theme.ui.bg },
ErrorMsg = { fg = theme.diag.error }, ErrorMsg = { fg = theme.diag.error },
WinSeparator = { fg = theme.ui.bg_m3, bg = theme.ui.none }, WinSeparator = { fg = theme.ui.bg_m3, bg = theme.ui.none },
VertSplit = { link = 'WinSeparator' }, VertSplit = { link = 'WinSeparator' },
Folded = { fg = theme.ui.special, bg = theme.ui.bg_p1 }, Folded = { fg = theme.ui.special, bg = theme.ui.bg_p1 },
FoldColumn = { fg = theme.ui.nontext, bg = theme.ui.none }, FoldColumn = { fg = theme.ui.nontext, bg = theme.ui.none },
SignColumn = { fg = theme.ui.special, bg = theme.ui.none }, SignColumn = { fg = theme.ui.special, bg = theme.ui.none },
IncSearch = { fg = theme.ui.fg_reverse, bg = theme.diag.warning }, IncSearch = { fg = theme.ui.fg_reverse, bg = theme.diag.warning },
Substitute = { fg = theme.ui.fg, bg = theme.vcs.removed }, Substitute = { fg = theme.ui.fg, bg = theme.vcs.removed },
LineNr = { fg = theme.ui.cursor_line_nr_foreground, bg = theme.ui.none }, 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 }, CursorLineNr = { fg = theme.ui.cursor_line_nr_active_foreground, bg = theme.ui.none },
MatchParen = { fg = theme.diag.warning, bold = true }, MatchParen = { fg = theme.diag.warning, bold = true },
ModeMsg = { 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 }, 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 }, MsgSeparator = { bg = vim.o.cmdheight == 0 and theme.ui.bg or theme.ui.bg_m3 },
MoreMsg = { fg = theme.diag.info }, MoreMsg = { fg = theme.diag.info },
NonText = { fg = theme.ui.nontext }, NonText = { fg = theme.ui.nontext },
Normal = { fg = theme.ui.fg, bg = theme.ui.bg }, Normal = { fg = theme.ui.fg, bg = theme.ui.bg },
NormalFloat = { fg = theme.ui.float.fg, bg = theme.ui.float.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 }, 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 }, FloatTitle = { fg = theme.ui.special, bg = theme.ui.float.bg_border, bold = true },
FloatFooter = { fg = theme.ui.nontext, bg = theme.ui.float.bg_border }, FloatFooter = { fg = theme.ui.nontext, bg = theme.ui.float.bg_border },
NormalNC = { link = 'Normal' }, NormalNC = { link = 'Normal' },
Pmenu = { fg = theme.ui.pmenu.fg, bg = theme.ui.pmenu.bg }, Pmenu = { fg = theme.ui.pmenu.fg, bg = theme.ui.pmenu.bg },
PmenuSel = { fg = theme.ui.pmenu.fg_sel, bg = theme.ui.pmenu.bg_sel }, PmenuSel = { fg = theme.ui.pmenu.fg_sel, bg = theme.ui.pmenu.bg_sel },
PmenuKind = { fg = theme.ui.fg_dim, bg = theme.ui.pmenu.bg }, PmenuKind = { fg = theme.ui.fg_dim, bg = theme.ui.pmenu.bg },
PmenuKindSel = { fg = theme.ui.fg_dim, bg = theme.ui.pmenu.bg_sel }, PmenuKindSel = { fg = theme.ui.fg_dim, bg = theme.ui.pmenu.bg_sel },
PmenuExtra = { fg = theme.ui.special, bg = theme.ui.pmenu.bg }, PmenuExtra = { fg = theme.ui.special, bg = theme.ui.pmenu.bg },
PmenuExtraSel = { fg = theme.ui.special, bg = theme.ui.pmenu.bg_sel }, PmenuExtraSel = { fg = theme.ui.special, bg = theme.ui.pmenu.bg_sel },
PmenuSbar = { bg = theme.ui.pmenu.bg_sbar }, PmenuSbar = { bg = theme.ui.pmenu.bg_sbar },
PmenuThumb = { bg = theme.ui.pmenu.bg_thumb }, PmenuThumb = { bg = theme.ui.pmenu.bg_thumb },
Question = { link = 'MoreMsg' }, Question = { link = 'MoreMsg' },
QuickFixLine = { bg = theme.ui.bg_p1 }, QuickFixLine = { bg = theme.ui.bg_p1 },
Search = { fg = theme.ui.fg, bg = theme.ui.bg_search }, Search = { fg = theme.ui.fg, bg = theme.ui.bg_search },
SpecialKey = { fg = theme.ui.special }, SpecialKey = { fg = theme.ui.special },
SpellBad = { undercurl = true, sp = theme.diag.error }, SpellBad = { undercurl = true, sp = theme.diag.error },
SpellCap = { undercurl = true, sp = theme.diag.warning }, SpellCap = { undercurl = true, sp = theme.diag.warning },
SpellLocal = { undercurl = true, sp = theme.diag.warning }, SpellLocal = { undercurl = true, sp = theme.diag.warning },
SpellRare = { undercurl = true, sp = theme.diag.warning }, SpellRare = { undercurl = true, sp = theme.diag.warning },
StatusLine = { fg = theme.ui.fg_dim, bg = theme.ui.none }, StatusLine = { fg = theme.ui.fg_dim, bg = theme.ui.none },
StatusLineNC = { fg = theme.ui.nontext, bg = theme.ui.none }, StatusLineNC = { fg = theme.ui.nontext, bg = theme.ui.none },
TabLine = { bg = theme.ui.none, fg = theme.ui.special }, TabLine = { bg = theme.ui.none, fg = theme.ui.special },
TabLineFill = { bg = theme.ui.none }, TabLineFill = { bg = theme.ui.none },
TabLineSel = { fg = theme.ui.fg_dim, bg = theme.ui.bg_p1, bold = true }, TabLineSel = { fg = theme.ui.fg_dim, bg = theme.ui.bg_p1, bold = true },
Title = { fg = theme.syn.fun, bold = true }, Title = { fg = theme.syn.fun, bold = true },
Visual = { bg = theme.ui.bg_visual }, Visual = { bg = theme.ui.bg_visual },
VisualNOS = { link = 'Visual' }, VisualNOS = { link = 'Visual' },
WarningMsg = { fg = theme.diag.warning }, WarningMsg = { fg = theme.diag.warning },
Whitespace = { fg = theme.ui.whitespace }, Whitespace = { fg = theme.ui.whitespace },
WildMenu = { link = 'Pmenu' }, WildMenu = { link = 'Pmenu' },
WinBar = { fg = theme.ui.fg_dim, bg = theme.ui.none }, WinBar = { fg = theme.ui.fg_dim, bg = theme.ui.none },
WinBarNC = { fg = theme.ui.fg_dim, bg = theme.ui.none }, WinBarNC = { fg = theme.ui.fg_dim, bg = theme.ui.none },
debugPC = { bg = theme.diff.delete }, debugPC = { bg = theme.diff.delete },
debugBreakpoint = { fg = theme.syn.special1, bg = theme.ui.none }, debugBreakpoint = { fg = theme.syn.special1, bg = theme.ui.none },
LspReferenceText = { bg = theme.ui.bg_p2 }, LspReferenceText = { bg = theme.ui.bg_p2 },
LspReferenceRead = { link = 'LspReferenceText' }, LspReferenceRead = { link = 'LspReferenceText' },
LspReferenceWrite = { bg = theme.ui.bg_p2, underline = true }, LspReferenceWrite = { bg = theme.ui.bg_p2, underline = true },
-- Diagnostics -- Diagnostics
DiagnosticError = { fg = theme.diag.error }, DiagnosticError = { fg = theme.diag.error },
DiagnosticWarn = { fg = theme.diag.warning }, DiagnosticWarn = { fg = theme.diag.warning },
DiagnosticInfo = { fg = theme.diag.info }, DiagnosticInfo = { fg = theme.diag.info },
DiagnosticHint = { fg = theme.diag.hint }, DiagnosticHint = { fg = theme.diag.hint },
DiagnosticOk = { fg = theme.diag.ok }, DiagnosticOk = { fg = theme.diag.ok },
DiagnosticFloatingError = { fg = theme.diag.error }, DiagnosticFloatingError = { fg = theme.diag.error },
DiagnosticFloatingWarn = { fg = theme.diag.warning }, DiagnosticFloatingWarn = { fg = theme.diag.warning },
DiagnosticFloatingInfo = { fg = theme.diag.info }, DiagnosticFloatingInfo = { fg = theme.diag.info },
DiagnosticFloatingHint = { fg = theme.diag.hint }, DiagnosticFloatingHint = { fg = theme.diag.hint },
DiagnosticFloatingOk = { fg = theme.diag.ok }, DiagnosticFloatingOk = { fg = theme.diag.ok },
DiagnosticSignError = { fg = theme.diag.error, bg = theme.ui.none }, DiagnosticSignError = { fg = theme.diag.error, bg = theme.ui.none },
DiagnosticSignWarn = { fg = theme.diag.warning, bg = theme.ui.none }, DiagnosticSignWarn = { fg = theme.diag.warning, bg = theme.ui.none },
DiagnosticSignInfo = { fg = theme.diag.info, bg = theme.ui.none }, DiagnosticSignInfo = { fg = theme.diag.info, bg = theme.ui.none },
DiagnosticSignHint = { fg = theme.diag.hint, bg = theme.ui.none }, DiagnosticSignHint = { fg = theme.diag.hint, bg = theme.ui.none },
DiagnosticVirtualTextError = { link = 'DiagnosticError' }, DiagnosticVirtualTextError = { link = 'DiagnosticError' },
DiagnosticVirtualTextWarn = { link = 'DiagnosticWarn' }, DiagnosticVirtualTextWarn = { link = 'DiagnosticWarn' },
DiagnosticVirtualTextInfo = { link = 'DiagnosticInfo' }, DiagnosticVirtualTextInfo = { link = 'DiagnosticInfo' },
DiagnosticVirtualTextHint = { link = 'DiagnosticHint' }, DiagnosticVirtualTextHint = { link = 'DiagnosticHint' },
DiagnosticUnderlineError = { undercurl = true, sp = theme.diag.error }, DiagnosticUnderlineError = { undercurl = true, sp = theme.diag.error },
DiagnosticUnderlineWarn = { undercurl = true, sp = theme.diag.warning }, DiagnosticUnderlineWarn = { undercurl = true, sp = theme.diag.warning },
DiagnosticUnderlineInfo = { undercurl = true, sp = theme.diag.info }, DiagnosticUnderlineInfo = { undercurl = true, sp = theme.diag.info },
DiagnosticUnderlineHint = { undercurl = true, sp = theme.diag.hint }, DiagnosticUnderlineHint = { undercurl = true, sp = theme.diag.hint },
LspSignatureActiveParameter = { fg = theme.diag.warning }, LspSignatureActiveParameter = { fg = theme.diag.warning },
LspCodeLens = { fg = theme.syn.comment }, LspCodeLens = { fg = theme.syn.comment },
-- Diff / VCS -- Diff / VCS
diffAdded = { fg = theme.vcs.added }, diffAdded = { fg = theme.vcs.added },
diffRemoved = { fg = theme.vcs.removed }, diffRemoved = { fg = theme.vcs.removed },
diffDeleted = { fg = theme.vcs.removed }, diffDeleted = { fg = theme.vcs.removed },
diffChanged = { fg = theme.vcs.changed }, diffChanged = { fg = theme.vcs.changed },
diffOldFile = { fg = theme.vcs.removed }, diffOldFile = { fg = theme.vcs.removed },
diffNewFile = { fg = theme.vcs.added }, diffNewFile = { fg = theme.vcs.added },
-- Syntax Highlights -- Syntax Highlights
Comment = { fg = theme.syn.comment, italic = true }, Comment = { fg = theme.syn.comment, italic = true },
Constant = { fg = theme.syn.constant }, Constant = { fg = theme.syn.constant },
String = { fg = theme.syn.string }, String = { fg = theme.syn.string },
Character = { link = 'String' }, Character = { link = 'String' },
Number = { fg = theme.syn.number }, Number = { fg = theme.syn.number },
Boolean = { fg = theme.syn.constant }, Boolean = { fg = theme.syn.constant },
Float = { link = 'Number' }, Float = { link = 'Number' },
Identifier = { fg = theme.syn.identifier }, Identifier = { fg = theme.syn.identifier },
Function = { fg = theme.syn.fun }, Function = { fg = theme.syn.fun },
Statement = { fg = theme.syn.statement }, Statement = { fg = theme.syn.statement },
Operator = { fg = theme.syn.operator }, Operator = { fg = theme.syn.operator },
Keyword = { fg = theme.syn.keyword, italic = true }, Keyword = { fg = theme.syn.keyword, italic = true },
Exception = { fg = theme.syn.special2 }, Exception = { fg = theme.syn.special2 },
PreProc = { fg = theme.syn.preproc }, PreProc = { fg = theme.syn.preproc },
Type = { fg = theme.syn.type }, Type = { fg = theme.syn.type },
Special = { fg = theme.syn.special1 }, Special = { fg = theme.syn.special1 },
Delimiter = { fg = theme.syn.punct }, Delimiter = { fg = theme.syn.punct },
Underlined = { fg = theme.syn.special1, underline = true }, Underlined = { fg = theme.syn.special1, underline = true },
Bold = { bold = true }, Bold = { bold = true },
Italic = { italic = true }, Italic = { italic = true },
Ignore = { link = 'NonText' }, Ignore = { link = 'NonText' },
Error = { fg = theme.diag.error }, Error = { fg = theme.diag.error },
Todo = { fg = theme.ui.fg_reverse, bg = theme.diag.info, bold = true }, Todo = { fg = theme.ui.fg_reverse, bg = theme.diag.info, bold = true },
qfLineNr = { link = 'LineNr' }, qfLineNr = { link = 'LineNr' },
qfFileName = { link = 'Directory' }, qfFileName = { link = 'Directory' },
markdownCode = { fg = theme.syn.string }, markdownCode = { fg = theme.syn.string },
markdownCodeBlock = { fg = theme.syn.string }, markdownCodeBlock = { fg = theme.syn.string },
markdownEscape = { fg = theme.ui.none }, markdownEscape = { fg = theme.ui.none },
-- Treesitter Highlights -- Treesitter Highlights
['@variable'] = { fg = theme.ui.fg }, ['@variable'] = { fg = theme.ui.fg },
['@variable.builtin'] = { fg = theme.syn.special2, italic = true }, ['@variable.builtin'] = { fg = theme.syn.special2, italic = true },
['@variable.parameter'] = { fg = theme.syn.parameter }, ['@variable.parameter'] = { fg = theme.syn.parameter },
['@variable.member'] = { fg = theme.syn.identifier }, ['@variable.member'] = { fg = theme.syn.identifier },
['@string.regexp'] = { fg = theme.syn.regex }, ['@string.regexp'] = { fg = theme.syn.regex },
['@string.escape'] = { fg = theme.syn.regex }, ['@string.escape'] = { fg = theme.syn.regex },
['@string.special.symbol'] = { fg = theme.syn.identifier }, ['@string.special.symbol'] = { fg = theme.syn.identifier },
['@type'] = { link = 'Type' }, ['@type'] = { link = 'Type' },
['@type.builtin'] = { fg = theme.syn.type }, ['@type.builtin'] = { fg = theme.syn.type },
['@attribute'] = { link = 'Constant' }, ['@attribute'] = { link = 'Constant' },
['@property'] = { fg = theme.syn.identifier }, ['@property'] = { fg = theme.syn.identifier },
['@function'] = { link = 'Function' }, ['@function'] = { link = 'Function' },
['@function.builtin'] = { link = 'Function' }, ['@function.builtin'] = { link = 'Function' },
['@function.call'] = { link = 'Function' }, ['@function.call'] = { link = 'Function' },
['@function.method'] = { link = 'Function' }, ['@function.method'] = { link = 'Function' },
['@function.method.call'] = { link = 'Function' }, ['@function.method.call'] = { link = 'Function' },
['@constructor'] = { fg = theme.syn.special1 }, ['@constructor'] = { fg = theme.syn.special1 },
['@constructor.lua'] = { fg = theme.syn.keyword }, ['@constructor.lua'] = { fg = theme.syn.keyword },
['@operator'] = { link = 'Operator' }, ['@operator'] = { link = 'Operator' },
['@keyword.coroutine'] = { fg = theme.syn.keyword }, ['@keyword.coroutine'] = { fg = theme.syn.keyword },
['@keyword.function'] = { fg = theme.syn.keyword }, ['@keyword.function'] = { fg = theme.syn.keyword },
['@keyword.operator'] = { fg = theme.syn.operator }, ['@keyword.operator'] = { fg = theme.syn.operator },
['@keyword.import'] = { link = 'PreProc' }, ['@keyword.import'] = { link = 'PreProc' },
['@keyword.modifier'] = { fg = theme.syn.keyword }, ['@keyword.modifier'] = { fg = theme.syn.keyword },
['@keyword.storage'] = { fg = theme.syn.keyword }, ['@keyword.storage'] = { fg = theme.syn.keyword },
['@keyword.return'] = { fg = theme.syn.special3, italic = true }, ['@keyword.return'] = { fg = theme.syn.special3, italic = true },
['@keyword.exception'] = { fg = theme.syn.special3 }, ['@keyword.exception'] = { fg = theme.syn.special3 },
['@keyword.conditional'] = { fg = theme.syn.keyword }, ['@keyword.conditional'] = { fg = theme.syn.keyword },
['@punctuation.delimiter'] = { fg = theme.syn.punct }, ['@punctuation.delimiter'] = { fg = theme.syn.punct },
['@punctuation.bracket'] = { fg = theme.syn.punct }, ['@punctuation.bracket'] = { fg = theme.syn.punct },
['@punctuation.special'] = { fg = theme.syn.special1 }, ['@punctuation.special'] = { fg = theme.syn.special1 },
['@comment.error'] = { fg = theme.ui.fg, bg = theme.diag.error, bold = true }, ['@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.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.note'] = { fg = theme.ui.fg_reverse, bg = theme.diag.hint, bold = true },
['@markup.strong'] = { bold = true }, ['@markup.strong'] = { bold = true },
['@markup.italic'] = { italic = true }, ['@markup.italic'] = { italic = true },
['@markup.strikethrough'] = { strikethrough = true }, ['@markup.strikethrough'] = { strikethrough = true },
['@markup.underline'] = { underline = true }, ['@markup.underline'] = { underline = true },
['@markup.heading'] = { link = 'Function' }, ['@markup.heading'] = { link = 'Function' },
['@markup.quote'] = { link = '@variable.parameter' }, ['@markup.quote'] = { link = '@variable.parameter' },
['@markup.math'] = { link = 'Constant' }, ['@markup.math'] = { link = 'Constant' },
['@markup.environment'] = { link = 'Keyword' }, ['@markup.environment'] = { link = 'Keyword' },
['@markup.raw'] = { link = 'String' }, ['@markup.raw'] = { link = 'String' },
['@diff.plus'] = { fg = theme.vcs.added }, ['@diff.plus'] = { fg = theme.vcs.added },
['@diff.minus'] = { fg = theme.vcs.removed }, ['@diff.minus'] = { fg = theme.vcs.removed },
['@diff.delta'] = { fg = theme.vcs.changed }, ['@diff.delta'] = { fg = theme.vcs.changed },
['@tag.attribute'] = { fg = theme.syn.identifier }, ['@tag.attribute'] = { fg = theme.syn.identifier },
['@tag.delimiter'] = { fg = theme.syn.punct }, ['@tag.delimiter'] = { fg = theme.syn.punct },
['@lsp.type.keyword.lua'] = { fg = theme.syn.regex }, ['@lsp.type.keyword.lua'] = { fg = theme.syn.regex },
-- Plugins (Blink/Cmp, etc.) -- Plugins (Blink/Cmp, etc.)
BlinkCmpMenu = { link = 'Pmenu' }, BlinkCmpMenu = { link = 'Pmenu' },
BlinkCmpMenuSelection = { link = 'PmenuSel' }, BlinkCmpMenuSelection = { link = 'PmenuSel' },
BlinkCmpMenuBorder = { fg = theme.ui.bg_search, bg = theme.ui.pmenu.bg }, BlinkCmpMenuBorder = { fg = theme.ui.bg_search, bg = theme.ui.pmenu.bg },
BlinkCmpLabel = { fg = theme.ui.pmenu.fg }, BlinkCmpLabel = { fg = theme.ui.pmenu.fg },
BlinkCmpLabelMatch = { fg = theme.syn.fun }, BlinkCmpLabelMatch = { fg = theme.syn.fun },
}) })
@@ -1,5 +1,8 @@
local map = vim.keymap.set local map = vim.keymap.set
--- grr for references, gra for actions, grn for rename as you removed the old keybinds to use defaults
map('n', 'gd', vim.lsp.buf.definition)
map('v', 'J', ":m '>+1<CR>gv=gv") map('v', 'J', ":m '>+1<CR>gv=gv")
map('v', 'K', ":m '<-2<CR>gv=gv") map('v', 'K', ":m '<-2<CR>gv=gv")
@@ -15,11 +18,6 @@ map('n', '<leader>ss', ':split<CR>')
map('n', '<leader>[', '<c-w>H', { silent = true }) map('n', '<leader>[', '<c-w>H', { silent = true })
map('n', '<leader>]', '<c-w>K', { silent = true }) map('n', '<leader>]', '<c-w>K', { silent = true })
map('n', '<C-h>', '<C-w>h', { silent = true })
map('n', '<C-j>', '<C-w>j', { silent = true })
map('n', '<C-k>', '<C-w>k', { silent = true })
map('n', '<C-l>', '<C-w>l', { silent = true })
map('n', '<C-h>', ':NvimTmuxNavigateLeft<CR>', { silent = true }) map('n', '<C-h>', ':NvimTmuxNavigateLeft<CR>', { silent = true })
map('n', '<C-j>', ':NvimTmuxNavigateDown<CR>', { silent = true }) map('n', '<C-j>', ':NvimTmuxNavigateDown<CR>', { silent = true })
map('n', '<C-k>', ':NvimTmuxNavigateUp<CR>', { silent = true }) map('n', '<C-k>', ':NvimTmuxNavigateUp<CR>', { silent = true })
@@ -30,56 +28,40 @@ map('n', '<leader>lp', '<cmd>LivePreview pick<cr>')
map('n', '<leader><leader>', ':Pick files<CR>', { silent = true }) map('n', '<leader><leader>', ':Pick files<CR>', { silent = true })
map('n', '<leader>fh', ':Pick help<CR>', { silent = true }) map('n', '<leader>fh', ':Pick help<CR>', { silent = true })
map('n', '<leader>fg', ':Pick grep<CR>', { silent = true }) map('n', '<leader>fg', ':Pick grep_live<CR>', { silent = true })
map('n', '<leader>uu', function() map('n', '<leader>uu', function()
require('undotree').open({ require('undotree').open({
command = 'topleft 45vnew', command = 'topleft 45vnew',
title = 'Undo Tree', title = 'Undo Tree',
}) })
end, { desc = 'native undotree', silent = true }) end, { desc = 'native undotree', silent = true })
map('n', '<leader>ff', vim.lsp.buf.format)
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)
local function qf_is_open()
return vim.fn.getqflist({ winid = 0 }).winid ~= 0
end
local function diagnostic_items()
return vim.diagnostic.toqflist(vim.diagnostic.get())
end
map('n', '<leader>xx', function() map('n', '<leader>xx', function()
if qf_is_open() then if vim.fn.getqflist({ win = 0 }).winid == 0 then
vim.cmd('cclose') vim.cmd('cclose')
return return
end end
local items = diagnostic_items() local items = vim.diagnostic.toqflist(vim.diagnostic.get())
if #items == 0 then if #items == 0 then
vim.notify('No diagnostics found', vim.log.levels.WARN) vim.notify('No diagnostics found', vim.log.levels.WARN)
return return
end end
vim.fn.setqflist(items) vim.fn.setqflist(items)
vim.cmd('copen') vim.cmd('copen')
end, { desc = 'Toggle diagnostics quickfix' }) end, { desc = 'Toggle diagnostics quickfix' })
local qf_group = vim.api.nvim_create_augroup('DiagnosticsQuickfix', { clear = true }) local qf_group = vim.api.nvim_create_augroup('DiagnosticsQuickfix', { clear = true })
vim.api.nvim_create_autocmd('DiagnosticChanged', { vim.api.nvim_create_autocmd('DiagnosticChanged', {
group = qf_group, group = qf_group,
callback = function() callback = function()
if not qf_is_open() then if vim.fn.getqflist({ win = 0 }).winid == 0 then
return return
end end
local items = diagnostic_items() local items = vim.diagnostic.toqflist(vim.diagnostic.get())
vim.fn.setqflist(items, 'r') vim.fn.setqflist(items, 'r')
if #items == 0 then if #items == 0 then
vim.cmd('cclose') vim.cmd('cclose')
end end
end, end,
}) })
+59 -91
View File
@@ -1,100 +1,68 @@
vim.lsp.config('*', { capabilities = require('blink.cmp').get_lsp_capabilities() }) vim.lsp.config('*', {
vim.lsp.config('lua_ls', { capabilities = require('blink.cmp').get_lsp_capabilities({
settings = { workspace = { didChangeWatchedFiles = { dynamicRegistration = false } },
Lua = { }, true),
runtime = { })
version = 'LuaJIT',
},
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 = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME .. '/lua',
'/Users/andrew/personal/Projects/Lua/vern-nvim/lua', vim.lsp.config('lua_ls', {
}, settings = {
}, Lua = {
didChangeWatchedFiles = { runtime = {
dynamicRegistration = false, version = 'LuaJIT',
}, },
}, 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 = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME .. '/lua',
'/Users/andrew/personal/Projects/Lua/vern-nvim/lua',
},
},
},
},
}) })
vim.lsp.config('vtsls', { vim.lsp.config('vtsls', {
settings = { settings = {
vtsls = { vtsls = {
autoUseWorkspaceTsdk = true, autoUseWorkspaceTsdk = true,
experimental = { experimental = {
completion = { completion = {
enableServerSideFuzzyMatch = true, enableServerSideFuzzyMatch = true,
}, },
}, },
}, },
typescript = { typescript = {
tsserver = { tsserver = {
maxTsServerMemory = 8192, maxTsServerMemory = 8192,
}, },
updateImportsOnFileMove = { enabled = 'always' }, updateImportsOnFileMove = { enabled = 'always' },
inlayHints = { preferences = {
parameterNames = { enabled = 'all', suppressWhenArgumentMatchesName = true }, importModuleSpecifier = 'non-relative',
parameterTypes = { enabled = true }, },
variableTypes = { enabled = true }, },
propertyDeclarationTypes = { enabled = true }, javascript = {
functionLikeReturnTypes = { enabled = true }, updateImportsOnFileMove = { enabled = 'always' },
enumMemberValues = { enabled = true }, },
}, },
preferences = {
importModuleSpecifier = 'non-relative',
},
},
javascript = {
updateImportsOnFileMove = { enabled = 'always' },
inlayHints = {
parameterNames = { enabled = 'all', suppressWhenArgumentMatchesName = true },
parameterTypes = { enabled = true },
variableTypes = { enabled = true },
propertyDeclarationTypes = { enabled = true },
functionLikeReturnTypes = { enabled = true },
enumMemberValues = { enabled = true },
},
},
},
})
vim.lsp.config('rust_analyzer', {
settings = {
['rust-analyzer'] = {
cargo = {
allFeatures = true, -- Enable all cargo features
},
check = {
command = 'clippy', -- Use clippy for errors/warnings on save
},
diagnostics = {
enable = true,
},
},
},
}) })
vim.lsp.enable({ vim.lsp.enable({
'lua_ls', 'lua_ls',
'clangd', 'clangd',
'pylsp', 'gopls',
'rust_analyzer',
'gopls',
--- Web --- Web
'vtsls', 'vtsls',
'superhtml', 'html',
}) })
+8 -25
View File
@@ -8,7 +8,8 @@ vim.opt.swapfile = false
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.signcolumn = 'yes' vim.opt.signcolumn = 'yes'
vim.opt.wrap = false vim.opt.wrap = false
vim.opt.showmode = false vim.opt.confirm = true
-- vim.opt.showmode = false
vim.o.winborder = 'rounded' vim.o.winborder = 'rounded'
vim.opt.scrolloff = 15 vim.opt.scrolloff = 15
@@ -17,31 +18,13 @@ vim.opt.smoothscroll = true
vim.opt.updatetime = 50 vim.opt.updatetime = 50
vim.opt.smartindent = true vim.opt.smartindent = true
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
local shifts = { vim.opt.tabstop = 2
lua = 4, vim.opt.shiftwidth = 2
python = 4, vim.opt.softtabstop = -1
rust = 4, vim.opt.expandtab = true
html = 2,
go = 4,
javascript = 2,
typescript = 2,
}
vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('IndentSettings', { clear = true }),
pattern = vim.tbl_keys(shifts),
callback = function(ev)
local size = shifts[ev.match]
local bo = vim.bo[ev.buf]
bo.tabstop = size
bo.shiftwidth = size
bo.softtabstop = size
bo.expandtab = true
end,
})
vim.diagnostic.config({ vim.diagnostic.config({
virtual_text = true, virtual_text = true,
severity_sort = true, severity_sort = true,
}) })
@@ -1,20 +1,20 @@
vim.pack.add({ vim.pack.add({
{ src = 'https://github.com/nvim-mini/mini.nvim.git', version = vim.version.range('*') }, { src = 'https://github.com/nvim-mini/mini.nvim.git', version = vim.version.range('*') },
{ src = 'https://github.com/nvim-treesitter/nvim-treesitter' }, { src = 'https://github.com/nvim-treesitter/nvim-treesitter' },
{ src = 'https://github.com/saghen/blink.cmp', version = vim.version.range('*') }, { src = 'https://github.com/saghen/blink.cmp', version = vim.version.range('*') },
{ 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' },
{ src = 'https://github.com/stevearc/conform.nvim' }, { src = 'https://github.com/stevearc/conform.nvim' },
{ src = 'https://git.moomancer.xyz/DarthMooMancer/mason-conform.nvim.git' }, { src = 'https://git.moomancer.xyz/DarthMooMancer/mason-conform.nvim.git' },
{ src = 'https://github.com/brianhuster/live-preview.nvim' }, { src = 'https://github.com/brianhuster/live-preview.nvim' },
{ src = 'https://github.com/alexghergh/nvim-tmux-navigation' }, { src = 'https://github.com/alexghergh/nvim-tmux-navigation' },
}) })
vim.opt.rtp:append('/Users/andrew/personal/Projects/Lua/vern-nvim') vim.opt.rtp:append('/Users/andrew/personal/Projects/Lua/vern-nvim')
vim.cmd('packadd nvim.undotree') vim.cmd('packadd nvim.undotree')
require('nvim-tmux-navigation').setup({ require('nvim-tmux-navigation').setup({
disable_when_zoomed = true, -- defaults to false disable_when_zoomed = true, -- defaults to false
}) })
require('DarthMooMancer.plugins.blink-cmp') require('DarthMooMancer.plugins.blink-cmp')
@@ -1,20 +1,30 @@
require('conform').setup({ local conform = require('conform')
formatters_by_ft = { conform.setup({
lua = { 'stylua', lsp_format = 'fallback' }, formatters_by_ft = {
javascript = { 'prettier', stop_after_first = true }, lua = { 'stylua' },
typescript = { 'prettier', stop_after_first = true }, c = { 'clang-format' },
json = { 'prettier' }, cpp = { 'clang-format' },
html = { 'prettier' }, go = { 'goimports' },
c = { 'clang-format' },
-- go = { 'goimports', 'crlfmt' }, --- Web
go = { 'goimports' }, javascript = { 'prettier', stop_after_first = true },
cpp = { 'clang-format' }, typescript = { 'prettier', stop_after_first = true },
python = { 'ruff_fix', 'ruff_format' }, json = { 'prettier' },
rust = { 'rustfmt' }, html = { 'prettier' },
['_'] = { 'trim_whitespace' }, css = { 'prettier' },
}, markdown = { 'prettier' },
format_on_save = { yaml = { 'prettier' },
timeout_ms = 500,
lsp_format = 'fallback', ['_'] = { 'trim_whitespace' },
}, },
format_on_save = {
timeout_ms = 2000,
lsp_format = 'fallback',
},
}) })
vim.keymap.set('n', '<leader>ff', function()
conform.format({ async = true, lsp_format = 'fallback' })
end)
vim.o.formatexpr = "v:lua.require'conform'.formatexpr()"
@@ -1,13 +1,11 @@
require('mason').setup() require('mason').setup()
require('mason-lspconfig').setup({ require('mason-lspconfig').setup({
ensure_installed = { ensure_installed = {
'vtsls', 'gopls',
'lua_ls', 'lua_ls',
'pylsp', 'vtsls', -- typescript, javascript
'cssls', 'html',
'superhtml', },
'gopls', automatic_enable = false,
},
automatic_enable = false,
}) })
require('mason-conform').setup() require('mason-conform').setup()
@@ -1,25 +1,25 @@
local hipatterns = require('mini.hipatterns') local hipatterns = require('mini.hipatterns')
hipatterns.setup({ hipatterns.setup({
highlighters = { highlighters = {
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()
@@ -30,13 +30,17 @@ require('mini.extra').setup()
require('mini.input').setup() require('mini.input').setup()
require('mini.pick').setup({ require('mini.pick').setup({
window = { window = {
config = { config = function()
anchor = 'NW', local height = math.floor(0.618 * vim.o.lines)
row = math.floor(0.5 * (vim.o.lines - math.floor(0.618 * vim.o.lines))), local width = math.floor(0.618 * vim.o.columns)
col = math.floor(0.5 * (vim.o.columns - math.floor(0.618 * vim.o.columns))), return {
height = math.floor(0.618 * vim.o.lines), anchor = 'NW',
width = math.floor(0.618 * vim.o.columns), row = math.floor(0.5 * (vim.o.lines - height)),
}, col = math.floor(0.5 * (vim.o.columns - width)),
}, height = height,
width = width,
}
end,
},
}) })
@@ -1,29 +1,53 @@
local parsers = { local parsers = {
'json', 'lua',
'rust', 'luadoc', -- highlights ---@ annotations, useful for your plugin work
'c', 'go',
'cpp', 'gomod',
'lua', 'c',
'html', 'cpp',
'javascript',
'typescript', 'vim',
'tsx', 'vimdoc',
'css', 'query',
'python', 'json',
'yaml', 'yaml',
'toml',
'bash',
'markdown',
'markdown_inline',
'gitcommit',
'gitignore',
'diff',
-- web: keep the installed parsers, but don't auto-install for now
-- 'javascript',
-- 'typescript',
-- 'tsx',
-- 'html',
-- 'css',
} }
require('nvim-treesitter').install(parsers)
local group = vim.api.nvim_create_augroup('UserTreesitter', { clear = true }) local group = vim.api.nvim_create_augroup('UserTreesitter', { clear = true })
vim.api.nvim_create_autocmd('VimEnter', {
group = group,
once = true,
callback = function()
require('nvim-treesitter').install(parsers)
end,
})
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
group = group, group = group,
desc = 'Start treesitter highlighting when a parser is installed', desc = 'Start treesitter highlighting when a parser is installed',
callback = function(ev) pattern = '*',
local lang = vim.treesitter.language.get_lang(ev.match) or ev.match callback = function(ev)
if not vim.treesitter.language.add(lang) then if vim.bo.buftype ~= '' then
return return
end end
vim.treesitter.start(ev.buf, lang) local ok = pcall(vim.treesitter.start, ev.buf)
end, if ok then
vim.bo[ev.buf].indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end
end,
}) })
+1 -1
View File
@@ -1,5 +1,5 @@
column_width = 100 column_width = 100
line_endings = "Unix" line_endings = "Unix"
indent_type = "Tabs" indent_type = "Spaces"
indent_width = 2 indent_width = 2
quote_style = "AutoPreferSingle" quote_style = "AutoPreferSingle"