refactor: massive refactor using flake-parts; use typos-cli and

keep-sorted
This commit is contained in:
2025-12-20 12:57:47 +08:00
parent d5f027f586
commit bc197eb3ca
21 changed files with 466 additions and 455 deletions

View File

@@ -29,6 +29,8 @@ lib.my.makeHomeProgramConfig {
gcc # treesitter
ripgrep # telescope
typos-lsp
];
};
};

View File

@@ -37,7 +37,7 @@ vim.g.autoread = true
vim.g.loaded_ruby_provider = 0
-- Hightlight on yank
-- Highlight on yank
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
@@ -55,12 +55,12 @@ vim.cmd([[
\ endif
]])
-- Automaticly switch input method
-- Automatically switch input method
Last_input_method = 1
vim.api.nvim_create_augroup("AutoInputMethod", {})
vim.api.nvim_create_autocmd("InsertLeave", {
pattern = "*",
desc = "Automaticly switch input method",
desc = "Automatically switch input method",
callback = function()
Last_input_method = require("core.globals").switch_input_method(1)
end,
@@ -68,7 +68,7 @@ vim.api.nvim_create_autocmd("InsertLeave", {
})
vim.api.nvim_create_autocmd("CmdlineLeave", {
pattern = "*",
desc = "Automaticly switch input method",
desc = "Automatically switch input method",
callback = function()
require("core.globals").switch_input_method(1)
end,
@@ -76,7 +76,7 @@ vim.api.nvim_create_autocmd("CmdlineLeave", {
})
vim.api.nvim_create_autocmd("InsertEnter", {
pattern = "*",
desc = "Automaticly switch input method",
desc = "Automatically switch input method",
callback = function()
require("core.globals").switch_input_method(Last_input_method)
end,

View File

@@ -42,7 +42,16 @@ local servers = {
command = { "nixfmt" },
},
nixpkgs = {
expr = "import <nixpkgs> { }",
expr = [[
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
nodeName = lock.nodes.root.inputs.nixpkgs;
in
import (fetchTarball {
url = lock.nodes.${nodeName}.locked.url or "https://github.com/NixOS/nixpkgs/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
sha256 = lock.nodes.${nodeName}.locked.narHash;
}) { }
]],
},
},
},
@@ -54,14 +63,17 @@ local servers = {
qmlls = {
cmd = { "qmlls", "-E" },
},
pyright = {},
gopls = {},
-- keep-sorted start
clangd = {},
ts_ls = {},
jsonls = {},
cssls = {},
gopls = {},
html = {},
java_language_server = {},
jsonls = {},
pyright = {},
ts_ls = {},
typos_lsp = {},
-- keep-sorted end
}
local capabilities = require("cmp_nvim_lsp").default_capabilities()