diff --git a/lazy-lock.json b/lazy-lock.json index 8aedb47..c2ee85f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,17 +1,17 @@ { "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, - "auto-session": { "branch": "main", "commit": "dcbc339a1a0e6505f755d980ad11f892b6a8d492" }, + "auto-session": { "branch": "main", "commit": "62437532b38495551410b3f377bcf4aaac574ebe" }, "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" }, + "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" }, "folkeTokyonight": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "fzy-lua-native": { "branch": "master", "commit": "9d720745d5c2fb563c0d86c17d77612a3519c506" }, "git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" }, - "gitsigns.nvim": { "branch": "main", "commit": "1ce96a464fdbc24208e24c117e2021794259005d" }, - "gruvbox.nvim": { "branch": "main", "commit": "a472496e1a4465a2dd574389dcf6cdb29af9bf1b" }, + "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" }, + "gruvbox.nvim": { "branch": "main", "commit": "334d5fd49fc8033f26408425366c66c6390c57bb" }, "harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" }, "img-clip.nvim": { "branch": "main", "commit": "b6ddfb97b5600d99afe3452d707444afda658aca" }, "incline.nvim": { "branch": "main", "commit": "8b54c59bcb23366645ae10edca6edfb9d3a0853e" }, @@ -19,46 +19,46 @@ "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lspkind.nvim": { "branch": "master", "commit": "c7274c48137396526b59d86232eabcdc7fed8a32" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "ae609525ddf01c153c39305730b1791800ffe4fe" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "a979821a975897b88493843301950c456a725982" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, - "mini.comment": { "branch": "main", "commit": "a0c721115faff8d05505c0a12dab410084d9e536" }, - "mini.files": { "branch": "main", "commit": "fafacfecdd6c5a66bb10d173a749f3c098e84498" }, - "mini.nvim": { "branch": "main", "commit": "e5a9a3830f9c37211df4c82cac45bf728b95739d" }, - "mini.splitjoin": { "branch": "main", "commit": "9fcd8856efb95a505090c3225726466494076127" }, - "mini.surround": { "branch": "main", "commit": "d648a5601e1c48f175b07d10eba141da338a0a2a" }, - "mini.trailspace": { "branch": "main", "commit": "f8083ca969e1b2098480c10f3c3c4d2ce3586680" }, + "mini.comment": { "branch": "main", "commit": "597d32ed2c9fbfbf9a250bec7c6b9035f71214f5" }, + "mini.files": { "branch": "main", "commit": "b4796e09eb103f9f2d1e00aa2dab3753b879b17b" }, + "mini.nvim": { "branch": "main", "commit": "59f09943573c5348ca6c88393fa09ce3b66a7818" }, + "mini.splitjoin": { "branch": "main", "commit": "8112e794cbb022b9d4b7af60b64e9896930f1697" }, + "mini.surround": { "branch": "main", "commit": "d205d1741d1fcc1f3117b4e839bf00f74ad72fa2" }, + "mini.trailspace": { "branch": "main", "commit": "27acb69562a4742256ab3e4b0127391fcb49dbb3" }, "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, - "nvim-colorizer.lua": { "branch": "master", "commit": "338409dd8a6ed74767bad3eb5269f1b903ffb3cf" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "85a5e83cd4daa258cf95c3204e277991d6fbe747" }, "nvim-emmet": { "branch": "main", "commit": "cde4fb2968704aae5c18b7f8a9bc2508767bb78d" }, - "nvim-lint": { "branch": "master", "commit": "bcd1a44edbea8cd473af7e7582d3f7ffc60d8e81" }, + "nvim-lint": { "branch": "master", "commit": "606b823a57b027502a9ae00978ebf4f5d5158098" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "b9c795d3973e8eec22706af14959bc60c579e771" }, - "nvim-lspconfig": { "branch": "master", "commit": "66fd02ad1c7ea31616d3ca678fa04e6d0b360824" }, - "nvim-treesitter": { "branch": "main", "commit": "45a07f869b0cffba342276f2c77ba7c116d35db8" }, + "nvim-lspconfig": { "branch": "master", "commit": "841c6d4139aedb8a3f2baf30cef5327371385b93" }, + "nvim-treesitter": { "branch": "main", "commit": "e5f65e31a5ec0e8526b2311ff8c7aaea4a581c82" }, "nvim-ts-autotag": { "branch": "main", "commit": "8e1c0a389f20bf7f5b0dd0e00306c1247bda2595" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, - "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, - "oil.nvim": { "branch": "master", "commit": "f55b25e493a7df76371cfadd0ded5004cb9cd48a" }, + "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" }, + "oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "render-markdown.nvim": { "branch": "main", "commit": "48b4175dbca8439d30c1f52231cbe5a712c8f9d9" }, + "render-markdown.nvim": { "branch": "main", "commit": "e3c18ddd27a853f85a6f513a864cf4f2982b9f26" }, "rose-pine": { "branch": "main", "commit": "cf2a288696b03d0934da713d66c6d71557b5c997" }, "showkeys": { "branch": "main", "commit": "cb0a50296f11f1e585acffba8c253b9e8afc1f84" }, - "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, + "snacks.nvim": { "branch": "main", "commit": "ad9ede6a9cddf16cedbd31b8932d6dcdee9b716e" }, "solarized-osaka.nvim": { "branch": "main", "commit": "f0c2f0ba0bd56108d53c9bfae4bb28ff6c67bbdb" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, "telescope-themes": { "branch": "main", "commit": "65721365bd7a04a6c9679e76b6387b60320fd5f3" }, - "telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, + "telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" }, "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, - "undotree": { "branch": "master", "commit": "fc28931fbfba66ab75d9af23fe46ffbbb9de6e8c" }, + "undotree": { "branch": "master", "commit": "6fa6b57cda8459e1e4b2ca34df702f55242f4e4d" }, "vim-be-good": { "branch": "master", "commit": "0ae3de14eb8efc6effe7704b5e46495e91931cc5" }, - "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, + "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" }, "vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }, "vim-tmux-navigator": { "branch": "master", "commit": "e41c431a0c7b7388ae7ba341f01a0d217eb3a432" }, "wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" } diff --git a/lua/themenacesauce/core/keymaps.lua b/lua/themenacesauce/core/keymaps.lua index f4a6a0e..45b702f 100644 --- a/lua/themenacesauce/core/keymaps.lua +++ b/lua/themenacesauce/core/keymaps.lua @@ -17,7 +17,7 @@ vim.keymap.set("v", "<", "", ">gv", opts) -- Paste without replacing clipboard content by x. -vim.keymap.set("x","p", [["_dP]]) +vim.keymap.set("x", "p", [["_dP]]) -- tab stuff vim.keymap.set("n", "to", "tabnew") --open new tab @@ -38,23 +38,30 @@ vim.keymap.set("n", "sx", "close", { desc = "Close current spli -- vim tmux settings local M = {} M.general = { - n = { - [""] = { " TmuxNavigateLeft", "window left"}, - [""] = { " TmuxNavigateRight", "window right"}, - [""] = { " TmuxNavigateDown", "window down"}, - [""] = { " TmuxNavigateUp", "window up"}, -} + n = { + [""] = { " TmuxNavigateLeft", "window left" }, + [""] = { " TmuxNavigateRight", "window right" }, + [""] = { " TmuxNavigateDown", "window down" }, + [""] = { " TmuxNavigateUp", "window up" }, + } } +-- ctrl c as escape cuz Im lazy to reach up to the esc key +vim.keymap.set("i", "", "") +vim.keymap.set("n", "", ":nohl", { desc = "Clear search hl", silent = true }) +-- format without prettier using the built in +vim.keymap.set("n", "f", vim.lsp.buf.format) + + -- Replace the word cursor is on globally vim.keymap.set("n", "s", [[:%s/\<\>//gI]], { desc = "Replace word cursor is on globally" }) -- Copy filepath to the clipboard vim.keymap.set("n", "fp", function() - local filePath = vim.fn.expand("%:~") -- Gets the file path relative to the home directory - vim.fn.setreg("+", filePath) -- Copy the file path to the clipboard register - print("File path copied to clipboard: " .. filePath) + local filePath = vim.fn.expand("%:~") -- Gets the file path relative to the home directory + vim.fn.setreg("+", filePath) -- Copy the file path to the clipboard register + print("File path copied to clipboard: " .. filePath) end, { desc = "Copy file path to clipboard" }) -- Toggle LSP diagnostics visibility diff --git a/lua/themenacesauce/plugins/formatting.lua b/lua/themenacesauce/plugins/formatting.lua index 2c5de5c..56be7fa 100644 --- a/lua/themenacesauce/plugins/formatting.lua +++ b/lua/themenacesauce/plugins/formatting.lua @@ -1,14 +1,14 @@ return { "stevearc/conform.nvim", event = { "BufReadPre", "BufNewFile" }, - config = function () + config = function() local conform = require("conform") conform.setup({ formatters = { ["markdown-toc"] = { condition = function(_, ctx) - for _, line in ipairs(vim.api.nvim_get_buf_lines(ctx.buf, 0, -1, false)) do + for _, line in ipairs(vim.api.nvim_get_buf_lines(ctx.buf, 0, -1, false)) do if line:find("") then return true end @@ -59,7 +59,7 @@ return { conform.formatters.shfmt = { prepend_args = { "-i", "4" } } - vim.keymap.set({ "n", "v"}, "mp", function() + vim.keymap.set({ "n", "v" }, "mp", function() conform.format({ lsp_fallback = true, async = false, diff --git a/lua/themenacesauce/plugins/lsp/mason.lua b/lua/themenacesauce/plugins/lsp/mason.lua index ea1b8ca..7bbaeb1 100644 --- a/lua/themenacesauce/plugins/lsp/mason.lua +++ b/lua/themenacesauce/plugins/lsp/mason.lua @@ -34,7 +34,7 @@ return { -- servers for mason to install ensure_installed = { "lua_ls", - -- "ts_ls" currently us a ts plugin + "ts_ls", --currently us a ts plugin "html", "cssls", "tailwindcss", @@ -50,7 +50,7 @@ return { mason_tool_installer.setup({ ensure_installed = { "prettier", - "stylua", -- + "stylua", -- "isort", "pylint", "clangd", diff --git a/lua/themenacesauce/plugins/mini.lua b/lua/themenacesauce/plugins/mini.lua index c9bf132..a86f104 100644 --- a/lua/themenacesauce/plugins/mini.lua +++ b/lua/themenacesauce/plugins/mini.lua @@ -1,119 +1,127 @@ return { - -- Mini Nvim - {"echasnovski/mini.nvim", version = false }, - - { - 'echasnovski/mini.comment', - version = false, - dependencies = { - "JoosepAlviste/nvim-ts-context-commentstring", - }, - config = function() - --disable the autocommand from ts-context-commentstring - require('ts_context_commentstring').setup { - enable_autocmd = false, - } - require("mini.comment").setup { - --tsx, jsx, html, svelte comment support - options = { - custom_commentstring = function() - return require('ts_context_commentstring.internal').calculate_commentstring({ key = - 'commentstring' }) - or vim.bo.commentstring - end, - }, - } - end, + -- Mini Nvim + {"echasnovski/mini.nvim", version = false }, + -- Comments + { + 'echasnovski/mini.comment', + version = false, + dependencies = { + "JoosepAlviste/nvim-ts-context-commentstring", }, - - -- File Explorer (works wil Oil File Explorer) - { - 'echasnovski/mini.files', - config = function() - local MiniFiles = require("mini.files") - MiniFiles.setup({ - mappings = { - go_in = "", -- Map both Enter and L to enter directories or open files - go_in_plus = "L", --Open - go_out = "-", --Previous folder - go_out_plus = "H", --Close folder - }, - }) - vim.keymap.set("n", "ee", "lua MiniFiles.open()", { desc = "Toggle mini file explorer" }) -- toggle file explorer - vim.keymap.set("n", "ef", function() - MiniFiles.open(vim.api.nvim_buf_get_name(0), false) - MiniFiles.reveal_cwd() - end, { desc = "Toggle into currently opened file" }) + config = function() + -- disable the autocommand from ts-context-commentstring + require('ts_context_commentstring').setup { + enable_autocmd = false, + } + + require("mini.comment").setup { + -- tsx, jsx, html , svelte comment support + options = { + custom_commentstring = function() + return require("ts_context_commentstring.internal").calculate_commentstring() or vim.bo.commentstring + end, + }, + } end + }, + -- File explorer (this works properly with oil unlike nvim-tree) + { + 'echasnovski/mini.files', + config = function() + local MiniFiles = require("mini.files") + MiniFiles.setup({ + mappings = { + go_in = "", -- Map both Enter and L to enter directories or open files + go_in_plus = "L", + go_out = "-", + go_out_plus = "H", + }, + }) + vim.keymap.set("n", "ee", "lua MiniFiles.open()", { desc = "Toggle mini file explorer" }) -- toggle file explorer + vim.keymap.set("n", "ef", function() + MiniFiles.open(vim.api.nvim_buf_get_name(0), false) + MiniFiles.reveal_cwd() + end, { desc = "Toggle into currently opened file" }) + end, + }, + -- Surround + { + "echasnovski/mini.surround", + event = { "BufReadPre", "BufNewFile" }, + opts = { + -- Add custom surroundings to be used on top of builtin ones. For more + -- information with examples, see `:h MiniSurround.config`. + custom_surroundings = nil, + + -- Duration (in ms) of highlight when calling `MiniSurround.highlight()` + highlight_duration = 300, + + -- Module mappings. Use `''` (empty string) to disable one. + -- INFO: + -- saiw surround with no whitespace + -- saw surround with whitespace + mappings = { + add = 'sa', -- Add surrounding in Normal and Visual modes + delete = 'ds', -- Delete surrounding + find = 'sf', -- Find surrounding (to the right) + find_left = 'sF', -- Find surrounding (to the left) + highlight = 'sh', -- Highlight surrounding + replace = 'sr', -- Replace surrounding + update_n_lines = 'sn', -- Update `n_lines` + + suffix_last = 'l', -- Suffix to search with "prev" method + suffix_next = 'n', -- Suffix to search with "next" method + }, + + -- Number of lines within which surrounding is searched + n_lines = 20, + + -- Whether to respect selection type: + -- - Place surroundings on separate lines in linewise mode. + -- - Place surroundings on each line in blockwise mode. + respect_selection_type = false, + + -- How to search for surrounding (first inside current line, then inside + -- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev', + -- 'cover_or_nearest', 'next', 'prev', 'nearest'. For more details, + -- see `:h MiniSurround.config`. + search_method = 'cover', + + -- Whether to disable showing non-error feedback + silent = false, }, - { - 'echasnovski/mini.surround', - event = { "BufReadPre", "BufNewFile" }, - opts = { - custom_surroundings = nil, + }, + -- Get rid of whitespace + { + "echasnovski/mini.trailspace", + event = { "BufReadPost", "BufNewFile" }, + config = function() + local miniTrailspace = require("mini.trailspace") - highlight_duration = 300, + miniTrailspace.setup({ + only_in_normal_buffers = true, + }) + vim.keymap.set("n", "cw", function() miniTrailspace.trim() end, { desc = "Erase Whitespace" }) - -- INFO: - --saiw surround with no whitespace - --saw surround with whitespace - mappings = { - add = 'sa', - delete = 'ds', - find = 'sf', - find_left = 'sF', - highlight = 'sh', - replace = 'sr', - update_n_lines = 'sn', - - suffix_last = 'l', -- Suffix to search with "previous" method - suffix_next = 'n', -- Suffix to search with "next" method - }, - - n_lines = 20, - - respect_selection_type = false, - - - search_method = 'cover', - - silent = false, - }, - - -- Get rid of whitespace - { - "echasnovski/mini.trailspace", - event = { "BufReadPost", "BufNewFile" }, - config = function() - local miniTrailspace = require("mini.trailspace") - - miniTrailspace.setup({ - only_in_normal_buffers = true, - }) - - vim.keymap.set("n", "cw", function() miniTrailspace.trim() end, { desc = "Erase Whitespace" }) - - vim.api.nvim_create_autocmd("CursorMoved", { - pattern = "*", - callback = function() - require("mini.trailspace").unhighlight() - end, - }) - end - }, - { - "echasnovski/mini.splitjoin", - config = function() - local miniSplitJoin = require("mini.splitjoin") - - miniSplitJoin.setup({ - mappings = { toggle = ""}, - }) - - vim.keymap.set({ "n", "x", }, "sj", function() miniSplitJoin.join() end, { desc = "Join arguments" }) - vim.keymap.set({ "n", "x", }, "sk", function() miniSplitJoin.split() end, { desc = "Split arguments"}) - end, - } + -- Ensure highlight never reappears by removing it on CursorMoved + vim.api.nvim_create_autocmd("CursorMoved", { + pattern = "*", + callback = function() + require("mini.trailspace").unhighlight() + end, + }) + end, + }, + -- Split & join + { + "echasnovski/mini.splitjoin", + config = function() + local miniSplitJoin = require("mini.splitjoin") + miniSplitJoin.setup({ + mappings = { toggle = "" }, -- Disable default mapping + }) + vim.keymap.set({ "n", "x" }, "sj", function() miniSplitJoin.join() end, { desc = "Join arguments" }) + vim.keymap.set({ "n", "x" }, "sk", function() miniSplitJoin.split() end, { desc = "Split arguments" }) + end, + }, } -} - diff --git a/lua/themenacesauce/plugins/tailwind-tools.lua b/lua/themenacesauce/plugins/tailwind-tools.lua index 33c4385..ab69bdb 100644 --- a/lua/themenacesauce/plugins/tailwind-tools.lua +++ b/lua/themenacesauce/plugins/tailwind-tools.lua @@ -19,7 +19,7 @@ return { }) vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, { callback = function() - vim.cmd("ColorizerAttachToBuffer") + -- vim.cmd("ColorizerAttachToBuffer") end, }) end