This commit is contained in:
punkfairie 2024-11-27 20:31:55 -08:00
parent 6b27c39f5d
commit ff773c3975
Signed by: punkfairie
GPG key ID: A509E8F77FB9D696
16 changed files with 0 additions and 1661 deletions

View file

@ -1,606 +0,0 @@
{
"nodes": {
"devshell": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1728330715,
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
"owner": "numtide",
"repo": "devshell",
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"revCount": 57,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": [
"neovim-nightly",
"hercules-ci-effects",
"nixpkgs"
]
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils-plus": {
"inputs": {
"flake-utils": "flake-utils_2"
},
"locked": {
"lastModified": 1715533576,
"narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat_2",
"gitignore": "gitignore",
"nixpkgs": [
"neovim-nightly",
"nixpkgs"
],
"nixpkgs-stable": [
"neovim-nightly",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732021966,
"narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"git-hooks_2": {
"inputs": {
"flake-compat": [
"nixvim",
"flake-compat"
],
"gitignore": "gitignore_2",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732021966,
"narHash": "sha256-mnTbjpdqF0luOkou8ZFi2asa1N3AA2CchR/RqCNmsGE=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "3308484d1a443fc5bc92012435d79e80458fe43c",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"neovim-nightly",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"nixvim",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"hercules-ci-effects": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": [
"neovim-nightly",
"nixpkgs"
]
},
"locked": {
"lastModified": 1730903510,
"narHash": "sha256-mnynlrPeiW0nUQ8KGZHb3WyxAxA3Ye/BH8gMjdoKP6E=",
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"rev": "b89ac4d66d618b915b1f0a408e2775fe3821d141",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732025103,
"narHash": "sha256-qjEI64RKvDxRyEarY0jTzrZMa8ebezh2DEZmJJrpVdo=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a46e702093a5c46e192243edbd977d5749e7f294",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
"neovim-nightly": {
"inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"hercules-ci-effects": "hercules-ci-effects",
"neovim-src": "neovim-src",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1732492905,
"narHash": "sha256-9/BfieHsR0BC5LaQr1WvqBBcfNAOMHHUpgV31NRZWf4=",
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"rev": "f021fdc7493b0243129a979fd338eaae50a931ef",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "neovim-nightly-overlay",
"type": "github"
}
},
"neovim-src": {
"flake": false,
"locked": {
"lastModified": 1732489512,
"narHash": "sha256-ctSHOjNaWQM6g5L2OhJyEMTeMYEbIGk2vENqhT8FWbs=",
"owner": "neovim",
"repo": "neovim",
"rev": "ff00d583af8f1ce21a508d701d09c54d2621b16e",
"type": "github"
},
"original": {
"owner": "neovim",
"repo": "neovim",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732016537,
"narHash": "sha256-XwXUK+meYnlhdQz2TVE4Wv+tsx1CkdGbDPt1tRzCNH4=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "61cee20168a3ebb71a9efd70a55adebaadfbe4d4",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1732014248,
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat_3",
"flake-parts": "flake-parts_3",
"git-hooks": "git-hooks_2",
"home-manager": "home-manager",
"nix-darwin": "nix-darwin",
"nixpkgs": [
"unstable"
],
"nuschtosSearch": "nuschtosSearch",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1732315025,
"narHash": "sha256-vPAMWd5/akE3U3B8uXzi05X/9fUd71sZaOnfBrX4AR0=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "c1271fa10a54a3b35db6040dd6e779f349af52bf",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1731936508,
"narHash": "sha256-z0BSSf78LkxIrrFXZYmCoRRAxAmxMUKpK7CyxQRvkZI=",
"owner": "NuschtOS",
"repo": "search",
"rev": "fe07070f811b717a4626d01fab714a87d422a9e1",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": {
"inputs": {
"neovim-nightly": "neovim-nightly",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim",
"snowfall-lib": "snowfall-lib",
"unstable": "unstable"
}
},
"snowfall-lib": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils-plus": "flake-utils-plus",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1730136121,
"narHash": "sha256-tfVayj13Zw+zzOKrmJhnvBod7Hdb9ixBR6/4GUlyMA0=",
"owner": "snowfallorg",
"repo": "lib",
"rev": "dd348182c1a010993e68004eada86cf0341fe2c4",
"type": "github"
},
"original": {
"owner": "snowfallorg",
"repo": "lib",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1732111664,
"narHash": "sha256-XWHuPWcP59QnHEewdZJXBX1TA2lAP78Vz4daG6tfIr4=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "62003fdad7a5ab7b6af3ea9bd7290e4c220277d0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"unstable": {
"locked": {
"lastModified": 1732014248,
"narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "23e89b7da85c3640bbc2173fe04f4bd114342367",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,44 +0,0 @@
{
description = "MarleyVim";
outputs = inputs:
inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
snowfall = {
namespace = "marleyvim";
};
# channels-config.allowUnfree = true;
alias.packages.default = "neovim";
overlays = [inputs.nixvim.overlays.default];
outputs-builder = channels: {
formatter = channels.nixpkgs.nixfmt-rfc-style;
};
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "unstable";
};
neovim-nightly = {
url = "github:nix-community/neovim-nightly-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}

View file

@ -1,14 +0,0 @@
_: {
autocmds = rec {
## [String] | String -> String -> [String] | String -> String -> String -> AttrSet
mk = event: group': pattern: callback: desc: let
group = "marleyvim_${group'}";
in {
inherit event group pattern callback desc;
};
## [String] | String -> String -> String -> String -> AttrSet
mk' = event: group: callback: desc:
mk event group null callback desc;
};
}

View file

@ -1,4 +0,0 @@
_: {
## (a -> {name :: String; value :: b}) -> [a] -> AttrSet
mapListToAttrs = fn: list: builtins.listToAttrs (builtins.map fn list);
}

View file

@ -1,10 +0,0 @@
_: {
icons = {
diagnostics = {
error = " ";
warn = " ";
hint = " ";
info = " ";
};
};
}

View file

@ -1,26 +0,0 @@
_: {
keys = rec {
## [String] | String -> String -> String -> String -> AttrSet
mk = mode: key: action: desc: {
inherit mode key action;
options = {
inherit desc;
};
};
## [String] | String -> String -> String -> AttrSet
mk' = mode: key: action:
mk mode key action null;
## [String] | String -> String -> String -> String -> AttrSet -> AttrSet
mkWithOpts = mode: key: action: desc: opts:
(mk mode key action desc)
// {
options = opts;
};
## [String] | String -> String -> String -> AttrSet -> AttrSet
mkWithOpts' = mode: key: action: opts:
mkWithOpts mode key action null opts;
};
}

View file

@ -1,132 +0,0 @@
{
lib,
helpers,
...
}: let
inherit (lib.marleyvim) mapListToAttrs autocmds;
inherit (helpers) mkRaw;
in {
autoGroups =
mapListToAttrs (i: {
name = "marleyvim_${i}";
value = {clear = true;};
}) [
"checktime"
"highlight_yank"
"resize_splits"
"last_loc"
"close_with_q"
"man_unlisted"
"wrap_spell"
"json_conceal"
"auto_create_dir"
];
autoCmd = [
(autocmds.mk' ["FocusGained" "TermClose" "TermLeave"] "checktime" (mkRaw ''
function()
if vim.o.buftype ~= "nofile" then
vim.cmd("checktime")
end
end
'') "Check if file needs to be reloaded when changed")
(autocmds.mk' ["TextYankPost"] "highlight_yank" (mkRaw ''
function()
(vim.hl or vim.highlight).on_yank()
end
'') "Highlight on yank")
(autocmds.mk' ["VimResized"] "resize_splits" (mkRaw ''
function()
local current_tab = vim.fn.tabpagenr()
vim.cmd("tabdo wincmd =")
vim.cmd("tabnext " .. current_tab)
end
'') "Resize splits on window resize")
(autocmds.mk' ["BufReadPost"] "last_loc" (mkRaw ''
function(event)
local exclude = { "gitcommit" }
local buf = event.buf
if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].marleyvim_last_loc then
return
end
vim.b[buf].marleyvim_last_loc = true
local mark = vim.api.nvim_buf_get_mark(buf, '"')
local lcount = vim.api.nvim_buf_line_count(buf)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end
'') "Go to last location when opening a buffer")
(autocmds.mk ["FileType"] "close_with_q" [
"PlenaryTestPopup"
"checkhealth"
"dbout"
"gitsigns-blame"
"grug-far"
"help"
"lspinfo"
"neotest-output"
"neotest-output-panel"
"neotest-summary"
"notify"
"qf"
"snacks_win"
"spectre_panel"
"startuptime"
"tsplayground"
] (mkRaw ''
function(event)
vim.bo[event.buf].buflisted = false
vim.schedule(function()
vim.keymap.set("n", "q", function()
vim.cmd("close")
pcall(vim.api.nvim_buf_delete, event.buf, { force = true })
end, {
buffer = event.buf,
silent = true,
desc = "Quit buffer",
})
end)
end
'') "Close some filetypes with <q>")
(autocmds.mk ["FileType"] "man_unlisted" ["man"] (mkRaw ''
function(event)
vim.bo[event.buf].buflisted = false
end
'') "Easy-close man files")
(autocmds.mk ["FileType"] "wrap_spell" [
"text"
"plaintex"
"typst"
"gitcommit"
"markdown"
] (mkRaw ''
function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end
'') "Wrap & check spelling in text files")
(autocmds.mk ["FileType"] "json_conceal" ["json" "jsonc" "json5"] (mkRaw ''
function()
vim.opt_local.conceallevel = 0
end
'') "Fix conceallevel for json files")
(autocmds.mk' ["BufWritePre"] "auto_create_dir" (mkRaw ''
function(event)
if event.match:match("^%w%w+:[\\/][\\/]") then
return
end
local file = vim.uv.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end
'') "Auto create missing parent dirs when saving")
];
}

