Compare commits
2 commits
113e44cb04
...
ee0fcad06f
Author | SHA1 | Date | |
---|---|---|---|
ee0fcad06f | |||
c36bad03eb |
1 changed files with 29 additions and 14 deletions
|
@ -1,9 +1,17 @@
|
|||
{ config, modulesPath, lib, ... }:
|
||||
{ config, modulesPath, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
inherit (lib.mod) ctrl;
|
||||
inherit (lib.nix2lua) lambda0 set pipe1 require call call0;
|
||||
|
||||
mkFiletypeDetect = ft: pattern: {
|
||||
"filetype-detect-${ft}" = {
|
||||
event = [ "BufNewFile" "BufRead" ];
|
||||
inherit pattern;
|
||||
command = "setfiletype ${ft}";
|
||||
};
|
||||
};
|
||||
|
||||
mkLineLimiterGroup = { limit, pattern }: {
|
||||
"line-limiter-${toString limit}" = {
|
||||
event = [ "BufNewFile" "BufRead" ];
|
||||
|
@ -17,19 +25,14 @@ in
|
|||
"${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 [
|
||||
(mkFiletypeDetect "d2" "*.d2")
|
||||
(mkFiletypeDetect "nickel" "*.ncl")
|
||||
(mkFiletypeDetect "psql" "*.psql")
|
||||
|
||||
(mkLineLimiterGroup {
|
||||
limit = 101;
|
||||
pattern = [
|
||||
|
@ -57,6 +60,22 @@ in
|
|||
})
|
||||
];
|
||||
|
||||
plugins.style.nvim-treesitter.extraGrammars = {
|
||||
tree-sitter-d2 = rec {
|
||||
language = "d2";
|
||||
version = "8a9d50043d58eedf1e375b0e2059e43efd856902";
|
||||
# version = "e7507ddd983427cb71b4bd96b039c382c73d65c5";
|
||||
src = pkgs.fetchFromGitea {
|
||||
domain = "git.pleshevski.ru";
|
||||
owner = "pleshevskiy";
|
||||
repo = "tree-sitter-d2";
|
||||
rev = version;
|
||||
sha256 = "sha256-ZhVjxo7Xi7DaHN3qabUcykflY74bUqPcOA410fA3zRk=";
|
||||
# sha256 = "sha256-m7ZCxnW4Q1bQp1GhntUF7l+p6DV1p/2AJXhVeRy8Rec=";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
plugins.style.neoformat.autoformat.enable = true;
|
||||
|
||||
plugins.navigation = {
|
||||
|
@ -112,16 +131,12 @@ in
|
|||
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" ];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue