From 792a99bf0f8896d9fea0199ea979d60da385abf8 Mon Sep 17 00:00:00 2001 From: Joe bellus Date: Thu, 19 Mar 2026 16:14:24 -0500 Subject: [PATCH] Refactor --- init.lua | 4 +- lazy-lock.json | 38 ++++++++------ lua/_blink.lua | 12 ++++- lua/_claude.lua | 15 ++++++ lua/_git.lua | 7 +++ lua/_lsp.lua | 1 + lua/_notes.lua | 52 +++++++++++++++++++ lua/_obsidian.lua | 104 ------------------------------------- lua/_snacks.lua | 9 +--- lua/_tea.lua | 26 ++++++++++ lua/_treesitter.lua | 4 ++ lua/editor.lua | 19 +++---- lua/format.lua | 1 + lua/plugins/dankcolors.lua | 91 ++++++++++++++++++++++++++++++++ lua/theme.lua | 4 +- 15 files changed, 242 insertions(+), 145 deletions(-) create mode 100644 lua/_claude.lua create mode 100644 lua/_git.lua create mode 100644 lua/_notes.lua delete mode 100644 lua/_obsidian.lua create mode 100644 lua/_tea.lua create mode 100644 lua/plugins/dankcolors.lua diff --git a/init.lua b/init.lua index 3292a2f..f6f67ba 100644 --- a/init.lua +++ b/init.lua @@ -29,10 +29,12 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end vim.opt.rtp:prepend(lazypath) +-- require(config_path .. "/lua/plugins/dankcolors.lua") + require("lazy").setup({ spec = { plugins, }, install = { colorscheme = { "habamax" } }, - checker = { enabled = true }, + checker = { enabled = true, notify = false }, }) diff --git a/lazy-lock.json b/lazy-lock.json index b793097..79e4427 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,30 +1,36 @@ { - "CopilotChat.nvim": { "branch": "main", "commit": "df5376c132382dd47e3e552612940cbf25b3580c" }, + "CopilotChat.nvim": { "branch": "main", "commit": "ecea24a9a067c6f176b8e13eb11251c739caf055" }, "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, + "blame.nvim": { "branch": "main", "commit": "179da7aaacce7c52874af636255ede72dd6fe796" }, "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, - "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, - "conform.nvim": { "branch": "master", "commit": "ffe26e8df8115c9665d24231f8a49fadb2d611ce" }, - "copilot.lua": { "branch": "master", "commit": "881f99b827d65b41f522eecc21b112cf518028ac" }, + "blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" }, + "claude-code.nvim": { "branch": "main", "commit": "55c0cb59828fbc3bec744288286a46f5d5750b83" }, + "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, + "copilot.lua": { "branch": "master", "commit": "0552b44fceedf0c4cba2cd4953d3976633b2509a" }, "elixir-tools.nvim": { "branch": "main", "commit": "b51b48edc668924a6b2f6610f9a0aff34741d20e" }, - "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "gitsigns.nvim": { "branch": "main", "commit": "5813e4878748805f1518cee7abb50fd7205a3a48" }, - "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, + "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, - "nvim-lspconfig": { "branch": "master", "commit": "f7c6e585fd80d5a2c075ab27ac312ac55bcf1550" }, + "neorg": { "branch": "main", "commit": "408fc04013a95da8f217cb0958a06b6a77c01743" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-lspconfig": { "branch": "master", "commit": "11f730caa976a00def4387cbacb6183cec7939c7" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-ufo": { "branch": "main", "commit": "72d54c31079d38d8dfc5456131b1d0fb5c0264b0" }, - "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, - "obsidian.nvim": { "branch": "main", "commit": "4065c233f618cdbfbf084d87e97317f8d019ef59" }, + "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, + "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" }, + "pathlib.nvim": { "branch": "main", "commit": "57e5598af6fe253761c1b48e0b59b7cd6699e2c1" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "ranger.nvim": { "branch": "main", "commit": "fd2cc999f3ef88f7cdcbcad5f26000c52b16c489" }, - "rustaceanvim": { "branch": "master", "commit": "6c3785d6a230bec63f70c98bf8e2842bed924245" }, - "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, - "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "38b06435305c30966b7ceb0a43e460dc43acaada" }, + "rustaceanvim": { "branch": "master", "commit": "f2f0c1231a5b019dbc1fd6dafac1751c878925a3" }, + "snacks-tea.nvim": { "branch": "main", "commit": "fdbfe05c29a2fab48d4d4feb3e4df0c43f3d4c14" }, + "snacks.nvim": { "branch": "main", "commit": "a049339328e2599ad6e85a69fa034ac501e921b2" }, + "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "ba133b3e932416e4b9507095731a6d7276878fe8" }, "tmux-status.nvim": { "branch": "main", "commit": "d985ba67132269dedc9a5f6479f2d40f10e06315" }, "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, "vim-abolish": { "branch": "master", "commit": "dcbfe065297d31823561ba787f51056c147aa682" }, - "vim-test": { "branch": "master", "commit": "1eeb12774a0f251571700ccf68da27789b2f0852" }, + "vim-test": { "branch": "master", "commit": "e4d4fa7f5ce354e7df473550080d9e78207ef4a0" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/_blink.lua b/lua/_blink.lua index b9dd1cb..6b53231 100644 --- a/lua/_blink.lua +++ b/lua/_blink.lua @@ -14,12 +14,20 @@ plugin({ }, -- (Default) Only show the documentation popup when manually triggered - completion = { documentation = { auto_show = true } }, + completion = { + list = { + selection = { + preselect = false, + auto_select = false, + }, + }, + documentation = { auto_show = true }, + }, -- Default list of enabled providers defined so that you can extend it -- elsewhere in your config, without redefining it, due to `opts_extend` sources = { - default = { "obsidian", "obsidian_new", "obsidian_tags", "lsp", "path", "snippets", "buffer", "copilot" }, + default = { "lsp", "path", "snippets", "buffer", "copilot" }, -- default = { "obsidian", "obsidian_new", "obsidian_tags", "lsp", "path", "snippets", "buffer" }, providers = { snippets = { diff --git a/lua/_claude.lua b/lua/_claude.lua new file mode 100644 index 0000000..63f70ed --- /dev/null +++ b/lua/_claude.lua @@ -0,0 +1,15 @@ +plugin({ + "greggh/claude-code.nvim", + dependencies = { + "nvim-lua/plenary.nvim", -- Required for git operations + }, + config = function() + require("claude-code").setup({ + shell = { + separator = ";", -- Command separator used in shell commands + pushd_cmd = "enter", -- Command to push directory onto stack (e.g., 'pushd' for bash/zsh, 'enter' for nushell) + popd_cmd = "exit", -- Command to pop directory from stack (e.g., 'popd' for bash/zsh, 'exit' for nushell) + }, + }) + end, +}) diff --git a/lua/_git.lua b/lua/_git.lua new file mode 100644 index 0000000..9059dfb --- /dev/null +++ b/lua/_git.lua @@ -0,0 +1,7 @@ +plugin({ + "FabijanZulj/blame.nvim", + lazy = false, + config = function() + require("blame").setup({}) + end, +}) diff --git a/lua/_lsp.lua b/lua/_lsp.lua index 2917544..9416cc2 100644 --- a/lua/_lsp.lua +++ b/lua/_lsp.lua @@ -15,3 +15,4 @@ plugin({ -- vim.lsp.enable("lexical") vim.lsp.enable("pyright") +vim.lsp.enable("ts_ls") diff --git a/lua/_notes.lua b/lua/_notes.lua new file mode 100644 index 0000000..ddbe5d9 --- /dev/null +++ b/lua/_notes.lua @@ -0,0 +1,52 @@ +-- plugin({ +-- "rebelot/kanagawa.nvim", -- neorg needs a colorscheme with treesitter support +-- config = function() +-- vim.cmd.colorscheme("kanagawa") +-- end, +-- }) + +plugin({ + "nvim-neorg/neorg", + lazy = false, + version = "*", + config = function() + require("neorg").setup({ + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + notes = "~/notes/general", + quikserve = "~/notes/quikserve", + personal = "~/notes/personal", + }, + default_workspace = "notes", + }, + }, + }, + }) + + vim.wo.foldlevel = 99 + vim.wo.conceallevel = 2 + end, +}) + +map("n", "n", ":Neorg index", { desc = "Neorg index" }) +map("n", "nn", ":Neorg", { desc = "Neorg index" }) +map("n", "nj", ":Neorg journal", { desc = "Neorg index" }) +map("n", "nt", ":Neorg journal today", { desc = "Neorg index" }) +map("n", "ni", ":Neorg index", { desc = "Neorg index" }) +map("n", "nr", ":Neorg return", { desc = "Neorg return" }) +map("n", "nw", function() + neorg = require("neorg") + local workspaces = {} + for k, v in pairs(neorg.config.modules["core.dirman"].workspaces) do + table.insert(workspaces, k) -- Inserts the key 'k' into the list + end + vim.ui.select(workspaces, {}, function(item) + if item ~= nil then + neorg.modules.loaded_modules["core.dirman"].public.open_workspace(item) + end + end) +end, { desc = "Neorg index" }) diff --git a/lua/_obsidian.lua b/lua/_obsidian.lua deleted file mode 100644 index c79555f..0000000 --- a/lua/_obsidian.lua +++ /dev/null @@ -1,104 +0,0 @@ -vim.opt.conceallevel = 1 - -plugin({ - "obsidian-nvim/obsidian.nvim", - version = "*", -- recommended, use latest release instead of latest commit - lazy = false, - ft = "markdown", - -- Replace the above line with this if you only want to load obsidian.nvim for markdown files in your vault: - -- event = { - -- -- If you want to use the home shortcut '~' here you need to call 'vim.fn.expand'. - -- -- E.g. "BufReadPre " .. vim.fn.expand "~" .. "/my-vault/*.md" - -- -- refer to `:h file-pattern` for more examples - -- "BufReadPre path/to/my-vault/*.md", - -- "BufNewFile path/to/my-vault/*.md", - -- }, - dependencies = { - -- Required. - "nvim-lua/plenary.nvim", - - -- see below for full list of optional dependencies 👇 - }, - opts = { - legacy_commands = false, - workspaces = { - { - name = "personal", - path = "~/Documents/obsidian/Personal", - }, - { - name = "Quikserve", - path = "~/Documents/obsidian/Quikserve", - }, - { - name = "Visage", - path = "~/Documents/obsidian/Visage", - }, - }, - notes_subdir = "notes", - new_notes_location = "notes_subdir", - note_id_func = function(title) - -- Create note IDs in a Zettelkasten format with a timestamp and a suffix. - -- In this case a note with the title 'My new note' will be given an ID that looks - -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'. - -- You may have as many periods in the note ID as you'd like—the ".md" will be added automatically - local suffix = "" - if title ~= nil then - -- If title is given, transform it into valid file name. - suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower() - else - -- If title is nil, just add 4 random uppercase letters to the suffix - for _ = 1, 4 do - suffix = suffix .. string.char(math.random(65, 90)) - end - end - prefix = os.date("%Y%m%d%H%M") - return tostring(prefix .. "-" .. suffix) - end, - daily_notes = { - -- Optional, if you keep daily notes in a separate directory. - folder = "dailies", - -- Optional, if you want to change the date format for the ID of daily notes. - date_format = "%Y-%m-%d", - -- Optional, if you want to change the date format of the default alias of daily notes. - alias_format = "%B %-d, %Y", - -- Optional, default tags to add to each new daily note created. - default_tags = { "daily-notes" }, - -- Optional, if you want to automatically insert a template from your template directory like 'daily.md' - template = "daily", - }, - templates = { - folder = "templates", - date_format = "%Y-%m-%d-%a", - time_format = "%H:%M", - }, - completion = { - blink = true, - }, - picker = { - -- Set your preferred picker. Can be one of 'telescope.nvim', 'fzf-lua', or 'mini.pick'. - name = "snacks.pick", - -- Optional, configure key mappings for the picker. These are the defaults. - -- Not all pickers support all mappings. - note_mappings = { - -- Create a new note from your query. - new = "", - -- Insert a link to the selected note. - insert_link = "", - }, - tag_mappings = { - -- Add tag(s) to current note. - tag_note = "", - -- Insert a tag at the current location. - insert_tag = "", - }, - }, - }, -}) - -map("n", "ot", ":Obsidian today", { desc = "Today Note" }) -map("n", "on", ":Obsidian new", { desc = "New Note" }) -map("n", "oN", ":Obsidian new_from_template", { desc = "New From Template" }) -map("n", "ow", ":Obsidian workspace", { desc = "Change Workspace" }) -map("n", "oo", "::Obsidian quick_switch", { desc = "Find Note" }) -map("n", "os", "!./sync.sh", { desc = "Sync" }) diff --git a/lua/_snacks.lua b/lua/_snacks.lua index e5ff454..6405ff8 100644 --- a/lua/_snacks.lua +++ b/lua/_snacks.lua @@ -71,7 +71,7 @@ plugin({ desc = "Grep", }, { - "n", + "N", function() Snacks.picker.notifications() end, @@ -260,13 +260,6 @@ plugin({ end, desc = "Select Scratch Buffer", }, - { - "n", - function() - Snacks.notifier.show_history() - end, - desc = "Notification History", - }, { "cR", function() diff --git a/lua/_tea.lua b/lua/_tea.lua new file mode 100644 index 0000000..e96e5e8 --- /dev/null +++ b/lua/_tea.lua @@ -0,0 +1,26 @@ +plugin({ + "folke/snacks.nvim", + dependencies = { + "sbulav/snacks-tea.nvim", + }, + opts = { + tea = { + enabled = true, + tea = { + cmd = "tea", -- Path to tea binary + login = nil, -- Specific login to use (nil = auto-detect) + remote = "origin", -- Git remote to use + }, + }, + }, +}) + +map("n", "gp", function() + Snacks.tea.pr() +end, { desc = "Tea Pull Requests (open)" }) +map("n", "gP", function() + Snacks.tea.pr({ state = "all" }) +end, { desc = "Tea Pull Requests (all)" }) +map("n", "gc", function() + Snacks.tea.pr_create({}) +end, { desc = "Tea Create Pull Request" }) diff --git a/lua/_treesitter.lua b/lua/_treesitter.lua index 41c7e8f..df1aa5f 100644 --- a/lua/_treesitter.lua +++ b/lua/_treesitter.lua @@ -18,6 +18,10 @@ plugin({ "python", "markdown", "markdown_inline", + "vimdoc", + "c", + "vim", + "query", }, highlight = { enable = true }, indent = { enable = true }, diff --git a/lua/editor.lua b/lua/editor.lua index bebbdcf..dfe5ed0 100644 --- a/lua/editor.lua +++ b/lua/editor.lua @@ -31,6 +31,12 @@ vim.opt.fillchars = { eob = " " } vim.o.undofile = true +--- transparent background +vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) +vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +-- Optional: also make the border of floating windows transparent +vim.api.nvim_set_hl(0, "FloatBorder", { bg = "none" }) + plugin({ "folke/which-key.nvim", event = "VeryLazy", @@ -76,19 +82,6 @@ plugin({ map("n", "tt", ":TestNearest", { desc = "Test Nearest" }) -plugin({ - "kelly-lin/ranger.nvim", - config = function() - require("ranger-nvim").setup({ replace_netrw = true }) - vim.api.nvim_set_keymap("n", "ff", "", { - noremap = true, - callback = function() - require("ranger-nvim").open(true) - end, - }) - end, -}) - plugin({ "rachartier/tiny-inline-diagnostic.nvim", event = "VeryLazy", -- Or `LspAttach` diff --git a/lua/format.lua b/lua/format.lua index 60081de..74f5989 100644 --- a/lua/format.lua +++ b/lua/format.lua @@ -10,6 +10,7 @@ plugin({ css = { "prettier" }, html = { "prettier" }, html = { "prettier" }, + typescript = { "deno_fmt" }, heex = { "mix" }, nix = { "nixfmt" }, json = { "prettier" }, diff --git a/lua/plugins/dankcolors.lua b/lua/plugins/dankcolors.lua new file mode 100644 index 0000000..563d188 --- /dev/null +++ b/lua/plugins/dankcolors.lua @@ -0,0 +1,91 @@ +return { + { + "RRethy/base16-nvim", + priority = 1000, + config = function() + require('base16-colorscheme').setup({ + base00 = '#131313', + base01 = '#131313', + base02 = '#5c6370', + base03 = '#5c6370', + base04 = '#abb2bf', + base05 = '#ffffff', + base06 = '#ffffff', + base07 = '#ffffff', + base08 = '#e05f92', + base09 = '#e05f92', + base0A = '#ffc29e', + base0B = '#abe086', + base0C = '#997050', + base0D = '#ffc29e', + base0E = '#b56254', + base0F = '#b56254', + }) + + vim.api.nvim_set_hl(0, 'Visual', { + bg = '#5c6370', + fg = '#ffffff', + bold = true + }) + vim.api.nvim_set_hl(0, 'Statusline', { + bg = '#ffc29e', + fg = '#131313', + }) + vim.api.nvim_set_hl(0, 'LineNr', { fg = '#5c6370' }) + vim.api.nvim_set_hl(0, 'CursorLineNr', { fg = '#997050', bold = true }) + + vim.api.nvim_set_hl(0, 'Statement', { + fg = '#b56254', + bold = true + }) + vim.api.nvim_set_hl(0, 'Keyword', { link = 'Statement' }) + vim.api.nvim_set_hl(0, 'Repeat', { link = 'Statement' }) + vim.api.nvim_set_hl(0, 'Conditional', { link = 'Statement' }) + + vim.api.nvim_set_hl(0, 'Function', { + fg = '#ffc29e', + bold = true + }) + vim.api.nvim_set_hl(0, 'Macro', { + fg = '#ffc29e', + italic = true + }) + vim.api.nvim_set_hl(0, '@function.macro', { link = 'Macro' }) + + vim.api.nvim_set_hl(0, 'Type', { + fg = '#997050', + bold = true, + italic = true + }) + vim.api.nvim_set_hl(0, 'Structure', { link = 'Type' }) + + vim.api.nvim_set_hl(0, 'String', { + fg = '#abe086', + italic = true + }) + + vim.api.nvim_set_hl(0, 'Operator', { fg = '#abb2bf' }) + vim.api.nvim_set_hl(0, 'Delimiter', { fg = '#abb2bf' }) + vim.api.nvim_set_hl(0, '@punctuation.bracket', { link = 'Delimiter' }) + vim.api.nvim_set_hl(0, '@punctuation.delimiter', { link = 'Delimiter' }) + + vim.api.nvim_set_hl(0, 'Comment', { + fg = '#5c6370', + italic = true + }) + + local current_file_path = vim.fn.stdpath("config") .. "/lua/plugins/dankcolors.lua" + if not _G._matugen_theme_watcher then + local uv = vim.uv or vim.loop + _G._matugen_theme_watcher = uv.new_fs_event() + _G._matugen_theme_watcher:start(current_file_path, {}, vim.schedule_wrap(function() + local new_spec = dofile(current_file_path) + if new_spec and new_spec[1] and new_spec[1].config then + new_spec[1].config() + print("Theme reload") + end + end)) + end + end + } +} diff --git a/lua/theme.lua b/lua/theme.lua index ffeac21..dd57dd5 100644 --- a/lua/theme.lua +++ b/lua/theme.lua @@ -11,7 +11,9 @@ plugin({ "folke/tokyonight.nvim", lazy = false, priority = 1000, - opts = {}, + opts = { + transparent = true, + }, init = function() vim.cmd([[colorscheme tokyonight-night]]) end,