View file

@ -1,9 +0,0 @@
_: {
viAlias = true;
vimAlias = true;
luaLoader.enable = true;
# Ignore ~/.config/nvim entirely.
impureRtp = false;
}

View file

@ -1,250 +0,0 @@
{
lib,
helpers,
...
}: let
inherit
(lib)
map
mapAttrsToList
toUpper
substring
mapCartesianProduct
toLower
;
inherit (lib.marleyvim) keys;
inherit (helpers) mkRaw;
in {
globals = {
mapleader = " ";
maplocalleader = "\\";
};
keymaps =
#
# Disable Arrow Key Movement - - - - - - - - - - - - - - - - - - - - - - - -
(map (d: keys.mk' ["i" "n"] d "<NOP>") ["<DOWN>" "<UP>" "<LEFT>" "<RIGHT>"])
#
# Better Up/Down - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (
mapAttrsToList
(d: k:
keys.mkWithOpts ["n" "x"] k "v:count == 0 ? 'g${k}' : '${k}'" d
{
expr = true;
silent = true;
})
{
Down = "j";
Up = "k";
}
)
#
# Resize Windows - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (
mapAttrsToList
(
k: d: let
s =
if (d == "Increase")
then "+"
else "-";
in
keys.mk ["n"] "<C-${k}>" "<CMD>resize ${s}4<CR>" "${d} Window Height"
)
{
Up = "Increase";
Down = "Decrease";
Left = "Decrease";
Right = "Increase";
}
)
#
# Buffers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (
mapAttrsToList (
k: d: let
# previous -> Prev
prettyDir = (toUpper (substring 0 1 d)) + (substring 1 3 d);
in
keys.mk ["n"] k "<CMD>b${d}<CR>" "${prettyDir} Buffer"
)
{
"<S-H>" = "previous";
"<S-L>" = "next";
"[b" = "previous";
"]b" = "next";
}
)
++ [(keys.mk ["n"] "<LEADER>bD" "<CMD>bd<CR>" "Delete Buffer and Window")]
#
# Clear Search/Diff Update/Redraw - - - - - - - - - - - - - - - - - - - - -
++ [
(keys.mk ["i" "n"] "<ESC>" "<CMD>noh<CR><ESC>" "Escape and Clear hlsearch")
(
keys.mk ["n"] "<LEADER>ur"
"<CMD>nohlsearch<BAR>diffupdate<BAR>normal! <C-l><CR>"
"Redraw / Clear hlsearch / Diff Update"
)
]
#
# Better n & N - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (
mapCartesianProduct (
{
m,
d,
}: let
k =
if (d == "Next")
then "n"
else "N";
nn =
if (d == "Next")
then "Nn"
else "nN";
zv =
if (m == "n")
then ".'zv'"
else "";
in
keys.mkWithOpts [m] k "'${nn}'[v:searchforward]${zv}"
"${d} Search Result" {expr = true;}
)
{
m = ["n" "x" "o"];
d = ["Next" "Prev"];
}
)
#
# Undo Break-Points - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (map (c: keys.mk' ["i"] c "${c}<C-g>u") ["," "." ";"])
#
# Search Docs (keywordprog) - - - - - - - - - - - - - - - - - - - - - - - -
# https://til.codeinthehole.com/posts/about-how-to-use-keywordprg-effectively/
++ [(keys.mk ["n"] "<LEADER>K" "<CMD>norm! K<CR>" "Search <KEYWORDPROG> for word")]
#
# Better Indenting - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (map (c: keys.mk' ["v"] c "${c}gv") ["<" ">"])
#
# Commenting - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (
mapAttrsToList (
k: d:
keys.mk ["n"] "gc${k}" "${k}<ESC>Vcx<ESC><CMD>normal gcc<CR>fxa<BS>"
"Add Comment ${d}"
)
{
o = "Below";
O = "Above";
}
)
#
# New File - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [(keys.mk ["n"] "<LEADER>fn" "<CMD>enew<CR>" "New File")]
#
# Locations/Quickfixes - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [
(keys.mk ["n"] "<LEADER>xl" "<CMD>lopen<CR>" "Location List")
(keys.mk ["n"] "<LEADER>xq" "<CMD>copen<CR>" "Quickfix list")
]
++ (
mapAttrsToList (
k: d: let
cmd = substring 0 4 (toLower d);
in
keys.mk ["n"] "${k}q" "<CMD>c${cmd}<CR>" "${d} Quickfix"
)
{
"[" = "Previous";
"]" = "Next";
}
)
#
# Diagnostics - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [
(keys.mk ["n"] "<LEADER>cd" (
mkRaw ''
function() vim.diagnostic.open_float() end
''
) "Line Diagnostics")
]
++ (
mapCartesianProduct (
{
dir,
key,
}: let
kmap = "${
if (dir == "Next")
then "]"
else "["
}${key}";
sevs = {
d = {
key = "nil";
desc = "Diagnostic";
};
e = {
key = "vim.diagnostic.severity.ERROR";
desc = "Error";
};
w = {
key = "vim.diagnostic.severity.WARN";
desc = "Warning";
};
};
cmd = toLower dir;
sev = sevs."${key}".key;
in
keys.mk ["n"] kmap (
mkRaw ''
function() vim.diagnostic.goto_${cmd}({ severity = ${sev} }) end
''
) "${dir} ${sevs."${key}".desc}"
)
{
dir = ["Next" "Prev"];
key = ["d" "e" "w"];
}
)
#
# Quit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [(keys.mk ["n"] "<LEADER>qq" "<CMD>qa<CR>" "Quit All")]
#
# Inspect - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [(keys.mk ["n"] "<LEADER>ui" (mkRaw "vim.show_pos") "Inspect Position")]
#
# Window Management - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ [
(keys.mkWithOpts ["n"] "<LEADER>w" "<C-w>" "Windows" {remap = true;})
(keys.mkWithOpts ["n"] "<LEADER>-" "<C-w>s" "Split Window Below" {remap = true;})
(keys.mkWithOpts ["n"] "<LEADER>|" "<C-w>v" "Split Window Right" {remap = true;})
(keys.mkWithOpts ["n"] "<LEADER>wd" "<C-w>c" "Delete Window" {remap = true;})
]
#
# Tab Management - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++ (
mapAttrsToList (
k: a: let
desc =
if (a == "Only")
then "Close Other Tabs"
else "${a} Tab";
in
keys.mk ["n"] "<LEADER><TAB>${k}" "<CMD>tab${toLower a}<CR>" desc
)
{
l = "Last";
o = "Only";
f = "First";
"<TAB>" = "New";
"]" = "Next";
d = "Close";
"[" = "Previous";
}
);
}

