diff --git a/lazy-lock.json b/lazy-lock.json index 347ace5..1e0d9c8 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -9,35 +9,39 @@ "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "copilot.vim": { "branch": "release", "commit": "4a361e8cf327590d51d214c5c01c6391727390d7" }, + "copilot.vim": { "branch": "release", "commit": "97a9f1af97627b6aebeef864c981539ac1776b69" }, "flash.nvim": { "branch": "main", "commit": "967117690bd677cb7b6a87f0bc0077d2c0be3a27" }, "focus.nvim": { "branch": "master", "commit": "31f41d91b6b331faa07f0a513adcbc37087d028d" }, "friendly-snippets": { "branch": "main", "commit": "bc38057e513458cb2486b6cd82d365fa294ee398" }, + "glow.nvim": { "branch": "main", "commit": "8942dfb05794f436af4fbc90a34393f1fd36f361" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, "indent-blankline.nvim": { "branch": "master", "commit": "4541d690816cb99a7fc248f1486aa87f3abce91c" }, "lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" }, - "lsp-zero.nvim": { "branch": "v2.x", "commit": "73bc33fe9ad5a1d4501536fdd4755b3aa18c3392" }, + "lsp-zero.nvim": { "branch": "v2.x", "commit": "96974fe970c37bd3879ad8b6be4fe7ddfad75680" }, "mason-lspconfig": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "e86a4c84ff35240639643ffed56ee1c4d55f538e" }, "mason-null-ls.nvim": { "branch": "main", "commit": "ae0c5fa57468ac65617f1bf821ba0c3a1e251f0c" }, - "mason.nvim": { "branch": "main", "commit": "fe9e34a9ab4d64321cdc3ecab4ea1809239bb73f" }, + "mason.nvim": { "branch": "main", "commit": "74eac861b013786bf231b204b4ba9a7d380f4bd9" }, "mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" }, "mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" }, + "nabla.nvim": { "branch": "master", "commit": "8c143ad2b3ab3b8ffbd51e238ccfcbd246452a7e" }, "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, - "neodev.nvim": { "branch": "main", "commit": "9f0205a08757711f57589a1dffa8abf525f4a23b" }, + "neodev.nvim": { "branch": "main", "commit": "81a893eb94d502b2cbb08ed3871eeaadfd240131" }, + "neorg": { "branch": "main", "commit": "66e5a4e4ed7645590ac8388abdedb8f840b88f0d" }, + "neorg-telescope": { "branch": "main", "commit": "1310d4aaefd8149c9839bbe1d5610e94389e2f0e" }, "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, "nvim-bqf": { "branch": "main", "commit": "c920a55c6153766bd909e474b7feffa9739f07e8" }, - "nvim-cmp": { "branch": "main", "commit": "c4e491a87eeacf0408902c32f031d802c7eafce8" }, - "nvim-lspconfig": { "branch": "master", "commit": "c0de180ddb3df36feef8ac3607670894d0e7497f" }, + "nvim-cmp": { "branch": "main", "commit": "3b9f28061a67b19cadc13946de981426a6425e4a" }, + "nvim-lspconfig": { "branch": "master", "commit": "7c73a4dc44c3d62ee79ab9f03ba313251c0388d4" }, "nvim-spectre": { "branch": "master", "commit": "5b39919a2947b1266b3aa34d0b0b14c35523bc69" }, "nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" }, - "nvim-treesitter": { "branch": "master", "commit": "d9e75a1736a960a104ff3086fc553a054f51835b" }, + "nvim-treesitter": { "branch": "master", "commit": "d92bfe2cbd86a9c10d814e38ecbe2fb7442da209" }, "nvim-treesitter-context": { "branch": "master", "commit": "3d4ab25056dcaf6dd11ebacf1da8525c8df6550f" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "9e519b6146512c8e2e702faf8ac48420f4f5deec" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "e9062e2dfb9854e6a927370f2d720de354c88524" }, "nvim-ufo": { "branch": "main", "commit": "5be5b800b4f3512bca128f345e9c98574b5637c0" }, - "nvim-web-devicons": { "branch": "master", "commit": "eb8f80f30fd5e9a6176dee5c46661ebd7437ac46" }, - "oil.nvim": { "branch": "master", "commit": "eaa20a6aee7c4df89d80ec8208de63ec2fa4d38a" }, + "nvim-web-devicons": { "branch": "master", "commit": "ab899311f8ae00a47eae8e0879506cead8eb1561" }, + "oil.nvim": { "branch": "master", "commit": "0e5fca35cdc743cf3a448cea1a6251cf25cebafa" }, "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, "promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" }, @@ -47,14 +51,16 @@ "smart-splits.nvim": { "branch": "master", "commit": "7aad6019dee974a01333523a5b8e122b7e7da454" }, "symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, - "telescope.nvim": { "branch": "master", "commit": "5a3fb8a012f9fcf777ba8deeae1c759362413efa" }, + "telescope.nvim": { "branch": "master", "commit": "2d92125620417fbea82ec30303823e3cd69e90e8" }, "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" }, + "venn.nvim": { "branch": "main", "commit": "c114563960b8fb1197695d42798d1f3e7190b798" }, "vim-fugitive": { "branch": "master", "commit": "b3b838d690f315a503ec4af8c634bdff3b200aaf" }, "vim-illuminate": { "branch": "master", "commit": "5ed17582a8e97bf0a0c617c3cf762e98f87b9859" }, "vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" }, "vim-tmux-navigator": { "branch": "master", "commit": "cdd66d6a37d991bba7997d593586fc51a5b37aa8" }, + "vimtex": { "branch": "master", "commit": "877de3ba5de5f766e5bfa1c3fb0d2ecfcd18f868" }, "which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" }, "zen-mode.nvim": { "branch": "main", "commit": "68f554702de63f4b7b6b6d4bcb10178f41a0acc7" } } \ No newline at end of file diff --git a/lua/rayandrew/plugins.lua b/lua/rayandrew/plugins.lua index faa0938..edd9925 100644 --- a/lua/rayandrew/plugins.lua +++ b/lua/rayandrew/plugins.lua @@ -55,8 +55,8 @@ return { "sp", function() local Util = require("rayandrew.util") - local fun = Util.telescope("live_grep") - fun() + local fn = Util.telescope("live_grep") + fn() end, desc = "Find in Files (Grep)", }, @@ -64,10 +64,10 @@ return { "ps", function() local Util = require("rayandrew.util") - local fun = Util.telescope("grep_string", { + local fn = Util.telescope("grep_string", { search = vim.fn.input("Grep > "), }) - fun() + fn() end, desc = "Find in Files (Grep)", }, @@ -75,17 +75,18 @@ return { "bb", function() local Util = require("rayandrew.util") - local fun = Util.telescope("buffers") - fun() + local fn = Util.telescope("buffers") + fn() end, desc = "List all opened buffers", }, { "fF", function() + local utils = require("telescope.utils") local Util = require("rayandrew.util") - local fun = Util.telescope("files") - fun() + local fn = Util.telescope("files", { cwd = utils.buffer_dir() }) + fn() end, desc = "Find Files (root dir)", }, @@ -93,8 +94,8 @@ return { "ff", function() local Util = require("rayandrew.util") - local fun = Util.telescope("files", { cwd = false }) - fun() + local fn = Util.telescope("files", { cwd = false }) + fn() end, desc = "Find Files (cwd)", }, @@ -102,8 +103,8 @@ return { "fh", function() local Util = require("rayandrew.util") - local fun = Util.telescope("files", { cwd = false, hidden = true }) - fun() + local fn = Util.telescope("files", { cwd = false, hidden = true }) + fn() end, desc = "Find Files with Hidden (cwd)", }, @@ -111,8 +112,8 @@ return { "sm", function() local Util = require("rayandrew.util") - local fun = Util.telescope("man_pages") - fun() + local fn = Util.telescope("man_pages") + fn() end, desc = "Find Manual", }, @@ -133,19 +134,19 @@ return { -- previewer = false, -- })) local Util = require("rayandrew.util") - local fun = Util.telescope("current_buffer_fuzzy_find", { + local fn = Util.telescope("current_buffer_fuzzy_find", { winblend = 10, previewer = false, }) - fun() + fn() end, }, { "sd", function() local Util = require("rayandrew.util") - local fun = Util.telescope("diagnostics") - fun() + local fn = Util.telescope("diagnostics") + fn() end, }, }, @@ -175,6 +176,7 @@ return { "html", "javascript", "json", + "latex", "lua", "luadoc", "luap", @@ -474,6 +476,7 @@ return { cmp.setup({ sources = { + { name = "neorg", group_index = 2 }, { name = "nvim_lsp", group_index = 2 }, { name = "path", group_index = 2 }, { name = "luasnip", group_index = 2 }, @@ -594,7 +597,7 @@ return { timeout_ms = 10000, }, servers = { - ["null-ls"] = { "javascript", "typescript", "lua", "python" }, + ["null-ls"] = { "javascript", "typescript", "lua", "python", "nix" }, }, }) @@ -1126,6 +1129,7 @@ return { ["c"] = { name = "+code" }, ["f"] = { name = "+file/find" }, ["g"] = { name = "+git" }, + ["n"] = { name = "+note" }, ["gh"] = { name = "+hunks" }, ["q"] = { name = "+quit/session" }, ["s"] = { name = "+search" }, @@ -1238,4 +1242,180 @@ return { }, keys = { "", "", "", "" }, }, + + ------------------------------ + -- Note Taking + ------------------------------ + + { + "nvim-neorg/neorg", + build = ":Neorg sync-parsers", + dependencies = { + { "nvim-lua/plenary.nvim" }, + { "nvim-neorg/neorg-telescope" }, + }, + cond = function() + return vim.fn.isdirectory(vim.fn.expand("~/Notes")) == 1 + end, + event = "VeryLazy", + cmd = { "Neorg" }, + keys = { + { + "na", + function() + local Util = require("rayandrew.util") + local fn = Util.telescope("files", { + prompt_title = "Neorg", + cwd = "~/Notes", + }) + fn() + end, + desc = "Find Notes", + }, + { + "fn", + function() + vim.cmd("Telescope neorg find_norg_files") + end, + desc = "Find Notes", + }, + { + "nf", + "fn", + desc = "Find Notes", + remap = true, + }, + { + "sn", + function() + local Util = require("rayandrew.util") + local fn = Util.telescope("live_grep", { + prompt_title = "Neorg Grep", + cwd = "~/Notes", + }) + fn() + end, + desc = "Search Notes", + }, + }, + opts = { + load = { + ["core.defaults"] = {}, + ["core.concealer"] = {}, + ["core.dirman"] = { + config = { + workspaces = { + notes = "~/Notes", + }, + default_workspace = "notes", + }, + }, + ["core.completion"] = { + config = { + engine = "nvim-cmp", + }, + }, + ["core.clipboard"] = {}, + ["core.clipboard.code-blocks"] = {}, + ["core.integrations.telescope"] = {}, + }, + }, + config = function(_, opts) + require("neorg").setup(opts) + local neorg_callbacks = require("neorg.core.callbacks") + + neorg_callbacks.on_event("core.keybinds.events.enable_keybinds", function(_, keybinds) + keybinds.map_event_to_mode("norg", { + n = { + { "", "core.integrations.telescope.find_linkable" }, + { "", "core.integrations.telescope.insert_link" }, + { "", "core.integrations.telescope.search_headings" }, + { "", "core.integrations.telescope.insert_file_link" }, + }, + + i = {}, + }, { + silent = true, + noremap = true, + }) + end) + end, + }, + + { + "jbyuki/venn.nvim", + keys = { + { + "nv", + function() + function Toggle_venn() + local venn_enabled = vim.inspect(vim.b.venn_enabled) + if venn_enabled == "nil" then + vim.b.venn_enabled = true + vim.cmd([[setlocal ve=all]]) + -- draw a line on HJKL keystokes + vim.api.nvim_buf_set_keymap(0, "n", "J", "j:VBox", { noremap = true }) + vim.api.nvim_buf_set_keymap(0, "n", "K", "k:VBox", { noremap = true }) + vim.api.nvim_buf_set_keymap(0, "n", "L", "l:VBox", { noremap = true }) + vim.api.nvim_buf_set_keymap(0, "n", "H", "h:VBox", { noremap = true }) + -- draw a box by pressing "f" with visual selection + vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox", { noremap = true }) + else + vim.cmd([[setlocal ve=]]) + vim.cmd([[mapclear ]]) + vim.b.venn_enabled = nil + end + end + + Toggle_venn() + end, + desc = "Open Venn panel", + }, + }, + }, + + { + "ellisonleao/glow.nvim", + config = true, + cmd = "Glow", + ft = "markdown", + keys = { + { + "pm", + "Glow", + desc = "Preview Markdown", + }, + }, + }, + + { + "jbyuki/nabla.nvim", + lazy = true, + -- ft = { "tex", "latex", "markdown" }, + -- opts = { + -- autogen = true, -- auto-regenerate ASCII art when exiting insert mode + -- silent = true, -- silents error messages + -- }, + -- config = function() + -- local nabla = require("nabla") + -- nabla.enable_virt() + -- end, + keys = { + { + "pe", + function() + require("nabla").toggle_virt() + end, + desc = "Preview Math Equation", + }, + }, + }, + + { + "lervag/vimtex", + config = function() + -- vim.g.vimtex_compiler_progname = "nvr" + -- vim.g.vimtex_view_method = "zathura" + end, + }, } diff --git a/lua/rayandrew/remap.lua b/lua/rayandrew/remap.lua index 86bd0ca..1fb6607 100644 --- a/lua/rayandrew/remap.lua +++ b/lua/rayandrew/remap.lua @@ -6,7 +6,7 @@ local Util = require("rayandrew.util") Util.map("n", "fs", "w", { desc = "Save file" }) -Util.map({ "i", "v", "n", "s" }, "", "w", { desc = "Save file" }) +-- Util.map({ "i", "v", "n", "s" }, "", "w", { desc = "Save file" }) -- Move Lines Util.map("n", "", "m .+1==", { desc = "Move down" })