mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2026-01-04 23:02:48 +00:00
feat: nixvim improvements
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
{ pkgs }:
|
||||
let
|
||||
angular-ls = (import ../../packages/node-packages {
|
||||
inherit pkgs;
|
||||
nodejs = pkgs.nodejs_18;
|
||||
})."@angular/language-server";
|
||||
darkman = pkgs.vimUtils.buildVimPlugin {
|
||||
name = "darkman";
|
||||
src = pkgs.buildGoModule rec {
|
||||
@@ -127,7 +123,10 @@ in {
|
||||
};
|
||||
icon = "";
|
||||
}];
|
||||
lualine_x = [ { name = "filesize"; } { name = "filetype"; } ];
|
||||
lualine_x = [
|
||||
"(vim.g.disable_autoformat or vim.b.disable_autoformat) and '' or nil"
|
||||
{ name = "filetype"; }
|
||||
];
|
||||
lualine_z = [{
|
||||
name = "location";
|
||||
separator = {
|
||||
@@ -234,10 +233,14 @@ in {
|
||||
bash = [ "shfmt" ];
|
||||
nix = [ "nixfmt" ];
|
||||
};
|
||||
formatOnSave = {
|
||||
timeoutMs = 500;
|
||||
lspFallback = true;
|
||||
};
|
||||
formatOnSave = ''
|
||||
function(bufnr)
|
||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||
return
|
||||
end
|
||||
return { timeout_ms = 500, lsp_fallback = true };
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
lint = {
|
||||
@@ -395,6 +398,7 @@ in {
|
||||
t = "Type Definitions";
|
||||
h = "Diagnostics";
|
||||
a = "Code Actions";
|
||||
f = "Auto Formatting";
|
||||
};
|
||||
"<leader>x" = {
|
||||
name = "Trouble";
|
||||
@@ -435,7 +439,6 @@ in {
|
||||
};
|
||||
|
||||
extraPackages = [
|
||||
angular-ls
|
||||
pkgs.nodePackages.typescript-language-server
|
||||
pkgs.nodePackages.stylelint
|
||||
pkgs.nodePackages.prettier
|
||||
|
||||
@@ -57,3 +57,14 @@ function _lazygit_toggle()
|
||||
end
|
||||
|
||||
vim.api.nvim_set_keymap("n", "<leader>g", "<cmd>lua _lazygit_toggle()<CR>", { noremap = true, silent = true })
|
||||
|
||||
vim.api.nvim_create_user_command("ConformToggle", function(args)
|
||||
if args.bang then
|
||||
vim.b.disable_autoformat = not vim.b.disable_autoformat
|
||||
else
|
||||
vim.g.disable_autoformat = not vim.g.disable_autoformat
|
||||
end
|
||||
end, {
|
||||
desc = "Disable autoformat-on-save",
|
||||
bang = true,
|
||||
})
|
||||
|
||||
@@ -65,6 +65,12 @@
|
||||
lua = true;
|
||||
action = "require('actions-preview').code_actions";
|
||||
}
|
||||
{
|
||||
key = "<leader>sf";
|
||||
mode = "n";
|
||||
options.silent = true;
|
||||
action = "<cmd>:ConformToggle<CR>";
|
||||
}
|
||||
# Trouble
|
||||
{
|
||||
key = "<leader>xx";
|
||||
|
||||
Reference in New Issue
Block a user