fix: conform-nvim option change
This commit is contained in:
parent
c72cb643b4
commit
0df66b4ab6
2 changed files with 34 additions and 36 deletions
21
README.md
21
README.md
|
@ -1,17 +1,6 @@
|
||||||
# Nixvim template
|
# Nixvim
|
||||||
|
|
||||||
This template gives you a good starting point for configuring nixvim standalone.
|
## TODO
|
||||||
|
[ ] Open last active buffer after :bd
|
||||||
## Configuring
|
[ ] Code action
|
||||||
|
[ ] DAP support
|
||||||
To start configuring, just add or modify the nix files in `./config`.
|
|
||||||
If you add a new configuration file, remember to add it to the
|
|
||||||
[`config/default.nix`](./config/default.nix) file
|
|
||||||
|
|
||||||
## Testing your new configuration
|
|
||||||
|
|
||||||
To test your configuration simply run the following command
|
|
||||||
|
|
||||||
```
|
|
||||||
nix run .
|
|
||||||
```
|
|
||||||
|
|
|
@ -1,26 +1,35 @@
|
||||||
{ helpers, pkgs, ... }: {
|
{ helpers, pkgs, ... }:
|
||||||
|
{
|
||||||
plugins.conform-nvim = {
|
plugins.conform-nvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
formatAfterSave = ''
|
settings = {
|
||||||
{
|
format_after_save = ''
|
||||||
format_after_save = {
|
function(bufnr)
|
||||||
lsp_format = "fallback",
|
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||||
},
|
return
|
||||||
}
|
end
|
||||||
'';
|
|
||||||
formattersByFt = {
|
if not slow_format_filetypes[vim.bo[bufnr].filetype] then
|
||||||
python = [ "black" ];
|
return
|
||||||
c = [ "clang-format" ];
|
end
|
||||||
cpp = [ "clang-format" ];
|
|
||||||
cmake = [ "cmake_format" ];
|
return { lsp_fallback = true }
|
||||||
nix = [ "nixfmt" ];
|
end
|
||||||
# Standalone scalafmt is too slow, so we use it as a fallback
|
|
||||||
scala = helpers.mkRaw ''
|
|
||||||
{ scalafmt, lsp_format = "prefer" }
|
|
||||||
'';
|
'';
|
||||||
toml = [ "taplo" ];
|
formatters_by_ft = {
|
||||||
yaml = [ "yq" ];
|
python = [ "black" ];
|
||||||
json = [ "jq" ];
|
c = [ "clang-format" ];
|
||||||
|
cpp = [ "clang-format" ];
|
||||||
|
cmake = [ "cmake_format" ];
|
||||||
|
nix = [ "nixfmt" ];
|
||||||
|
# Standalone scalafmt is too slow, so we use it as a fallback
|
||||||
|
scala = helpers.mkRaw ''
|
||||||
|
{ scalafmt, lsp_format = "prefer" }
|
||||||
|
'';
|
||||||
|
toml = [ "taplo" ];
|
||||||
|
yaml = [ "yq" ];
|
||||||
|
json = [ "jq" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue