mirror of
https://github.com/Dichgrem/DCGOS.git
synced 2025-12-17 19:51:59 -05:00
build:neotree
fix:highlight fix:nvim_fmt fix:stop_autofmt fix:update_notice fix:niri_scroll
This commit is contained in:
2
dotfiles/.config/niri/config.kdl
vendored
2
dotfiles/.config/niri/config.kdl
vendored
@@ -1,6 +1,6 @@
|
|||||||
input {
|
input {
|
||||||
disable-power-key-handling
|
disable-power-key-handling
|
||||||
focus-follows-mouse
|
focus-follows-mouse max-scroll-amount="0%"
|
||||||
warp-mouse-to-focus
|
warp-mouse-to-focus
|
||||||
|
|
||||||
mouse {
|
mouse {
|
||||||
|
|||||||
@@ -3,27 +3,25 @@
|
|||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: {
|
||||||
neo-tree-nvim-main = pkgs.vimUtils.buildVimPlugin {
|
|
||||||
pname = "neo-tree-nvim-main";
|
|
||||||
version = "3.35.2+6";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "nvim-neo-tree";
|
|
||||||
repo = "neo-tree.nvim";
|
|
||||||
rev = "8dd9f08ff086d09d112f1873f88dc0f74b598cdb";
|
|
||||||
sha256 = "sha256-edthaqznGTJ+VFVORK7gfHI9J14PLAghG9prsWlzXtc=";
|
|
||||||
};
|
|
||||||
doCheck = false;
|
|
||||||
meta.homepage = "https://github.com/nvim-neo-tree/neo-tree.nvim/";
|
|
||||||
meta.hydraPlatforms = [];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
# LazyVim
|
black
|
||||||
|
ruff
|
||||||
|
google-java-format
|
||||||
|
jdt-language-server
|
||||||
|
prettierd
|
||||||
|
nodePackages.prettier
|
||||||
|
clang-tools
|
||||||
|
rustfmt
|
||||||
|
jq
|
||||||
|
yamlfmt
|
||||||
|
taplo
|
||||||
|
shfmt
|
||||||
lua-language-server
|
lua-language-server
|
||||||
stylua
|
stylua
|
||||||
|
nixpkgs-fmt
|
||||||
];
|
];
|
||||||
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
@@ -41,10 +39,7 @@ in {
|
|||||||
friendly-snippets
|
friendly-snippets
|
||||||
gitsigns-nvim
|
gitsigns-nvim
|
||||||
lualine-nvim
|
lualine-nvim
|
||||||
{
|
neo-tree-nvim
|
||||||
name = "neo-tree.nvim";
|
|
||||||
path = neo-tree-nvim-main;
|
|
||||||
}
|
|
||||||
neoconf-nvim
|
neoconf-nvim
|
||||||
neodev-nvim
|
neodev-nvim
|
||||||
noice-nvim
|
noice-nvim
|
||||||
@@ -55,7 +50,6 @@ in {
|
|||||||
nvim-spectre
|
nvim-spectre
|
||||||
nvim-treesitter
|
nvim-treesitter
|
||||||
nvim-treesitter-context
|
nvim-treesitter-context
|
||||||
nvim-treesitter-textobjects
|
|
||||||
nvim-ts-autotag
|
nvim-ts-autotag
|
||||||
nvim-ts-context-commentstring
|
nvim-ts-context-commentstring
|
||||||
nvim-web-devicons
|
nvim-web-devicons
|
||||||
@@ -199,7 +193,4 @@ in {
|
|||||||
|
|
||||||
# Normal LazyVim config here, see https://github.com/LazyVim/starter/tree/main/lua
|
# Normal LazyVim config here, see https://github.com/LazyVim/starter/tree/main/lua
|
||||||
xdg.configFile."nvim/lua".source = ./lua;
|
xdg.configFile."nvim/lua".source = ./lua;
|
||||||
|
|
||||||
# Set default editor
|
|
||||||
home.sessionVariables.EDITOR = "nvim";
|
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
-- Options are automatically loaded before lazy.nvim startup
|
-- Options are automatically loaded before lazy.nvim startup
|
||||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||||
-- Add any additional options here
|
-- Add any additional options here
|
||||||
|
vim.g.autoformat = false
|
||||||
44
home/nvim/lua/plugins/format.lua
Normal file
44
home/nvim/lua/plugins/format.lua
Normal 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,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
return {
|
return {
|
||||||
"ojroques/nvim-osc52",
|
"ojroques/nvim-osc52",
|
||||||
config = function()
|
config = function()
|
||||||
require("osc52").setup {
|
require("osc52").setup({
|
||||||
max_length = 0, -- 不限制长度
|
max_length = 0, -- 不限制长度
|
||||||
silent = false,
|
silent = false,
|
||||||
trim = false,
|
trim = false,
|
||||||
}
|
})
|
||||||
|
|
||||||
local function copy()
|
local function copy()
|
||||||
if vim.v.event.operator == "y" and vim.v.event.regname == "" then
|
if vim.v.event.operator == "y" and vim.v.event.regname == "" then
|
||||||
|
|||||||
30
home/nvim/lua/plugins/treesitter.lua
Normal file
30
home/nvim/lua/plugins/treesitter.lua
Normal 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,
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user