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, ...}: { { pkgs, ... }:
imports = [./plugins ./keymaps.nix ./init.nix]; {
imports = [
./plugins
./keymaps.nix
./init.nix
];
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
withNodeJs = true; withNodeJs = true;

View file

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

View file

@ -5,14 +5,24 @@
enable = true; enable = true;
settings = { settings = {
autoEnableSources = true; autoEnableSources = true;
experimental = {ghost_text = true;}; experimental = {
ghost_text = true;
};
performance = { performance = {
debounce = 60; debounce = 60;
fetchingTimeout = 200; fetchingTimeout = 200;
maxViewEntries = 30; maxViewEntries = 30;
}; };
snippet = {expand = "luasnip";}; snippet = {
formatting = {fields = ["kind" "abbr" "menu"];}; expand = "luasnip";
};
formatting = {
fields = [
"kind"
"abbr"
"menu"
];
};
sources = [ sources = [
{ name = "nvim_lsp"; } { name = "nvim_lsp"; }
{ name = "emoji"; } { name = "emoji"; }
@ -33,8 +43,12 @@
]; ];
window = { window = {
completion = {border = "solid";}; completion = {
documentation = {border = "solid";}; border = "solid";
};
documentation = {
border = "solid";
};
}; };
mapping = { 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 # Code formatters
{pkgs, ...}: { { pkgs, ... }:
{
extraPackages = with pkgs; [ extraPackages = with pkgs; [
# TS/JS, Markdown, TOML, JSON, etc # TS/JS, Markdown, TOML, JSON, etc
nodePackages.prettier nodePackages.prettier

View file

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

View file

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

View file

@ -8,7 +8,8 @@
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
}; };
outputs = { outputs =
{
nixvim, nixvim,
flake-parts, flake-parts,
... ...
@ -21,11 +22,13 @@
"aarch64-darwin" "aarch64-darwin"
]; ];
perSystem = { perSystem =
{
pkgs, pkgs,
system, system,
... ...
}: let }:
let
nixvimLib = nixvim.lib.${system}; nixvimLib = nixvim.lib.${system};
nixvim' = nixvim.legacyPackages.${system}; nixvim' = nixvim.legacyPackages.${system};
nixvimModule = { nixvimModule = {
@ -33,8 +36,9 @@
module = import ./config; module = import ./config;
}; };
nvim = nixvim'.makeNixvimWithModule nixvimModule; nvim = nixvim'.makeNixvimWithModule nixvimModule;
in { in
formatter = pkgs.alejandra; {
formatter = pkgs.nixfmt-rfc-style;
checks = { checks = {
default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule; default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule;
}; };