View file

@ -1,154 +0,0 @@
{
pkgs,
helpers,
...
}: {
extraPackages = [pkgs.ripgrep];
opts = {
# Relative line numbers.
number = true;
relativenumber = true;
# Set <Tab> to 2 spaces.
expandtab = true;
shiftwidth = 2;
tabstop = 2;
# Smart/auto indenting.
shiftround = true;
smartindent = true;
breakindent = true;
# Show matches while searching.
hlsearch = true;
incsearch = true;
# Disable text wrap.
wrap = true;
# Better splitting.
splitbelow = true;
splitright = true;
# Enable mouse mode.
mouse = "a";
# Smart handling of case when searching.
ignorecase = true;
smartcase = true;
# Use Ripgrep for searching.
grepprg = "rg --vimgrep";
grepformat = "%f:%l:%c:%m";
# Faster swap file saving.
updatetime = 200;
# Completion.
completeopt = [
"menu"
"menuone"
"noselect"
"noinsert"
];
# Persistent & bigger undo history.
undofile = true;
undolevels = 10000;
# Enable 24-bit colors.
termguicolors = true;
# Always show the signcolumn to keep the text from shifting.
signcolumn = "yes";
# Highlight the current line.
cursorline = true;
# Fold settings.
foldcolumn = "1";
foldlevel = 99;
foldenable = true;
foldmethod = "expr";
foldexpr = "v:lua.vim.treesitter.foldexpr()";
# Always keep 4 lines above/below cursor.
scrolloff = 4;
# Max width.
textwidth = 80;
colorcolumn = "+1";
# Show some invisible chars.
list = true;
listchars = {
tab = "->";
trail = "·";
};
# Only show a single status line instead of one for each window.
laststatus = 3;
# Preview subsitutions as you type.
inccommand = "split";
# Only set clipboard if not in SSH, to make sure the OSC 52
# integration works automatically.
clipboard =
helpers.mkRaw # lua
''
vim.env.SSH_TTY and "" or "unnamedplus"
'';
# Ask to save changes before exiting modified buffer.
confirm = true;
# I don't understand this but LazyVim sets it and it seems like a good idea.
jumpoptions = "view";
# Enable a little transparency for pop-ups.
pumblend = 10;
# Disable showing line/col numbers in statusline.
ruler = false;
# What to save when calling :mksession.
sessionoptions = [
"buffers"
"curdir"
"tabpages"
"winsize"
"help"
"globals"
"skiprtp"
"folds"
];
# Smoother left/right scrolling.
sidescroll = 1;
# Min columns to show to the left/right of cursor when side-scrolling.
sidescrolloff = 8;
# Languages to use for spelling suggestions.
spelllang = ["en"];
# Allow cursor to move where there is no text in visual block mode.
virtualedit = "block";
# Command mode completion mode.
wildmode = ["longest:full" "full"];
# Min window width when splitting.
winminwidth = 5;
};
extraConfigLua =
# lua
''
-- Disable messages.
vim.opt.shortmess:append({ W = true, I = true, c = true, C = true })
'';
}

