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

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

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

View file

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