build:neotree

fix:highlight
fix:nvim_fmt
fix:stop_autofmt
fix:update_notice
fix:niri_scroll
This commit is contained in:
dichgrem
2025-11-14 16:58:48 +08:00
parent 02da5c19e2
commit e02cfc5dcd
7 changed files with 152 additions and 86 deletions

View File

@@ -0,0 +1,44 @@
return {
{
"stevearc/conform.nvim",
opts = function(_, opts)
opts.format_on_save = nil
opts.formatters = opts.formatters or {}
opts.formatters.nixpkgs_fmt = {
command = "nixpkgs-fmt",
args = function(ctx)
return {}
end,
stdin = true,
exit_codes = { 0 },
}
opts.formatters_by_ft = opts.formatters_by_ft or {}
opts.formatters_by_ft.nix = { "nixpkgs_fmt", stop_after_first = true }
opts.formatters_by_ft.lua = { "stylua" }
opts.formatters_by_ft.python = { "black", "ruff_format" }
opts.formatters_by_ft.sh = { "shfmt" }
opts.formatters_by_ft.javascript = { "prettier" }
opts.formatters_by_ft.typescript = { "prettier" }
opts.formatters_by_ft.javascriptreact = { "prettier" }
opts.formatters_by_ft.typescriptreact = { "prettier" }
opts.formatters_by_ft.vue = { "prettier" }
opts.formatters_by_ft.go = { "gofmt" }
opts.formatters_by_ft.c = { "clang_format" }
opts.formatters_by_ft.cpp = { "clang_format" }
opts.formatters_by_ft.rust = { "rustfmt" }
opts.formatters_by_ft.java = { "google-java-format" }
opts.formatters_by_ft.json = { "jq" }
opts.formatters_by_ft.yaml = { "yamlfmt" }
opts.formatters_by_ft.toml = { "taplo" }
opts.default_format_opts = {
timeout_ms = 1000,
lsp_format = "fallback",
stop_after_first = false,
}
opts.log_level = vim.log.levels.ERROR
opts.notify_on_error = true
opts.notify_no_formatters = true
return opts
end,
},
}

View File

@@ -1,18 +1,18 @@
return {
"ojroques/nvim-osc52",
config = function()
require("osc52").setup {
max_length = 0, -- 不限制长度
silent = false,
trim = false,
}
"ojroques/nvim-osc52",
config = function()
require("osc52").setup({
max_length = 0, -- 不限制长度
silent = false,
trim = false,
})
local function copy()
if vim.v.event.operator == "y" and vim.v.event.regname == "" then
require("osc52").copy_register("")
end
end
local function copy()
if vim.v.event.operator == "y" and vim.v.event.regname == "" then
require("osc52").copy_register("")
end
end
vim.api.nvim_create_autocmd("TextYankPost", { callback = copy })
end,
vim.api.nvim_create_autocmd("TextYankPost", { callback = copy })
end,
}

View File

@@ -0,0 +1,30 @@
return {
{
"LazyVim/LazyVim",
opts = {
treesitter = false,
},
},
{
"nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile" },
opts = {
ensure_installed = {},
auto_install = false,
highlight = { enable = true },
indent = { enable = true },
incremental_selection = {
enable = true,
keymaps = {
init_selection = "gnn",
node_incremental = "grn",
scope_incremental = "grc",
node_decremental = "grm",
},
},
},
config = function(_, opts)
require("nvim-treesitter.configs").setup(opts)
end,
},
}