View file

@ -1,103 +0,0 @@
{
lib,
helpers,
...
}: let
inherit (lib) flatten mapAttrsToList map;
inherit (lib.marleyvim) icons keys autocmds;
inherit (helpers) mkRaw;
in {
plugins.mini = {
enable = true;
modules.icons = {};
};
plugins.bufferline = {
enable = true;
settings = {
options = {
close_command.__raw = "function(n) Snacks.bufdelete(n) end";
right_mouse_command.__raw = "function(n) Snacks.bufdelete(n) end";
diagnostics = "nvim_lsp";
diagnostics_indicator.__raw =
# lua
''
function(_, _, diag)
local ret = (diag.error and "${icons.diagnostics.error}" .. diag.error .. " " or "")
.. (diag.warning and "${icons.diagnostics.warn}" .. diag.warning or "")
return vim.trim(ret)
end
'';
always_show_bufferline = true;
offsets = [
{
filetype = "neo-tree";
text = "Explorer";
highlight = "Directory";
text_align = "left";
}
];
get_element_icon.__raw = ''
function(elem)
local icon, hl, _ =
require('mini.icons').get('filetype', elem.filetype)
return icon, hl
end
'';
};
};
};
autoGroups.marleyvim_bufferline.clear = true;
autoCmd = [
(autocmds.mk' ["BufAdd" "BufDelete"] "bufferline" (
mkRaw ''
function()
vim.schedule(function()
pcall(nvim_bufferline)
end)
end
''
) "Fix bufferline when restoring a session")
];
keymaps =
[
(keys.mk ["n"] "<LEADER>bp" "<CMD>BufferLineTogglePin<CR>" "Toggle Pin")
(keys.mk ["n"] "<LEADER>bP" "<CMD>BufferLineGroupClose ungrouped<CR>"
"Delete Non-Pinned Buffers")
(keys.mk ["n"] "<LEADER>br" "<CMD>BufferLineCloseRight<CR>"
"Delete Buffers to the Right")
(keys.mk ["n"] "<LEADER>bl" "<CMD>BufferLineCloseLeft<CR>"
"Delete Buffers to the Left")
(keys.mk ["n"] "<S-H>" "<CMD>BufferLineCyclePrev<CR>" "Prev Buffer")
(keys.mk ["n"] "<S-L>" "<CMD>BufferLineCycleNext<CR>" "Next Buffer")
]
++ (flatten (mapAttrsToList (
a: ks:
map (k: keys.mk ["n"] k "<CMD>BufferLineCycle${a}<CR>" "${a} Buffer") ks
) {
Prev = ["<S-H>" "[b"];
Next = ["<S-L>" "]b"];
}))
++ (
mapAttrsToList (
a: k: let
befAft =
if (a == "Prev")
then "After"
else "Before";
in
keys.mk ["n"] "${k}B" "<CMD>BufferLineMove${a}<CR>"
"Move Buffer ${befAft} ${a}"
) {
Prev = "[";
After = "]";
}
);
}

