Compare commits

..

4 commits

Author SHA1 Message Date
26887e2f33
neovim: add specific options for python filetype
- change limiter to 90
- remove t and n from formatoptions
2024-06-09 16:52:03 +03:00
b9fe063b50
neovim: refac line limiter 2024-06-09 16:50:35 +03:00
9cda7b1c76
neovim: change formatoptions 2024-06-09 16:49:59 +03:00
26338a9f35
neovim: add missed nlspsettings plugin 2024-06-09 16:49:22 +03:00

View file

@ -4,15 +4,17 @@ let
inherit (lib.mod) ctrl; inherit (lib.mod) ctrl;
inherit (lib.nix2lua) pipe1 require call call0 nf var; inherit (lib.nix2lua) pipe1 require call call0 nf var;
mkLineLimiterOpts = limit: {
colorcolumn = toString (limit + 1);
textwidth = limit;
};
mkLineLimiterGroup = { limit, pattern }: mkLineLimiterGroup = { limit, pattern }:
lib.nameValuePair lib.nameValuePair
"line-limiter-${toString limit}" "line-limiter-${toString limit}"
{ {
inherit pattern; inherit pattern;
opt = { opt = mkLineLimiterOpts limit;
colorcolumn = toString limit;
textwidth = limit - 1;
};
}; };
in in
{ {
@ -23,11 +25,17 @@ in
vim.opt = { vim.opt = {
list = true; list = true;
formatoptions = "tcroqwanljp";
}; };
buffer.filetype = lib.listToAttrs [ buffer.filetype = {
python-options = {
pattern = [ "python" ];
opt = { formatoptions = "croqwaljp"; } // mkLineLimiterOpts 90;
};
} // lib.listToAttrs [
(mkLineLimiterGroup { (mkLineLimiterGroup {
limit = 101; limit = 100;
pattern = [ pattern = [
"nix" "nix"
"javascript,javascriptreact" "javascript,javascriptreact"
@ -37,9 +45,8 @@ in
]; ];
}) })
(mkLineLimiterGroup { (mkLineLimiterGroup {
limit = 81; limit = 80;
pattern = [ pattern = [
"python"
"json" "json"
"yaml" "yaml"
"markdown" "markdown"
@ -59,6 +66,12 @@ in
# Enable fast navigation between windows # Enable fast navigation between windows
vim.keymap.set = map (k: { mode = "n"; lhs = ctrl k; rhs = "${ctrl "w"}${k}"; }) [ "h" "l" "j" "k" ]; vim.keymap.set = map (k: { mode = "n"; lhs = ctrl k; rhs = "${ctrl "w"}${k}"; }) [ "h" "l" "j" "k" ];
plugin.nlsp-settings-nvim = {
enable = true;
name = "nlspsettings";
setupSettings = { };
};
plugins.style.nvim-treesitter.extraGrammars = { plugins.style.nvim-treesitter.extraGrammars = {
tree-sitter-d2 = rec { tree-sitter-d2 = rec {
language = "d2"; language = "d2";