diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index 962341f..08b5f87 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -1,6 +1,7 @@ { "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, "aerial.nvim": { "branch": "master", "commit": "ddd25f57e5205b36bc2e939c486b47818bef9ec3" }, + "catppuccin": { "branch": "main", "commit": "637d99e638bc6f1efedac582f6ccab08badac0c6" }, "ccc.nvim": { "branch": "main", "commit": "4fb5abaef2f2e0540fe22d4d74a9841205fff9e4" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, @@ -20,7 +21,7 @@ "friendly-snippets": { "branch": "main", "commit": "45a1b96e46efe5fce8af325d4bed45feb9d29d0f" }, "gitsigns.nvim": { "branch": "main", "commit": "e9c4187c3774a46df2d086a66cf3a7e6bea4c432" }, "grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" }, - "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, + "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, "lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, "lualine.nvim": { "branch": "master", "commit": "6a40b530539d2209f7dc0492f3681c8c126647ad" }, @@ -34,7 +35,6 @@ "neogit": { "branch": "master", "commit": "a20031fb5d7d12148764764059243135085e5c9b" }, "noice.nvim": { "branch": "main", "commit": "6263b6696811f0b11c88d8d2371134b1cc1762fc" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim": { "branch": "main", "commit": "7946d1a195c66fed38b3e34f9fa8e0c5a2da0700" }, "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, "nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" }, "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, diff --git a/config/nvim/lua/aleidk/plugins-base/indent-blankline.lua b/config/nvim/lua/aleidk/plugins-base/indent-blankline.lua index 95b4c4f..f529305 100644 --- a/config/nvim/lua/aleidk/plugins-base/indent-blankline.lua +++ b/config/nvim/lua/aleidk/plugins-base/indent-blankline.lua @@ -1,7 +1,7 @@ return { -- Add indentation guides even on blank lines "lukas-reineke/indent-blankline.nvim", - event = { "BufReadPost", "BufNewFile" }, + dependencies = { "nvim-treesitter/nvim-treesitter" }, main = "ibl", opts = { -- char = "▏", diff --git a/config/nvim/lua/aleidk/plugins-base/treesitter.lua b/config/nvim/lua/aleidk/plugins-base/treesitter.lua index 1d1111d..870f442 100644 --- a/config/nvim/lua/aleidk/plugins-base/treesitter.lua +++ b/config/nvim/lua/aleidk/plugins-base/treesitter.lua @@ -36,30 +36,24 @@ return { move = { enable = true, set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - ["]m"] = "@function.outer", - ["]]"] = "@class.outer", + goto_previous = { -- current or last start of object + ["[["] = { query = "@local.scope", query_group = "locals", desc = "Next scope" }, + ["[f"] = "@function.outer", + ["[c"] = "@class.outer", }, - goto_next_end = { - ["]M"] = "@function.outer", - ["]["] = "@class.outer", - }, - goto_previous_start = { - ["[m"] = "@function.outer", - ["[["] = "@class.outer", - }, - goto_previous_end = { - ["[M"] = "@function.outer", - ["[]"] = "@class.outer", + goto_next = { -- next object end + ["]]"] = { query = "@local.scope", query_group = "locals", desc = "Next scope" }, + ["]f"] = "@function.outer", -- current function end + ["]c"] = "@class.outer", }, }, swap = { enable = true, swap_next = { - ["a"] = "@parameter.inner", + ["ln"] = "@parameter.inner", }, swap_previous = { - ["A"] = "@parameter.inner", + ["lN"] = "@parameter.inner", }, }, }, @@ -70,6 +64,23 @@ return { enable_autocmd = false, } + 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) + + -- 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 }) + + vim.keymap.set("n", "[u", function() + require("treesitter-context").go_to_context() + end, { silent = true, noremap = true, desc = "Go up when context is out of view" }) + vim.opt.foldmethod = "expr" vim.opt.foldexpr = "nvim_treesitter#foldexpr()" diff --git a/config/nvim/lua/aleidk/plugins-base/ui.lua b/config/nvim/lua/aleidk/plugins-base/ui.lua index 0fd279f..1ef7277 100644 --- a/config/nvim/lua/aleidk/plugins-base/ui.lua +++ b/config/nvim/lua/aleidk/plugins-base/ui.lua @@ -42,12 +42,26 @@ return { }, routes = { { - filter = { - event = "msg_show", - kind = "", - find = "written", - }, + -- Don't show these messages opts = { skip = true }, + filter = { + any = { + { + event = "msg_show", + kind = "search_count", + }, + { + event = "msg_show", + kind = "", + find = "written", + }, + { + event = "msg_show", + kind = "", + find = "yazi.nvim", + }, + } + }, }, { filter = { diff --git a/config/nvim/lua/aleidk/plugins-core/colorscheme.lua b/config/nvim/lua/aleidk/plugins-core/colorscheme.lua index 643a053..ff0bf3f 100644 --- a/config/nvim/lua/aleidk/plugins-core/colorscheme.lua +++ b/config/nvim/lua/aleidk/plugins-core/colorscheme.lua @@ -1,7 +1,7 @@ return { -- Change colors.none if not using a transparent background "catppuccin/nvim", + name = "catppuccin", priority = 1000, - lazy = false, opts = { flavour = "macchiato", transparent_background = true, @@ -13,10 +13,10 @@ return { -- Change colors.none if not using a transparent background mason = true, neogit = true, noice = true, - hop = true, lsp_trouble = true, indent_blankline = { enabled = true, + scope_color = "text", }, }, custom_highlights = function(colors) @@ -35,6 +35,6 @@ return { -- Change colors.none if not using a transparent background config = function(_, opts) require("catppuccin").setup(opts) - vim.cmd.colorscheme("catppuccin") + vim.cmd.colorscheme("catppuccin-macchiato") end, } diff --git a/config/nvim/lua/aleidk/plugins-ide/lsp.lua b/config/nvim/lua/aleidk/plugins-ide/lsp.lua index 70d875f..553b256 100644 --- a/config/nvim/lua/aleidk/plugins-ide/lsp.lua +++ b/config/nvim/lua/aleidk/plugins-ide/lsp.lua @@ -245,8 +245,8 @@ return { { }, keys = { - { "lt", function() require("aerial").toggle() end, desc = "Open syntax tree" }, - { "lT", function() require("aerial").nav_toggle() end, desc = "Open syntax tree navigation" }, + { "ll", function() require("aerial").toggle() end, desc = "Open syntax tree" }, + { "lL", function() require("aerial").nav_toggle() end, desc = "Open syntax tree navigation" }, { "fl", "Telescope aerial", desc = "Find in syntax tree" }, } }