View file

@ -1,36 +0,0 @@
_: {
plugins.lualine = {
enable = true;
luaConfig.pre.__raw = ''
vim.g.lualine_laststatus = vim.o.laststatus
if vim.fn.argc(-1) > 0 then
-- set an empty statusline till lualine loads
vim.o.statusline = " "
else
-- hide the statusline on the starter page
vim.o.laststatus = 0
end
'';
settings = {
options = {
theme = "auto";
globalstatus.__raw = "vim.o.laststatus == 3";
disabled_filetypes.statusline = [
"dashboard"
"alpha"
"ministarter"
"snacks_dashboard"
];
};
sections = {
lualine_a = ["mode"];
lualine_b = ["branch"];
lualine_c = [
];
};
};
};
}

View file

@ -1,8 +0,0 @@
_: {
plugins.mini = {
enable = true;
mockDevIcons = true;
modules.icons = {};
};
}

View file

@ -1,190 +0,0 @@
{
pkgs,
lib,
helpers,
...
}: let
inherit (helpers) mkRaw;
inherit (lib.marleyvim) keys;
in {
extraPackages = [pkgs.lazygit];
plugins.snacks = {
enable = true;
settings = {
bigfile.enabled = true;
notifier.enabled = true;
quickfile.enabled = true;
statuscolumn.enabled = true;
words.enabled = true;
};
};
keymaps = [
(keys.mk ["n"] "<LEADER>un" (
mkRaw ''
function() Snacks.notifier.hide() end
''
) "Dismiss All Notifications")
(keys.mk ["n"] "<LEADER>bd" (
mkRaw ''
function() Snacks.bufdelete() end
''
) "Delete Buffer")
(keys.mk ["n"] "<LEADER>bo" (
mkRaw ''
function() Snacks.bufdelete.other() end
''
) "Delete Other Buffers")
# LazyGit - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(keys.mk ["n"] "<LEADER>gg" (
mkRaw ''
function() Snacks.lazygit() end
''
) "Lazygit")
(keys.mk ["n"] "<LEADER>gf" (
mkRaw ''
function() Snacks.lazygit.log_file() end
''
) "Lazygit Current File History")
(keys.mk ["n"] "<LEADER>gl" (
mkRaw ''
function() Snacks.lazygit.log() end
''
) "Lazygit Log")
# Git - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(keys.mk ["n"] "<LEADER>gb" (
mkRaw ''
function() Snacks.git.blame_line() end
''
) "Git Blame Line")
(keys.mk ["n" "x"] "<LEADER>gB" (
mkRaw ''
function() Snacks.gitbrowse() end
''
) "Git Browse (open)")
(keys.mk ["n" "x"] "<LEADER>gY" (
mkRaw ''
function()
Snacks.gitbrowse({ open = function(url) vim.fn.setreg("+", url) end })
end
''
) "Git Browse (copy)")
];
# Toggles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
extraConfigLua =
# lua
''
---@param buf? number
function format_enabled(buf)
buf = (buf == nil or buf == 0) and vim.api.nvim_get_current_buf() or buf
local gaf = vim.g.autoformat
local baf = vim.b[buf].autoformat
-- If the buffer has a local value, use that
if baf ~= nil then
return baf
end
-- Otherwise use the global value if set, or true by default
return gaf == nil or gaf
end
---@param enable? boolean
---@param buf? boolean
function format_enable(state, buf)
if enable == nil then
enable = true
end
if buf then
vim.b.autoformat = enable
else
vim.g.autoformat = enable
vim.b.autoformat = nil
end
end
---@param buf? boolean
function toggle_format(buf)
return Snacks.toggle({
name = "Auto Format (" .. (buf and "Buffer" or "Global") .. ")",
get = function()
if not buf then
return vim.g.autoformat == nil or vim.g.autoformat
end
return format_enabled()
end,
set = function(state)
format_enable(state, buf)
end,
})
end
toggle_format():map("<LEADER>uf")
toggle_format(true):map("<LEADER>uF")
Snacks.toggle.option("spell", { name = "Spelling"}):map("<LEADER>us")
Snacks.toggle.option("wrap", {name = "Wrap"}):map("<LEADER>uw")
Snacks.toggle.option("relativenumber", { name = "Relative Number"}):map("<LEADER>uL")
Snacks.toggle.diagnostics():map("<LEADER>ud")
Snacks.toggle.line_number():map("<LEADER>ul")
Snacks.toggle.option("conceallevel", {off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2}):map("<LEADER>uc")
Snacks.toggle.treesitter():map("<LEADER>uT")
Snacks.toggle.option("background", { off = "light", on = "dark" , name = "Dark Background"}):map("<LEADER>ub")
if vim.lsp.inlay_hint then
Snacks.toggle.inlay_hints():map("<LEADER>uh")
end
function maximize_window()
---@type {k:string, v:any}[]?
local maximized = nil
return Snacks.toggle({
name = "Maximize",
get = function()
return maximized ~= nil
end,
set = function(state)
if state then
maximized = {}
local function set(k, v)
table.insert(maximized, 1, { k = v, v = vim.o[k] })
vim.o[k] = v
end
set("winwidth", 999)
set("winheight", 999)
set("winminwidth", 10)
set("winminheight", 4)
vim.cmd("wincmd =")
vim.api.nvim_create_autocmd("ExitPre", {
once = true,
group = vim.api.nvim_create_augroup("marleyvim_restore_max_exit_pre", { clear = true }),
desc = "Restore width/height when closing Neovim while maximized",
callback = function()
maximize_window.set(false)
end,
})
else
for _, opt in ipairs(maximized) do
vim.o[opt.k] = opt.v
end
maximized = nil
vim.cmd("wincmd =")
end
end,
})
end
maximize_window():map("<LEADER>wm")
'';
}

