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.nix2lua) pipe1 require call call0 nf var;
mkLineLimiterOpts = limit: {
colorcolumn = toString (limit + 1);
textwidth = limit;
};
mkLineLimiterGroup = { limit, pattern }:
lib.nameValuePair
"line-limiter-${toString limit}"
{
inherit pattern;
opt = {
colorcolumn = toString limit;
textwidth = limit - 1;
};
opt = mkLineLimiterOpts limit;
};
in
{
@ -23,11 +25,17 @@ in
vim.opt = {
list = true;
formatoptions = "tcroqwanljp";
};
buffer.filetype = lib.listToAttrs [
buffer.filetype = {
python-options = {
pattern = [ "python" ];
opt = { formatoptions = "croqwaljp"; } // mkLineLimiterOpts 90;
};
} // lib.listToAttrs [
(mkLineLimiterGroup {
limit = 101;
limit = 100;
pattern = [
"nix"
"javascript,javascriptreact"
@ -37,9 +45,8 @@ in
];
})
(mkLineLimiterGroup {
limit = 81;
limit = 80;
pattern = [
"python"
"json"
"yaml"
"markdown"
@ -59,6 +66,12 @@ in
# Enable fast navigation between windows
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 = {
tree-sitter-d2 = rec {
language = "d2";