incremental troubleshooting

This commit is contained in:
Erik Stambaugh 2024-06-12 14:55:54 -07:00
parent 37fcfdb3b9
commit b86dca5b8b
8 changed files with 533 additions and 377 deletions

View file

@ -1,345 +1,345 @@
--
local augroup = vim.api.nvim_create_augroup('config', {clear = false}) -- local augroup = vim.api.nvim_create_augroup('config', {clear = false})
--
-- stolen from https://gitlab.com/Iron_E/dotfiles/-/blob/master/.config/nvim/lua/plugin/heirline.lua -- -- stolen from https://gitlab.com/Iron_E/dotfiles/-/blob/master/.config/nvim/lua/plugin/heirline.lua
--
--
--[[ -- --[[
_ _ _ _ _ -- _ _ _ _ _
| |__ ___(_)_ __| (_)_ __ ___ _ ____ _(_)_ __ ___ -- | |__ ___(_)_ __| (_)_ __ ___ _ ____ _(_)_ __ ___
| '_ \ / _ \ | '__| | | '_ \ / _ \ | '_ \ \ / / | '_ ` _ \ -- | '_ \ / _ \ | '__| | | '_ \ / _ \ | '_ \ \ / / | '_ ` _ \
| | | | __/ | | | | | | | | __/_| | | \ V /| | | | | | | -- | | | | __/ | | | | | | | | __/_| | | \ V /| | | | | | |
|_| |_|\___|_|_| |_|_|_| |_|\___(_)_| |_|\_/ |_|_| |_| |_| -- |_| |_|\___|_|_| |_|_|_| |_|\___(_)_| |_|\_/ |_|_| |_| |_|
--]] -- --]]
--
local devicons = require 'nvim-web-devicons' -- local devicons = require 'nvim-web-devicons'
--
--[[/* CONSTANTS */]] -- --[[/* CONSTANTS */]]
--
-- Defined in https://github.com/Iron-E/nvim-highlite -- -- Defined in https://github.com/Iron-E/nvim-highlite
local BLACK = '#202020' -- local BLACK = '#202020'
local BLUE = '#7766ff' -- local BLUE = '#7766ff'
local CYAN = '#33dbc3' -- local CYAN = '#33dbc3'
local GRAY_DARK = '#353535' -- local GRAY_DARK = '#353535'
local GRAY_LIGHT = '#c0c0c0' -- local GRAY_LIGHT = '#c0c0c0'
local GREEN = '#22ff22' -- local GREEN = '#22ff22'
local GREEN_DARK = '#70d533' -- local GREEN_DARK = '#70d533'
local GREEN_LIGHT = '#99ff99' -- local GREEN_LIGHT = '#99ff99'
local ICE = '#95c5ff' -- local ICE = '#95c5ff'
local MAGENTA = '#d5508f' -- local MAGENTA = '#d5508f'
local MAGENTA_DARK = '#bb0099' -- local MAGENTA_DARK = '#bb0099'
local ORANGE = '#ff8900' -- local ORANGE = '#ff8900'
local ORANGE_LIGHT = '#f0af00' -- local ORANGE_LIGHT = '#f0af00'
local PINK = '#ffa6ff' -- local PINK = '#ffa6ff'
local PINK_LIGHT = '#ffb7b7' -- local PINK_LIGHT = '#ffb7b7'
local PURPLE = '#cf55f0' -- local PURPLE = '#cf55f0'
local PURPLE_LIGHT = '#af60af' -- local PURPLE_LIGHT = '#af60af'
local RED = '#ee4a59' -- local RED = '#ee4a59'
local RED_DARK = '#a80000' -- local RED_DARK = '#a80000'
local RED_LIGHT = '#ff4090' -- local RED_LIGHT = '#ff4090'
local TAN = '#f4c069' -- local TAN = '#f4c069'
local TEAL = '#60afff' -- local TEAL = '#60afff'
local TURQOISE = '#2bff99' -- local TURQOISE = '#2bff99'
local WHITE = '#ffffff' -- local WHITE = '#ffffff'
local YELLOW = '#f0df33' -- local YELLOW = '#f0df33'
--
local SIDEBAR = BLACK -- local SIDEBAR = BLACK
local MIDBAR = GRAY_DARK -- local MIDBAR = GRAY_DARK
local TEXT = GRAY_LIGHT -- local TEXT = GRAY_LIGHT
--
--[[/* HELPERS */]] -- --[[/* HELPERS */]]
--
--- The width of the screen -- --- The width of the screen
local columns = vim.api.nvim_get_option_value('columns', {}) -- local columns = vim.api.nvim_get_option_value('columns', {})
vim.api.nvim_create_autocmd('VimResized', { -- vim.api.nvim_create_autocmd('VimResized', {
callback = function() columns = vim.api.nvim_get_option_value('columns', {}) end, -- callback = function() columns = vim.api.nvim_get_option_value('columns', {}) end,
group = 'config', -- group = 'config',
}) -- })
--
do -- do
local command = 'doautocmd User BufEnterOrGitSignsUpdate' -- local command = 'doautocmd User BufEnterOrGitSignsUpdate'
vim.api.nvim_create_autocmd('BufEnter', {command = command, group = 'config'}) -- vim.api.nvim_create_autocmd('BufEnter', {command = command, group = 'config'})
vim.api.nvim_create_autocmd('User', {command = command, group = 'config', pattern = 'GitSignsUpdate'}) -- vim.api.nvim_create_autocmd('User', {command = command, group = 'config', pattern = 'GitSignsUpdate'})
end -- end
--
--- Set buffer variables for file icon and color. -- --- Set buffer variables for file icon and color.
--- @return {color: string, icon: string} -- --- @return {color: string, icon: string}
local function buf_init_devicons() -- local function buf_init_devicons()
local icon, color = devicons.get_icon(vim.fn.expand '%:t', vim.fn.expand '%:e', {default = true}) -- local icon, color = devicons.get_icon(vim.fn.expand '%:t', vim.fn.expand '%:e', {default = true})
local dev_icons = {color = vim.api.nvim_get_hl(0, {link = false, name = color}).fg, icon = icon} -- local dev_icons = {color = vim.api.nvim_get_hl(0, {link = false, name = color}).fg, icon = icon}
--
vim.b.dev_icons = dev_icons -- vim.b.dev_icons = dev_icons
return dev_icons -- return dev_icons
end -- end
--
--- @return {color: string, icon: string} -- --- @return {color: string, icon: string}
local function filetype_info() -- local function filetype_info()
return vim.b.dev_icons or buf_init_devicons() -- return vim.b.dev_icons or buf_init_devicons()
end -- end
--
--- Redraw the statusline -- --- Redraw the statusline
local redrawstatus = vim.schedule_wrap(function() vim.api.nvim_command 'redrawstatus' end) -- local redrawstatus = vim.schedule_wrap(function() vim.api.nvim_command 'redrawstatus' end)
--
--[[/* HEIRLINE CONFIG */]] -- --[[/* HEIRLINE CONFIG */]]
--
--- Components separated by this component will be padded with an equal number of spaces. -- --- Components separated by this component will be padded with an equal number of spaces.
local ALIGN = {provider = '%='} -- local ALIGN = {provider = '%='}
--
--- A left separator. -- --- A left separator.
local LEFT_SEPARATOR = {provider = ''} -- local LEFT_SEPARATOR = {provider = ''}
--
--- A right separator. -- --- A right separator.
local RIGHT_SEPARATOR = {provider = ''} -- local RIGHT_SEPARATOR = {provider = ''}
--
require('heirline').setup({statusline = -- require('heirline').setup({statusline =
{ -- {
-- LEFT {{{ -- -- LEFT {{{
{ -- ViMode {{{ -- { -- ViMode {{{
hl = function(self) -- hl = function(self)
vim.api.nvim_set_hl(0, self.group, {bg = SIDEBAR, fg = self.color, bold = true}) -- vim.api.nvim_set_hl(0, self.group, {bg = SIDEBAR, fg = self.color, bold = true})
return self.group -- return self.group
end, -- end,
init = function(self) -- init = function(self)
if vim.g.libmodalActiveModeName then -- if vim.g.libmodalActiveModeName then
self.name = vim.g.libmodalActiveModeName -- self.name = vim.g.libmodalActiveModeName
self.color = self.modes[self.name] -- self.color = self.modes[self.name]
else -- else
local current_mode = self.modes[vim.api.nvim_get_mode().mode] -- local current_mode = self.modes[vim.api.nvim_get_mode().mode]
--
self.name = current_mode[1] -- self.name = current_mode[1]
self.color = current_mode[2] -- self.color = current_mode[2]
end -- end
end, -- end,
provider = function(self) return '' .. self.name .. ' ' end, -- provider = function(self) return '▊ ' .. self.name .. ' ' end,
static = -- static =
{ -- {{{ -- { -- {{{
group = 'HeirlineViMode', -- group = 'HeirlineViMode',
modes = -- modes =
{ -- {
['c'] = {'COMMAND-LINE', RED}, -- ['c'] = {'COMMAND-LINE', RED},
['ce'] = {'NORMAL EX', RED_DARK}, -- ['ce'] = {'NORMAL EX', RED_DARK},
['cv'] = {'EX', RED_LIGHT}, -- ['cv'] = {'EX', RED_LIGHT},
--
['i'] = {'INSERT', GREEN}, -- ['i'] = {'INSERT', GREEN},
--
['ic'] = {'INS-COMPLETE', GREEN_LIGHT}, -- ['ic'] = {'INS-COMPLETE', GREEN_LIGHT},
['ix'] = {'INS-COMPLETE', GREEN_LIGHT}, -- ['ix'] = {'INS-COMPLETE', GREEN_LIGHT},
['Rc'] = {'REP-COMPLETE', GREEN_LIGHT}, -- ['Rc'] = {'REP-COMPLETE', GREEN_LIGHT},
['Rvc'] = {'VIRT-REP-COMPLETE', GREEN_LIGHT}, -- ['Rvc'] = {'VIRT-REP-COMPLETE', GREEN_LIGHT},
['Rvx'] = {'VIRT-REP-COMPLETE', GREEN_LIGHT}, -- ['Rvx'] = {'VIRT-REP-COMPLETE', GREEN_LIGHT},
['Rx'] = {'REP-COMPLETE', GREEN_LIGHT}, -- ['Rx'] = {'REP-COMPLETE', GREEN_LIGHT},
--
['n'] = {'NORMAL', PURPLE_LIGHT}, -- ['n'] = {'NORMAL', PURPLE_LIGHT},
['niI'] = {'INS-NORMAL', PURPLE_LIGHT}, -- ['niI'] = {'INS-NORMAL', PURPLE_LIGHT},
['niR'] = {'REP-NORMAL', PURPLE_LIGHT}, -- ['niR'] = {'REP-NORMAL', PURPLE_LIGHT},
['niV'] = {'VIRT-REP-NORMAL', PURPLE_LIGHT}, -- ['niV'] = {'VIRT-REP-NORMAL', PURPLE_LIGHT},
['nt'] = {'TERM-NORMAL', PURPLE_LIGHT}, -- ['nt'] = {'TERM-NORMAL', PURPLE_LIGHT},
['ntT'] = {'TERM-NORMAL', PURPLE_LIGHT}, -- ['ntT'] = {'TERM-NORMAL', PURPLE_LIGHT},
--
['no'] = {'OPERATOR-PENDING', PURPLE}, -- ['no'] = {'OPERATOR-PENDING', PURPLE},
['nov'] = {'CHAR OPERATOR-PENDING', PURPLE}, -- ['nov'] = {'CHAR OPERATOR-PENDING', PURPLE},
['noV'] = {'LINE OPERATOR-PENDING', PURPLE}, -- ['noV'] = {'LINE OPERATOR-PENDING', PURPLE},
['no'] = {'BLOCK OPERATOR-PENDING', PURPLE}, -- ['no'] = {'BLOCK OPERATOR-PENDING', PURPLE},
--
['R'] = {'REPLACE', PINK}, -- ['R'] = {'REPLACE', PINK},
['Rv'] = {'VIRT-REPLACE', PINK_LIGHT}, -- ['Rv'] = {'VIRT-REPLACE', PINK_LIGHT},
--
['r'] = {'HIT-ENTER', CYAN}, -- ['r'] = {'HIT-ENTER', CYAN},
['rm'] = {'--MORE', CYAN}, -- ['rm'] = {'--MORE', CYAN},
['r?'] = {':CONFIRM', CYAN}, -- ['r?'] = {':CONFIRM', CYAN},
--
['s'] = {'SELECT', TURQOISE}, -- ['s'] = {'SELECT', TURQOISE},
['S'] = {'SELECT LINE', TURQOISE}, -- ['S'] = {'SELECT LINE', TURQOISE},
[''] = {'SELECT', TURQOISE}, -- [''] = {'SELECT', TURQOISE},
--
['v'] = {'VISUAL', BLUE}, -- ['v'] = {'VISUAL', BLUE},
['vs'] = {'SEL-VISUAL', BLUE}, -- ['vs'] = {'SEL-VISUAL', BLUE},
['V'] = {'VISUAL LINE', BLUE}, -- ['V'] = {'VISUAL LINE', BLUE},
['Vs'] = {'SEL-VISUAL LINE', BLUE}, -- ['Vs'] = {'SEL-VISUAL LINE', BLUE},
[''] = {'VISUAL BLOCK', BLUE}, -- [''] = {'VISUAL BLOCK', BLUE},
['s'] = {'VISUAL BLOCK', BLUE}, -- ['s'] = {'VISUAL BLOCK', BLUE},
--
['t'] = {'TERMINAL', ORANGE}, -- ['t'] = {'TERMINAL', ORANGE},
['!'] = {'SHELL', YELLOW}, -- ['!'] = {'SHELL', YELLOW},
--
-- libmodal -- -- libmodal
['BUFFERS'] = TEAL, -- ['BUFFERS'] = TEAL,
['TABLES'] = ORANGE_LIGHT, -- ['TABLES'] = ORANGE_LIGHT,
['TABS'] = TAN, -- ['TABS'] = TAN,
} -- }
}, -- }}} -- }, -- }}}
update = {'ModeChanged', callback = redrawstatus, pattern = '*:*'}, -- update = {'ModeChanged', callback = redrawstatus, pattern = '*:*'},
}, -- }}} -- }, -- }}}
--
{ -- File Icon {{{ -- { -- File Icon {{{
hl = function(self) return {bg = SIDEBAR, fg = self.file.color} end, -- hl = function(self) return {bg = SIDEBAR, fg = self.file.color} end,
init = function(self) self.file = filetype_info() end, -- init = function(self) self.file = filetype_info() end,
update = 'BufEnter', -- update = 'BufEnter',
--
LEFT_SEPARATOR, -- LEFT_SEPARATOR,
{ -- {
hl = function(self) return {bg = self.file.color, fg = SIDEBAR} end, -- hl = function(self) return {bg = self.file.color, fg = SIDEBAR} end,
provider = function(self) return ' ' .. self.file.icon .. ' %Y ' end, -- provider = function(self) return ' ' .. self.file.icon .. ' %Y ' end,
}, -- },
--
RIGHT_SEPARATOR, -- RIGHT_SEPARATOR,
}, -- }}} -- }, -- }}}
--
{ -- File Info {{{ -- { -- File Info {{{
hl = {bg = SIDEBAR, bold = true, fg = TEXT}, -- hl = {bg = SIDEBAR, bold = true, fg = TEXT},
--
-- File name -- -- File name
{provider = ' %t '}, -- {provider = ' %t '},
{ -- Readonly {{{ -- { -- Readonly {{{
condition = function() return vim.api.nvim_get_option_value('readonly', {buf = 0}) end, -- condition = function() return vim.api.nvim_get_option_value('readonly', {buf = 0}) end,
provider = '', -- provider = ' ',
update = {'OptionSet', pattern = 'readonly'}, -- update = {'OptionSet', pattern = 'readonly'},
}, -- }}} -- }, -- }}}
--
{ -- Modified {{{ -- { -- Modified {{{
condition = function() return vim.api.nvim_get_option_value('modified', {}) end, -- condition = function() return vim.api.nvim_get_option_value('modified', {}) end,
provider = '', -- provider = ' ',
update = 'BufModifiedSet', -- update = 'BufModifiedSet',
}, -- }}} -- }, -- }}}
--
{ -- File size {{{ -- { -- File size {{{
init = function(self) self.stat = vim.loop.fs_stat(vim.api.nvim_buf_get_name(0)) end, -- init = function(self) self.stat = vim.loop.fs_stat(vim.api.nvim_buf_get_name(0)) end,
update = {'BufEnter', 'BufWritePost'}, -- update = {'BufEnter', 'BufWritePost'},
--
{ -- {
condition = function(self) return self.stat end, -- condition = function(self) return self.stat end,
provider = function(self) -- provider = function(self)
local size = self.stat.size -- local size = self.stat.size
--
local i = 1 -- local i = 1
while size > self.conversion and i < #self.units do -- while size > self.conversion and i < #self.units do
size = size / self.conversion -- size = size / self.conversion
i = i + 1 -- i = i + 1
end -- end
--
return ('%.2f%sb '):format(size, self.units[i]) -- return ('%.2f%sb '):format(size, self.units[i])
end, -- end,
static = {conversion = 1024, units = {'', 'k', 'm', 'g', 't', 'p', 'e', 'z', 'y'}}, -- static = {conversion = 1024, units = {'', 'k', 'm', 'g', 't', 'p', 'e', 'z', 'y'}},
}, -- },
}, -- }}} -- }, -- }}}
--
{hl = {fg = MIDBAR}, LEFT_SEPARATOR}, -- {hl = {fg = MIDBAR}, LEFT_SEPARATOR},
}, -- }}} -- }, -- }}}
-- }}} -- -- }}}
--
-- MIDDLE {{{ -- -- MIDDLE {{{
{hl = {bg = MIDBAR}, ALIGN}, -- {hl = {bg = MIDBAR}, ALIGN},
--
{ -- Diagnostics {{{ -- { -- Diagnostics {{{
hl = {bg = MIDBAR, fg = SIDEBAR}, -- hl = {bg = MIDBAR, fg = SIDEBAR},
init = function(self) -- init = function(self)
local diagnostics = vim.diagnostic.get(0) --- @type Diagnostic[] -- local diagnostics = vim.diagnostic.get(0) --- @type Diagnostic[]
--
if #diagnostics < 1 then -- if #diagnostics < 1 then
self.diagnostics = nil -- self.diagnostics = nil
else -- else
self.diagnostics = {0, 0, 0, 0} -- self.diagnostics = {0, 0, 0, 0}
for _, diagnostic in ipairs(diagnostics) do -- for _, diagnostic in ipairs(diagnostics) do
self.diagnostics[diagnostic.severity] = self.diagnostics[diagnostic.severity] + 1 -- self.diagnostics[diagnostic.severity] = self.diagnostics[diagnostic.severity] + 1
end -- end
end -- end
end, -- end,
update = {'BufEnter', 'DiagnosticChanged'}, -- update = {'BufEnter', 'DiagnosticChanged'},
--
{ -- {
condition = function(self) return self.diagnostics end, -- condition = function(self) return self.diagnostics end,
--
LEFT_SEPARATOR, -- LEFT_SEPARATOR,
{ -- {
hl = {bg = SIDEBAR}, -- hl = {bg = SIDEBAR},
static = -- static =
{ -- {{{ -- { -- {{{
icons = {'', '', '', ''}, -- icons = {' ', ' ', ' ', ' '},
--
--- @param severity 1|2|3|4 -- --- @param severity 1|2|3|4
--- @return nil|string -- --- @return nil|string
provide = function(self, severity) -- provide = function(self, severity)
if self.diagnostics[severity] > 0 then -- if self.diagnostics[severity] > 0 then
local str = self.icons[severity] .. self.diagnostics[severity] -- local str = self.icons[severity] .. self.diagnostics[severity]
--
for i = severity + 1, #self.diagnostics do -- for i = severity + 1, #self.diagnostics do
if self.diagnostics[i] > 0 then -- if self.diagnostics[i] > 0 then
str = str .. ' ' -- str = str .. ' '
break -- break
end -- end
end -- end
--
return str -- return str
end -- end
end, -- end,
}, -- }}} -- }, -- }}}
--
{hl = {fg = RED}, provider = function(self) return self:provide(vim.diagnostic.severity.ERROR) end}, -- {hl = {fg = RED}, provider = function(self) return self:provide(vim.diagnostic.severity.ERROR) end},
{hl = {fg = ORANGE}, provider = function(self) return self:provide(vim.diagnostic.severity.WARN) end}, -- {hl = {fg = ORANGE}, provider = function(self) return self:provide(vim.diagnostic.severity.WARN) end},
{hl = {fg = PINK_LIGHT}, provider = function(self) return self:provide(vim.diagnostic.severity.INFO) end}, -- {hl = {fg = PINK_LIGHT}, provider = function(self) return self:provide(vim.diagnostic.severity.INFO) end},
{hl = {fg = MAGENTA}, provider = function(self) return self:provide(vim.diagnostic.severity.HINT) end}, -- {hl = {fg = MAGENTA}, provider = function(self) return self:provide(vim.diagnostic.severity.HINT) end},
}, -- },
--
RIGHT_SEPARATOR, -- RIGHT_SEPARATOR,
}, -- },
}, -- }}} -- }, -- }}}
-- }}} -- -- }}}
--
-- RIGHT {{{ -- -- RIGHT {{{
{hl = {bg = MIDBAR}, ALIGN}, -- {hl = {bg = MIDBAR}, ALIGN},
--
{ -- Git {{{ -- { -- Git {{{
init = function(self) self.status = vim.b.gitsigns_status_dict end, -- init = function(self) self.status = vim.b.gitsigns_status_dict end,
update = {'User', callback = redrawstatus, pattern = 'BufEnterOrGitSignsUpdate'}, -- update = {'User', callback = redrawstatus, pattern = 'BufEnterOrGitSignsUpdate'},
--
{ -- Diff {{{ -- { -- Diff {{{
hl = {bg = MIDBAR}, -- hl = {bg = MIDBAR},
--
{ -- {
condition = function(self) return self.status end, -- condition = function(self) return self.status end,
static = -- static =
{ -- {
--- @param sign string -- --- @param sign string
--- @param change string -- --- @param change string
--- @return nil|string -- --- @return nil|string
provide = function(self, sign, change) -- provide = function(self, sign, change)
local count = self.status[change] or 0 -- local count = self.status[change] or 0
if count > 0 then return sign .. count end -- if count > 0 then return sign .. count end
end, -- end,
}, -- },
--
{hl = {fg = GREEN}, provider = function(self) return self:provide('+', 'added') end}, -- {hl = {fg = GREEN}, provider = function(self) return self:provide('+', 'added') end},
{hl = {fg = ORANGE_LIGHT}, provider = function(self) return self:provide('~', 'changed') end}, -- {hl = {fg = ORANGE_LIGHT}, provider = function(self) return self:provide('~', 'changed') end},
{hl = {fg = RED_LIGHT}, provider = function(self) return self:provide('-', 'removed') end}, -- {hl = {fg = RED_LIGHT}, provider = function(self) return self:provide('-', 'removed') end},
{provider = ' '}, -- {provider = ' '},
}, -- },
}, -- }}} -- }, -- }}}
--
{ -- Branch {{{ -- { -- Branch {{{
hl = {bg = GREEN_DARK}, -- hl = {bg = GREEN_DARK},
--
{hl = {fg = MIDBAR}, RIGHT_SEPARATOR}, -- {hl = {fg = MIDBAR}, RIGHT_SEPARATOR},
{provider = ' '}, -- {provider = ' '},
{ -- {
condition = function(self) return self.status end, -- condition = function(self) return self.status end,
hl = {fg = SIDEBAR, bold = true}, -- hl = {fg = SIDEBAR, bold = true},
provider = function(self) return '' .. self.status.head .. ' ' end, -- provider = function(self) return ' ' .. self.status.head .. ' ' end,
}, -- },
--
{hl = {fg = SIDEBAR}, LEFT_SEPARATOR}, -- {hl = {fg = SIDEBAR}, LEFT_SEPARATOR},
}, -- }}} -- }, -- }}}
}, -- }}} -- }, -- }}}
--
-- Column Number -- -- Column Number
{hl = {fg = TEXT, bg = SIDEBAR}, provider = '  %v '}, -- {hl = {fg = TEXT, bg = SIDEBAR}, provider = '  %v '},
--
{ -- Line Percentage {{{ -- { -- Line Percentage {{{
hl = {bg = MAGENTA_DARK}, -- hl = {bg = MAGENTA_DARK},
--
{hl = {fg = SIDEBAR}, RIGHT_SEPARATOR}, -- {hl = {fg = SIDEBAR}, RIGHT_SEPARATOR},
{hl = {fg = WHITE}, provider = ' %p%% '}, -- {hl = {fg = WHITE}, provider = ' %p%% '},
}, -- }}} -- }, -- }}}
--
-- }}} -- -- }}}
}}) -- }})
--

View file

@ -48,3 +48,20 @@ require "lspconfig".pylsp.setup {
} }
} }
require "lspconfig".pyright.setup {
-- on_attach = on_attach,
settings = {
-- pyright = {autoImportCompletion = true,},
python = {
analysis = {
-- autoSearchPaths = true,
-- diagnosticMode = 'openFilesOnly',
-- useLibraryCodeForTypes = true,
-- typeCheckingMode = 'off',
diagnosticSeverityOverrides = {
reportMissingImports = false
}
}
}
}
}

View file

@ -1,6 +1,6 @@
require'nvim-treesitter.configs'.setup { require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed) -- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "javascript", "python" }, ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "javascript", "python", "comment" },
--ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, --ensure_installed = { "c", "lua", "vim", "vimdoc", "query" },
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)

View file

@ -2,9 +2,9 @@
"LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" }, "LuaSnip": { "branch": "master", "commit": "50fcf17db7c75af80e6b6109acfbfb4504768780" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"gitsigns.nvim": { "branch": "main", "commit": "de18f6b749f6129eb9042a2038590872df4c94a9" }, "gitsigns.nvim": { "branch": "main", "commit": "de18f6b749f6129eb9042a2038590872df4c94a9" },
"heirline.nvim": { "branch": "master", "commit": "0d797435e54645a5f98bad7ad6046aac1ef95c1e" },
"lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" }, "lazy.nvim": { "branch": "main", "commit": "eb4957442e3182f051b0ae11da32e06d22c190e3" },
"lsp-zero.nvim": { "branch": "v3.x", "commit": "16de3b18c5f7b6230d89b8e64ce9a4801b6f8d08" }, "lsp-zero.nvim": { "branch": "v3.x", "commit": "16de3b18c5f7b6230d89b8e64ce9a4801b6f8d08" },
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" },
"mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" }, "mason.nvim": { "branch": "main", "commit": "0950b15060067f752fde13a779a994f59516ce3d" },
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
@ -13,7 +13,9 @@
"nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, "nvim-web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" },
"plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"telescope.nvim": { "branch": "master", "commit": "f12b15e1b3a33524eb06a1ae7bc852fb1fd92197" }, "telescope.nvim": { "branch": "master", "commit": "f12b15e1b3a33524eb06a1ae7bc852fb1fd92197" },
"todo-comments.nvim": { "branch": "main", "commit": "51e10f838e84b4756c16311d0b1ef0972c6482d2" },
"tokyonight.nvim": { "branch": "main", "commit": "024621763d91bb48f2b486df529c7aaeb8d6d355" }, "tokyonight.nvim": { "branch": "main", "commit": "024621763d91bb48f2b486df529c7aaeb8d6d355" },
"trouble.nvim": { "branch": "main", "commit": "3609bb9a82bbab1ef95cf2c27ce7e52267a7d40d" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"vim-better-whitespace": { "branch": "master", "commit": "029f35c783f1b504f9be086b9ea757a36059c846" }, "vim-better-whitespace": { "branch": "master", "commit": "029f35c783f1b504f9be086b9ea757a36059c846" },
"vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" } "vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" }

View file

@ -26,13 +26,20 @@ require("tokyonight").setup({
--- You can override specific color groups to use other groups or a hex color --- You can override specific color groups to use other groups or a hex color
--- function will be called with a ColorScheme table --- function will be called with a ColorScheme table
---@param colors ColorScheme ---@param colors ColorScheme
on_colors = function(colors) end, on_colors = function(colors)
colors.hint = colors.magenta2
end,
--- You can override specific highlights to use other groups or a hex color --- You can override specific highlights to use other groups or a hex color
--- function will be called with a Highlights and ColorScheme table --- function will be called with a Highlights and ColorScheme table
---@param highlights Highlights ---@param highlights Highlights
---@param colors ColorScheme ---@param colors ColorScheme
on_highlights = function(highlights, colors) end, on_highlights = function(hl, colors)
hl.Todo = {
fg=colors.bg_dark,
bg=colors.magenta2,
}
end,
}) })
vim.cmd[[colorscheme tokyonight]] vim.cmd[[colorscheme tokyonight]]

View file

@ -28,6 +28,80 @@ require("lazy").setup({
end, end,
}, },
-- -- does this work if it goes this late in the file?
--
-- {
-- "folke/todo-comments.nvim",
-- lazy = false,
-- dependencies = { "nvim-lua/plenary.nvim" },
-- opts = {
-- signs = true, -- show icons in the signs column
-- sign_priority = 8, -- sign priority
-- -- keywords recognized as todo comments
-- keywords = {
-- FIX = {
-- icon = " ", -- icon used for the sign, and in search results
-- color = "error", -- can be a hex color, or a named color (see below)
-- alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- -- signs = false, -- configure signs for some keywords individually
-- },
-- TODO = { icon = " ", color = "info" },
-- HACK = { icon = " ", color = "warning" },
-- WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
-- PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
-- NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
-- TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
-- },
-- gui_style = {
-- fg = "NONE", -- The gui style to use for the fg highlight group.
-- bg = "BOLD", -- The gui style to use for the bg highlight group.
-- },
-- merge_keywords = true, -- when true, custom keywords will be merged with the defaults
-- -- highlighting of the line containing the todo comment
-- -- * before: highlights before the keyword (typically comment characters)
-- -- * keyword: highlights of the keyword
-- -- * after: highlights after the keyword (todo text)
-- highlight = {
-- multiline = true, -- enable multine todo comments
-- multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
-- multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
-- before = "", -- "fg" or "bg" or empty
-- keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
-- after = "fg", -- "fg" or "bg" or empty
-- pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
-- comments_only = true, -- uses treesitter to match keywords in comments only
-- max_line_len = 400, -- ignore lines longer than this
-- exclude = {}, -- list of file types to exclude highlighting
-- },
-- -- list of named colors where we try to extract the guifg from the
-- -- list of highlight groups or use the hex color if hl not found as a fallback
-- colors = {
-- error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
-- warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
-- info = { "DiagnosticInfo", "#2563EB" },
-- hint = { "DiagnosticHint", "#10B981" },
-- default = { "Identifier", "#7C3AED" },
-- test = { "Identifier", "#FF00FF" }
-- },
-- search = {
-- command = "rg",
-- args = {
-- "--color=never",
-- "--no-heading",
-- "--with-filename",
-- "--line-number",
-- "--column",
-- },
-- -- regex that will be used to match keywords.
-- -- don't replace the (KEYWORDS) placeholder
-- pattern = [[\b(KEYWORDS):]], -- ripgrep regex
-- -- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
-- },
--
-- }
-- },
{ "folke/tokyonight.nvim", lazy = false, priority = 1000, opts = {} }, { "folke/tokyonight.nvim", lazy = false, priority = 1000, opts = {} },
{ {
@ -38,23 +112,70 @@ require("lazy").setup({
end, end,
}, },
{
"folke/trouble.nvim",
lazy = false,
opts = {}, -- for default options, refer to the configuration section for custom setup.
cmd = "Trouble",
keys = {
{
"<leader>xx",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leader>xX",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>cs",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>cl",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>xL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>xQ",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
},
{ "mbbill/undotree", lazy = false }, { "mbbill/undotree", lazy = false },
{ "tpope/vim-fugitive", lazy = false }, { "tpope/vim-fugitive", lazy = false },
{ "ntpeters/vim-better-whitespace", lazy = false }, { "ntpeters/vim-better-whitespace", lazy = false },
-- { "glepnir/galaxyline.nvim", lazy = false }, -- -- { "glepnir/galaxyline.nvim", lazy = false },
-- {
-- "rebelot/heirline.nvim",
-- lazy = false,
-- dependencies = {'gitsigns.nvim', 'nvim-web-devicons'},
-- },
{ {
"rebelot/heirline.nvim", 'nvim-lualine/lualine.nvim',
lazy = false, lazy = false,
dependencies = {'gitsigns.nvim', 'nvim-web-devicons'}, dependencies = {
'nvim-tree/nvim-web-devicons'
},
}, },
{ "lewis6991/gitsigns.nvim" }, { "lewis6991/gitsigns.nvim" },
{ "nvim-tree/nvim-web-devicons" }, { "nvim-tree/nvim-web-devicons" },
-- LSP stuff -- LSP stuff
--- Uncomment the two plugins below if you want to manage the language servers from neovim --- Uncomment the two plugins below if you want to manage the language servers from neovim
{'williamboman/mason.nvim'}, {'williamboman/mason.nvim'},
@ -66,6 +187,8 @@ require("lazy").setup({
{'hrsh7th/nvim-cmp'}, {'hrsh7th/nvim-cmp'},
{'L3MON4D3/LuaSnip'}, {'L3MON4D3/LuaSnip'},
}) })

View file

@ -4,6 +4,13 @@ vim.keymap.set("n", "<leader>ee", vim.cmd.Ex)
-- other stuff from https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/remap.lua -- other stuff from https://github.com/ThePrimeagen/init.lua/blob/master/lua/theprimeagen/remap.lua
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true }) -- x to make executable vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true }) -- x to make executable
vim.keymap.set("n", "<C-e>",
function()
local result = vim.treesitter.get_captures_at_cursor(0)
print(vim.inspect(result))
end,
{ noremap = true, silent = false }
)
-- from my original vimrc -- from my original vimrc
vim.keymap.set("n", "<C-Z>", vim.cmd.shell) vim.keymap.set("n", "<C-Z>", vim.cmd.shell)

View file

@ -84,7 +84,7 @@ set-window-option -g window-status-separator "" # UGH this doesn't work -- tmux
# Inactive windows get low-contrast; active window sharper # Inactive windows get low-contrast; active window sharper
#set -g window-style 'fg=colour246,bg=#152030' #set -g window-style 'fg=colour246,bg=#152030'
set -g window-style 'fg=colour246,bg=#252731' set -g window-style 'fg=colour246,bg=#262a3d'
#set -g window-active-style 'fg=colour255,bg=black' #set -g window-active-style 'fg=colour255,bg=black'
set -g window-active-style 'fg=colour255,bg=#1e2030' set -g window-active-style 'fg=colour255,bg=#1e2030'