View file

@ -1,66 +0,0 @@
{
lib,
pkgs,
inputs,
neovim-settings ? {},
neovim-config ? {},
...
}: let
raw-modules = lib.snowfall.fs.get-default-nix-files-recursive (
lib.snowfall.fs.get-file "/modules/nixvim"
);
wrapped-modules =
builtins.map
(
raw-module: args: let
module = import raw-module;
result =
if builtins.isFunction module
then
module
(
args
// {
# NOTE: nixvim doesn't allow for these to be customized so we must work around the
# module system here...
inherit lib pkgs;
}
)
else module;
in
result // {_file = raw-module;}
)
raw-modules;
raw-neovim = pkgs.nixvim.makeNixvimWithModule {
inherit pkgs;
module = {
imports = wrapped-modules;
config = lib.mkMerge [
{
_module.args = {
settings = neovim-settings;
lib = lib.mkForce lib;
};
}
neovim-config
];
};
};
neovim = raw-neovim.overrideAttrs (attrs: {
meta =
attrs.meta
// {
# NOTE: The default platforms specified aren't actually all
# supported by nixvim. Instead, only support the ones that can build with
# the module system.
platforms = builtins.attrNames inputs.nixvim.legacyPackages;
};
});
in
neovim

View file

@ -1,9 +0,0 @@
# MarleyVim
## Notes
`plugins.${plugin}.luaConfig` - added in top-level Lua config (outside of
`require("${plugin}").setup({})`)
`plugins.${plugin}.settings` - given to setup function (i.e.
`require("${plugin}").setup(${settings})`)