chore: switch to nixfmt-rfc-style

This commit is contained in:
Youwen Wu 2024-09-02 18:28:53 -07:00
parent 93a8dac2f2
commit 59189d88db
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
9 changed files with 113 additions and 65 deletions

View file

@ -1,5 +1,10 @@
{pkgs, ...}: {
imports = [./plugins ./keymaps.nix ./init.nix];
{ pkgs, ... }:
{
imports = [
./plugins
./keymaps.nix
./init.nix
];
viAlias = true;
vimAlias = true;
withNodeJs = true;

View file

@ -278,22 +278,34 @@
{
action = "<Plug>(YankyPutAfter)";
key = "p";
mode = ["n" "x"];
mode = [
"n"
"x"
];
}
{
action = "<Plug>(YankyPutBefore)";
key = "P";
mode = ["n" "x"];
mode = [
"n"
"x"
];
}
{
action = "<Plug>(YankyGPutAfter)";
key = "gp";
mode = ["n" "x"];
mode = [
"n"
"x"
];
}
{
action = "<Plug>(YankyGPutBefore)";
key = "gP";
mode = ["n" "x"];
mode = [
"n"
"x"
];
}
{
action = ":Telescope yank_history<CR>";

View file

@ -5,17 +5,27 @@
enable = true;
settings = {
autoEnableSources = true;
experimental = {ghost_text = true;};
experimental = {
ghost_text = true;
};
performance = {
debounce = 60;
fetchingTimeout = 200;
maxViewEntries = 30;
};
snippet = {expand = "luasnip";};
formatting = {fields = ["kind" "abbr" "menu"];};
snippet = {
expand = "luasnip";
};
formatting = {
fields = [
"kind"
"abbr"
"menu"
];
};
sources = [
{name = "nvim_lsp";}
{name = "emoji";}
{ name = "nvim_lsp"; }
{ name = "emoji"; }
{
name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
@ -33,8 +43,12 @@
];
window = {
completion = {border = "solid";};
documentation = {border = "solid";};
completion = {
border = "solid";
};
documentation = {
border = "solid";
};
};
mapping = {

View file

@ -1,3 +1,13 @@
{
imports = [./lsps.nix ./setup.nix ./formatters.nix ./cmp.nix ./qol.nix ./mini.nix ./misc.nix ./navigation.nix ./treesitter.nix];
imports = [
./lsps.nix
./setup.nix
./formatters.nix
./cmp.nix
./qol.nix
./mini.nix
./misc.nix
./navigation.nix
./treesitter.nix
];
}

View file

@ -1,5 +1,6 @@
# Code formatters
{pkgs, ...}: {
{ pkgs, ... }:
{
extraPackages = with pkgs; [
# TS/JS, Markdown, TOML, JSON, etc
nodePackages.prettier
@ -31,21 +32,21 @@
lspFallback = true;
};
formatters_by_ft = {
lua = ["stylua"];
python = ["black"];
nix = ["nixfmt"];
svelte = ["prettier"];
rust = ["rustfmt"];
haskell = ["fourmolu"];
toml = ["prettier"];
json = ["prettier"];
markdown = ["prettier"];
yaml = ["prettier"];
html = ["prettier"];
javascript = ["prettier"];
typescript = ["prettier"];
lua = [ "stylua" ];
python = [ "black" ];
nix = [ "nixfmt" ];
svelte = [ "prettier" ];
rust = [ "rustfmt" ];
haskell = [ "fourmolu" ];
toml = [ "prettier" ];
json = [ "prettier" ];
markdown = [ "prettier" ];
yaml = [ "prettier" ];
html = [ "prettier" ];
javascript = [ "prettier" ];
typescript = [ "prettier" ];
# "*" = ["codespell"];
"_" = ["trim_whitespace"];
"_" = [ "trim_whitespace" ];
};
};
};

View file

@ -1,5 +1,6 @@
# LSP setup
{pkgs, ...}: {
{ pkgs, ... }:
{
extraPackages = with pkgs; [
rust-analyzer
lua-language-server

View file

@ -3,14 +3,14 @@
plugins.mini = {
enable = true;
modules = {
surround = {};
ai = {};
hipatterns = {};
notify = {};
tabline = {};
trailspace = {};
cursorword = {};
bracketed = {};
surround = { };
ai = { };
hipatterns = { };
notify = { };
tabline = { };
trailspace = { };
cursorword = { };
bracketed = { };
};
};
}

View file

@ -1,5 +1,6 @@
# Quality of life plugins
{pkgs, ...}: {
{ pkgs, ... }:
{
extraPackages = with pkgs; [
ripgrep
yazi

View file

@ -8,12 +8,13 @@
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = {
nixvim,
flake-parts,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
outputs =
{
nixvim,
flake-parts,
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
@ -21,27 +22,30 @@
"aarch64-darwin"
];
perSystem = {
pkgs,
system,
...
}: let
nixvimLib = nixvim.lib.${system};
nixvim' = nixvim.legacyPackages.${system};
nixvimModule = {
inherit pkgs;
module = import ./config;
};
nvim = nixvim'.makeNixvimWithModule nixvimModule;
in {
formatter = pkgs.alejandra;
checks = {
default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
};
perSystem =
{
pkgs,
system,
...
}:
let
nixvimLib = nixvim.lib.${system};
nixvim' = nixvim.legacyPackages.${system};
nixvimModule = {
inherit pkgs;
module = import ./config;
};
nvim = nixvim'.makeNixvimWithModule nixvimModule;
in
{
formatter = pkgs.nixfmt-rfc-style;
checks = {
default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
};
packages = {
default = nvim;
packages = {
default = nvim;
};
};
};
};
}