Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 49e474caeb | |||
| 04e1114959 |
+77
-18
@@ -567,7 +567,12 @@ local function makespec_lualine()
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "echasnovski/mini.icons", "folke/noice.nvim" },
|
||||
opts = {
|
||||
options = { theme = "auto", globalstatus = false, always_divide_middle = false },
|
||||
options = {
|
||||
theme = "auto",
|
||||
globalstatus = false,
|
||||
always_divide_middle = false,
|
||||
disabled_filetypes = { statusline = { "snacks_picker_list" } },
|
||||
},
|
||||
extensions = { "fugitive", "neo-tree", "lazy" },
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
@@ -605,7 +610,6 @@ local function makespec_lualine()
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {
|
||||
-- { 'require("noice").api.status.message.get()', color = { fg = "#99c794" } }, -- gets too obtrusive
|
||||
{ 'require("noice").api.status.mode.get()', color = "lualine_a_command" },
|
||||
{ 'require("noice").api.status.command.get()', color = "lualine_a_command" },
|
||||
},
|
||||
@@ -882,7 +886,7 @@ local function makespec_fugitive()
|
||||
pattern = { "fugitive", "gitcommit" },
|
||||
callback = function()
|
||||
vim.opt_local.foldmethod = "syntax"
|
||||
vim.opt_local.foldlevel = 0
|
||||
vim.opt_local.foldlevel = 99
|
||||
end,
|
||||
})
|
||||
end,
|
||||
@@ -1392,6 +1396,29 @@ local function makespec_treesitter()
|
||||
}
|
||||
end
|
||||
|
||||
local function makespec_treewalker()
|
||||
return {
|
||||
"aaronik/treewalker.nvim",
|
||||
-- Load when you open a file that Treesitter supports
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
opts = {
|
||||
-- Briefly highlights the block of code you just jumped to
|
||||
highlight = true,
|
||||
},
|
||||
keys = {
|
||||
-- Normal and Visual mode mappings
|
||||
{ "]]", "<cmd>Treewalker Down<cr>", mode = { "n", "v" }, desc = "Next Sibling (Current Level)" },
|
||||
{ "[[", "<cmd>Treewalker Up<cr>", mode = { "n", "v" }, desc = "Prev Sibling (Current Level)" },
|
||||
{ "((", "<cmd>Treewalker Left<cr>", mode = { "n", "v" }, desc = "Go Out (Parent Level)" },
|
||||
{ "))", "<cmd>Treewalker Right<cr>", mode = { "n", "v" }, desc = "Go In (Child Level)" },
|
||||
|
||||
-- Optional: Swap nodes! (Move current block down/up past its sibling)
|
||||
{ "<leader>Sj", "<cmd>Treewalker SwapDown<cr>", desc = "Swap Block Down" },
|
||||
{ "<leader>Sk", "<cmd>Treewalker SwapUp<cr>", desc = "Swap Block Up" },
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
local function makespec_hlslens()
|
||||
return {
|
||||
-- search count > 99
|
||||
@@ -1422,16 +1449,26 @@ end
|
||||
local function makespec_lint()
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
require("lint").linters_by_ft = {
|
||||
local lint = require("lint")
|
||||
lint.linters_by_ft = {
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
html = { "tidy", "eslint_d" },
|
||||
go = { "golangcilint" },
|
||||
sh = { "shellcheck" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("nvim_lint", { clear = true })
|
||||
|
||||
-- Use a timer to debounce linting to prevent UI stutter
|
||||
local timer = vim.uv.new_timer()
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
callback = function() require("lint").try_lint() end,
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
timer:start(200, 0, vim.schedule_wrap(function() lint.try_lint() end))
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1440,14 +1477,26 @@ end
|
||||
local function makespec_conform()
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
lazy = true,
|
||||
-- Load conform right before you save a file, or when you trigger a keymap
|
||||
event = { "BufWritePre" },
|
||||
cmd = { "ConformInfo" },
|
||||
keys = {
|
||||
{ "<leader>p", function() require("conform").format() end, silent = true, desc = "Autoformat" },
|
||||
{
|
||||
"<leader>p",
|
||||
function() require("conform").format({ async = true, lsp_format = "fallback" }) end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Autoformat",
|
||||
},
|
||||
{ "<leader>lp", "<cmd>ConformInfo<cr>", desc = "Conform log" },
|
||||
{ "<leader>lP", "<cmd>e ~/.local/state/nvim/conform.log<cr>", desc = "Conform log" },
|
||||
{ "<leader>lP", "<cmd>e ~/.local/state/nvim/conform.log<cr>", desc = "Conform log file" },
|
||||
},
|
||||
opts = {
|
||||
-- format_on_save = function(bufnr)
|
||||
-- -- Disable with a global or buffer-local variable
|
||||
-- if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then return end
|
||||
-- return { timeout_ms = 3000, lsp_format = "fallback" }
|
||||
-- end,
|
||||
|
||||
formatters_by_ft = {
|
||||
["_"] = { "trim_whitespace" },
|
||||
css = { "prettierd", "prettier", stop_after_first = true },
|
||||
@@ -1465,7 +1514,9 @@ local function makespec_conform()
|
||||
typst = { "typstyle" },
|
||||
yaml = { "yamlfmt" },
|
||||
},
|
||||
default_format_opts = { timeout_ms = 3000, lsp_format = "fallback" },
|
||||
default_format_opts = {
|
||||
lsp_format = "fallback",
|
||||
},
|
||||
formatters = {
|
||||
javascript = { require_cwd = true },
|
||||
stylua = { append_args = { "--indent-type", "Spaces", "--collapse-simple-statement", "Always" } },
|
||||
@@ -1552,13 +1603,15 @@ local function makespec_noice()
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = { "MunifTanjim/nui.nvim", "rcarriga/nvim-notify" },
|
||||
dependencies = { "MunifTanjim/nui.nvim" },
|
||||
opts = {
|
||||
-- Disable Noice's notification router so Snacks can handle it
|
||||
notify = { enabled = false },
|
||||
messages = {
|
||||
enabled = true,
|
||||
view = "notify",
|
||||
view_error = "notify",
|
||||
view_warn = "notify",
|
||||
view = "mini",
|
||||
view_error = "mini",
|
||||
view_warn = "mini",
|
||||
view_history = "popup",
|
||||
view_search = false,
|
||||
},
|
||||
@@ -1566,19 +1619,24 @@ local function makespec_noice()
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
signature = { enabled = true, auto_open = { enabled = false, throttle = 50 } },
|
||||
},
|
||||
presets = { command_palette = true, long_message_to_split = true },
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
lsp_doc_border = true,
|
||||
},
|
||||
routes = {
|
||||
{ filter = { event = "msg_show", kind = "search_count" }, opts = { skip = true } },
|
||||
{ filter = { kind = "", min_height = 2 }, view = "split" },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>lx", function() require("noice").cmd("dismiss") end, desc = "Noice dismiss" },
|
||||
{ "<leader>lh", function() require("noice").cmd("all") end, desc = "Noice history" },
|
||||
{ "<leader>ls", function() require("noice").cmd("stats") end, desc = "Noice stats" },
|
||||
{ "<leader>lx", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
|
||||
{ "<leader>lh", function() require("noice").cmd("all") end, desc = "Noice History" },
|
||||
{ "<leader>ls", function() require("noice").cmd("stats") end, desc = "Noice Stats" },
|
||||
{ "<leader>un", function() require("noice").cmd("enable") end, desc = "Enable Noice" },
|
||||
{ "<leader>uN", function() require("noice").cmd("disable") end, desc = "Disable Noice" },
|
||||
},
|
||||
@@ -1601,6 +1659,7 @@ for _, spec in ipairs({
|
||||
makespec_conform(), -- autoformat
|
||||
makespec_lspconfig(),
|
||||
makespec_treesitter(),
|
||||
makespec_treewalker(),
|
||||
makespec_todocomments(),
|
||||
makespec_autotag(),
|
||||
makespec_lint(),
|
||||
|
||||
Reference in New Issue
Block a user