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,17 +5,27 @@
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"; }
{ {
name = "buffer"; # text within current buffer name = "buffer"; # text within current buffer
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs"; option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
@ -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
@ -31,21 +32,21 @@
lspFallback = true; lspFallback = true;
}; };
formatters_by_ft = { formatters_by_ft = {
lua = ["stylua"]; lua = [ "stylua" ];
python = ["black"]; python = [ "black" ];
nix = ["nixfmt"]; nix = [ "nixfmt" ];
svelte = ["prettier"]; svelte = [ "prettier" ];
rust = ["rustfmt"]; rust = [ "rustfmt" ];
haskell = ["fourmolu"]; haskell = [ "fourmolu" ];
toml = ["prettier"]; toml = [ "prettier" ];
json = ["prettier"]; json = [ "prettier" ];
markdown = ["prettier"]; markdown = [ "prettier" ];
yaml = ["prettier"]; yaml = [ "prettier" ];
html = ["prettier"]; html = [ "prettier" ];
javascript = ["prettier"]; javascript = [ "prettier" ];
typescript = ["prettier"]; typescript = [ "prettier" ];
# "*" = ["codespell"]; # "*" = ["codespell"];
"_" = ["trim_whitespace"]; "_" = [ "trim_whitespace" ];
}; };
}; };
}; };

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

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

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