Compare commits

..

4 commits

Author SHA1 Message Date
59189d88db
chore: switch to nixfmt-rfc-style 2024-09-02 18:28:53 -07:00
93a8dac2f2
flake.lock: update 2024-09-02 18:26:56 -07:00
91c08532a1
formatters: add for common languages 2024-09-02 18:25:15 -07:00
1b5e491ac9
init gitignore 2024-09-02 18:25:03 -07:00
11 changed files with 143 additions and 87 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
result

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,14 +1,15 @@
# Code formatters # Code formatters
{pkgs, ...}: { { pkgs, ... }:
{
extraPackages = with pkgs; [ extraPackages = with pkgs; [
# TS/JS # TS/JS, Markdown, TOML, JSON, etc
nodePackages.prettier nodePackages.prettier
# Rust # Rust
rustfmt rustfmt
# Nix # Nix
alejandra nixfmt-rfc-style
# Python # Python
black black
@ -20,7 +21,7 @@
haskellPackages.fourmolu haskellPackages.fourmolu
# Misc # Misc
codespell # codespell
]; ];
plugins.conform-nvim = { plugins.conform-nvim = {
@ -33,11 +34,18 @@
formatters_by_ft = { formatters_by_ft = {
lua = [ "stylua" ]; lua = [ "stylua" ];
python = [ "black" ]; python = [ "black" ];
nix = ["alejandra"]; nix = [ "nixfmt" ];
svelte = [ "prettier" ]; svelte = [ "prettier" ];
rust = [ "rustfmt" ]; rust = [ "rustfmt" ];
haskell = [ "fourmolu" ]; haskell = [ "fourmolu" ];
"*" = ["codespell"]; 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 # 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

@ -40,11 +40,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1722555600, "lastModified": 1725234343,
"narHash": "sha256-XOQkdLafnb/p9ij77byFQjDf5m5QYl9b2REiVClC+x4=", "narHash": "sha256-+ebgonl3NbiKD2UD0x4BszCZQ6sTfL4xioaM49o5B3Y=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "8471fe90ad337a8074e957b69ca4d0089218391d", "rev": "567b938d64d4b4112ee253b9274472dc3a346eb6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -109,11 +109,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724440431, "lastModified": 1724857454,
"narHash": "sha256-9etXEOUtzeMgqg1u0wp+EdwG7RpmrAZ2yX516bMj2aE=", "narHash": "sha256-Qyl9Q4QMTLZnnBb/8OuQ9LSkzWjBU1T5l5zIzTxkkhk=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "c8a54057aae480c56e28ef3e14e4960628ac495b", "rev": "4509ca64f1084e73bc7a721b20c669a8d4c5ebe6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -173,11 +173,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724469941, "lastModified": 1724561770,
"narHash": "sha256-+U5152FwmDD9EUOiFi5CFxCK6/yFESyDei9jEIlmUtI=", "narHash": "sha256-zv8C9RNa86CIpyHwPIVO/k+5TfM8ZbjGwOOpTe1grls=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "ea319a737939094b48fda9063fa3201ef2479aac", "rev": "ac5694a0b855a981e81b4d9f14052e3ff46ca39e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -188,11 +188,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1724224976, "lastModified": 1725103162,
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=", "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62", "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -204,14 +204,14 @@
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1722555339, "lastModified": 1725233747,
"narHash": "sha256-uFf2QeW7eAHlYXuDktm9c25OxOyCoUOQmh5SZ9amE5Q=", "narHash": "sha256-Ss8QWLXdr2JCBPcYChJhz4xJm+h/xjl4G0c0XlP6a74=",
"type": "tarball", "type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/a5d394176e64ab29c852d03346c1fc9b0b7d33eb.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/356624c12086a18f2ea2825fed34523d60ccc4e3.tar.gz"
} }
}, },
"nixvim": { "nixvim": {
@ -229,11 +229,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1724528976, "lastModified": 1725269752,
"narHash": "sha256-5W13nD/5ySIsxSvDqXHlj4bg2F3tNcYGKCGudWzpNzw=", "narHash": "sha256-AtZ9fSo2q6UeMoDy6kw6solM1B+BCABbKgCyUclsctg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixvim", "repo": "nixvim",
"rev": "8234ee85eaa2c8b7f2c74f5b4cdf02c4965b07fc", "rev": "18b7597e6ca4b98a6c3f20ddc9783165d5998018",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -251,11 +251,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1723969429, "lastModified": 1724584782,
"narHash": "sha256-BuewfNEXEf11MIkJY+uvWsdLu1dIvgJqntWChvNdALg=", "narHash": "sha256-7FfHv7b1jwMPSu9SPY9hdxStk8E6EeSwzqdvV69U4BM=",
"owner": "NuschtOS", "owner": "NuschtOS",
"repo": "search", "repo": "search",
"rev": "a05d1805f2a2bc47d230e5e92aecbf69f784f3d0", "rev": "5a08d691de30b6fc28d58ce71a5e420f2694e087",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -294,11 +294,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1724338379, "lastModified": 1724833132,
"narHash": "sha256-kKJtaiU5Ou+e/0Qs7SICXF22DLx4V/WhG1P6+k4yeOE=", "narHash": "sha256-F4djBvyNRAXGusJiNYInqR6zIMI3rvlp6WiKwsRISos=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "070f834771efa715f3e74cd8ab93ecc96fabc951", "rev": "3ffd842a5f50f435d3e603312eefa4790db46af5",
"type": "github" "type": "github"
}, },
"original": { "original": {

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;
}; };