many neovim changes and vimplugins nightly overlay
parent
7f0611d186
commit
f04388f562
|
@ -4,9 +4,6 @@
|
||||||
-- - <leader>df to format document
|
-- - <leader>df to format document
|
||||||
-- - Harpoon marks: Navigate through main files within each project
|
-- - Harpoon marks: Navigate through main files within each project
|
||||||
--
|
--
|
||||||
-- REQUIREMENTS:
|
|
||||||
-- - zk @ https://github.com/mickael-menu/zk
|
|
||||||
-- - prettierd @ npm install -g @fsouza/prettierd
|
|
||||||
|
|
||||||
-- Auto-installs vim-plug
|
-- Auto-installs vim-plug
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
|
@ -70,6 +67,7 @@ WPlug('hrsh7th/cmp-path')
|
||||||
WPlug('hrsh7th/cmp-buffer') -- Recommends words within the buffer
|
WPlug('hrsh7th/cmp-buffer') -- Recommends words within the buffer
|
||||||
WPlug('hrsh7th/cmp-cmdline')
|
WPlug('hrsh7th/cmp-cmdline')
|
||||||
WPlug('hrsh7th/nvim-cmp')
|
WPlug('hrsh7th/nvim-cmp')
|
||||||
|
WPlug('hrsh7th/cmp-nvim-lsp-signature-help')
|
||||||
WPlug('onsails/lspkind-nvim')
|
WPlug('onsails/lspkind-nvim')
|
||||||
WPlug('yioneko/nvim-yati', { tag = '*' }) -- copium: fix Python indent auto-correct from smart-indent
|
WPlug('yioneko/nvim-yati', { tag = '*' }) -- copium: fix Python indent auto-correct from smart-indent
|
||||||
WPlug('nathanalderson/yang.vim')
|
WPlug('nathanalderson/yang.vim')
|
||||||
|
@ -104,6 +102,8 @@ WPlug('lukas-reineke/indent-blankline.nvim') -- identation lines on blank lines
|
||||||
WPlug('kyazdani42/nvim-web-devicons') -- icons for folder and filetypes
|
WPlug('kyazdani42/nvim-web-devicons') -- icons for folder and filetypes
|
||||||
WPlug('m-demare/hlargs.nvim') -- highlights arguments; great for func prog
|
WPlug('m-demare/hlargs.nvim') -- highlights arguments; great for func prog
|
||||||
WPlug('folke/todo-comments.nvim') -- Highlights TODO
|
WPlug('folke/todo-comments.nvim') -- Highlights TODO
|
||||||
|
WPlug('NvChad/nvim-colorizer.lua') -- color highlighter with tailwind support
|
||||||
|
WPlug('roobert/tailwindcss-colorizer-cmp.nvim') -- color highlighter with tailwind support
|
||||||
|
|
||||||
-- other utilities
|
-- other utilities
|
||||||
WPlug('nvim-treesitter/nvim-treesitter-context') -- Top one-liner context of func/class scope
|
WPlug('nvim-treesitter/nvim-treesitter-context') -- Top one-liner context of func/class scope
|
||||||
|
@ -121,6 +121,10 @@ WPlug('~/local_repos/ts-ql') -- workspace code intelligence
|
||||||
---------
|
---------
|
||||||
vim.call('plug#end')
|
vim.call('plug#end')
|
||||||
|
|
||||||
|
local PLUGIN_URI = 'gh:pegasust:dotfiles'
|
||||||
|
local PLUGIN_LEVEL = 'debug'
|
||||||
|
local log = require('plenary.log').new({ plugin = PLUGIN_URI, level = PLUGIN_LEVEL, use_console = false })
|
||||||
|
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
if len(filter(values(g:plugs), '!isdirectory(v:val.dir)'))
|
||||||
PlugInstall --sync | autocmd VimEnter * so $MYVIMRC
|
PlugInstall --sync | autocmd VimEnter * so $MYVIMRC
|
||||||
|
@ -128,6 +132,10 @@ endif
|
||||||
]])
|
]])
|
||||||
|
|
||||||
-- special terminals, place them at 4..=7 for ergonomics
|
-- special terminals, place them at 4..=7 for ergonomics
|
||||||
|
-- NOTE: this requires a flawless startup, otherwise, it's going to throw errors
|
||||||
|
-- since we're basically simulating keystrokes
|
||||||
|
-- TODO: The correct behavior is to register terminal keystroke with an assigned
|
||||||
|
-- buffer
|
||||||
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||||
callback = function()
|
callback = function()
|
||||||
local function named_term(term_idx, term_name)
|
local function named_term(term_idx, term_name)
|
||||||
|
@ -193,7 +201,10 @@ vim.opt.swapfile = false
|
||||||
vim.opt.backup = false
|
vim.opt.backup = false
|
||||||
vim.opt.undodir = vim.fn.stdpath('state') .. '/.vim/undodir'
|
vim.opt.undodir = vim.fn.stdpath('state') .. '/.vim/undodir'
|
||||||
vim.opt.undofile = true
|
vim.opt.undofile = true
|
||||||
vim.opt.completeopt = 'menuone,noselect'
|
-- show menu even if there's 1 selection, and default to no selection
|
||||||
|
-- Note that we're not setitng `noinsert`, which allows us to "foresee" what the
|
||||||
|
-- completion would give us. This is faithful to VSCode
|
||||||
|
vim.opt.completeopt = { "menu", "menuone", "noselect", "noinsert" }
|
||||||
|
|
||||||
|
|
||||||
-- vim.opt.clipboard = "unnamedplus"
|
-- vim.opt.clipboard = "unnamedplus"
|
||||||
|
@ -438,7 +449,7 @@ require('nvim-treesitter.configs').setup {
|
||||||
init_selection = '<C-space>',
|
init_selection = '<C-space>',
|
||||||
node_incremental = '<C-space>',
|
node_incremental = '<C-space>',
|
||||||
node_decremental = '<C-backspace>',
|
node_decremental = '<C-backspace>',
|
||||||
pscope_incremental = '<C-S>'
|
scope_incremental = '<C-S>'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
textobjects = {
|
textobjects = {
|
||||||
|
@ -521,11 +532,49 @@ remap('n', '<leader>gs', function() require('neogit').open({}) end, { desc = "[G
|
||||||
-- LSP settings
|
-- LSP settings
|
||||||
-- This function gets run when an LSP connects to a particular buffer.
|
-- This function gets run when an LSP connects to a particular buffer.
|
||||||
require("inlay-hints").setup {
|
require("inlay-hints").setup {
|
||||||
|
-- renderer to use
|
||||||
|
-- possible options are dynamic, eol, virtline and custom
|
||||||
|
-- renderer = "inlay-hints/render/dynamic",
|
||||||
|
renderer = "inlay-hints/render/dynamic",
|
||||||
|
|
||||||
|
hints = {
|
||||||
|
parameter = {
|
||||||
|
show = true,
|
||||||
|
highlight = "whitespace",
|
||||||
|
},
|
||||||
|
type = {
|
||||||
|
show = true,
|
||||||
|
highlight = "Whitespace",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Only show inlay hints for the current line
|
||||||
only_current_line = false,
|
only_current_line = false,
|
||||||
|
|
||||||
eol = {
|
eol = {
|
||||||
|
-- whether to align to the extreme right or not
|
||||||
right_align = false,
|
right_align = false,
|
||||||
}
|
|
||||||
|
-- padding from the right if right_align is true
|
||||||
|
right_align_padding = 7,
|
||||||
|
|
||||||
|
parameter = {
|
||||||
|
separator = ", ",
|
||||||
|
format = function(hints)
|
||||||
|
return string.format(" <- (%s)", hints)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
type = {
|
||||||
|
separator = ", ",
|
||||||
|
format = function(hints)
|
||||||
|
return string.format(" => %s", hints)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
local nmap = function(keys, func, desc)
|
local nmap = function(keys, func, desc)
|
||||||
if desc then
|
if desc then
|
||||||
|
@ -553,7 +602,7 @@ local on_attach = function(client, bufnr)
|
||||||
-- This is to stay faithful with vim's default keybind for help.
|
-- This is to stay faithful with vim's default keybind for help.
|
||||||
-- See `:help K` for even more info on Vim's original keybindings for help
|
-- See `:help K` for even more info on Vim's original keybindings for help
|
||||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
-- nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||||
|
|
||||||
-- Less likely LSP functionality to be used
|
-- Less likely LSP functionality to be used
|
||||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||||
|
@ -571,30 +620,39 @@ local on_attach = function(client, bufnr)
|
||||||
require('inlay-hints').on_attach(client, bufnr)
|
require('inlay-hints').on_attach(client, bufnr)
|
||||||
end
|
end
|
||||||
-- nvim-cmp
|
-- nvim-cmp
|
||||||
|
|
||||||
local cmp = require 'cmp'
|
local cmp = require 'cmp'
|
||||||
local luasnip = require 'luasnip'
|
local luasnip = require 'luasnip'
|
||||||
local lspkind = require('lspkind')
|
local lspkind = require('lspkind')
|
||||||
local source_mapping = {
|
|
||||||
buffer = '[Buffer]',
|
|
||||||
nvim_lsp = '[LSP]',
|
|
||||||
nvim_lua = '[Lua]',
|
|
||||||
-- cmp_tabnine = '[T9]',
|
|
||||||
path = '[Path]',
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
lspkind.init {
|
||||||
|
symbol_map = {
|
||||||
|
Copilot = "",
|
||||||
|
},
|
||||||
|
}
|
||||||
cmp.event:on(
|
cmp.event:on(
|
||||||
"confirm_done",
|
"confirm_done",
|
||||||
require('nvim-autopairs.completion.cmp').on_confirm_done()
|
require('nvim-autopairs.completion.cmp').on_confirm_done()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
cmp.setup {
|
---@type cmp.ConfigSchema
|
||||||
|
local cmp_config = {
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
luasnip.lsp_expand(args.body)
|
luasnip.lsp_expand(args.body)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert {
|
mapping = cmp.mapping.preset.insert {
|
||||||
|
['<C-l'] = cmp.mapping(function(_)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.refresh()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
-- 'i': insert, 's': select, 'c': command
|
||||||
|
end, { 'i', 's' }),
|
||||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||||
['<C-space>'] = cmp.mapping.complete(),
|
['<C-space>'] = cmp.mapping.complete(),
|
||||||
|
@ -602,47 +660,61 @@ cmp.setup {
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = true,
|
select = true,
|
||||||
},
|
},
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
-- NOTE: rebind tab and shift-tab since it may break whenever we
|
||||||
|
-- need to peform manual indentation
|
||||||
|
['<C-j>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
luasnip.expand_or_jump()
|
luasnip.expand_or_jump()
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { 'i', 's' }),
|
end, { 'i', 's' }),
|
||||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
['<C-k>'] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
elseif luasnip.jumpable(-1) then
|
elseif luasnip.jumpable(-1) then
|
||||||
luasnip.jump(-1)
|
luasnip.jump(-1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { 'i', 's' }),
|
end, { 'i', 's' }),
|
||||||
|
|
||||||
|
},
|
||||||
|
performance = {
|
||||||
|
debounce = 60,
|
||||||
|
throttle = 30,
|
||||||
},
|
},
|
||||||
formatting = {
|
formatting = {
|
||||||
|
fields = { 'abbr', 'kind', 'menu' },
|
||||||
|
-- vim_items: complete-items (`:h complete-items`)
|
||||||
|
-- word, abbr, menu, info, kind, icase, equal, dup, empty, user_data
|
||||||
format = function(entry, vim_item)
|
format = function(entry, vim_item)
|
||||||
vim_item.kind = lspkind.symbolic(vim_item.kind, { mode = 'symbol' })
|
local kind_fn = lspkind.cmp_format {
|
||||||
vim_item.menu = source_mapping[entry.source_name]
|
with_text = true,
|
||||||
-- if entry.source.name == "cmp_tabnine" then
|
menu = {
|
||||||
-- local detail = (entry.completion_item.data or {}).detail
|
buffer = "[buf]",
|
||||||
-- vim_item.kind = ""
|
nvim_lsp = "[LSP]",
|
||||||
-- if detail and detail:find('.*%%.*') then
|
nvim_lua = "[api]",
|
||||||
-- vim_item.kind = vim_item.kind .. ' ' .. detail
|
path = "[path]",
|
||||||
-- end
|
luasnip = "[snip]",
|
||||||
--
|
gh_issues = "[issues]",
|
||||||
-- if (entry.completion_item.data or {}).multiline then
|
tn = "[TabNine]",
|
||||||
-- vim_item.kind = vim_item.kind .. ' ' .. '[ML]'
|
eruby = "[erb]",
|
||||||
-- end
|
nvim_lsp_signature_help = "[sig]",
|
||||||
-- end
|
}
|
||||||
local maxwidth = 80
|
}
|
||||||
vim_item.abbr = string.sub(vim_item.abbr, 1, maxwidth)
|
vim_item = kind_fn(entry, vim_item)
|
||||||
return vim_item
|
return require('tailwindcss-colorizer-cmp').formatter(entry, vim_item)
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
sources = cmp.config.sources {
|
sources = cmp.config.sources( --[[@as cmp.SourceConfig[]] {
|
||||||
{ name = 'nvim_lsp' },
|
{ name = 'nvim_lsp', },
|
||||||
|
{ name = 'nvim_lsp_signature_help' },
|
||||||
|
-- NOTE: Path is triggered by `.` and `/`, so when it comes up, it's
|
||||||
|
-- usually desirable.
|
||||||
|
{ name = 'path' },
|
||||||
{ name = 'luasnip' },
|
{ name = 'luasnip' },
|
||||||
{
|
{
|
||||||
name = 'buffer',
|
name = 'buffer',
|
||||||
|
@ -650,9 +722,9 @@ cmp.setup {
|
||||||
-- default is only in the current buffer. This grabs recommendations
|
-- default is only in the current buffer. This grabs recommendations
|
||||||
-- from all visible buffers
|
-- from all visible buffers
|
||||||
get_bufnrs = function()
|
get_bufnrs = function()
|
||||||
local bufs = {}
|
-- Must always have current buffer
|
||||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
local bufs = { [0] = true }
|
||||||
local buf = vim.api.nvim_win_get_buf(win)
|
for _, buf in ipairs(vim.api.nvim_list_bufs()) do
|
||||||
local byte_size = vim.api.nvim_buf_get_offset(buf, vim.api.nvim_buf_line_count(buf))
|
local byte_size = vim.api.nvim_buf_get_offset(buf, vim.api.nvim_buf_line_count(buf))
|
||||||
if byte_size <= 1024 * 1024 then -- 1 MiB max
|
if byte_size <= 1024 * 1024 then -- 1 MiB max
|
||||||
bufs[buf] = true
|
bufs[buf] = true
|
||||||
|
@ -660,19 +732,57 @@ cmp.setup {
|
||||||
end
|
end
|
||||||
return vim.tbl_keys(bufs)
|
return vim.tbl_keys(bufs)
|
||||||
end,
|
end,
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{ name = 'path' },
|
},
|
||||||
-- { name = "conjure" },
|
-- NOTE: I don't like cmdline that much. Most of the time, it recommends more harm than good
|
||||||
-- { name = 'cmp_tabnine' },
|
-- { name = 'cmp_tabnine' },
|
||||||
},
|
-- { name = "conjure" },
|
||||||
|
}),
|
||||||
|
experimental = { ghost_text = { hl_group = "Comment" }, },
|
||||||
sorting = {
|
sorting = {
|
||||||
comparators = {
|
comparators = {
|
||||||
-- Optimize searches by recommending things that are closer to the current cursor
|
---@param lhs_entry cmp.Entry
|
||||||
function(...) require('cmp-buffer'):compare_locality(...) end,
|
---@param rhs_entry cmp.Entry
|
||||||
}
|
function(lhs_entry, rhs_entry)
|
||||||
|
return nil
|
||||||
|
end,
|
||||||
|
cmp.config.compare.exact,
|
||||||
|
cmp.config.compare.recently_used,
|
||||||
|
cmp.config.compare.offset,
|
||||||
|
cmp.config.compare.score,
|
||||||
|
cmp.config.compare.kind,
|
||||||
|
cmp.config.compare.locality,
|
||||||
|
cmp.config.compare.sort_text,
|
||||||
|
cmp.config.compare.scope,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
cmp.setup(vim.tbl_deep_extend("force", require('cmp.config.default')(), cmp_config))
|
||||||
|
|
||||||
|
-- `/` cmdline search.
|
||||||
|
cmp.setup.cmdline('/', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
-- `:` cmdline vim command.
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
mapping = cmp.mapping.preset.cmdline(),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, {
|
||||||
|
{
|
||||||
|
name = 'cmdline',
|
||||||
|
option = {
|
||||||
|
ignore_cmds = { 'Man', '!' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
-- nvim-cmp supports additional completion capabilities
|
-- nvim-cmp supports additional completion capabilities
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
-- local tabnine = require('cmp_tabnine.config')
|
-- local tabnine = require('cmp_tabnine.config')
|
||||||
|
@ -708,7 +818,8 @@ require("mason").setup({
|
||||||
})
|
})
|
||||||
require('mason-lspconfig').setup({
|
require('mason-lspconfig').setup({
|
||||||
-- ensure_installed = servers,
|
-- ensure_installed = servers,
|
||||||
automatic_installation = false
|
ensure_installed = { "pylsp", "pyright", "tailwindcss", "svelte", "astro", "lua_ls" },
|
||||||
|
automatic_installation = false,
|
||||||
})
|
})
|
||||||
|
|
||||||
local inlay_hint_tsjs = {
|
local inlay_hint_tsjs = {
|
||||||
|
@ -743,7 +854,9 @@ require('mason-lspconfig').setup_handlers({
|
||||||
globals = { "vim" }
|
globals = { "vim" }
|
||||||
},
|
},
|
||||||
workspace = {
|
workspace = {
|
||||||
library = vim.api.nvim_get_runtime_file('', true)
|
library = vim.api.nvim_get_runtime_file('', true),
|
||||||
|
-- Don't prompt me to select
|
||||||
|
checkThirdParty = false,
|
||||||
},
|
},
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
hint = {
|
hint = {
|
||||||
|
@ -1102,7 +1215,6 @@ require('lualine').setup {
|
||||||
}
|
}
|
||||||
|
|
||||||
require('nvim-surround').setup {}
|
require('nvim-surround').setup {}
|
||||||
require('tsql').setup()
|
|
||||||
require('fidget').setup({
|
require('fidget').setup({
|
||||||
text = {
|
text = {
|
||||||
spinner = "moon", -- animation shown when tasks are ongoing
|
spinner = "moon", -- animation shown when tasks are ongoing
|
||||||
|
@ -1154,3 +1266,65 @@ require('fidget').setup({
|
||||||
strict = false, -- whether to interpret LSP strictly
|
strict = false, -- whether to interpret LSP strictly
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Messaages as buf because it's so limiting to work with builtin view menu from neovim
|
||||||
|
vim.api.nvim_create_user_command('ShowLogs', function(opts)
|
||||||
|
local plugin_name = opts.fargs[1] or PLUGIN_URI
|
||||||
|
local min_level = opts.fargs[2] or PLUGIN_LEVEL
|
||||||
|
local logfile = string.format("%s/%s.log", vim.api.nvim_call_function("stdpath", { "cache" }), plugin_name)
|
||||||
|
|
||||||
|
-- Ensure that the logfile exists
|
||||||
|
local file = io.open(logfile, 'r')
|
||||||
|
if not file then
|
||||||
|
print(string.format("No logfile found for plugin '%s'", vim.inspect(plugin_name)))
|
||||||
|
print("min_level: " .. vim.inspect(min_level))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
file:close()
|
||||||
|
|
||||||
|
vim.cmd('vnew ' .. logfile)
|
||||||
|
|
||||||
|
-- Load messages from the log file
|
||||||
|
local file_messages = vim.fn.readfile(logfile)
|
||||||
|
local levels = { trace = 1, debug = 2, info = 3, warn = 4, error = 5, fatal = 6 }
|
||||||
|
local min_index = levels[min_level] or 3
|
||||||
|
local filtered_messages = {}
|
||||||
|
for _, message in ipairs(file_messages) do
|
||||||
|
local level = message:match("^%[([a-z]+)")
|
||||||
|
if levels[level] and levels[level] >= min_index then
|
||||||
|
table.insert(filtered_messages, message)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_buf_set_lines(0, 0, -1, false, filtered_messages)
|
||||||
|
vim.cmd('setlocal ft=log')
|
||||||
|
vim.cmd('setlocal nomodifiable')
|
||||||
|
end, { nargs = "*", })
|
||||||
|
|
||||||
|
require("colorizer").setup {
|
||||||
|
filetypes = { "*" },
|
||||||
|
user_default_options = {
|
||||||
|
RGB = true, -- #RGB hex codes
|
||||||
|
RRGGBB = true, -- #RRGGBB hex codes
|
||||||
|
names = true, -- "Name" codes like Blue or blue
|
||||||
|
RRGGBBAA = true, -- #RRGGBBAA hex codes
|
||||||
|
AARRGGBB = true, -- 0xAARRGGBB hex codes
|
||||||
|
rgb_fn = true, -- CSS rgb() and rgba() functions
|
||||||
|
hsl_fn = true, -- CSS hsl() and hsla() functions
|
||||||
|
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
|
||||||
|
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn
|
||||||
|
-- Available modes for `mode`: foreground, background, virtualtext
|
||||||
|
mode = "background", -- Set the display mode.
|
||||||
|
-- Available methods are false / true / "normal" / "lsp" / "both"
|
||||||
|
-- True is same as normal
|
||||||
|
tailwind = true, -- Enable tailwind colors
|
||||||
|
-- parsers can contain values used in |user_default_options|
|
||||||
|
sass = { enable = true, parsers = { "css" }, }, -- Enable sass colors
|
||||||
|
virtualtext = "■",
|
||||||
|
-- update color values even if buffer is not focused
|
||||||
|
-- example use: cmp_menu, cmp_docs
|
||||||
|
always_update = false
|
||||||
|
},
|
||||||
|
-- all the sub-options of filetypes apply to buftypes
|
||||||
|
buftypes = {},
|
||||||
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project
|
# TODO: vim-plug and Mason supports laziness. Probably worth it to explore incremental dependencies based on the project TODO: just install these things, then symlink to mason's bin directory
|
||||||
# TODO: just install these things, then symlink to mason's bin directory
|
|
||||||
#
|
#
|
||||||
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
|
# One thing to consider, though, /nix/store of `nix-shell` or `nix-develop`
|
||||||
# might be different from `home-manager`'s (~/.nix_profile/bin/jq)
|
# might be different from `home-manager`'s (~/.nix_profile/bin/jq)
|
||||||
|
|
|
@ -58,11 +58,11 @@
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1684981077,
|
"lastModified": 1686186025,
|
||||||
"narHash": "sha256-68X9cFm0RTZm8u0rXPbeBzOVUH5OoUGAfeHHVoxGd9o=",
|
"narHash": "sha256-SuQjKsO1G87qM5j8VNtq6kIw4ILYE03Y8yL/FoKwR+4=",
|
||||||
"owner": "ipetkov",
|
"owner": "ipetkov",
|
||||||
"repo": "crane",
|
"repo": "crane",
|
||||||
"rev": "35110cccf28823320f4fd697fcafcb5038683982",
|
"rev": "057d95721ee67d421391dda7031977d247ddec28",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -570,11 +570,11 @@
|
||||||
"systems": "systems_2"
|
"systems": "systems_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1681202837,
|
"lastModified": 1685518550,
|
||||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -818,11 +818,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1686562199,
|
"lastModified": 1686638670,
|
||||||
"narHash": "sha256-FG6kCtVjCh0dHnV4AsVfhfSyPhjnSVXucwqCdTpMASE=",
|
"narHash": "sha256-+/5lqVzqeOguJlX/57LU2e3tChw5L/jpAOzyNsiveVg=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "b0cdae4e9baa188d69ba84aa1b7406b7bebe37f6",
|
"rev": "c8dafb187b7b010bf279a7bf0842eaadf3e387a8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -953,11 +953,11 @@
|
||||||
"topiary": "topiary"
|
"topiary": "topiary"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1686315162,
|
"lastModified": 1686564419,
|
||||||
"narHash": "sha256-KZZRTXSpxJDDGVbEdyTR/4Mu2COSMtrim+5iL7qwDTw=",
|
"narHash": "sha256-DJGvo1wDBRQSjAHAiNb8dD/77/CHwpeBzBYasIb51Hk=",
|
||||||
"owner": "tweag",
|
"owner": "tweag",
|
||||||
"repo": "nickel",
|
"repo": "nickel",
|
||||||
"rev": "9fed1326c9306d7c339884584702ce570764beaf",
|
"rev": "25c509e0b19f5b38b61a28765f62ce5c20e3e476",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1037,11 +1037,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1685764721,
|
"lastModified": 1686574167,
|
||||||
"narHash": "sha256-CIy1iwQTEKfZRrid4gBLA+r/LPGA9IUFo0lKJVyECGI=",
|
"narHash": "sha256-hxE8z+S9E4Qw03D2VQRaJUmj9zep3FvhKz316JUZuPA=",
|
||||||
"owner": "mic92",
|
"owner": "mic92",
|
||||||
"repo": "nix-index-database",
|
"repo": "nix-index-database",
|
||||||
"rev": "669ca1f2e2bc401abab6b837ae9c51503edc9b49",
|
"rev": "7e83b70f31f4483c07e6939166cb667ecb8d05d5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1150,16 +1150,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable_2": {
|
"nixpkgs-stable_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1678872516,
|
"lastModified": 1685801374,
|
||||||
"narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=",
|
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8",
|
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-22.11",
|
"ref": "nixos-23.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@ -1245,11 +1245,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1685655444,
|
"lastModified": 1686412476,
|
||||||
"narHash": "sha256-6EujQNAeaUkWvpEZZcVF8qSfQrNVWFNNGbUJxv/A5a8=",
|
"narHash": "sha256-inl9SVk6o5h75XKC79qrDCAobTD1Jxh6kVYTZKHzewA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e635192892f5abbc2289eaac3a73cdb249abaefd",
|
"rev": "21951114383770f96ae528d0ae68824557768e81",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1513,11 +1513,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable_2"
|
"nixpkgs-stable": "nixpkgs-stable_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1685361114,
|
"lastModified": 1686213770,
|
||||||
"narHash": "sha256-4RjrlSb+OO+e1nzTExKW58o3WRwVGpXwj97iCta8aj4=",
|
"narHash": "sha256-Re6xXLEqQ/HRnThryumyGzEf3Uv0Pl4cuG50MrDofP8=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "pre-commit-hooks.nix",
|
"repo": "pre-commit-hooks.nix",
|
||||||
"rev": "ca2fdbf3edda2a38140184da6381d49f8206eaf4",
|
"rev": "182af51202998af5b64ddecaa7ff9be06425399b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1599,11 +1599,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1683080331,
|
"lastModified": 1685759304,
|
||||||
"narHash": "sha256-nGDvJ1DAxZIwdn6ww8IFwzoHb2rqBP4wv/65Wt5vflk=",
|
"narHash": "sha256-I3YBH6MS3G5kGzNuc1G0f9uYfTcNY9NYoRc3QsykLk4=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "d59c3fa0cba8336e115b376c2d9e91053aa59e56",
|
"rev": "c535b4f3327910c96dcf21851bbdd074d0760290",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1624,11 +1624,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1685759304,
|
"lastModified": 1686364106,
|
||||||
"narHash": "sha256-I3YBH6MS3G5kGzNuc1G0f9uYfTcNY9NYoRc3QsykLk4=",
|
"narHash": "sha256-h4gCQg+jizmAbdg6UPlhxQVk4A7Ar/zoLa0wx3wBya0=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "c535b4f3327910c96dcf21851bbdd074d0760290",
|
"rev": "ba011dd1c5028dbb880bc3b0f427e0ff689e6203",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1768,11 +1768,11 @@
|
||||||
"nixpkgs": "nixpkgs_13"
|
"nixpkgs": "nixpkgs_13"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1686537156,
|
"lastModified": 1686623191,
|
||||||
"narHash": "sha256-mJD80brS6h6P4jzwdKID0S9RvfyiruxgJbXvPPIDqF0=",
|
"narHash": "sha256-x2gQcKtSgfbZlcTaVvdMPbrXMRjUEYIV88yzsFww6D4=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "e75da5cfc7da874401decaa88f4ccb3b4d64d20d",
|
"rev": "e279547de84413ca1a65cec3f0f879709c8c65eb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -1973,11 +1973,11 @@
|
||||||
"rust-overlay": "rust-overlay_4"
|
"rust-overlay": "rust-overlay_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1685522994,
|
"lastModified": 1686167925,
|
||||||
"narHash": "sha256-OJQ16KpYT3jGyP0WSI+jZQMU55/cnbzdYZKVBfx9wNk=",
|
"narHash": "sha256-2OU00zeoIS2jFBdXKak1Y2txC6IXEP0LsIUKSvr0qbc=",
|
||||||
"owner": "tweag",
|
"owner": "tweag",
|
||||||
"repo": "topiary",
|
"repo": "topiary",
|
||||||
"rev": "b2399161f60c1eb3404e487b4471ff76455d7a94",
|
"rev": "61d076c216422af7f865e2ade3bbdb4729e767ef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
description = "simple home-manager config";
|
description = "simple home-manager config";
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
nixpkgs-latest.url = "github:nixos/nixpkgs";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
@ -52,6 +53,7 @@
|
||||||
, neovim-nightly-overlay
|
, neovim-nightly-overlay
|
||||||
, nickel
|
, nickel
|
||||||
, nix-boost
|
, nix-boost
|
||||||
|
, nixpkgs-latest
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
|
@ -5,6 +5,7 @@ flake_input@{ kpcli-py
|
||||||
, system
|
, system
|
||||||
, nickel
|
, nickel
|
||||||
, nix-boost
|
, nix-boost
|
||||||
|
, nixpkgs-latest
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
@ -63,6 +64,10 @@ let
|
||||||
inherit (flake_input.nickel.packages.${system})
|
inherit (flake_input.nickel.packages.${system})
|
||||||
lsp-nls nickel nickelWasm;
|
lsp-nls nickel nickelWasm;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
vimPlugins = (final: prev: {
|
||||||
|
inherit (nixpkgs-latest) vimPlugins;
|
||||||
|
});
|
||||||
in
|
in
|
||||||
[
|
[
|
||||||
nix-boost.overlays.default
|
nix-boost.overlays.default
|
||||||
|
|
Loading…
Reference in New Issue