fix: stuff

This commit is contained in:
2024-06-10 19:08:43 +02:00
parent b801064f84
commit d18b3d1683
11 changed files with 154 additions and 161 deletions

View File

@@ -16,20 +16,16 @@ in
};
config = lib.mkIf cfg.enable {
userCommands.${cfg.commandName} = {
command = {
__raw = # lua
''
function(args)
if args.bang then
vim.b.${cfg.varName} = not vim.b.${cfg.varName}
else
vim.g.${cfg.varName} = not vim.g.${cfg.varName}
end
end
'';
};
};
userCommands.${cfg.commandName}.command.__raw = # lua
''
function(args)
if args.bang then
vim.b.${cfg.varName} = not vim.b.${cfg.varName}
else
vim.g.${cfg.varName} = not vim.g.${cfg.varName}
end
end
'';
keymaps = [
{

View File

@@ -47,18 +47,16 @@ in
userCommands.${cfg.commandName} = {
bang = true;
command = {
__raw = # lua
''
function(args)
if args.bang then
vim.b.${cfg.varName} = not vim.b.${cfg.varName}
else
vim.g.${cfg.varName} = not vim.g.${cfg.varName}
end
command.__raw = # lua
''
function(args)
if args.bang then
vim.b.${cfg.varName} = not vim.b.${cfg.varName}
else
vim.g.${cfg.varName} = not vim.g.${cfg.varName}
end
'';
};
end
'';
};
keymaps = [
@@ -85,11 +83,12 @@ in
};
};
neo-tree.eventHandlers.window_before_open = ''
function()
AutoSave()
end
'';
neo-tree.eventHandlers.window_before_open = # lua
''
function()
AutoSave()
end
'';
lualine.sections.lualine_x = lib.mkOrder 700 [
"(vim.g.${cfg.varName} or vim.b.${cfg.varName}) and '󱙃' or nil"

View File

@@ -42,16 +42,15 @@ in
key = "<leader>sa";
mode = "n";
options.silent = true;
lua = true;
action = # lua
action.__raw = # lua
"require('actions-preview').code_actions";
}
{
key = "<leader>sx";
mode = "n";
options.silent = true;
lua = true;
action = "vim.lsp.buf.format";
action.__raw = # lua
"vim.lsp.buf.format";
}
{
key = "<leader>sR";
@@ -63,8 +62,8 @@ in
key = "<leader>sn";
mode = "n";
options.silent = true;
action = "vim.lsp.buf.hover";
lua = true;
action.__raw = # lua
"vim.lsp.buf.hover";
}
];
plugins = {

View File

@@ -21,8 +21,8 @@ in
"--ngProbeLocations"
""
];
on_new_config = {
__raw = ''
on_new_config.__raw = # lua
''
function(new_config, new_root_dir)
new_config.cmd = {
new_root_dir .. "/node_modules/@angular/language-server/bin/ngserver",
@@ -34,7 +34,6 @@ in
}
end
'';
};
filetypes = [
"typescript"
"html"
@@ -43,15 +42,14 @@ in
"angular"
"html.angular"
];
on_attach = {
__raw = ''
on_attach.__raw = # lua
''
function(client, bufnr)
if vim.bo[bufnr].filetype == "html" then
vim.bo[bufnr].filetype = "angular"
end
end
'';
};
};
}
];

View File

@@ -15,21 +15,24 @@ in
};
config = lib.mkIf cfg.enable {
extraConfigLua = lib.mkIf cfg.npm ''
require("cmp-npm").setup({})
'';
extraConfigLua =
lib.mkIf cfg.npm # lua
''
require("cmp-npm").setup({})
'';
plugins = {
lspkind = lib.mkIf cfg.npm {
cmp.after = ''
function(entry, vim_item, kind)
if entry.source.name == "npm" then
kind.kind = ""
kind.kind_hl_group = "CmpItemKindNpm"
cmp.after = # lua
''
function(entry, vim_item, kind)
if entry.source.name == "npm" then
kind.kind = ""
kind.kind_hl_group = "CmpItemKindNpm"
end
kind.kind = kind.kind .. " "
return kind
end
kind.kind = kind.kind .. " "
return kind
end
'';
'';
};
cmp.settings.sources = lib.mkIf cfg.npm [
{

View File

@@ -15,7 +15,7 @@ in
config = lib.mkIf cfg.enable {
plugins = {
conform-nvim.formattersByFt.nix = [ "nixfmt" ];
lsp.servers.nil_ls.enable = true;
lsp.servers.nil-ls.enable = true;
nix.enable = true;
};
extraPackages = [ pkgs.nixfmt-rfc-style ];

View File

@@ -42,16 +42,12 @@ in
end
'';
userCommands.${cfg.commandName} = {
command = {
__raw = # lua
''
function()
LazygitTerminal:toggle()
end
'';
};
};
userCommands.${cfg.commandName}.command.__raw = # lua
''
function()
LazygitTerminal:toggle()
end
'';
keymaps = [
{

View File

@@ -12,36 +12,31 @@ in
{
key = "<leader>xx";
mode = "n";
lua = true;
action = # lua
action.__raw = # lua
"require('trouble').toggle";
}
{
key = "<leader>xw";
mode = "n";
lua = true;
action = # lua
action.__raw = # lua
"function() require('trouble').toggle('workspace_diagnostics') end";
}
{
key = "<leader>xd";
mode = "n";
lua = true;
action = # lua
action.__raw = # lua
"function() require('trouble').toggle('document_diagnostics') end";
}
{
key = "<leader>xq";
mode = "n";
lua = true;
action = # lua
action.__raw = # lua
"function() require('trouble').toggle('quickfix') end";
}
{
key = "<leader>xl";
mode = "n";
lua = true;
action = # lua
action.__raw = # lua
"function() require('trouble').toggle('loclist') end";
}
];

View File

@@ -9,10 +9,8 @@ in
config = lib.mkIf cfg.enable {
opts = {
undodir = {
__raw = # lua
"os.getenv('HOME') .. '/.config/nvim/undodir'";
};
undodir.__raw = # lua
"os.getenv('HOME') .. '/.config/nvim/undodir'";
undofile = true;
};
plugins = {