Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zmre committed Sep 11, 2024
1 parent 152132a commit 10e1aa4
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 22 deletions.
18 changes: 18 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
onedarkpro.flake = false;
catppuccin.url = "github:catppuccin/nvim";
catppuccin.flake = false;

# Need to manually roll back Noice to commig d9328ef until Folke resolves https://github.com/folke/noice.nvim/issues/923
# Otherwise neovide goes crazy on me when I'm in the command line
noice-nvim.url = "github:folke/noice.nvim?ref=d9328ef";
noice-nvim.flake = false;
};
outputs = inputs @ {
self,
Expand Down Expand Up @@ -83,6 +88,11 @@
pname = "conform-nvim";
src = inputs.conform-nvim;
};
noice-nvim = super.vimUtils.buildVimPlugin {
name = "noice-nvim";
pname = "noice-nvim";
src = inputs.noice-nvim;
};
};
})
];
Expand Down Expand Up @@ -391,7 +401,7 @@
};
};
}
// {buildInputs = dependencies;})
// {buildInputs = dependencies;}) # this last line is needed so neovide can pull in same ones
.overrideAttrs (old: {
name = "pwnvim";
version = old.version + "-" + self.lastModifiedDate;
Expand Down
44 changes: 23 additions & 21 deletions pwnvim/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,6 @@ M.diagnostics = function()
-- rust = { "rustfmt" }
}

require("conform").formatters.lua_format = {
command = "lua-format",
args = { "-i", "--no-use-tab", "--indent-width=2" },
stdin = true
}
require("conform.formatters.prettier").args = {
"--stdin-filepath", "$FILENAME", "--tab-width", "2"
}

require("conform").setup({ -- use formatter.nvim instead?
notify_on_error = true,
format_on_save = {
Expand All @@ -458,24 +449,35 @@ M.diagnostics = function()
formatters = {
prettier = {
-- below path set in init.lua which is made in flake.nix
command = prettier_path
command = prettier_path,
args = { "--stdin-filepath", "$FILENAME", "--tab-width", "2" }
},
lua_format = {
command = "lua-format",
args = { "-i", "--no-use-tab", "--indent-width=2" },
stdin = true
},
alejandra = {
command = "alejandra",
args = { "-q", "-q" }
}

},
formatters_by_ft = {
-- lua = {{"lua_format", "stylua"}},
python = { "black" },
-- Use a sub-list to run only the first available formatter
javascript = { { "prettier", "eslint_d" } },
javascriptreact = { { "prettier", "eslint_d" } },
typescript = { { "prettier", "eslint_d" } },
typescriptreact = { { "prettier", "eslint_d" } },
vue = { { "prettier", "eslint_d" } },
scss = { { "prettier", "eslint_d" } },
html = { { "prettier", "eslint_d" } },
css = { { "prettier", "eslint_d" } },
json = { { "prettier", "eslint_d" } },
jsonc = { { "prettier", "eslint_d" } },
yaml = { { "prettier", "eslint_d" } },
-- javascript = { "prettier", "eslint_d" }, -- handled by lsp
-- javascriptreact = { "prettier", "eslint_d" }, -- handled by lsp
-- typescript = { "prettier", "eslint_d" }, -- handled by lsp
-- typescriptreact = { "prettier", "eslint_d" }, -- handled by lsp
vue = { "prettier", "eslint_d" },
scss = { "prettier", "eslint_d" },
html = { "prettier", "eslint_d" },
css = { "prettier", "eslint_d" },
json = { "prettier", "eslint_d" },
jsonc = { "prettier", "eslint_d" },
yaml = { "prettier", "eslint_d" },
-- svelte = { { "prettier", "eslint_d" } }, -- handled by lsp
nix = { "alejandra" }
}
Expand Down

0 comments on commit 10e1aa4

Please sign in to comment.