2024-05-10 02:39:22 +03:00
|
|
|
{ config, modulesPath, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib.mod) ctrl;
|
|
|
|
inherit (lib.nix2lua) lambda0 set pipe1 require call call0;
|
|
|
|
|
|
|
|
mkLineLimiterGroup = { limit, pattern }: {
|
|
|
|
"line-limiter-${toString limit}" = {
|
|
|
|
event = [ "BufNewFile" "BufRead" ];
|
|
|
|
inherit pattern;
|
|
|
|
callback = lambda0 (set "vim.wo.colorcolumn" (toString limit));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
"${modulesPath}/profiles/recommended.nix"
|
|
|
|
];
|
|
|
|
|
|
|
|
vim.namedCmd.extra-ftdetect = ''
|
|
|
|
aug extra_ftdetect
|
|
|
|
au!
|
|
|
|
au BufNewFile,BufRead *.d2 setfiletype d2
|
|
|
|
au BufNewFile,BufRead *.ncl setfiletype nickel
|
|
|
|
au BufNewFile,BufRead *.psql setfiletype psql
|
|
|
|
aug END
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Enable fast navigation between windows
|
|
|
|
vim.keymap.set = map (k: { mode = "n"; lhs = ctrl k; rhs = "${ctrl "w"}${k}"; }) [ "h" "l" "j" "k" ];
|
|
|
|
|
|
|
|
vim.augroup = lib.mkMerge [
|
|
|
|
(mkLineLimiterGroup {
|
|
|
|
limit = 101;
|
|
|
|
pattern = [
|
|
|
|
"*.nix"
|
|
|
|
"*.ts"
|
|
|
|
"*.tsx"
|
|
|
|
"*.js"
|
|
|
|
"*.jsx"
|
|
|
|
"*.rs"
|
|
|
|
"*.hs"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
(mkLineLimiterGroup {
|
|
|
|
limit = 81;
|
|
|
|
pattern = [
|
|
|
|
"*.json"
|
|
|
|
"*.yml"
|
|
|
|
"*.yaml"
|
|
|
|
"*.md"
|
|
|
|
"*.html"
|
|
|
|
"*.css"
|
|
|
|
"*.scss"
|
|
|
|
"*.less"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2024-05-10 16:35:54 +03:00
|
|
|
plugins.style.neoformat.autoformat.enable = true;
|
|
|
|
|
2024-05-10 02:39:22 +03:00
|
|
|
plugins.navigation = {
|
|
|
|
nvim-tree.settings = {
|
|
|
|
renderer = {
|
|
|
|
group_empty = true;
|
|
|
|
full_name = true;
|
|
|
|
};
|
|
|
|
tab.sync = {
|
|
|
|
open = true;
|
|
|
|
close = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
telescope.extensions.telescope-live-grep-args-nvim.settings = {
|
|
|
|
auto_quoting = true;
|
|
|
|
mappings.i = {
|
2024-05-10 18:50:22 +03:00
|
|
|
"${ctrl "k"}" = pipe1
|
2024-05-10 02:39:22 +03:00
|
|
|
(require "telescope-live-grep-args.actions")
|
|
|
|
(call0 "quote_prompt")
|
|
|
|
;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-10 18:50:22 +03:00
|
|
|
fn.lspconfig-eslint-on-attach = {
|
|
|
|
args = [ "client" "bufnr" ];
|
|
|
|
content = { bufnr, ... }: {
|
|
|
|
vim.augroup.eslint-fix = {
|
|
|
|
event = "BufWritePre";
|
|
|
|
buffer = bufnr;
|
|
|
|
command = "silent! EslintFixAll";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-05-10 02:39:22 +03:00
|
|
|
plugins.language-server.lspconfig.serverSettings = {
|
|
|
|
nil_ls = { };
|
|
|
|
rust_analyzer = {
|
|
|
|
settings.rust-analyzer = {
|
|
|
|
"server.path" = "rust-analyzer";
|
|
|
|
"updates.prompt" = false;
|
|
|
|
"updates.checkOnStartup" = false;
|
|
|
|
"checkOnSave.enable" = true;
|
|
|
|
"checkOnSave.command" = "clippy";
|
|
|
|
"cargo.autoreload" = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
tsserver = { };
|
|
|
|
eslint = {
|
2024-05-10 18:50:22 +03:00
|
|
|
on_attach = config.fn.lspconfig-eslint-on-attach.lambda;
|
2024-05-10 02:39:22 +03:00
|
|
|
};
|
|
|
|
volar = {
|
|
|
|
init_options = {
|
|
|
|
typescript.tsdk = "./node_modules/typescript/lib";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
ltex = {
|
|
|
|
language = "en-US";
|
|
|
|
languageToolHttpServerUri = "http://localhost:8081";
|
|
|
|
};
|
|
|
|
|
|
|
|
pylsp = { };
|
|
|
|
|
|
|
|
denols = {
|
|
|
|
root_dir = call "${config.plugin.nvim-lspconfig.varName}.util.root_pattern" [ "deno.json" "deno.jsonc" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|