Added Nixvim
This commit is contained in:
34
home/neovim/conform.nix
Normal file
34
home/neovim/conform.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
# Conform: Code formatter that runs external formatting tools
|
||||
# Automatically formats code on save for consistent style.
|
||||
programs.nixvim = {
|
||||
plugins.conform-nvim = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
formatters_by_ft = {
|
||||
lua = [ "stylua" ];
|
||||
nix = [ "nixfmt" ];
|
||||
python = [ "black" ];
|
||||
rust = [ "rustfmt" ];
|
||||
rasi = [ "prettierd" ];
|
||||
};
|
||||
|
||||
format_on_save = {
|
||||
timeout_ms = 500;
|
||||
lsp_fallback = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Install formatters
|
||||
extraPackages = with pkgs; [
|
||||
stylua
|
||||
nixfmt-classic
|
||||
black
|
||||
rustfmt
|
||||
prettierd
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user