summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbee <beebeeb5k@gmail.com>2026-05-05 22:37:10 +0530
committerbee <beebeeb5k@gmail.com>2026-05-05 22:37:10 +0530
commit9365a8e96827cbf7bc5adad6d29bcd05b4d761b2 (patch)
tree0998a5dcfc4517e4112a2c589e04ac0dbc1e011b
parent0c50f17133b90c60735f1f51943f51f60372bdd3 (diff)
Migrate from nixcats to nix-wrapper-modules
-rw-r--r--cats.nix185
-rw-r--r--colors/bee_matugen.lua98
-rw-r--r--colors/matugen.lua78
-rw-r--r--flake.lock441
-rw-r--r--flake.nix138
-rw-r--r--ftplugin/java.lua5
-rw-r--r--init.lua38
-rw-r--r--lua/bee/LSPs/init.lua148
-rw-r--r--lua/bee/LSPs/on_attach.lua54
-rw-r--r--lua/bee/format.lua35
-rw-r--r--lua/bee/init.lua80
-rw-r--r--lua/bee/lint.lua18
-rw-r--r--lua/bee/plugins/blink.lua150
-rw-r--r--lua/bee/plugins/git.lua62
-rw-r--r--lua/bee/plugins/init.lua9
-rw-r--r--lua/bee/plugins/oil.lua72
-rw-r--r--lua/bee/plugins/treesitter.lua192
-rw-r--r--lua/bee/plugins/ui.lua69
-rw-r--r--lua/bee/utils/init.lua77
-rw-r--r--lua/colorscheme_persistence.lua50
-rw-r--r--lua/config/init.lua4
-rw-r--r--lua/config/keys.lua35
-rw-r--r--lua/config/lsp.lua92
-rw-r--r--lua/config/options.lua52
-rw-r--r--lua/nixCatsUtils/lzUtils.lua36
-rw-r--r--lua/plugins/ai.lua29
-rw-r--r--lua/plugins/completion.lua65
-rw-r--r--lua/plugins/debug.lua90
-rw-r--r--lua/plugins/formatter.lua47
-rw-r--r--lua/plugins/general.lua134
-rw-r--r--lua/plugins/git.lua98
-rw-r--r--lua/plugins/init.lua13
-rw-r--r--lua/plugins/linter.lua40
-rw-r--r--lua/plugins/misc.lua50
-rw-r--r--lua/plugins/picker.lua97
-rw-r--r--lua/plugins/tsitter.lua187
-rw-r--r--lua/plugins/ui.lua86
-rw-r--r--module.nix241
-rw-r--r--package.nix90
-rw-r--r--plugin/keymaps.lua40
-rw-r--r--plugin/opts.lua118
41 files changed, 1542 insertions, 2101 deletions
diff --git a/cats.nix b/cats.nix
deleted file mode 100644
index 94a778c..0000000
--- a/cats.nix
+++ /dev/null
@@ -1,185 +0,0 @@
-inputs:
-let
- inherit (inputs.nixcats) utils;
-in
-{
- pkgs,
- settings,
- categories,
- extra,
- name,
- mkPlugin,
- ...
-}@packageDef:
-{
- lspsAndRuntimeDeps = with pkgs; {
- general = [
- fd
- ripgrep
- lsof
- # lldb
- ];
-
- markdown = [
- marksman
- harper
- ];
-
- typst = [
- tinymist
- ];
-
- nix = [
- nixd
- nil
- nixfmt
- ];
-
- qml = [
- kdePackages.qtdeclarative
- ];
-
- java = [
- jdt-language-server
- google-java-format
- ];
-
- lua = [
- lua-language-server
- stylua
- ];
-
- python = [
- ruff
- zuban
- ];
-
- zig = [
- zls
- ];
-
- toml = [
- tombi
- ];
- javascript = [
- eslint
- prettierd
- typescript-language-server
- ];
- };
-
- startupPlugins = with pkgs.vimPlugins; {
- theme = [
- pkgs.neovimPlugins.base46-nvim
- ];
-
- ui = [
- nvim-web-devicons
- ];
-
- general = [
- pkgs.neovimPlugins.lze
- pkgs.neovimPlugins.lzextras
- nvim-lspconfig
- ];
-
- rust = [
- rustaceanvim
- ];
-
- extras = [
- plenary-nvim
- ];
- };
-
- optionalPlugins = with pkgs.vimPlugins; {
- core = {
- general = [
- oil-nvim
- guess-indent-nvim
- undotree
- nvim-surround
- conform-nvim
- nvim-lint
- lazydev-nvim
- trouble-nvim
- ];
-
- picker = [
- telescope-nvim
- telescope-fzf-native-nvim
- telescope-ui-select-nvim
- ];
-
- git = [
- pkgs.neovimPlugins.neogit
- gitsigns-nvim
- ];
-
- completion = [
- blink-cmp
- blink-ripgrep-nvim
- friendly-snippets
- ];
- };
-
- ui = [
- hlchunk-nvim
- lualine-nvim
- ];
-
- tsitter = [
- nvim-treesitter.withAllGrammars
- nvim-treesitter-textobjects
- # (nvim-treesitter.withPlugins (
- # plugins:
- # with plugins; [
- # nix
- # lua
- # rust
- # cpp
- # c
- # go
- # yaml
- # python
- # javascript
- # typescript
- # toml
- # json
- # ]
- # ))
- ];
-
- debug = [
- nvim-dap
- nvim-dap-ui
- nvim-dap-virtual-text
- nvim-dap-go
- ];
-
- misc = [
- obsidian-nvim
- typst-preview-nvim
- ];
-
- ai = [
- pkgs.neovimPlugins.opencode-nvim
- ];
- };
-
- sharedLibraries = {
- general = with pkgs; [
- # libgit2
- ];
- };
-
- environmentVariables = {
- };
-
- extraWrapperArgs = {
- };
-
- extraLuaPackages = {
- test = [ (_: [ ]) ];
- };
-}
diff --git a/colors/bee_matugen.lua b/colors/bee_matugen.lua
deleted file mode 100644
index 9d7f760..0000000
--- a/colors/bee_matugen.lua
+++ /dev/null
@@ -1,98 +0,0 @@
-local present, base46 = pcall(require, "base46")
-if not present then
- vim.notify("base46 plugin not found or incorrect.", vim.log.levels.ERROR, { title = "matugen integration" })
- return
-end
-
-local config_home = vim.env.XDG_CONFIG_HOME
-if config_home == nil or #config_home == 0 then
- config_home = vim.fs.joinpath(vim.env.HOME, ".config")
-end
-
-local settings_file_path = vim.fs.joinpath(config_home, "matugen", "neovim_matugen.json")
-
-local settings_file = io.open(settings_file_path, "r")
-if settings_file == nil then
- vim.notify(
- "Cannot read matugen settings file at '" .. settings_file_path .. "'. Did you run beesettings wall?",
- vim.log.levels.WARN,
- { title = "matugen integration" }
- )
- return
-end
-
-local content = settings_file:read("*a")
-settings_file:close()
-
-local ok, settings = pcall(vim.json.decode, content)
-if not ok or not settings then
- vim.notify("Failed to parse matugen JSON", vim.log.levels.ERROR, { title = "matugen integration" })
- return
-end
-
-local harmony = settings.harmony or 0.5
-local source_color = settings.source_color
-local bg_color = settings.background
-vim.o.background = settings.mode
-
-if not source_color or not bg_color then
- vim.notify(
- "Missing colors in matugen JSON. Check your template.",
- vim.log.levels.ERROR,
- { title = "matugen integration" }
- )
- return
-end
-
--- local theme_base = "github_" .. vim.o.background
-local theme_base = "kanagawa"
-if vim.o.background == "light" then
- theme_base = "one_light"
-end
-local theme_name = "bee_matugen"
-
-if not _G._matugen_theme_watcher then
- local uv = vim.uv or vim.loop
- _G._matugen_theme_watcher = { uv.new_fs_event(), reload_timer = uv.new_timer() }
-
- local debounce_time = 100 -- ms
- local function handler()
- _G._matugen_theme_watcher.reload_timer:stop()
- _G._matugen_theme_watcher.reload_timer:start(
- debounce_time,
- 0,
- vim.schedule_wrap(function()
- -- Clear the cached theme table to force a rebuild
- local f = io.open(settings_file_path, "r")
- if f then
- local new_content = f:read("*a")
- f:close()
- local ok_new, new_settings = pcall(vim.json.decode, new_content)
- if ok_new and new_settings.mode then
- vim.o.background = new_settings.mode
- end
- end
- base46.theme_tables[theme_name] = nil
- if vim.g.colors_name == theme_name then
- vim.cmd.colorscheme(theme_name)
- end
-
- _G._matugen_theme_watcher[1]:stop()
- _G._matugen_theme_watcher[1]:start(settings_file_path, {}, handler)
- end)
- )
- end
- _G._matugen_theme_watcher[1]:start(settings_file_path, {}, handler)
-end
-
-if not base46.theme_tables[theme_name] or base46.theme_tables[theme_name].type ~= vim.o.background then
- local builtin = vim.deepcopy(assert(base46.get_builtin_theme(theme_base)))
-
- local harmonized = base46.theme_harmonize(builtin, source_color, harmony)
- harmonized = base46.theme_set_bg(harmonized, bg_color)
-
- base46.theme_tables[theme_name] = harmonized
-end
-
-base46.load(theme_name)
-vim.g.colors_name = theme_name
diff --git a/colors/matugen.lua b/colors/matugen.lua
new file mode 100644
index 0000000..241bdf2
--- /dev/null
+++ b/colors/matugen.lua
@@ -0,0 +1,78 @@
+local present, base46 = pcall(require, "base46")
+if not present or not base46._DMS_SUPPORT then
+ vim.notify(
+ "base46 plugin not found or incorrect, make sure to install AvengeMedia/base46",
+ vim.log.levels.ERROR,
+ { title = "matugen integration" }
+ )
+ return
+end
+
+local config_home = vim.env.XDG_CONFIG_HOME
+if config_home == nil or #config_home == 0 then
+ config_home = vim.fs.joinpath(vim.env.HOME, ".config")
+end
+
+local colors_file_path = vim.fs.joinpath(config_home, "nvim", "colors.json")
+local colors_file = io.open(colors_file_path, "r")
+if colors_file == nil then
+ vim.notify(
+ "cannnot read matugen colors file at '" .. colors_file_path .. "'",
+ vim.log.levels.ERROR,
+ { title = "matugen integration" }
+ )
+ return
+end
+local colors = vim.json.decode(colors_file:read("*a"))
+colors_file:close()
+
+local mode = colors.mode
+if mode ~= nil then
+ if mode:match("light") then
+ vim.o.background = "light"
+ elseif mode:match("dark") then
+ vim.o.background = "dark"
+ end
+end
+
+local settings = { matugenTemplateNeovimSetBackground = true }
+
+local theme_base = ("github_" .. vim.o.background)
+local harmony = 0.5
+local theme_name = "matugen"
+
+if not _G._matugen_theme_watcher then
+ local uv = vim.uv or vim.loop
+ _G._matugen_theme_watcher = { uv.new_fs_event(), reload_timer = uv.new_timer() }
+
+ local debounce_time = 100 -- ms
+ local function handler()
+ _G._matugen_theme_watcher.reload_timer:stop()
+ _G._matugen_theme_watcher.reload_timer:start(
+ debounce_time,
+ 0,
+ vim.schedule_wrap(function()
+ base46.theme_tables[theme_name] = nil
+ if vim.g.colors_name == theme_name then
+ vim.cmd.colorscheme(theme_name)
+ end
+ _G._matugen_theme_watcher[1]:stop()
+ _G._matugen_theme_watcher[1]:start(colors_file_path, {}, handler)
+ end)
+ )
+ end
+ _G._matugen_theme_watcher[1]:start(colors_file_path, {}, handler)
+end
+
+if not base46.theme_tables[theme_name] or base46.theme_tables[theme_name].type ~= vim.o.background then
+ local builtin = vim.deepcopy(assert(base46.get_builtin_theme(theme_base)))
+ local harmonized = base46.theme_harmonize(builtin, colors.source_color, harmony)
+ if settings.matugenTemplateNeovimSetBackground ~= false then
+ harmonized = base46.theme_set_bg(harmonized, colors.background)
+ end
+
+ base46.theme_tables[theme_name] = harmonized
+end
+
+base46.load(theme_name)
+vim.g.colors_name = theme_name
diff --git a/flake.lock b/flake.lock
index 6cb4925..8a8274a 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,267 +1,12 @@
{
"nodes": {
- "flake-compat": {
- "flake": false,
- "locked": {
- "lastModified": 1767039857,
- "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
- "owner": "NixOS",
- "repo": "flake-compat",
- "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
- "type": "github"
- },
- "original": {
- "owner": "NixOS",
- "repo": "flake-compat",
- "type": "github"
- }
- },
- "flake-parts": {
- "inputs": {
- "nixpkgs-lib": [
- "neovim-nightly-overlay",
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1775087534,
- "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
- "type": "github"
- },
- "original": {
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "type": "github"
- }
- },
- "flake-parts_2": {
- "inputs": {
- "nixpkgs-lib": "nixpkgs-lib"
- },
- "locked": {
- "lastModified": 1775087534,
- "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
- "type": "github"
- },
- "original": {
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "type": "github"
- }
- },
- "flake-parts_3": {
- "inputs": {
- "nixpkgs-lib": [
- "plugins-rustaceanvim",
- "neovim-nightly-overlay",
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1775087534,
- "narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
- "type": "github"
- },
- "original": {
- "owner": "hercules-ci",
- "repo": "flake-parts",
- "type": "github"
- }
- },
- "gen-luarc": {
- "inputs": {
- "flake-parts": [
- "plugins-rustaceanvim",
- "flake-parts"
- ],
- "git-hooks": [
- "plugins-rustaceanvim",
- "git-hooks"
- ],
- "luvit-meta": "luvit-meta",
- "nixpkgs": [
- "plugins-rustaceanvim",
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1755304025,
- "narHash": "sha256-xVKfjFwc0zMbLMjLTiHz+0llggkjs93SmHkhaa9S3M4=",
- "owner": "mrcjkb",
- "repo": "nix-gen-luarc-json",
- "rev": "1865b0ebb753ae5324d7381b1fa8c98c04ec7509",
- "type": "github"
- },
- "original": {
- "owner": "mrcjkb",
- "repo": "nix-gen-luarc-json",
- "type": "github"
- }
- },
- "git-hooks": {
- "inputs": {
- "flake-compat": "flake-compat",
- "gitignore": "gitignore",
- "nixpkgs": [
- "plugins-rustaceanvim",
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1775585728,
- "narHash": "sha256-8Psjt+TWvE4thRKktJsXfR6PA/fWWsZ04DVaY6PUhr4=",
- "owner": "cachix",
- "repo": "git-hooks.nix",
- "rev": "580633fa3fe5fc0379905986543fd7495481913d",
- "type": "github"
- },
- "original": {
- "owner": "cachix",
- "repo": "git-hooks.nix",
- "type": "github"
- }
- },
- "gitignore": {
- "inputs": {
- "nixpkgs": [
- "plugins-rustaceanvim",
- "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"
- }
- },
- "luvit-meta": {
- "flake": false,
- "locked": {
- "lastModified": 1705776742,
- "narHash": "sha256-zAAptV/oLuLAAsa2zSB/6fxlElk4+jNZd/cPr9oxFig=",
- "owner": "Bilal2453",
- "repo": "luvit-meta",
- "rev": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60",
- "type": "github"
- },
- "original": {
- "owner": "Bilal2453",
- "repo": "luvit-meta",
- "type": "github"
- }
- },
- "neovim-nightly-overlay": {
- "inputs": {
- "flake-parts": "flake-parts",
- "neovim-src": "neovim-src",
- "nixpkgs": "nixpkgs"
- },
- "locked": {
- "lastModified": 1775832851,
- "narHash": "sha256-Nvkak/2K4Sy39bfWitq5ZsInup95jZE1z4LAHJ89Z8o=",
- "owner": "nix-community",
- "repo": "neovim-nightly-overlay",
- "rev": "d3367f69ec16ba005704e54e66e6983bd6a5abe6",
- "type": "github"
- },
- "original": {
- "owner": "nix-community",
- "repo": "neovim-nightly-overlay",
- "type": "github"
- }
- },
- "neovim-nightly-overlay_2": {
- "inputs": {
- "flake-parts": "flake-parts_3",
- "neovim-src": "neovim-src_2",
- "nixpkgs": "nixpkgs_3"
- },
- "locked": {
- "lastModified": 1775779477,
- "narHash": "sha256-JjbovRW+t6qWwTpNBJ1+I7BcYYjaxl00vIsiDnmvxN4=",
- "owner": "nix-community",
- "repo": "neovim-nightly-overlay",
- "rev": "4f47ea565f3d2e1148025820839a11642b4cb496",
- "type": "github"
- },
- "original": {
- "owner": "nix-community",
- "repo": "neovim-nightly-overlay",
- "type": "github"
- }
- },
- "neovim-src": {
- "flake": false,
- "locked": {
- "lastModified": 1775778978,
- "narHash": "sha256-pHfmttziaYuGoWRnSu8nhsUA2AOcQuUwzWCGNTU1R+U=",
- "owner": "neovim",
- "repo": "neovim",
- "rev": "10e385cf30f07d80a42abe30d36ebf065c496c99",
- "type": "github"
- },
- "original": {
- "owner": "neovim",
- "repo": "neovim",
- "type": "github"
- }
- },
- "neovim-src_2": {
- "flake": false,
- "locked": {
- "lastModified": 1775778978,
- "narHash": "sha256-pHfmttziaYuGoWRnSu8nhsUA2AOcQuUwzWCGNTU1R+U=",
- "owner": "neovim",
- "repo": "neovim",
- "rev": "10e385cf30f07d80a42abe30d36ebf065c496c99",
- "type": "github"
- },
- "original": {
- "owner": "neovim",
- "repo": "neovim",
- "type": "github"
- }
- },
- "nixCats": {
- "locked": {
- "lastModified": 1774835836,
- "narHash": "sha256-6ok7iv/9R82vl6MYe3Lwyyb6S5bmW2PxEZtmjzlqyPs=",
- "owner": "BirdeeHub",
- "repo": "nixCats-nvim",
- "rev": "ebb9f279a55ca60ff4e37e4accf6518dc627aa8d",
- "type": "github"
- },
- "original": {
- "owner": "BirdeeHub",
- "repo": "nixCats-nvim",
- "type": "github"
- }
- },
"nixpkgs": {
"locked": {
- "lastModified": 1775763530,
- "narHash": "sha256-BuTK9z1QEwWPOIakQ1gCN4pa4VwVJpfptYCviy2uOGc=",
+ "lastModified": 1777826146,
+ "narHash": "sha256-wQ/iN5Zp5VIa3ebBibijPnLyKhor+xEbDy4d0goa9Zs=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "b0188973b4b2a5b6bdba8b65381d6cd09a533da0",
+ "rev": "73c703c22422b8951895a960959dbbaca7296492",
"type": "github"
},
"original": {
@@ -271,93 +16,14 @@
"type": "github"
}
},
- "nixpkgs-lib": {
- "locked": {
- "lastModified": 1774748309,
- "narHash": "sha256-+U7gF3qxzwD5TZuANzZPeJTZRHS29OFQgkQ2kiTJBIQ=",
- "owner": "nix-community",
- "repo": "nixpkgs.lib",
- "rev": "333c4e0545a6da976206c74db8773a1645b5870a",
- "type": "github"
- },
- "original": {
- "owner": "nix-community",
- "repo": "nixpkgs.lib",
- "type": "github"
- }
- },
- "nixpkgs_2": {
- "locked": {
- "lastModified": 1775763530,
- "narHash": "sha256-BuTK9z1QEwWPOIakQ1gCN4pa4VwVJpfptYCviy2uOGc=",
- "owner": "Nixos",
- "repo": "nixpkgs",
- "rev": "b0188973b4b2a5b6bdba8b65381d6cd09a533da0",
- "type": "github"
- },
- "original": {
- "owner": "Nixos",
- "ref": "nixpkgs-unstable",
- "repo": "nixpkgs",
- "type": "github"
- }
- },
- "nixpkgs_3": {
- "locked": {
- "lastModified": 1775763530,
- "narHash": "sha256-BuTK9z1QEwWPOIakQ1gCN4pa4VwVJpfptYCviy2uOGc=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "b0188973b4b2a5b6bdba8b65381d6cd09a533da0",
- "type": "github"
- },
- "original": {
- "owner": "NixOS",
- "ref": "nixpkgs-unstable",
- "repo": "nixpkgs",
- "type": "github"
- }
- },
- "nixpkgs_4": {
- "locked": {
- "lastModified": 1775763530,
- "narHash": "sha256-BuTK9z1QEwWPOIakQ1gCN4pa4VwVJpfptYCviy2uOGc=",
- "owner": "nixos",
- "repo": "nixpkgs",
- "rev": "b0188973b4b2a5b6bdba8b65381d6cd09a533da0",
- "type": "github"
- },
- "original": {
- "owner": "nixos",
- "ref": "nixpkgs-unstable",
- "repo": "nixpkgs",
- "type": "github"
- }
- },
- "plugins-base46-nvim": {
- "flake": false,
- "locked": {
- "lastModified": 1774439058,
- "narHash": "sha256-+FNEJBBa33onbq+BCQA1kO9dXDhGEUYbVIMnhrpr98U=",
- "owner": "AvengeMedia",
- "repo": "base46",
- "rev": "0f57acc24500694d0253b63c9fc6aaeb1a2b6696",
- "type": "github"
- },
- "original": {
- "owner": "AvengeMedia",
- "repo": "base46",
- "type": "github"
- }
- },
"plugins-lze": {
"flake": false,
"locked": {
- "lastModified": 1775782676,
- "narHash": "sha256-KDIY90Ny+uyuDCk8r57KBtT9a49wmWdLvviOMFfXa+E=",
+ "lastModified": 1777332925,
+ "narHash": "sha256-jKADsx+893AjFfua++A/Py0Z5bZC6M8HJuXPVJdi+pA=",
"owner": "BirdeeHub",
"repo": "lze",
- "rev": "c4403a54d9cd94156d7a149d830f39a4a437f048",
+ "rev": "d9425d09fc66f9529b29689852ec21d6aadf9fbc",
"type": "github"
},
"original": {
@@ -369,11 +35,11 @@
"plugins-lzextras": {
"flake": false,
"locked": {
- "lastModified": 1774897220,
- "narHash": "sha256-6ULOHXri/VAeRR+XwZ23YwN5xqOnBTBb+SBDgsIIFc8=",
+ "lastModified": 1777352146,
+ "narHash": "sha256-lPGTL68ghRgX9eKOgLjAc9rkhmhACVzwD/pxPaG+dAw=",
"owner": "BirdeeHub",
"repo": "lzextras",
- "rev": "e04b92af006e0357099f2ce023094b22ae4d105d",
+ "rev": "844c3e5c5b9ab857db948941c8c7dba4e8ddd0e3",
"type": "github"
},
"original": {
@@ -382,100 +48,31 @@
"type": "github"
}
},
- "plugins-neogit": {
- "flake": false,
- "locked": {
- "lastModified": 1775637236,
- "narHash": "sha256-tBmRZwBoUfJyTcPbqS/Vm7Ww0JE2wLgQ7e6o+1Fxei0=",
- "owner": "NeogitOrg",
- "repo": "neogit",
- "rev": "e06745228600a585b88726fc9fba44a373c15a47",
- "type": "github"
- },
- "original": {
- "owner": "NeogitOrg",
- "repo": "neogit",
- "type": "github"
- }
- },
- "plugins-opencode-nvim": {
- "flake": false,
- "locked": {
- "lastModified": 1775746206,
- "narHash": "sha256-rMTGNbhyo6YOmhVTyIkkl9HMl/73jYO8SdKGktHd+nU=",
- "owner": "NickvanDyke",
- "repo": "opencode.nvim",
- "rev": "6ed56733b19dce45d1f02abc34547cb21857ca95",
- "type": "github"
- },
- "original": {
- "owner": "NickvanDyke",
- "repo": "opencode.nvim",
- "type": "github"
- }
- },
- "plugins-rustaceanvim": {
- "inputs": {
- "flake-parts": "flake-parts_2",
- "gen-luarc": "gen-luarc",
- "git-hooks": "git-hooks",
- "neovim-nightly-overlay": "neovim-nightly-overlay_2",
- "nixpkgs": "nixpkgs_4",
- "vimcats": "vimcats"
- },
- "locked": {
- "lastModified": 1775781822,
- "narHash": "sha256-uPyJNzvX0K6zjko0RCh/eGixkcg2H208eV3SAp55HqY=",
- "owner": "mrcjkb",
- "repo": "rustaceanvim",
- "rev": "3eca3979c37a55f39119631bbd8a472ea622fc0c",
- "type": "github"
- },
- "original": {
- "owner": "mrcjkb",
- "repo": "rustaceanvim",
- "type": "github"
- }
- },
"root": {
"inputs": {
- "neovim-nightly-overlay": "neovim-nightly-overlay",
- "nixCats": "nixCats",
- "nixpkgs": "nixpkgs_2",
- "plugins-base46-nvim": "plugins-base46-nvim",
+ "nixpkgs": "nixpkgs",
"plugins-lze": "plugins-lze",
"plugins-lzextras": "plugins-lzextras",
- "plugins-neogit": "plugins-neogit",
- "plugins-opencode-nvim": "plugins-opencode-nvim",
- "plugins-rustaceanvim": "plugins-rustaceanvim"
+ "wrappers": "wrappers"
}
},
- "vimcats": {
+ "wrappers": {
"inputs": {
- "flake-parts": [
- "plugins-rustaceanvim",
- "flake-parts"
- ],
- "git-hooks": [
- "plugins-rustaceanvim",
- "git-hooks"
- ],
"nixpkgs": [
- "plugins-rustaceanvim",
"nixpkgs"
]
},
"locked": {
- "lastModified": 1775235697,
- "narHash": "sha256-wlobsn5gVjfk88q4QnzLUY8rIFARaYp7/9ziDc2xZ2Q=",
- "owner": "mrcjkb",
- "repo": "vimcats",
- "rev": "f0edff54f47d6c7dddef3ec9a61496b23f43640e",
+ "lastModified": 1777827587,
+ "narHash": "sha256-Tz3QSgl1wwWH1jf0BngEkNhoWDIIWSBDE/RI+RpVemc=",
+ "owner": "BirdeeHub",
+ "repo": "nix-wrapper-modules",
+ "rev": "b1308b562306f59c7732357655d19cedb292d5e1",
"type": "github"
},
"original": {
- "owner": "mrcjkb",
- "repo": "vimcats",
+ "owner": "BirdeeHub",
+ "repo": "nix-wrapper-modules",
"type": "github"
}
}
diff --git a/flake.nix b/flake.nix
index c143213..0faaab2 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,19 +1,9 @@
{
- description = "A Lua-natic's neovim flake, with extra cats! nixCats!";
-
+ description = "Flake exporting a configured neovim package";
inputs = {
- nixpkgs.url = "github:Nixos/nixpkgs/nixpkgs-unstable";
- nixCats.url = "github:BirdeeHub/nixCats-nvim";
- plugins-rustaceanvim.url = "github:mrcjkb/rustaceanvim";
- plugins-opencode-nvim.url = "github:NickvanDyke/opencode.nvim";
- plugins-opencode-nvim.flake = false;
- plugins-neogit.url = "github:NeogitOrg/neogit";
- plugins-neogit.flake = false;
- plugins-base46-nvim.url = "github:AvengeMedia/base46";
- plugins-base46-nvim.flake = false;
- neovim-nightly-overlay = {
- url = "github:nix-community/neovim-nightly-overlay";
- };
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ wrappers.url = "github:BirdeeHub/nix-wrapper-modules";
+ wrappers.inputs.nixpkgs.follows = "nixpkgs";
plugins-lze = {
url = "github:BirdeeHub/lze";
flake = false;
@@ -22,92 +12,56 @@
url = "github:BirdeeHub/lzextras";
flake = false;
};
+ plugins-base46 = {
+ url = "github:AvengeMedia/base46";
+ flake = false;
+ };
};
-
outputs =
{
self,
nixpkgs,
- nixCats,
+ wrappers,
...
}@inputs:
let
- inherit (nixCats) utils;
- luaPath = ./.;
- forEachSystem = utils.eachSystem nixpkgs.lib.platforms.all;
- extra_pkg_config = {
- allowUnfree = true;
- };
-
- dependencyOverlays = [
- (utils.standardPluginOverlay inputs)
- ];
-
- categoryDefinitions = import ./cats.nix inputs;
- packageDefinitions = import ./package.nix inputs;
- defaultPackageName = "beeVim";
+ forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.all;
+ module = nixpkgs.lib.modules.importApply ./module.nix inputs;
+ wrapper = wrappers.lib.evalModule module;
in
- forEachSystem (
- system:
- let
- nixCatsBuilder = utils.baseBuilder luaPath {
- inherit
- nixpkgs
- system
- dependencyOverlays
- extra_pkg_config
- ;
- } categoryDefinitions packageDefinitions;
- defaultPackage = nixCatsBuilder defaultPackageName;
- pkgs = import nixpkgs { inherit system; };
- in
- {
- packages = utils.mkAllWithDefault defaultPackage;
- devShells = {
- default = pkgs.mkShell {
- name = defaultPackageName;
- packages = [ defaultPackage ];
- inputsFrom = [ ];
- shellHook = "";
- };
- };
- }
- )
- // (
- let
- nixosModule = utils.mkNixosModules {
- moduleNamespace = [ defaultPackageName ];
- inherit
- defaultPackageName
- dependencyOverlays
- luaPath
- categoryDefinitions
- packageDefinitions
- extra_pkg_config
- nixpkgs
- ;
- };
- homeModule = utils.mkHomeModules {
- moduleNamespace = [ defaultPackageName ];
- inherit
- defaultPackageName
- dependencyOverlays
- luaPath
- categoryDefinitions
- packageDefinitions
- extra_pkg_config
- nixpkgs
- ;
+ {
+ wrapperModules = {
+ neovim = module;
+ default = self.wrapperModules.neovim;
+ };
+ wrappers = {
+ neovim = wrapper.config;
+ default = self.wrappers.neovim;
+ };
+ overlays = {
+ neovim = final: prev: { neovim = self.wrappers.neovim.wrap { pkgs = final; }; };
+ default = self.overlays.neovim;
+ };
+ packages = forAllSystems (
+ system:
+ let
+ pkgs = import nixpkgs { inherit system; };
+ in
+ {
+ neovim = self.wrappers.neovim.wrap { inherit pkgs; };
+ default = self.packages.${system}.neovim;
+ }
+ );
+ nixosModules = {
+ default = self.nixosModules.neovim;
+ neovim = wrappers.lib.getInstallModule {
+ name = "neovim";
+ value = module;
};
- in
- {
- overlays = utils.makeOverlays luaPath {
- inherit nixpkgs dependencyOverlays extra_pkg_config;
- } categoryDefinitions packageDefinitions defaultPackageName;
- nixosModules.default = nixosModule;
- homeModules.default = homeModule;
- inherit utils nixosModule homeModule;
- inherit (utils) templates;
- }
- );
+ };
+ homeModules = {
+ default = self.homeModules.neovim;
+ neovim = self.nixosModules.neovim;
+ };
+ };
}
diff --git a/ftplugin/java.lua b/ftplugin/java.lua
deleted file mode 100644
index 7a67f3b..0000000
--- a/ftplugin/java.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-vim.schedule(function()
- if vim.bo.filetype == "java" then
- require("LSPs.java_jdtls").setupJDTLS()
- end
-end)
diff --git a/init.lua b/init.lua
index 34d4a53..596c4ed 100644
--- a/init.lua
+++ b/init.lua
@@ -1,6 +1,36 @@
-require("lze").register_handlers(require("nixCatsUtils.lzUtils").for_cat)
+string.relpath = function(str, sub, n)
+ local result = {}
+ n = type(sub) == "string" and n or sub
+ if type(n) == "number" and n > 0 then
+ for match in (str .. "."):gmatch("(.-)%.") do
+ table.insert(result, match)
+ end
+ while n > 0 do
+ table.remove(result)
+ n = n - 1
+ end
+ else
+ table.insert(result, str)
+ end
+ if type(sub) == "string" then
+ table.insert(result, sub)
+ end
+ return #result == 1 and result[1] or table.concat(result, ".")
+end
-require("config")
-require("lze").load({ { import = "plugins" } })
+if not table.pack then
+ table.pack = function(...)
+ return { n = select("#", ...), ... }
+ end
+end
-require("colorscheme_persistence")
+vim.loader.enable()
+vim.g.mapleader = " "
+vim.g.maplocalleader = " "
+vim.o.exrc = false
+vim.g.netrw_liststyle = 0
+vim.g.netrw_banner = 0
+
+if vim.g.vscode == nil then
+ require("bee")
+end
diff --git a/lua/bee/LSPs/init.lua b/lua/bee/LSPs/init.lua
new file mode 100644
index 0000000..3bc86a5
--- /dev/null
+++ b/lua/bee/LSPs/init.lua
@@ -0,0 +1,148 @@
+local MP = ...
+local get_nixd_opts = nixInfo(nil, "info", "nixdExtras", "get_configs")
+return {
+ {
+ "mason.nvim",
+ auto_enable = true,
+ priority = 55,
+ on_plugin = { "nvim-lspconfig" },
+ lsp = function(plugin)
+ vim.cmd.MasonInstall(plugin.name)
+ end,
+ },
+ {
+ "nvim-lspconfig",
+ auto_enable = true,
+ priority = 50,
+ lsp = function(plugin)
+ vim.lsp.config(plugin.name, plugin.lsp or {})
+ vim.lsp.enable(plugin.name)
+ end,
+ before = function(_)
+ vim.lsp.config("*", {
+ on_attach = require(MP:relpath("on_attach")),
+ })
+ end,
+ },
+ {
+ "lua_ls",
+ for_cat = "lua",
+ lsp = {
+ filetypes = { "lua" },
+ settings = {
+ Lua = {
+ runtime = { version = "LuaJIT" },
+ formatters = {
+ ignoreComments = true,
+ },
+ signatureHelp = { enabled = true },
+ diagnostics = {
+ globals = { "vim", "make_test" },
+ disable = {},
+ },
+ workspace = {
+ checkThirdParty = false,
+ library = {
+ -- '${3rd}/luv/library',
+ -- unpack(vim.api.nvim_get_runtime_file('', true)),
+ },
+ },
+ completion = {
+ callSnippet = "Replace",
+ },
+ telemetry = { enabled = false },
+ },
+ },
+ },
+ },
+ {
+ "nixd",
+ for_cat = "nix",
+ after = function(_)
+ vim.api.nvim_create_user_command("StartNilLSP", function()
+ vim.lsp.start(vim.lsp.config.nil_ls)
+ end, { desc = "Run nil-ls (when you really need docs for the builtins and nixd refuse)" })
+ end,
+ lsp = {
+ filetypes = { "nix" },
+ settings = {
+ nixd = {
+ nixpkgs = {
+ expr = nixInfo("import <nixpkgs> {}", "info", "nixdExtras", "nixpkgs"),
+ },
+ formatting = {
+ command = { "nixfmt" },
+ },
+ options = {
+ -- (builtins.getFlake "path:${builtins.toString <path_to_system_flake>}").legacyPackages.<system>.nixosConfigurations."<user@host>".options
+ nixos = {
+ expr = get_nixd_opts
+ and get_nixd_opts("nixos", nixInfo(nil, "info", "nixdExtras", "flake-path")),
+ },
+ -- (builtins.getFlake "path:${builtins.toString <path_to_system_flake>}").legacyPackages.<system>.homeConfigurations."<user@host>".options
+ ["home-manager"] = {
+ expr = get_nixd_opts
+ and get_nixd_opts("home-manager", nixInfo(nil, "info", "nixdExtras", "flake-path")), -- <- if flake-path is nil it will be lsp root dir
+ },
+ },
+ diagnostic = {
+ suppress = {
+ "sema-escaping-with",
+ },
+ },
+ },
+ },
+ },
+ },
+ {
+ "clangd",
+ for_cat = "C",
+ lsp = {
+ filetypes = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
+ on_attach = function(client, bufnr)
+ require(MP:relpath("on_attach"))(client, bufnr)
+ -- the stuff they were adding that was overriding my on_attach
+ dofile(nixInfo.utils.get_nix_plugin_path("nvim-lspconfig") .. "/lsp/clangd.lua").on_attach(
+ client,
+ bufnr
+ )
+ end,
+ -- unneded thanks to clangd_extensions-nvim I think
+ -- settings = {
+ -- clangd_config = {
+ -- init_options = {
+ -- compilationDatabasePath="./build",
+ -- },
+ -- }
+ -- }
+ },
+ },
+ {
+ "gopls",
+ for_cat = "go",
+ lsp = {
+ filetypes = { "go", "gomod", "gowork", "gotmpl", "templ" },
+ },
+ },
+ {
+ "zls",
+ for_cat = "zig",
+ lsp = {
+ filetypes = { "zig", "zir" },
+ },
+ },
+ {
+ "rust_analyzer",
+ for_cat = "rust",
+ lsp = {
+ filetypes = { "rust" },
+ },
+ },
+ {
+ "bashls",
+ for_cat = "bash",
+ lsp = {
+ filetypes = { "bash", "sh" },
+ },
+ },
+}
diff --git a/lua/bee/LSPs/on_attach.lua b/lua/bee/LSPs/on_attach.lua
new file mode 100644
index 0000000..d4d69e4
--- /dev/null
+++ b/lua/bee/LSPs/on_attach.lua
@@ -0,0 +1,54 @@
+-- vim.api.nvim_create_autocmd('LspAttach', {
+-- group = vim.api.nvim_create_augroup('my-lsp-attach', { clear = true }),
+-- callback = function(event)
+-- require('birdee.LSPs.on_attach')(vim.lsp.get_client_by_id(event.data.client_id), event.buf)
+-- end,
+-- })
+return function(_, bufnr)
+ -- we create a function that lets us more easily define mappings specific
+ -- for LSP related items. It sets the mode, buffer and description for us each time.
+
+ local map = function(keys, func, desc, mode)
+ if desc then
+ desc = "LSP: " .. desc
+ end
+ vim.keymap.set(mode or "n", keys, func, { buffer = bufnr, desc = desc })
+ end
+
+ map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
+ map("<leader>la", vim.lsp.buf.code_action, "[L]sp [A]ction")
+
+ -- See `:help K` for why this keymap
+ map("K", vim.lsp.buf.hover, "Hover Documentation")
+ map("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
+
+ -- Lesser used LSP functionality
+ map("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
+ map("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
+ map("<leader>wl", function()
+ print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
+ end, "[W]orkspace [L]ist Folders")
+
+ -- Create a command `:Format` local to the LSP buffer
+ vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
+ vim.lsp.buf.format()
+ end, { desc = "Format current buffer with LSP" })
+ map("<leader>Fl", ":Format<CR>", "[F]ormat with [l]sp")
+ map("<leader>FL", ":Format<CR>", "[F]ormat with [L]SP")
+ -- The following two autocommands are used to highlight references of the
+ -- word under your cursor when your cursor rests there for a little while.
+ -- See `:help CursorHold` for information about when this is executed
+ -- When you move your cursor, the highlights will be cleared (the second autocommand).
+ -- local client = vim.lsp.get_client_by_id(event.data.client_id)
+ -- if client and client.server_capabilities.documentHighlightProvider then
+ -- vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
+ -- buffer = event.buf,
+ -- callback = vim.lsp.buf.document_highlight,
+ -- })
+
+ -- vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
+ -- buffer = event.buf,
+ -- callback = vim.lsp.buf.clear_references,
+ -- })
+ -- end
+end
diff --git a/lua/bee/format.lua b/lua/bee/format.lua
new file mode 100644
index 0000000..c8d1214
--- /dev/null
+++ b/lua/bee/format.lua
@@ -0,0 +1,35 @@
+return {
+ "conform.nvim",
+ auto_enable = true,
+ event = "FileType",
+ keys = {
+ { "<leader>lf", desc = "[F]ormat [F]ile" },
+ },
+ after = function(_)
+ local conform = require("conform")
+ conform.setup({
+ format_on_save = {
+ timeout_ms = 1000,
+ lsp_format = "fallback",
+ quiet = true,
+ },
+ formatters_by_ft = {
+ lua = { "stylua" },
+ nix = { "nixfmt" },
+ c = { "clang_format" },
+ cpp = { "clang_format" },
+ cmake = { "cmake_format" },
+ -- Use a sub-list to run only the first available formatter
+ javascript = { { "prettierd", "prettier" } },
+ },
+ })
+
+ vim.keymap.set({ "n", "v" }, "<leader>lf", function()
+ conform.format({
+ lsp_fallback = true,
+ async = false,
+ timeout_ms = 1000,
+ })
+ end, { desc = "[L]anguage [F]ormat" })
+ end,
+}
diff --git a/lua/bee/init.lua b/lua/bee/init.lua
new file mode 100644
index 0000000..23991ef
--- /dev/null
+++ b/lua/bee/init.lua
@@ -0,0 +1,80 @@
+local MP = ...
+do
+ local ok
+ ok, _G.nixInfo = pcall(require, vim.g.nix_info_plugin_name)
+ if not ok then
+ package.loaded[vim.g.nix_info_plugin_name] = setmetatable({}, {
+ __call = function(_, default)
+ return default
+ end,
+ })
+ _G.nixInfo = require(vim.g.nix_info_plugin_name)
+ end
+ nixInfo.isNix = vim.g.nix_info_plugin_name ~= nil
+ nixInfo.utils = require(MP:relpath("utils"))
+ nixInfo.lze = setmetatable(require("lze"), getmetatable(require("lzextras")))
+ function nixInfo.get_nix_plugin_path(name)
+ return nixInfo(nil, "plugins", "lazy", name) or nixInfo(nil, "plugins", "start", name)
+ end
+end
+
+nixInfo.lze.register_handlers({
+ nixInfo.utils.auto_enable_handler,
+ nixInfo.utils.for_cat_handler,
+ nixInfo.lze.lsp,
+})
+nixInfo.lze.h.lsp.set_ft_fallback(nixInfo.utils.lsp_ft_fallback)
+nixInfo.lze.load({
+ { import = MP:relpath("plugins") },
+ { import = MP:relpath("format") },
+ { import = MP:relpath("lint") },
+ { import = MP:relpath("LSPs") },
+ {
+ "base46",
+ lazy = false,
+ auto_enable = true,
+ event = "VimEnter",
+ after = function(_)
+ require("base46").setup()
+ end,
+ },
+ {
+ "vim-startuptime",
+ auto_enable = true,
+ cmd = { "StartupTime" },
+ before = function(_)
+ vim.g.startuptime_event_width = 0
+ vim.g.startuptime_tries = 10
+ vim.g.startuptime_exe_path = nixInfo(vim.v.progpath, "progpath")
+ end,
+ },
+ {
+ "mini.surround",
+ auto_enable = true,
+ event = "DeferredUIEnter",
+ after = function(_)
+ require("mini.surround").setup()
+ end,
+ },
+ {
+ "mini.pick",
+ lazy = true,
+ auto_enable = true,
+ keys = {
+ { "<leader>ff", desc = "File finder" },
+ { "<leader>bb", desc = "List open buffers" },
+ { "<leader>sg", desc = "Live grep" },
+ { "<leader>/", desc = "Grep" },
+ },
+ after = function(_)
+ require("mini.pick").setup({
+ vim.keymap.set("n", "<leader>ff", "<cmd>Pick files<cr>", { desc = "File finder" }),
+ vim.keymap.set("n", "<leader>bb", "<cmd>Pick buffers<cr>", { desc = "List open buffers" }),
+ vim.keymap.set("n", "<leader>sg", "<cmd>Pick grep_live<cr>", { desc = "live grep" }),
+ vim.keymap.set("n", "<leader>/", "<cmd>Pick grep<cr>", { desc = "Grep" }),
+ })
+ end,
+ },
+})
+
+vim.cmd.colorscheme("matugen")
diff --git a/lua/bee/lint.lua b/lua/bee/lint.lua
new file mode 100644
index 0000000..d29ea3a
--- /dev/null
+++ b/lua/bee/lint.lua
@@ -0,0 +1,18 @@
+return {
+ "nvim-lint",
+ auto_enable = true,
+ event = "FileType",
+ after = function(_)
+ require("lint").linters_by_ft = {
+ cpp = { "cpplint" },
+ javascript = { "eslint" },
+ typescript = { "eslint" },
+ }
+
+ vim.api.nvim_create_autocmd({ "BufWritePost" }, {
+ callback = function()
+ require("lint").try_lint()
+ end,
+ })
+ end,
+}
diff --git a/lua/bee/plugins/blink.lua b/lua/bee/plugins/blink.lua
new file mode 100644
index 0000000..7fd147b
--- /dev/null
+++ b/lua/bee/plugins/blink.lua
@@ -0,0 +1,150 @@
+local MP = ...
+return {
+ {
+ "luasnip",
+ auto_enable = true,
+ dep_of = { "blink.cmp" },
+ after = function(_)
+ local luasnip = require("luasnip")
+ require("luasnip.loaders.from_vscode").lazy_load()
+ luasnip.config.setup({})
+
+ local ls = require("luasnip")
+ local s = ls.snippet
+ local t = ls.text_node
+ local i = ls.insert_node
+ local extras = require("luasnip.extras")
+ local rep = extras.rep
+ local fmta = require("luasnip.extras.fmt").fmta
+ local c = ls.choice_node
+ local f = ls.function_node
+ local d = ls.dynamic_node
+ local sn = ls.snippet_node
+
+ vim.keymap.set({ "i", "s" }, "<M-n>", function()
+ if ls.choice_active() then
+ ls.change_choice(1)
+ end
+ end)
+ end,
+ },
+ {
+ "colorful-menu.nvim",
+ auto_enable = true,
+ on_plugin = { "blink.cmp" },
+ },
+ {
+ "blink.cmp",
+ auto_enable = true,
+ event = { "InsertEnter", "CmdlineEnter" },
+ after = function(_)
+ require("blink.cmp").setup({
+ keymap = { preset = "default" },
+ cmdline = {
+ enabled = true,
+ completion = {
+ menu = {
+ auto_show = true,
+ },
+ },
+ sources = function()
+ local type = vim.fn.getcmdtype()
+ -- Search forward and backward
+ if type == "/" or type == "?" then
+ return { "buffer" }
+ end
+ -- Commands
+ if type == ":" or type == "@" then
+ return { "cmdline" }
+ end
+ return {}
+ end,
+ },
+ term = {
+ enabled = false,
+ },
+ fuzzy = {
+ sorts = {
+ "exact",
+ "score",
+ "sort_text",
+ },
+ },
+ appearance = {
+ nerd_font_variant = "mono",
+ },
+ signature = {
+ enabled = true,
+ window = {
+ show_documentation = true,
+ },
+ },
+ completion = {
+ menu = {
+ draw = {
+ columns = {
+ { "label", "label_description", gap = 1 },
+ { "srckind" },
+ },
+ treesitter = { "lsp" },
+ components = {
+ srckind = {
+ ellipsis = false,
+ width = { fill = true },
+ text = function(ctx)
+ return ctx.kind
+ end,
+ highlight = function(ctx)
+ return ctx.kind_hl
+ end,
+ },
+ label = {
+ text = function(ctx)
+ return require("colorful-menu").blink_components_text(ctx)
+ end,
+ highlight = function(ctx)
+ return require("colorful-menu").blink_components_highlight(ctx)
+ end,
+ },
+ },
+ },
+ },
+ documentation = {
+ auto_show = true,
+ },
+ },
+ ---@type blink.cmp.SnippetsConfig
+ snippets = {
+ preset = "luasnip",
+ active = function(filter)
+ local snippet = require("luasnip")
+ local blink = require("blink.cmp")
+ if snippet.in_snippet() and not blink.is_visible() then
+ return true
+ else
+ if not snippet.in_snippet() and vim.fn.mode() == "n" then
+ snippet.unlink_current()
+ vim.snippet.stop()
+ end
+ return false
+ end
+ end,
+ },
+ sources = {
+ default = { "lsp", "path", "snippets", "buffer", "omni" },
+ providers = {
+ path = {
+ score_offset = 50,
+ },
+ lsp = {
+ score_offset = 40,
+ },
+ snippets = {
+ score_offset = 40,
+ },
+ },
+ },
+ })
+ end,
+ },
+}
diff --git a/lua/bee/plugins/git.lua b/lua/bee/plugins/git.lua
new file mode 100644
index 0000000..78be9b4
--- /dev/null
+++ b/lua/bee/plugins/git.lua
@@ -0,0 +1,62 @@
+return {
+ {
+ "vim-fugitive",
+ auto_enable = {
+ "vim-fugitive",
+ "vim-rhubarb",
+ },
+ keys = { { "<leader>gg", "<CMD>G<CR>", desc = "Open git" } },
+ cmd = {
+ "G",
+ "Git",
+ "Gdiffsplit",
+ "Gvdiffsplit",
+ "Gedit",
+ "Gread",
+ "Gwrite",
+ "Ggrep",
+ "GMove",
+ "Glgrep",
+ "GRename",
+ "GDelete",
+ "GRemove",
+ "GBrowse",
+ "DiffviewOpen",
+ "DiffviewClose",
+ "DiffviewToggleFiles",
+ "DiffviewFocusFiles",
+ "DiffviewRefresh",
+ "DiffviewFileHistory",
+ },
+ load = function(name)
+ nixInfo.lze.loaders.multi({
+ name,
+ "vim-rhubarb",
+ "diffview.nvim",
+ })
+ end,
+ },
+ {
+ "mini.diff",
+ auto_enable = true,
+ event = "DeferredUIEnter",
+ after = function(_)
+ require("mini.diff").setup({
+ view = {
+ style = "sign",
+ signs = { add = "│", change = "~", delete = "-" },
+ priority = 9,
+ },
+ mappings = {
+ apply = "",
+ reset = "",
+ textobject = "",
+ goto_first = "",
+ goto_prev = "",
+ goto_next = "",
+ goto_last = "",
+ },
+ })
+ end,
+ },
+}
diff --git a/lua/bee/plugins/init.lua b/lua/bee/plugins/init.lua
new file mode 100644
index 0000000..59e0a41
--- /dev/null
+++ b/lua/bee/plugins/init.lua
@@ -0,0 +1,9 @@
+local MP = ...
+
+return {
+ { import = MP:relpath("ui") },
+ { import = MP:relpath("oil") },
+ { import = MP:relpath("git") },
+ { import = MP:relpath("blink") },
+ { import = MP:relpath("treesitter") },
+}
diff --git a/lua/bee/plugins/oil.lua b/lua/bee/plugins/oil.lua
new file mode 100644
index 0000000..5f8c6d6
--- /dev/null
+++ b/lua/bee/plugins/oil.lua
@@ -0,0 +1,72 @@
+return {
+ {
+ "oil.nvim",
+ lazy = true,
+ keys = { { "<leader>o", "<CMD>Oil<CR>", desc = "Open oil" } },
+ auto_enable = true,
+ after = function()
+ vim.g.loaded_netrwPlugin = 1
+ vim.keymap.set("n", "<leader>o", "<cmd>Oil .<CR>", { noremap = true, desc = "Open nvim root directory" })
+ require("oil").setup({
+ keymaps = {
+ ["-"] = "actions.parent",
+ ["<CR>"] = "actions.select",
+ ["<C-v>"] = "actions.select_vsplit",
+ ["<C-s>"] = "actions.select_split",
+ },
+ vim.keymap.set("n", "<leader>o", "<cmd>Oil<cr>", { desc = "Open Oil" }),
+
+ -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`)
+ -- Set to false if you still want to use netrw.
+ default_file_explorer = true,
+ -- Id is automatically added at the beginning, and name at the end
+ -- See :help oil-columns
+ columns = {
+ "icon",
+ "permissions",
+ "size",
+ -- "mtime",
+ },
+ -- Buffer-local options to use for oil buffers
+ buf_options = {
+ buflisted = false,
+ bufhidden = "hide",
+ },
+ -- Window-local options to use for oil buffers
+ win_options = {
+ wrap = false,
+ signcolumn = "no",
+ cursorcolumn = false,
+ foldcolumn = "0",
+ spell = false,
+ list = false,
+ conceallevel = 3,
+ concealcursor = "nvic",
+ },
+ -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
+ delete_to_trash = false,
+ -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits)
+ skip_confirm_for_simple_edits = false,
+ -- Selecting a new/moved/renamed file or directory will prompt you to save changes first
+ -- (:help prompt_save_on_select_new_entry)
+ prompt_save_on_select_new_entry = true,
+ -- Oil will automatically delete hidden buffers after this delay
+ -- You can set the delay to false to disable cleanup entirely
+ -- Note that the cleanup process only starts when none of the oil buffers are currently displayed
+ cleanup_delay_ms = 2000,
+ lsp_file_methods = {
+ -- Time to wait for LSP file operations to complete before skipping
+ timeout_ms = 1000,
+ -- Set to true to autosave buffers that are updated with LSP willRenameFiles
+ -- Set to "unmodified" to only save unmodified buffers
+ autosave_changes = false,
+ },
+ -- Constrain the cursor to the editable parts of the oil buffer
+ -- Set to `false` to disable, or "name" to keep it on the file names
+ constrain_cursor = "editable",
+ -- Set to true to watch the filesystem for changes and reload oil
+ experimental_watch_for_changes = false,
+ })
+ end,
+ },
+}
diff --git a/lua/bee/plugins/treesitter.lua b/lua/bee/plugins/treesitter.lua
new file mode 100644
index 0000000..bfce021
--- /dev/null
+++ b/lua/bee/plugins/treesitter.lua
@@ -0,0 +1,192 @@
+-- Docs say not to lazy load it
+return {
+ {
+ "nvim-treesitter",
+ auto_enable = true,
+ lazy = false,
+ after = function(plugin)
+ ---@param buf integer
+ ---@param language string
+ local function treesitter_try_attach(buf, language)
+ -- check if parser exists and load it
+ if not vim.treesitter.language.add(language) then
+ return false
+ end
+ vim.treesitter.start(buf, language)
+
+ -- enables treesitter based folds
+ vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
+ vim.wo.foldmethod = "expr"
+ -- ensure folds are open to begin with
+ vim.o.foldlevel = 99
+
+ -- enables treesitter based indentation
+ vim.b.did_indent = 1 -- this right here prevents built-in indent scripts from loading
+ vim.bo.indentexpr = "v:lua.require'nvim-treesitter.indent'.get_indent(v:lnum)"
+
+ return true
+ end
+
+ local installable_parsers = nixInfo.isNix or require("nvim-treesitter").get_available()
+ vim.api.nvim_create_autocmd("FileType", {
+ callback = function(args)
+ local buf, filetype = args.buf, args.match
+ local language = vim.treesitter.language.get_lang(filetype)
+ if not language then
+ return
+ end
+
+ if not treesitter_try_attach(buf, language) and not nixInfo.isNix then
+ -- we do something more interesting in nix and don't do this there
+ ---@cast installable_parsers string[]
+ if vim.tbl_contains(installable_parsers, language) then
+ -- not already installed, so try to install them via nvim-treesitter if possible
+ require("nvim-treesitter").install(language):await(function()
+ treesitter_try_attach(buf, language)
+ end)
+ end
+ end
+ end,
+ })
+ end,
+ },
+ {
+ "nvim-treesitter-textobjects",
+ auto_enable = true,
+ lazy = false,
+ before = function(plugin)
+ vim.g.no_plugin_maps = true
+ end,
+ after = function(plugin)
+ require("nvim-treesitter-textobjects").setup({
+ select = {
+ -- Automatically jump forward to textobj, similar to targets.vim
+ lookahead = true,
+ -- You can choose the select mode (default is charwise 'v')
+ --
+ -- Can also be a function which gets passed a table with the keys
+ -- * query_string: eg '@function.inner'
+ -- * method: eg 'v' or 'o'
+ -- and should return the mode ('v', 'V', or '<c-v>') or a table
+ -- mapping query_strings to modes.
+ selection_modes = {
+ ["@parameter.outer"] = "v", -- charwise
+ ["@function.outer"] = "V", -- linewise
+ -- ['@class.outer'] = '<c-v>', -- blockwise
+ },
+ -- If you set this to `true` (default is `false`) then any textobject is
+ -- extended to include preceding or succeeding whitespace. Succeeding
+ -- whitespace has priority in order to act similarly to eg the built-in
+ -- `ap`.
+ --
+ -- Can also be a function which gets passed a table with the keys
+ -- * query_string: eg '@function.inner'
+ -- * selection_mode: eg 'v'
+ -- and should return true of false
+ include_surrounding_whitespace = false,
+ },
+ move = {
+ set_jumps = true,
+ },
+ })
+
+ -- keymaps
+ -- You can use the capture groups defined in `textobjects.scm`
+ vim.keymap.set({ "x", "o" }, "am", function()
+ require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects")
+ end)
+ vim.keymap.set({ "x", "o" }, "im", function()
+ require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects")
+ end)
+ vim.keymap.set({ "x", "o" }, "ac", function()
+ require("nvim-treesitter-textobjects.select").select_textobject("@class.outer", "textobjects")
+ end)
+ vim.keymap.set({ "x", "o" }, "ic", function()
+ require("nvim-treesitter-textobjects.select").select_textobject("@class.inner", "textobjects")
+ end)
+ -- You can also use captures from other query groups like `locals.scm`
+ vim.keymap.set({ "x", "o" }, "as", function()
+ require("nvim-treesitter-textobjects.select").select_textobject("@local.scope", "locals")
+ end)
+ vim.keymap.set("n", "<leader>a", function()
+ require("nvim-treesitter-textobjects.swap").swap_next("@parameter.inner")
+ end)
+ vim.keymap.set("n", "<leader>A", function()
+ require("nvim-treesitter-textobjects.swap").swap_previous("@parameter.outer")
+ end)
+
+ -- You can use the capture groups defined in `textobjects.scm`
+ vim.keymap.set({ "n", "x", "o" }, "]m", function()
+ require("nvim-treesitter-textobjects.move").goto_next_start("@function.outer", "textobjects")
+ end)
+ vim.keymap.set({ "n", "x", "o" }, "]]", function()
+ require("nvim-treesitter-textobjects.move").goto_next_start("@class.outer", "textobjects")
+ end)
+ -- You can also pass a list to group multiple queries.
+ vim.keymap.set({ "n", "x", "o" }, "]o", function()
+ require("nvim-treesitter-textobjects.move").goto_next_start(
+ { "@loop.inner", "@loop.outer" },
+ "textobjects"
+ )
+ end)
+ -- You can also use captures from other query groups like `locals.scm` or `folds.scm`
+ vim.keymap.set({ "n", "x", "o" }, "]s", function()
+ require("nvim-treesitter-textobjects.move").goto_next_start("@local.scope", "locals")
+ end)
+ vim.keymap.set({ "n", "x", "o" }, "]z", function()
+ require("nvim-treesitter-textobjects.move").goto_next_start("@fold", "folds")
+ end)
+
+ vim.keymap.set({ "n", "x", "o" }, "]M", function()
+ require("nvim-treesitter-textobjects.move").goto_next_end("@function.outer", "textobjects")
+ end)
+ vim.keymap.set({ "n", "x", "o" }, "][", function()
+ require("nvim-treesitter-textobjects.move").goto_next_end("@class.outer", "textobjects")
+ end)
+
+ vim.keymap.set({ "n", "x", "o" }, "[m", function()
+ require("nvim-treesitter-textobjects.move").goto_previous_start("@function.outer", "textobjects")
+ end)
+ vim.keymap.set({ "n", "x", "o" }, "[[", function()
+ require("nvim-treesitter-textobjects.move").goto_previous_start("@class.outer", "textobjects")
+ end)
+
+ vim.keymap.set({ "n", "x", "o" }, "[M", function()
+ require("nvim-treesitter-textobjects.move").goto_previous_end("@function.outer", "textobjects")
+ end)
+ vim.keymap.set({ "n", "x", "o" }, "[]", function()
+ require("nvim-treesitter-textobjects.move").goto_previous_end("@class.outer", "textobjects")
+ end)
+ local ts_repeat_move = require("nvim-treesitter-textobjects.repeatable_move")
+
+ -- Repeat movement with ; and ,
+ -- ensure ; goes forward and , goes backward regardless of the last direction
+ -- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next)
+ -- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous)
+
+ -- vim way: ; goes to the direction you were moving.
+ vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
+ vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)
+
+ -- Optionally, make builtin f, F, t, T also repeatable with ; and ,
+ vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f_expr, { expr = true })
+ vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F_expr, { expr = true })
+ vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t_expr, { expr = true })
+ vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T_expr, { expr = true })
+ end,
+ },
+ {
+ "nvim-ts-autotag",
+ auto_enable = true,
+ lazy = false,
+ after = function(plugin)
+ require("nvim-ts-autotag").setup({
+ opts = {
+ enable_close = true,
+ enable_rename = true,
+ enable_close_on_slash = false,
+ },
+ })
+ end,
+ },
+}
diff --git a/lua/bee/plugins/ui.lua b/lua/bee/plugins/ui.lua
new file mode 100644
index 0000000..8ce2a3c
--- /dev/null
+++ b/lua/bee/plugins/ui.lua
@@ -0,0 +1,69 @@
+return {
+ {
+ "lualine.nvim",
+ auto_enable = true,
+ after = function(_)
+ require("lualine").setup({
+ options = {
+ component_separators = { left = "|", right = "|" },
+ section_separators = {},
+ },
+ sections = {
+ lualine_a = {
+ {
+ "mode",
+ fmt = function(mode)
+ return ({
+ ["NORMAL"] = "っ( ' ᵕ ' )っ",
+ ["O-PENDING"] = "っ( º _ º )っ",
+ ["INSERT"] = "っ(>‿<)っ✎",
+ ["VISUAL"] = "っ(⊙‿⊙)っ",
+ ["V-LINE"] = "っ(ò_ó)っ¤=[]::>",
+ ["V-BLOCK"] = "っ[ •̀ ⌂ •́ ]っ",
+ ["REPLACE"] = "っ( O )っ",
+ ["V-REPLACE"] = "っ[ O ]っ",
+ ["COMMAND"] = "っ(ง •̀_•́)ง",
+ ["TERMINAL"] = "っ( ͡° ͜ʖ ͡°)っ",
+ ["EX"] = "っ( ͡ಠ ͜ʖ ͡ಠ)ง",
+ ["SHELL"] = "っ(©_©)っ",
+ ["MORE"] = "っ(°-° )っ",
+ ["CONFIRM"] = "っ( 0_0)?",
+
+ -- ["SELECT"] = "っ(づ。◕‿‿◕。)づ",
+ -- ["S-LINE"] = "っ(づ。◕‿‿◕。)づ¤",
+ -- ["S-BLOCK"] = "っ[づ。◕‿‿◕。]づ",
+ })[mode] or mode
+ end,
+ },
+ },
+ lualine_c = {
+ {
+ "filename",
+ path = 1,
+ },
+ },
+ },
+ inactive_sections = {
+ lualine_a = { "filename" },
+ lualine_b = {},
+ lualine_c = {},
+ lualine_x = {},
+ lualine_y = {},
+ lualine_z = { "location" },
+ },
+ })
+ end,
+ },
+ {
+ "mini.indentscope",
+ auto_enable = true,
+ event = "DeferredUIEnter",
+ after = function(_)
+ require("mini.indentscope").setup({
+ draw = {
+ delay = 200,
+ },
+ })
+ end,
+ },
+}
diff --git a/lua/bee/utils/init.lua b/lua/bee/utils/init.lua
new file mode 100644
index 0000000..4296561
--- /dev/null
+++ b/lua/bee/utils/init.lua
@@ -0,0 +1,77 @@
+local M = {}
+
+local nixInfo = _G.nixInfo or function(default, ...)
+ return default
+end
+
+function M.get_nix_plugin_path(name)
+ if vim.g.nix_info_plugin_name then
+ return nixInfo(nil, "plugins", "lazy", name) or nixInfo(nil, "plugins", "start", name)
+ else
+ return vim.api.nvim_get_runtime_file("pack/*/*/" .. name, false)[1]
+ end
+end
+
+function M.lsp_ft_fallback(name)
+ local nvimlspcfg = M.get_nix_plugin_path("nvim-lspconfig")
+ if not nvimlspcfg then
+ local matches = vim.api.nvim_get_runtime_file("pack/*/*/nvim-lspconfig", false)
+ nvimlspcfg = assert(matches[1], "nvim-lspconfig not found!")
+ end
+ vim.api.nvim_create_user_command("LspGetFiletypesToClipboard", function(opts)
+ local lspname =
+ assert(opts.fargs[1] or vim.fn.getreg("+") or name, "no name to search for provided or in clipboard")
+ local ok, lspcfg = pcall(dofile, nvimlspcfg .. "/lsp/" .. lspname .. ".lua")
+ if not ok or not lspcfg then
+ error("failed to get config for lsp: " .. lspname)
+ end
+ vim.fn.setreg("+", "filetypes = " .. vim.inspect(lspcfg.filetypes or {}) .. ",")
+ end, { nargs = "?" })
+ vim.schedule(function()
+ vim.notify((name or "lsp") .. " not provided filetype", vim.log.levels.WARN)
+ end)
+ return name and dofile(nvimlspcfg .. "/lsp/" .. name .. ".lua").filetypes or {}
+end
+
+M.auto_enable_handler = {
+ spec_field = "auto_enable",
+ set_lazy = false,
+ modify = function(plugin)
+ if vim.g.nix_info_plugin_name then
+ if type(plugin.auto_enable) == "table" then
+ for _, name in pairs(plugin.auto_enable) do
+ if not M.get_nix_plugin_path(name) then
+ plugin.enabled = false
+ break
+ end
+ end
+ elseif type(plugin.auto_enable) == "string" then
+ if not M.get_nix_plugin_path(plugin.auto_enable) then
+ plugin.enabled = false
+ end
+ elseif type(plugin.auto_enable) == "boolean" and plugin.auto_enable then
+ if not M.get_nix_plugin_path(plugin.name) then
+ plugin.enabled = false
+ end
+ end
+ end
+ return plugin
+ end,
+}
+
+M.for_cat_handler = {
+ spec_field = "for_cat",
+ set_lazy = false,
+ modify = function(plugin)
+ if vim.g.nix_info_plugin_name then
+ if type(plugin.for_cat) == "table" then
+ plugin.enabled = nixInfo(plugin.for_cat.default, "settings", "cats", plugin.for_cat.cat)
+ elseif type(plugin.for_cat) == "string" then
+ plugin.enabled = nixInfo(false, "settings", "cats", plugin.for_cat)
+ end
+ end
+ return plugin
+ end,
+}
+
+return M
diff --git a/lua/colorscheme_persistence.lua b/lua/colorscheme_persistence.lua
deleted file mode 100644
index e5f6cda..0000000
--- a/lua/colorscheme_persistence.lua
+++ /dev/null
@@ -1,50 +0,0 @@
-local M = {}
-
--- (~/.local/share/nvim/last_theme.txt)
-local theme_cache_path = vim.fn.stdpath("data") .. "/last_theme.txt"
-
-M.is_programmatic_change = false
-
-function M.load_theme()
- local theme = ""
-
- local f = io.open(theme_cache_path, "r")
- if f then
- theme = f:read("*all"):gsub("%s+", "")
- f:close()
- end
-
- if theme == "" then
- theme = nixCats.extra("colorscheme")
- end
-
- M.is_programmatic_change = true
- local status, _ = pcall(vim.cmd.colorscheme, theme)
-
- -- just to be safe
- if not status then
- vim.cmd.colorscheme("habamax")
- end
-end
-
-vim.api.nvim_create_autocmd("ColorScheme", {
- callback = function(args)
- -- If the change was programmatic (like at startup), don't overwrite the file
- if M.is_programmatic_change then
- M.is_programmatic_change = false -- Reset for the next manual change
- return
- end
-
- -- Save the new theme name to the file
- local theme_name = args.match
- local f = io.open(theme_cache_path, "w")
- if f then
- f:write(theme_name)
- f:close()
- end
- end,
-})
-
-M.load_theme()
-
-return M
diff --git a/lua/config/init.lua b/lua/config/init.lua
deleted file mode 100644
index afc9d18..0000000
--- a/lua/config/init.lua
+++ /dev/null
@@ -1,4 +0,0 @@
-require("config.options")
--- require("colors.colorschemes")
-require("config.keys")
-require("config.lsp")
diff --git a/lua/config/keys.lua b/lua/config/keys.lua
deleted file mode 100644
index 518b9c1..0000000
--- a/lua/config/keys.lua
+++ /dev/null
@@ -1,35 +0,0 @@
-vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", { silent = true })
-vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", { silent = true })
-
-vim.keymap.set("n", "J", "mzJ`z", { silent = true })
-vim.keymap.set("n", "<C-d>", "<C-d>zz", { silent = true })
-vim.keymap.set("n", "<C-u>", "<C-u>zz", { silent = true })
-vim.keymap.set("n", "n", "nzzzv", { silent = true })
-vim.keymap.set("n", "N", "Nzzzv", { silent = true })
-vim.keymap.set({ "n", "v" }, "<leader>y", [["+y]])
-vim.keymap.set({ "n", "v" }, "<leader>d", [["_d"]])
-
-vim.keymap.set("n", "q:", "<nop>") -- disable that annoying cmd history buffer thingy
-
-vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
-vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
-vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
-vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
-vim.keymap.set("n", "<leader>bn", "<cmd>bn<CR>")
-vim.keymap.set("n", "<leader>bp", "<cmd>bp<CR>")
-
-vim.keymap.set("n", "<leader>u", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
-vim.keymap.set("n", "<leader>px", "<cmd>!chmod +x %<CR>")
-vim.keymap.set("n", "", "<cmd>nohlsearch<CR>")
-
-local function hover_cap(opts)
- opts = vim.tbl_deep_extend("force", opts or {}, {
- max_width = 100,
- max_height = 25,
- wrap = true,
- })
- return vim.lsp.buf.hover(opts)
-end
-
-vim.keymap.set("n", "K", hover_cap, { silent = true })
--- vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "Rename Symbol" })
diff --git a/lua/config/lsp.lua b/lua/config/lsp.lua
deleted file mode 100644
index ab35b80..0000000
--- a/lua/config/lsp.lua
+++ /dev/null
@@ -1,92 +0,0 @@
-vim.lsp.inlay_hint.enable(true)
-vim.lsp.enable({
- "clangd",
- "lua_ls",
- "nixd",
- "nil_ls",
- "zls",
- "pyrefly",
- "marksman",
- "harper",
- "tinymist",
- "gopls",
- "tombi",
- "qmlls",
-})
-
-vim.lsp.config("nil_ls", {
- settings = {
- formatting = {
- command = { "nixfmt" },
- },
- },
-})
-
-vim.lsp.config("lua_ls", {
- settings = {
- Lua = {
- codeLens = { enable = true },
- hint = {
- enable = false,
- semicolon = "Disable",
- },
- workspace = {
- checkThirdParty = false,
- -- IMPORTANT: Leave library empty here.
- -- lazydev will inject the correct Nix store paths dynamically.
- library = {},
- },
- runtime = {
- version = "LuaJIT",
- -- Setting this to false allows lazydev to find files
- -- outside your immediate workspace (like Nix store plugins)
- pathStrict = false,
- },
- },
- },
-})
-
-vim.lsp.config("*", {
- capabilities = { textDocument = { semanticTokens = { multilineTokenSupport = true } } },
- root_markers = { ".git", ".editorconfig", "flake.nix", "shell.nix" },
-})
-
-vim.diagnostic.config({
- severity_sort = true,
- severity_sort_priority = {
- Error = 100,
- Warn = 90,
- Hint = 50,
- Info = 10,
- },
-})
-
-local RustLsp = function(mode, keymap, action, bufnr)
- vim.keymap.set(mode, keymap, function()
- vim.cmd.RustLsp(action)
- end, { silent = true, buffer = bufnr })
-end
-
-vim.g.rustaceanvim = {
- tools = {},
- server = {
- on_attach = function(client, bufnr)
- RustLsp({ "n", "x" }, "gra", "codeAction", bufnr)
- RustLsp("n", "<leader>ee", "explainError", bufnr)
- RustLsp("n", "K", { "hover", "actions" }, bufnr)
- RustLsp("n", "L", { "hover", "range" }, bufnr)
- end,
- default_settings = {
- ["rust-analyzer"] = {
- checkOnSave = {
- enable = true,
- command = "clippy",
- },
- procMacro = {
- enable = true,
- },
- },
- },
- },
- dap = {},
-}
diff --git a/lua/config/options.lua b/lua/config/options.lua
deleted file mode 100644
index d0e2b40..0000000
--- a/lua/config/options.lua
+++ /dev/null
@@ -1,52 +0,0 @@
-vim.loader.enable()
-vim.g.mapleader = " "
-vim.g.maplocalleader = " "
-vim.o.updatetime = 1500
-
-vim.o.inccommand = "split"
-
-vim.o.undofile = false
-vim.o.undodir = vim.fn.expand("~/.local/share/nvim/undo")
-
-vim.o.termguicolors = true
-vim.o.guicursor = "n-v-c-sm:block,ci-ve:ver25,r-cr-o:hor20"
-vim.o.showmode = false
-vim.o.showcmd = false
-vim.o.signcolumn = "yes"
-vim.o.cursorline = true
--- vim.o.cursorlineopt = "number" -- Restricts the highlight ONLY to the number column
--- vim.o.background = "dark"
-vim.o.winborder = "single"
-vim.o.conceallevel = 2
-vim.o.autoread = true
-
-vim.o.nu = true
-vim.o.relativenumber = true
-
-vim.o.mouse = ""
-vim.o.scrolloff = 21
-vim.g.loaded_netrwPlugin = 1
-vim.g.loaded_netrw = 1
-
-vim.o.expandtab = true
-vim.o.tabstop = 4
-vim.o.softtabstop = 4
-vim.o.shiftwidth = 4
-vim.o.smartindent = false
-vim.o.smarttab = true
-vim.o.breakindent = true
-vim.o.autoindent = true
-
-vim.o.wrap = false
-vim.o.linebreak = false
-
-vim.o.hlsearch = true
-vim.o.incsearch = true
-
-vim.o.title = true
-vim.o.swapfile = false
-
-vim.o.foldlevel = 99
-vim.o.foldlevelstart = 99
-vim.o.foldenable = true
-vim.o.foldmethod = "expr"
diff --git a/lua/nixCatsUtils/lzUtils.lua b/lua/nixCatsUtils/lzUtils.lua
deleted file mode 100644
index 2e2393d..0000000
--- a/lua/nixCatsUtils/lzUtils.lua
+++ /dev/null
@@ -1,36 +0,0 @@
---[[
- This directory is the luaUtils template.
- You can choose what things from it that you would like to use.
- And then delete the rest.
- Everything in this directory is optional.
---]]
-
-local M = {}
--- A nixCats specific lze handler that you can use to conditionally enable by category easier.
--- at the start of your config, register with
--- require('lze').register_handlers(require('nixCatsUtils.lzUtils').for_cat)
--- before any calls to require('lze').load using the handler have been made.
--- accepts:
--- for_cat = { "your" "cat" };
--- for_cat = { cat = { "your" "cat" }, default = bool }
--- for_cat = "your.cat";
--- for_cat = { cat = "your.cat", default = bool }
--- where default is an alternate value for when nixCats was NOT used to install the config
-M.for_cat = {
- spec_field = "for_cat",
- set_lazy = false,
- modify = function(plugin)
- if type(plugin.for_cat) == "table" and plugin.for_cat.cat ~= nil then
- if vim.g[ [[nixCats-special-rtp-entry-nixCats]] ] ~= nil then
- plugin.enabled = nixCats(plugin.for_cat.cat) or false
- else
- plugin.enabled = plugin.for_cat.default
- end
- else
- plugin.enabled = nixCats(plugin.for_cat) or false
- end
- return plugin
- end,
-}
-
-return M
diff --git a/lua/plugins/ai.lua b/lua/plugins/ai.lua
deleted file mode 100644
index 0aa51d8..0000000
--- a/lua/plugins/ai.lua
+++ /dev/null
@@ -1,29 +0,0 @@
-return {
- {
- "opencode-nvim",
- for_cat = "ai",
- keys = {
- -- stylua: ignore start
- { '<leader>co', function() require('opencode').toggle() end, desc = 'Toggle opencode' },
- { '<leader>ca', function() require('opencode').ask() end, desc = 'Ask opencode', mode = { 'n', 'v' } },
- { '<leader>cA', function() require('opencode').ask('@buffer ', { submit = true }) end, desc = 'Ask opencode about current file', mode = { 'n', 'v' } },
- { '<leader>cn', function() require('opencode').command('session.new') end, desc = 'New session' },
- { '<leader>ce', function() require('opencode').prompt('Explain @this and its context') end, desc = 'Explain code at cursor', mode = { 'n', 'v' } },
- { '<leader>cr', function() require('opencode').prompt('Review @buffer for correctness and readability') end, desc = 'Review file' },
- { '<leader>cf', function() require('opencode').prompt('Fix @diagnostics') end, desc = 'Fix errors' },
- { '<leader>cp', function() require('opencode').prompt('Optimize @this for performance and readability') end, desc = 'Optimize selection', mode = 'v' },
- { '<leader>cd', function() require('opencode').prompt('Add documentation comments for @this') end, desc = 'Document selection', mode = 'v' },
- { '<leader>ct', function() require('opencode').prompt('Add tests for @this') end, desc = 'Test selection', mode = 'v' },
- { '<leader>cs', function() require('opencode').select() end, desc = 'Select opencode action', mode = { 'n', 'v' } },
- -- stylua: ignore end
- },
- before = function()
- vim.g.opencode_opts = {
- providers = {
- enabled = "terminal",
- tmux = {},
- },
- }
- end,
- },
-}
diff --git a/lua/plugins/completion.lua b/lua/plugins/completion.lua
deleted file mode 100644
index 79946e1..0000000
--- a/lua/plugins/completion.lua
+++ /dev/null
@@ -1,65 +0,0 @@
-return {
- {
- "blink.cmp",
- event = { "InsertEnter", "CmdlineEnter" },
- for_cat = "core.completion",
- load = function(name)
- require("lzextras").loaders.multi({
- name,
- -- "blink-ripgrep.nvim",
- "friendly-snippets",
- })
- end,
- after = function(_)
- require("blink.cmp").setup({
- keymap = { preset = "default" },
- appearance = { nerd_font_variant = "mono" },
- signature = { enabled = false },
- completion = {
- documentation = {
- auto_show = false,
- },
- menu = {
- draw = {
- columns = {
- { "label", "label_description", gap = 1 },
- { "kind_icon", "kind", gap = 1 },
- },
- treesitter = { "lsp" },
- },
- },
- },
- sources = {
- default = { "lsp", "path", "snippets", "buffer", "cmdline", "omni" },
- providers = {
- path = {
- score_offset = 25,
- },
- lsp = {
- fallbacks = {},
- score_offset = 20,
- },
- snippets = {
- score_offset = 20,
- },
- buffer = {
- score_offset = 5,
- },
- -- ripgrep = {
- -- module = "blink-ripgrep",
- -- name = "Ripgrep",
- -- opts = {
- -- project_root_marker = { ".git", "flake.nix", "flake.lock" },
- -- backend = {
- -- use = "gitgrep-or-ripgrep",
- -- customize_icon_highlight = false,
- -- },
- -- },
- -- },
- },
- },
- fuzzy = { implementation = "prefer_rust_with_warning" },
- })
- end,
- },
-}
diff --git a/lua/plugins/debug.lua b/lua/plugins/debug.lua
deleted file mode 100644
index 659336b..0000000
--- a/lua/plugins/debug.lua
+++ /dev/null
@@ -1,90 +0,0 @@
-return {
- {
- "nvim-dap-go",
- for_cat = { cat = "go", default = false },
- on_plugin = { "nvim-dap" },
- after = function(_)
- require("dap-go").setup()
- end,
- },
- {
- "nvim-dap",
- for_cat = "debug",
- on_require = { "dap" },
- keys = {
- { "<F5>", desc = "Debug: Start/Continue" },
- { "<F2>", desc = "Debug: Step Into" },
- { "<F3>", desc = "Debug: Step Over" },
- { "<F4>", desc = "Debug: Step Out" },
- { "<leader>b", desc = "Debug: Toggle Breakpoint" },
- { "<leader>B", desc = "Debug: Set Breakpoint" },
- { "<F7>", desc = "Debug: See last session result." },
- },
- load = function(name)
- require("lzextras").loaders.multi({
- name,
- "nvim-dap-ui",
- "nvim-dap-virtual-text",
- })
- end,
- after = function(_)
- local dap = require("dap")
- local dapui = require("dapui")
-
- -- Basic debugging keymaps, feel free to change to your liking!
- vim.keymap.set("n", "<F5>", dap.continue, { desc = "Debug: Start/Continue" })
- vim.keymap.set("n", "<F2>", dap.step_into, { desc = "Debug: Step Into" })
- vim.keymap.set("n", "<F3>", dap.step_over, { desc = "Debug: Step Over" })
- vim.keymap.set("n", "<F4>", dap.step_out, { desc = "Debug: Step Out" })
- vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
- vim.keymap.set("n", "<leader>B", function()
- dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
- end, { desc = "Debug: Set Breakpoint" })
-
- -- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
- vim.keymap.set("n", "<F7>", dapui.toggle, { desc = "Debug: See last session result." })
-
- dap.listeners.after.event_initialized["dapui_config"] = dapui.open
- dap.listeners.before.event_terminated["dapui_config"] = dapui.close
- dap.listeners.before.event_exited["dapui_config"] = dapui.close
-
- -- Dap UI setup
- -- For more information, see |:help nvim-dap-ui|
- dapui.setup()
-
- require("nvim-dap-virtual-text").setup({
- -- enabled = true, -- enable this plugin (the default)
- -- enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
- -- highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
- -- highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
- -- show_stop_reason = true, -- show stop reason when stopped for exceptions
- -- commented = false, -- prefix virtual text with comment string
- -- only_first_definition = true, -- only show virtual text at first definition (if there are multiple)
- -- all_references = false, -- show virtual text on all all references of the variable (not only definitions)
- -- clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping)
- -- --- A callback that determines how a variable is displayed or whether it should be omitted
- -- --- variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
- -- --- buf number
- -- --- stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
- -- --- node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`)
- -- --- options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text
- -- --- string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed
- -- display_callback = function(variable, buf, stackframe, node, options)
- -- if options.virt_text_pos == "inline" then
- -- return " = " .. variable.value
- -- else
- -- return variable.name .. " = " .. variable.value
- -- end
- -- end,
- -- -- position of virtual text, see `:h nvim_buf_set_extmark()`, default tries to inline the virtual text. Use 'eol' to set to end of line
- -- virt_text_pos = vim.fn.has("nvim-0.10") == 1 and "inline" or "eol",
- --
- -- -- experimental features:
- -- all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
- -- virt_lines = false, -- show virtual lines instead of virtual text (will flicker!)
- -- virt_text_win_col = nil, -- position the virtual text at a fixed window column (starting from the first text column) ,
- -- -- e.g. 80 to position at column 80, see `:h nvim_buf_set_extmark()`
- })
- end,
- },
-}
diff --git a/lua/plugins/formatter.lua b/lua/plugins/formatter.lua
deleted file mode 100644
index a18610a..0000000
--- a/lua/plugins/formatter.lua
+++ /dev/null
@@ -1,47 +0,0 @@
-return {
- {
- "conform.nvim",
- event = { "BufReadPre", "BufNewFile" },
- for_cats = "core.general",
- after = function()
- local conform = require("conform")
-
- conform.setup({
- format_after_save = {
- lsp_format = "fallback",
- quiet = true,
- },
-
- formatters_by_ft = {
- lua = { "stylua" },
- go = { "gofmt" },
- rust = { "rustfmt" },
- toml = { "tombi" },
- java = { "google-java-format" },
- cmake = { "cmake_format" },
- typescript = { "prettierd" },
- javascript = { "prettierd" },
- c = { "clang-format" },
- cpp = { "clang-format" },
- qml = { "qmlformat" },
- python = { "ruff_fix", "ruff_organize_imports", "ruff_format" },
- },
-
- formatters = {
- ["google-java-format"] = {
- prepend_args = { "--aosp" },
- },
- ["clang-format"] = {
- prepend_args = { "-style={BasedOnStyle: LLVM, IndentWidth: 4, TabWidth: 4, UseTab: Never}" },
- },
- },
- })
-
- vim.keymap.set({ "n", "v" }, "<leader>lf", function()
- conform.format({ async = true })
- end, {
- desc = "Language format",
- })
- end,
- },
-}
diff --git a/lua/plugins/general.lua b/lua/plugins/general.lua
deleted file mode 100644
index 6716bbc..0000000
--- a/lua/plugins/general.lua
+++ /dev/null
@@ -1,134 +0,0 @@
-return {
- {
- "guess-indent.nvim",
- for_cat = "core.general",
- event = "DeferredUIEnter",
- after = function()
- require("guess-indent").setup({
- auto_cmd = true,
- override_editorconfig = true,
- filetype_exclude = {
- "netrw",
- "tutor",
- "oil",
- "gitcommit",
- },
- buftype_exclude = {
- "help",
- "nofile",
- "terminal",
- "prompt",
- },
- on_tab_options = {
- ["expandtab"] = false,
- },
- on_space_options = {
- ["expandtab"] = true,
- ["tabstop"] = "detected",
- ["softtabstop"] = "detected",
- ["shiftwidth"] = "detected",
- },
- })
- end,
- },
- {
- "nvim-surround",
- for_cat = "core.general",
- event = { "BufReadPre", "BufNewFile" },
- after = function()
- require("nvim-surround").setup()
- end,
- },
- {
- "oil.nvim",
- keys = { { "<leader>o", "<CMD>Oil<CR>", desc = "Open oil" } },
- for_cat = "core.general",
- after = function()
- require("oil").setup({
- default_file_explorer = true,
- columns = { "icon", "permissions", "size" },
- keymaps = {
- ["-"] = "actions.parent",
- ["<CR>"] = "actions.select",
- ["<C-v>"] = "actions.select_vsplit",
- ["<C-s>"] = "actions.select_split",
- },
- })
- end,
- },
- {
- "undotree",
- for_cat = "core.general",
- cmd = { "UndotreeToggle", "UndotreeHide", "UndotreeShow", "UndotreeFocus", "UndotreePersistUndo" },
- keys = { { "<leader>U", "<cmd>UndotreeToggle<CR>", mode = { "n" }, desc = "Undo Tree" } },
- before = function(_)
- vim.g.undotree_WindowLayout = 1
- vim.g.undotree_SplitWidth = 40
- vim.g.undotree_WindowLayout = 3
- end,
- },
- {
- "lazydev.nvim",
- ft = "lua",
- after = function()
- require("lazydev").setup({
- library = {
- { path = "${3rd}/luv/library", words = { "vim%.uv" } },
- },
-
- integrations = {
- -- Fixes lspconfig's workspace management for LuaLS
- -- Only create a new workspace if the buffer is not part
- -- of an existing workspace or one of its libraries
- lspconfig = true,
- -- add the cmp source for completion of:
- -- `require "modname"`
- -- `---@module "modname"`
- cmp = true,
- -- same, but for Coq
- coq = false,
- },
- })
- end,
- },
- {
- "trouble.nvim",
- for_cat = "core.general",
- cmd = "Trouble",
- keys = {
- {
- "<leader>xx",
- "<cmd>Trouble diagnostics toggle<cr>",
- desc = "Diagnostics (Trouble)",
- },
- {
- "<leader>xX",
- "<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
- desc = "Buffer Diagnostics (Trouble)",
- },
- {
- "<leader>cs",
- "<cmd>Trouble symbols toggle focus=false<cr>",
- desc = "Symbols (Trouble)",
- },
- {
- "<leader>cl",
- "<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
- desc = "LSP Definitions / references / ... (Trouble)",
- },
- {
- "<leader>xL",
- "<cmd>Trouble loclist toggle<cr>",
- desc = "Location List (Trouble)",
- },
- {
- "<leader>xQ",
- "<cmd>Trouble qflist toggle<cr>",
- desc = "Quickfix List (Trouble)",
- },
- },
- after = function()
- require("trouble").setup()
- end,
- },
-}
diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua
deleted file mode 100644
index 0e333f8..0000000
--- a/lua/plugins/git.lua
+++ /dev/null
@@ -1,98 +0,0 @@
-return {
- {
- "neogit",
- for_cat = "core.git",
- keys = { { "<leader>gg", "<CMD>Neogit<CR>", desc = "Open Neogit Ui" } },
- cmd = { "Neogit" },
- after = function()
- require("neogit").setup({
- disable_hint = true,
- kind = "split_above",
-
- commit_editor = {
- kind = "tab",
- show_staged_diff = true,
- staged_diff_split_kind = "auto",
- spell_check = true,
- },
- })
- end,
- },
- {
- "gitsigns.nvim",
- event = { "DeferredUIEnter" },
- for_cat = "core.git",
- after = function(_)
- require("gitsigns").setup({
- signs = {
- add = { text = "+" },
- change = { text = "~" },
- delete = { text = "_" },
- topdelete = { text = "‾" },
- changedelete = { text = "~" },
- },
-
- on_attach = function(bufnr)
- local gs = package.loaded.gitsigns
-
- local function map(mode, l, r, opts)
- opts = opts or {}
- opts.buffer = bufnr
- vim.keymap.set(mode, l, r, opts)
- end
-
- -- Navigation
- map({ "n", "v" }, "]c", function()
- if vim.wo.diff then
- return "]c"
- end
- vim.schedule(function()
- gs.next_hunk()
- end)
- return "<Ignore>"
- end, { expr = true, desc = "Jump to next hunk" })
-
- map({ "n", "v" }, "[c", function()
- if vim.wo.diff then
- return "[c"
- end
- vim.schedule(function()
- gs.prev_hunk()
- end)
- return "<Ignore>"
- end, { expr = true, desc = "Jump to previous hunk" })
-
- -- Actions
- -- visual mode
- map("v", "<leader>hs", function()
- gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") })
- end, { desc = "stage git hunk" })
- map("v", "<leader>hr", function()
- gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
- end, { desc = "reset git hunk" })
- -- normal mode
- map("n", "<leader>gs", gs.stage_hunk, { desc = "git stage hunk" })
- map("n", "<leader>gr", gs.reset_hunk, { desc = "git reset hunk" })
- map("n", "<leader>gS", gs.stage_buffer, { desc = "git Stage buffer" })
- map("n", "<leader>gu", gs.undo_stage_hunk, { desc = "undo stage hunk" })
- map("n", "<leader>gR", gs.reset_buffer, { desc = "git Reset buffer" })
- map("n", "<leader>gp", gs.preview_hunk, { desc = "preview git hunk" })
- map("n", "<leader>gb", function()
- gs.blame_line({ full = false })
- end, { desc = "git blame line" })
- -- map('n', '<leader>gd', gs.diffthis, { desc = 'git diff against index' })
- map("n", "<leader>gD", function()
- gs.diffthis("~")
- end, { desc = "git diff against last commit" })
-
- -- Toggles
- map("n", "<leader>gtb", gs.toggle_current_line_blame, { desc = "toggle git blame line" })
- map("n", "<leader>gtd", gs.toggle_deleted, { desc = "toggle git show deleted" })
-
- -- Text object
- map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", { desc = "select git hunk" })
- end,
- })
- end,
- },
-}
diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua
deleted file mode 100644
index 33575ee..0000000
--- a/lua/plugins/init.lua
+++ /dev/null
@@ -1,13 +0,0 @@
-return {
- { import = "plugins.ai" },
- { import = "plugins.general" },
- { import = "plugins.completion" },
- { import = "plugins.git" },
- { import = "plugins.formatter" },
- { import = "plugins.tsitter" },
- { import = "plugins.misc" },
- { import = "plugins.picker" },
- { import = "plugins.debug" },
- { import = "plugins.linter" },
- { import = "plugins.ui" },
-}
diff --git a/lua/plugins/linter.lua b/lua/plugins/linter.lua
deleted file mode 100644
index bd798ba..0000000
--- a/lua/plugins/linter.lua
+++ /dev/null
@@ -1,40 +0,0 @@
-return {
- {
- "nvim-lint",
- event = { "BufReadPre", "BufNewFile" },
- for_cats = "core.general",
- after = function()
- local lint = require("lint")
-
- lint.linters_by_ft = {
- python = { "ruff" },
- go = { "golangcilint" },
- -- rust = { "clippy" },
- c = { "clangtidy" },
- cpp = { "clangtidy" },
- java = { "checkstyle" },
- cmake = { "cmakelint" },
- javascript = { "eslint_d" },
- typescript = { "eslint_d" },
- }
-
- local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
-
- vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost" }, {
- group = lint_augroup,
- callback = function()
- lint.try_lint(nil, { ignore_errors = true })
- end,
- })
-
- vim.api.nvim_create_autocmd({ "InsertLeave" }, {
- group = lint_augroup,
- callback = function()
- if vim.bo.filetype ~= "rust" then
- lint.try_lint(nil, { ignore_errors = true })
- end
- end,
- })
- end,
- },
-}
diff --git a/lua/plugins/misc.lua b/lua/plugins/misc.lua
deleted file mode 100644
index 37185ae..0000000
--- a/lua/plugins/misc.lua
+++ /dev/null
@@ -1,50 +0,0 @@
-return {
- {
- "obsidian.nvim",
- for_cats = "misc",
- event = {
- "BufReadPre " .. vim.fn.expand("~") .. "/Notes/**/*.md",
- "BufNewFile " .. vim.fn.expand("~") .. "/Notes/**/*.md",
- },
- after = function()
- require("obsidian").setup({
- legacy_commands = false,
- workspaces = {
- {
- name = "personal",
- path = "~/Notes",
- },
- },
- })
- end,
- },
- {
- "typst-preview.nvim",
- ft = "typst",
- for_cats = "misc",
- after = function()
- require("typst-preview").setup({
- debug = false,
- open_cmd = nil,
- port = nil,
- invert_colors = "never",
- follow_cursor = true,
- dependencies_bin = {
- tinymist = "tinymist",
- websocat = "websocat",
- },
- extra_args = nil,
- get_root = function(path_of_main_file)
- local root = os.getenv("TYPST_ROOT")
- if root then
- return root
- end
- return vim.fn.fnamemodify(path_of_main_file, ":p:h")
- end,
- get_main_file = function(path_of_buffer)
- return path_of_buffer
- end,
- })
- end,
- },
-}
diff --git a/lua/plugins/picker.lua b/lua/plugins/picker.lua
deleted file mode 100644
index bf60d6a..0000000
--- a/lua/plugins/picker.lua
+++ /dev/null
@@ -1,97 +0,0 @@
-local telescope_builtin = function(key, action, desc)
- return {
- key,
- "<cmd>Telescope " .. action .. "<CR>",
- mode = { "n" },
- desc = desc,
- }
-end
-
-return {
- {
- "telescope.nvim",
- event = "DeferredUIEnter",
- for_cat = "core.picker",
- keys = {
- telescope_builtin("<leader>ff", "find_files", "Search files in cwd"),
- telescope_builtin("<leader>fb", "buffers", "Search files in cwd"),
- telescope_builtin("<leader>fo", "oldfiles", "Recent files"),
- telescope_builtin("<leader>fr", "registers", "Registers"),
- telescope_builtin("<leader>fj", "jumplist", "Jump list"),
- telescope_builtin("<leader>fm", "marks", "Marks"),
-
- telescope_builtin("<leader>fq", "quickfix", "Quickfix list"),
- telescope_builtin("<leader>fl", "loclist", "Location list"),
-
- telescope_builtin("<leader>st", "treesitter", "Treesitter symbols"),
-
- telescope_builtin("<leader>sc", "commands", "Commands"),
- telescope_builtin("<leader>sp", "spell_suggest", "Spell suggestions"),
-
- telescope_builtin("<leader>sg", "live_grep", "Search by grep"),
- telescope_builtin("<leader>ss", "grep_string", "Search string"),
- telescope_builtin("<leader>sk", "keymaps", "Search keymaps"),
- telescope_builtin("<leader>sh", "help_tags", "Search help tags"),
- telescope_builtin("<leader>/", "current_buffer_fuzzy_find", "Search in current buffer"),
-
- telescope_builtin("<leader>gc", "git_commits", "Git commits"),
- telescope_builtin("<leader>gB", "git_branches", "Git branches"),
- telescope_builtin("<leader>gs", "git_status", "Git status"),
- telescope_builtin("<leader>gS", "git_stash", "Git stash"),
-
- telescope_builtin("<leader>ls", "lsp_document_symbols", "Document symbols"),
- telescope_builtin("<leader>lS", "lsp_workspace_symbols", "Workspace symbols"),
- telescope_builtin("<leader>lds", "lsp_dynamic_workspace_symbols", "Workspace symbols"),
- telescope_builtin("<leader>ld", "diagnostics", "Diagnostics"),
- telescope_builtin("<leader>lD", "lsp_definitions", "LSP definitions"),
- telescope_builtin("<leader>li", "lsp_incoming_calls", "LSP incoming calls"),
- telescope_builtin("<leader>lo", "lsp_outgoing_calls", "LSP outgoing calls"),
- telescope_builtin("<leader>lt", "lsp_type_definitions", "LSP type definitions"),
- telescope_builtin("grr", "lsp_references", "LSP references"),
- telescope_builtin("gri", "lsp_implementations", "LSP implementations"),
- },
- load = function(name)
- require("lzextras").loaders.multi({
- name,
- "telescope-fzf-native.nvim",
- "telescope-ui-select.nvim",
- })
- end,
- after = function()
- require("telescope").setup({
- defaults = {
- mappings = {
- i = {
- ["<M-Enter>"] = "to_fuzzy_refine",
- },
- },
- },
- pickers = {
- buffers = {
- mappings = {
- i = {
- -- ["<C-d>"] = "delete_buffer",
- },
- n = {
- ["d"] = "delete_buffer",
- },
- },
- },
- },
- extensions = {
- fzf = {
- fuzzy = true,
- override_generic_sorter = true,
- override_file_sorter = true,
- case_mode = "smart_case",
- },
- ["ui-select"] = {
- require("telescope.themes").get_dropdown({}),
- },
- },
- })
- require("telescope").load_extension("fzf")
- require("telescope").load_extension("ui-select")
- end,
- },
-}
diff --git a/lua/plugins/tsitter.lua b/lua/plugins/tsitter.lua
deleted file mode 100644
index 0816c23..0000000
--- a/lua/plugins/tsitter.lua
+++ /dev/null
@@ -1,187 +0,0 @@
-return {
- {
- "nvim-treesitter",
- lazy = false,
- for_cats = "tsitter",
- after = function(plugin)
- ---@param buf integer
- ---@param language string
- local function treesitter_try_attach(buf, language)
- -- check if parser exists and load it
- if not vim.treesitter.language.add(language) then
- return false
- end
- -- enables syntax highlighting and other treesitter features
- vim.treesitter.start(buf, language)
-
- -- enables treesitter based folds
- vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
-
- -- enables treesitter based indentation
- vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
-
- return true
- end
-
- local installable_parsers = require("nvim-treesitter").get_available()
- vim.api.nvim_create_autocmd("FileType", {
- callback = function(args)
- local buf, filetype = args.buf, args.match
- local language = vim.treesitter.language.get_lang(filetype)
- if not language then
- return
- end
-
- if not treesitter_try_attach(buf, language) then
- if vim.tbl_contains(installable_parsers, language) then
- -- not already installed, so try to install them via nvim-treesitter if possible
- require("nvim-treesitter").install(language):await(function()
- treesitter_try_attach(buf, language)
- end)
- end
- end
- end,
- })
- end,
- },
-
- {
- "nvim-treesitter-textobjects",
- auto_enable = true,
- for_cats = "tsitter",
- lazy = false,
- before = function(plugin)
- -- https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/main?tab=readme-ov-file#using-a-package-manager
- -- Disable entire built-in ftplugin mappings to avoid conflicts.
- -- See https://github.com/neovim/neovim/tree/master/runtime/ftplugin for built-in ftplugins.
- vim.g.no_plugin_maps = true
-
- -- Or, disable per filetype (add as you like)
- -- vim.g.no_python_maps = true
- -- vim.g.no_ruby_maps = true
- -- vim.g.no_rust_maps = true
- -- vim.g.no_go_maps = true
- end,
- after = function(plugin)
- require("nvim-treesitter-textobjects").setup({
- select = {
- -- Automatically jump forward to textobj, similar to targets.vim
- lookahead = true,
- -- You can choose the select mode (default is charwise 'v')
- --
- -- Can also be a function which gets passed a table with the keys
- -- * query_string: eg '@function.inner'
- -- * method: eg 'v' or 'o'
- -- and should return the mode ('v', 'V', or '<c-v>') or a table
- -- mapping query_strings to modes.
- selection_modes = {
- ["@parameter.outer"] = "v", -- charwise
- ["@function.outer"] = "V", -- linewise
- -- ['@class.outer'] = '<c-v>', -- blockwise
- },
- -- If you set this to `true` (default is `false`) then any textobject is
- -- extended to include preceding or succeeding whitespace. Succeeding
- -- whitespace has priority in order to act similarly to eg the built-in
- -- `ap`.
- --
- -- Can also be a function which gets passed a table with the keys
- -- * query_string: eg '@function.inner'
- -- * selection_mode: eg 'v'
- -- and should return true of false
- include_surrounding_whitespace = false,
- },
- move = {
- set_jumps = true,
- },
- })
-
- -- keymaps
- -- You can use the capture groups defined in `textobjects.scm`
- vim.keymap.set({ "x", "o" }, "am", function()
- require("nvim-treesitter-textobjects.select").select_textobject("@function.outer", "textobjects")
- end)
- vim.keymap.set({ "x", "o" }, "im", function()
- require("nvim-treesitter-textobjects.select").select_textobject("@function.inner", "textobjects")
- end)
- vim.keymap.set({ "x", "o" }, "ac", function()
- require("nvim-treesitter-textobjects.select").select_textobject("@class.outer", "textobjects")
- end)
- vim.keymap.set({ "x", "o" }, "ic", function()
- require("nvim-treesitter-textobjects.select").select_textobject("@class.inner", "textobjects")
- end)
- -- You can also use captures from other query groups like `locals.scm`
- vim.keymap.set({ "x", "o" }, "as", function()
- require("nvim-treesitter-textobjects.select").select_textobject("@local.scope", "locals")
- end)
- vim.keymap.set("n", "<leader>a", function()
- require("nvim-treesitter-textobjects.swap").swap_next("@parameter.inner")
- end)
- vim.keymap.set("n", "<leader>A", function()
- require("nvim-treesitter-textobjects.swap").swap_previous("@parameter.outer")
- end)
-
- -- You can use the capture groups defined in `textobjects.scm`
- vim.keymap.set({ "n", "x", "o" }, "]m", function()
- require("nvim-treesitter-textobjects.move").goto_next_start("@function.outer", "textobjects")
- end)
- vim.keymap.set({ "n", "x", "o" }, "]]", function()
- require("nvim-treesitter-textobjects.move").goto_next_start("@class.outer", "textobjects")
- end)
- -- You can also pass a list to group multiple queries.
- vim.keymap.set({ "n", "x", "o" }, "]o", function()
- require("nvim-treesitter-textobjects.move").goto_next_start(
- { "@loop.inner", "@loop.outer" },
- "textobjects"
- )
- end)
- -- You can also use captures from other query groups like `locals.scm` or `folds.scm`
- vim.keymap.set({ "n", "x", "o" }, "]s", function()
- require("nvim-treesitter-textobjects.move").goto_next_start("@local.scope", "locals")
- end)
- vim.keymap.set({ "n", "x", "o" }, "]z", function()
- require("nvim-treesitter-textobjects.move").goto_next_start("@fold", "folds")
- end)
-
- vim.keymap.set({ "n", "x", "o" }, "]M", function()
- require("nvim-treesitter-textobjects.move").goto_next_end("@function.outer", "textobjects")
- end)
- vim.keymap.set({ "n", "x", "o" }, "][", function()
- require("nvim-treesitter-textobjects.move").goto_next_end("@class.outer", "textobjects")
- end)
-
- vim.keymap.set({ "n", "x", "o" }, "[m", function()
- require("nvim-treesitter-textobjects.move").goto_previous_start("@function.outer", "textobjects")
- end)
- vim.keymap.set({ "n", "x", "o" }, "[[", function()
- require("nvim-treesitter-textobjects.move").goto_previous_start("@class.outer", "textobjects")
- end)
-
- vim.keymap.set({ "n", "x", "o" }, "[M", function()
- require("nvim-treesitter-textobjects.move").goto_previous_end("@function.outer", "textobjects")
- end)
- vim.keymap.set({ "n", "x", "o" }, "[]", function()
- require("nvim-treesitter-textobjects.move").goto_previous_end("@class.outer", "textobjects")
- end)
- local ts_repeat_move = require("nvim-treesitter-textobjects.repeatable_move")
-
- -- Repeat movement with ; and ,
- -- ensure ; goes forward and , goes backward regardless of the last direction
- -- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move_next)
- -- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_previous)
-
- -- vim way: ; goes to the direction you were moving.
- vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
- vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)
-
- -- Optionally, make builtin f, F, t, T also repeatable with ; and ,
- vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f_expr, { expr = true })
- vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F_expr, { expr = true })
- vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t_expr, { expr = true })
- vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T_expr, { expr = true })
-
- -- NOTE: for more textobjects options, see the following link.
- -- This template is using the new `main` branch of the repo.
- -- https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/main
- end,
- },
-}
diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua
deleted file mode 100644
index b2094eb..0000000
--- a/lua/plugins/ui.lua
+++ /dev/null
@@ -1,86 +0,0 @@
-return {
- {
- "lualine.nvim",
- for_cats = "ui",
- event = { "DeferredUIEnter" },
- after = function()
- require("lualine").setup({
- options = {
- component_separators = { left = "|", right = "|" },
- section_separators = {},
- },
- sections = {
- lualine_a = {
- {
- "mode",
- fmt = function(mode)
- return ({
- NORMAL = "(。•ᴗ•。)",
- INSERT = "(づ。◕‿‿◕。)づ",
- VISUAL = "(≧◡≦)",
- ["V-LINE"] = "(≧▿≦)",
- ["V-BLOCK"] = "(☆ω☆)",
- COMMAND = "( ̄ω ̄)",
- REPLACE = "(;ω;)",
- TERMINAL = "(^▽^)",
- })[mode] or mode
- end,
- },
- },
- },
- })
- end,
- },
- {
- "hlchunk.nvim",
- for_cats = "ui",
- event = { "BufReadPre", "BufNewFile" },
- after = function()
- local ignored_filetypes = {
- gitcommit = true,
- oil = true,
- Neogitstatus = true,
- TelescopePrompt = true,
- NvimTree = true,
- help = true,
- nix = true,
- }
-
- require("hlchunk").setup({
- chunk = {
- enable = true,
- priority = 15,
- -- style = {
- -- vim.api.nvim_get_hl(0, { name = "IndentBlanklineIndent1" }),
- -- vim.api.nvim_get_hl(0, { name = "DiagnosticError" }),
- -- },
- use_treesitter = false,
- chars = {
- horizontal_line = "─",
- vertical_line = "│",
- left_top = "┌",
- left_bottom = "└",
- right_arrow = "─",
- },
- textobject = "",
- exclude_filetypes = ignored_filetypes,
- max_file_size = 1024 * 1024,
- error_sign = true,
- -- animation related
- duration = 200,
- delay = 300,
- },
- indent = {
- enable = true,
- priority = 10,
- style = { vim.api.nvim_get_hl(0, { name = "Whitespace" }) },
- use_treesitter = false,
- exclude_filetypes = ignored_filetypes,
- chars = { "│" },
- ahead_lines = 5,
- delay = 100,
- },
- })
- end,
- },
-}
diff --git a/module.nix b/module.nix
new file mode 100644
index 0000000..3f49271
--- /dev/null
+++ b/module.nix
@@ -0,0 +1,241 @@
+inputs:
+{
+ config,
+ wlib,
+ lib,
+ pkgs,
+ ...
+}:
+{
+ imports = [ wlib.wrapperModules.neovim ];
+ # NOTE: see the tips and tricks section or the bottom of this file + flake inputs to understand this value
+ options.nvim-lib.neovimPlugins = lib.mkOption {
+ readOnly = true;
+ type = lib.types.attrsOf wlib.types.stringable;
+ # Makes plugins autobuilt from our inputs available with
+ # `config.nvim-lib.neovimPlugins.<name_without_prefix>`
+ default = config.nvim-lib.pluginsFromPrefix "plugins-" inputs;
+ };
+
+ # choose a directory for your config.
+ config.settings.config_directory = ./.;
+ # you can also use an impure path!
+ # config.settings.config_directory = lib.generators.mkLuaInline "vim.fn.stdpath('config')";
+ # config.settings.config_directory = "/home/<USER>/.config/nvim";
+ # If you do that, it will not be provisioned by nix, but it will have normal reload for quick edits!
+
+ # If you want to install multiple neovim derivations via home.packages or environment.systemPackages
+ # in order to prevent path collisions:
+
+ # set this to true:
+ # config.settings.dont_link = true;
+
+ # and make sure these dont share values:
+ config.binName = "nvim";
+ config.settings.aliases = [
+ "vim"
+ "vi"
+ ];
+
+ config.hosts.python3.nvim-host.enable = false;
+ config.hosts.node.nvim-host.enable = false;
+ config.hosts.ruby.nvim-host.enable = false;
+ config.hosts.perl.nvim-host.enable = false;
+ config.hosts.neovide.nvim-host.enable = false;
+
+ # If the defaults are fine, you can just provide the `.data` field
+ # In this case, a list of specs, instead of a single plugin like above
+ config.specs.lze = [
+ # if defaults is fine, you can just provide the `.data` field
+ config.nvim-lib.neovimPlugins.lze
+ # but these can be specs too!
+ {
+ # these ones can't take lists though
+ data = config.nvim-lib.neovimPlugins.lzextras;
+ # things can target any spec that has a name.
+ name = "lzextras";
+ # now something else can be after = [ "lzextras" ]
+ # the spec name is not the plugin name.
+ # to override the plugin name, use `pname`
+ # You could run something before your main init.lua like this
+ # before = [ "INIT_MAIN" ];
+ # You can include configuration and translated nix values here as well!
+ # type = "lua"; # | "fnl" | "vim"
+ # info = { };
+ # config = ''
+ # local info, pname, lazy = ...
+ # '';
+ }
+ ];
+
+ # you can name these whatever you want.
+ config.specs.nix = {
+ lazy = true;
+ data = null;
+ extraPackages = with pkgs; [
+ nixd
+ nixfmt
+ ];
+ };
+ config.specs.lua = {
+ after = [ "general" ];
+ lazy = true;
+ data = with pkgs.vimPlugins; [
+ lazydev-nvim
+ ];
+ extraPackages = with pkgs; [
+ lua-language-server
+ stylua
+ ];
+ };
+ config.specs.bash = {
+ lazy = true;
+ enable = false;
+ data = null;
+ extraPackages = with pkgs; [
+ bash-language-server
+ ];
+ };
+ config.specs.C = {
+ lazy = true;
+ data = null;
+ extraPackages = with pkgs; [
+ clang-tools
+ ];
+ };
+ config.specs.rust = {
+ # enable = false;
+ lazy = true;
+ data = null;
+ extraPackages = with pkgs; [
+ rust-analyzer
+ rustfmt
+ ];
+ };
+ config.specs.zig = {
+ enable = false;
+ lazy = true;
+ data = null;
+ extraPackages = with pkgs; [
+ zls
+ ];
+ };
+
+ config.specs.general = {
+ # this would ensure any config included from nix in here will be ran after any provided by the `lze` spec
+ # If we provided any from within either spec, anyway
+ after = [ "lze" ];
+ # note we didn't have to specify the `lze` specs name, because it was a top level spec
+ extraPackages = with pkgs; [
+ wl-clipboard
+ xclip
+ xsel
+ tree-sitter
+ ];
+ # this `lazy = true` definition will transfer to specs in the contained DAL, if there is one.
+ # This is because the definition of lazy in `config.specMods` checks `parentSpec.lazy or false`
+ # the submodule type for `config.specMods` gets `parentSpec` as a `specialArg`.
+ # you can define options like this too!
+ lazy = true;
+ # here we chose a DAL of plugins, but we can also pass a single plugin, or null
+ # plugins are of type wlib.types.stringable
+ data = with pkgs.vimPlugins; [
+ vim-sleuth
+ config.nvim-lib.neovimPlugins.base46
+ nvim-lspconfig
+ oil-nvim
+ vim-startuptime
+ blink-cmp
+ colorful-menu-nvim
+ luasnip
+ lualine-nvim
+ nvim-lint
+ conform-nvim
+ nvim-treesitter-textobjects
+ mini-pick
+ mini-diff
+ mini-surround
+ mini-indentscope
+ nvim-ts-autotag
+ vim-fugitive
+ vim-rhubarb
+ diffview-nvim
+ (nvim-treesitter.withPlugins (
+ plugins: with plugins; [
+ nix
+ lua
+ c
+ cpp
+ rust
+ zig
+ ]
+ ))
+ ];
+ };
+
+ # These are from the tips and tricks section of the neovim wrapper docs!
+ # https://birdeehub.github.io/nix-wrapper-modules/neovim.html#tips-and-tricks
+ # We could put these in another module and import them here instead!
+
+ # This submodule modifies both levels of your specs
+ config.specMods =
+ {
+ # When this module is ran in an inner list,
+ # this will contain `config` of the parent spec
+ parentSpec ? null,
+ # and this will contain `options`
+ # otherwise they will be `null`
+ parentOpts ? null,
+ parentName ? null,
+ # and then config from this one, as normal
+ config,
+ # and the other module arguments.
+ ...
+ }:
+ {
+ # you could use this to change defaults for the specs
+ # config.collateGrammars = lib.mkDefault (parentSpec.collateGrammars or false);
+ # config.autoconfig = lib.mkDefault (parentSpec.autoconfig or false);
+ # config.runtimeDeps = lib.mkDefault (parentSpec.runtimeDeps or false);
+ # config.pluginDeps = lib.mkDefault (parentSpec.pluginDeps or false);
+ # or something more interesting like:
+ # add an extraPackages field to the specs themselves
+ options.extraPackages = lib.mkOption {
+ type = lib.types.listOf wlib.types.stringable;
+ default = [ ];
+ description = "a extraPackages spec field to put packages to suffix to the PATH";
+ };
+ # You could do this too
+ # config.before = lib.mkDefault [ "INIT_MAIN" ];
+ };
+ config.extraPackages = config.specCollect (acc: v: acc ++ (v.extraPackages or [ ])) [ ];
+
+ # Inform our lua of which top level specs are enabled
+ options.settings.cats = lib.mkOption {
+ readOnly = true;
+ type = lib.types.attrsOf lib.types.bool;
+ default = builtins.mapAttrs (_: v: v.enable) config.specs;
+ };
+ # build plugins from inputs set
+ options.nvim-lib.pluginsFromPrefix = lib.mkOption {
+ type = lib.types.raw;
+ readOnly = true;
+ default =
+ prefix: inputs:
+ lib.pipe inputs [
+ builtins.attrNames
+ (builtins.filter (s: lib.hasPrefix prefix s))
+ (map (
+ input:
+ let
+ name = lib.removePrefix prefix input;
+ in
+ {
+ inherit name;
+ value = config.nvim-lib.mkPlugin name inputs.${input};
+ }
+ ))
+ builtins.listToAttrs
+ ];
+ };
+}
diff --git a/package.nix b/package.nix
deleted file mode 100644
index b9d78c6..0000000
--- a/package.nix
+++ /dev/null
@@ -1,90 +0,0 @@
-inputs:
-let
- inherit (inputs.nixCats) utils;
- baseSettings =
- {
- pkgs,
- name,
- ...
- }@misc:
- {
- suffix-path = true;
- suffix-LD = true;
- hosts.node.enable = false;
- hosts.ruby.enable = false;
- hosts.perl.enable = false;
- hosts.python3.enable = false;
- # neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${pkgs.stdenv.hostPlatform.system}.neovim;
- wrapRc = true;
- useBinaryWrapper = true;
- aliases = [
- "vim"
- "vi"
- "nvim"
- ];
- # neovim-unwrapped = inputs.neovim-nightly-overlay.packages.${pkgs.system}.neovim;
- };
- baseCats =
- { pkgs, ... }@misc:
- {
- ai = true;
- theme = true;
- rust = true;
- toml = true;
- nix = true;
- general = true;
- lua = true;
- javascript = false;
- java = false;
- typst = false;
- misc = false;
- zig = false;
- ui = true;
- debug = false;
- python = false;
- markdown = false;
- qml = true;
- core = {
- formatter = true;
- git = true;
- general = true;
- completion = true;
- picker = true;
- };
- tsitter = true;
- };
- baseExtra =
- { pkgs, ... }@misc:
- {
- colorscheme = "onedark";
- nixdExtras = {
- nixpkgs = "import ${pkgs.path} {}";
- };
- };
-in
-{
- beeVim = args: {
- settings = baseSettings args;
- categories = baseCats args;
- extra = baseExtra args;
- };
- mvim = args: {
- settings = baseSettings args // {
- suffix-path = false;
- suffix-LD = false;
- };
- categories = baseCats args // {
- ai = false;
- rust = false;
- tsitter = false;
- core = {
- formatter = false;
- git = true;
- general = true;
- picker.mini = true;
- picker.telescope = false;
- };
- };
- extra = baseExtra args;
- };
-}
diff --git a/plugin/keymaps.lua b/plugin/keymaps.lua
new file mode 100644
index 0000000..c22f149
--- /dev/null
+++ b/plugin/keymaps.lua
@@ -0,0 +1,40 @@
+vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv", { desc = "Moves Line Down" })
+vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv", { desc = "Moves Line Up" })
+vim.keymap.set("n", "<C-d>", "<C-d>zz", { desc = "Scroll Down" })
+vim.keymap.set("n", "<C-u>", "<C-u>zz", { desc = "Scroll Up" })
+vim.keymap.set("n", "n", "nzzzv", { desc = "Next Search Result" })
+vim.keymap.set("n", "N", "Nzzzv", { desc = "Previous Search Result" })
+
+vim.keymap.set("n", "<leader><leader>[", "<cmd>bprev<CR>", { desc = "Previous buffer" })
+vim.keymap.set("n", "<leader><leader>]", "<cmd>bnext<CR>", { desc = "Next buffer" })
+vim.keymap.set("n", "<leader><leader>l", "<cmd>b#<CR>", { desc = "Last buffer" })
+vim.keymap.set("n", "<leader><leader>d", "<cmd>bdelete<CR>", { desc = "delete buffer" })
+
+-- Remap for dealing with word wrap
+vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
+vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
+
+-- Diagnostic keymaps
+vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Open floating diagnostic message" })
+vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostics list" })
+
+vim.keymap.set({ "v", "x", "n" }, "<leader>y", '"+y', { noremap = true, silent = true, desc = "Yank to clipboard" })
+vim.keymap.set(
+ { "n", "v", "x" },
+ "<leader>Y",
+ '"+yy',
+ { noremap = true, silent = true, desc = "Yank line to clipboard" }
+)
+vim.keymap.set({ "n", "v", "x" }, "<leader>p", '"+p', { noremap = true, silent = true, desc = "Paste from clipboard" })
+vim.keymap.set(
+ "i",
+ "<C-p>",
+ "<C-r><C-p>+",
+ { noremap = true, silent = true, desc = "Paste from clipboard from within insert mode" }
+)
+vim.keymap.set(
+ "x",
+ "<leader>P",
+ '"_dP',
+ { noremap = true, silent = true, desc = "Paste over selection without erasing unnamed register" }
+)
diff --git a/plugin/opts.lua b/plugin/opts.lua
new file mode 100644
index 0000000..942443a
--- /dev/null
+++ b/plugin/opts.lua
@@ -0,0 +1,118 @@
+-- vim.opt.list = true
+-- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
+-- vim.opt.listchars:append("space:⋅")
+-- Set highlight on search
+-- vim.opt.hlsearch = false
+
+require("vim._core.ui2").enable()
+vim.cmd.packadd("nvim.undotree")
+-- vim.cmd.packadd("nvim.difftool")
+
+vim.o.showmode = false
+vim.o.showcmd = false
+vim.o.winborder = "single"
+
+vim.opt.hlsearch = true
+vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
+
+-- Preview substitutions live, as you type!
+vim.opt.inccommand = "split"
+
+-- Minimal number of screen lines to keep above and below the cursor.
+vim.opt.scrolloff = 3
+
+-- Make line numbers default
+vim.wo.number = true
+vim.o.cursorline = true
+
+-- Disable mouse mode
+vim.o.mouse = ""
+
+-- Indent
+vim.o.smarttab = true
+-- vim.o.smartindent = true
+-- vim.o.indentexpr = true
+vim.o.autoindent = true
+vim.opt.cpoptions:append("I")
+vim.o.tabstop = 4
+vim.o.softtabstop = 4
+vim.o.shiftwidth = 4
+vim.o.expandtab = true
+
+-- stops line wrapping from being confusing
+vim.o.wrap = true
+vim.o.linebreak = true
+vim.o.breakindent = true
+
+-- Save undo history
+vim.o.undofile = false
+vim.o.title = true
+vim.o.swapfile = false
+
+-- Case-insensitive searching UNLESS \C or capital in search
+vim.o.ignorecase = true
+vim.o.smartcase = true
+
+-- Keep signcolumn on by default
+vim.wo.signcolumn = "yes"
+vim.wo.relativenumber = true
+vim.opt.lazyredraw = true
+
+-- Decrease update time
+vim.o.updatetime = 250
+vim.o.timeoutlen = 300
+
+-- Set completeopt to have a better completion experience
+vim.o.completeopt = "menu,preview,noselect"
+
+-- NOTE: You should make sure your terminal supports this
+vim.o.termguicolors = true
+
+-- remove empty buffer text
+vim.opt.shortmess:append("I")
+
+vim.g.netrw_liststyle = 0
+vim.g.netrw_banner = 0
+
+-- [[ Highlight on yank ]]
+-- See `:help vim.highlight.on_yank()`
+local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
+vim.api.nvim_create_autocmd("TextYankPost", {
+ callback = function()
+ vim.hl.on_yank()
+ end,
+ group = highlight_group,
+ pattern = "*",
+})
+
+local augroup = vim.api.nvim_create_augroup("UserConfig", {})
+
+-- [[ Disable auto comment on enter ]]
+-- See :help formatoptions
+vim.api.nvim_create_autocmd("FileType", {
+ desc = "remove formatoptions",
+ group = augroup,
+ callback = function()
+ vim.opt.formatoptions:remove({ "c", "r", "o" })
+ end,
+})
+
+vim.api.nvim_create_autocmd("FileType", {
+ group = augroup,
+ pattern = "help",
+ callback = function()
+ vim.bo.bufhidden = "unload"
+ vim.cmd.wincmd("L")
+ end,
+})
+
+-- -- Create directories when saving files
+-- vim.api.nvim_create_autocmd("BufWritePre", {
+-- group = augroup,
+-- callback = function()
+-- local dir = vim.fn.expand('<afile>:p:h')
+-- if vim.fn.isdirectory(dir) == 0 then
+-- vim.fn.mkdir(dir, 'p')
+-- end
+-- end,
+-- })