diff --git a/config/nvim/lua/config/keymaps.lua b/config/nvim/lua/config/keymaps.lua index fd72675e..562b12fe 100644 --- a/config/nvim/lua/config/keymaps.lua +++ b/config/nvim/lua/config/keymaps.lua @@ -2,6 +2,7 @@ local map = vim.keymap.set local o = vim.opt local Util = require("lazyvim.util") +local lazy = require("lazy") -- Search current word local searching_brave = function() @@ -14,13 +15,13 @@ map("n", "l", "") map("n", "ll", "Lazy", { desc = "Lazy" }) -- stylua: ignore start map("n", "ld", function() vim.fn.system({ "xdg-open", "https://lazyvim.org" }) end, { desc = "LazyVim Docs" }) -map("n", "lr", function() vim.fn.system({ "xdg-open", "https://github.com/LazyVim/LazyVim" }) end, - { desc = "LazyVim Repo" }) +map("n", "lr", function() vim.fn.system({ "xdg-open", "https://github.com/LazyVim/LazyVim" }) end, { desc = "LazyVim Repo" }) map("n", "lx", "LazyExtras", { desc = "Extras" }) map("n", "lc", function() Util.news.changelog() end, { desc = "LazyVim Changelog" }) -map("n", "lu", function() require("lazy").update() end, { desc = "Lazy Update" }) -map("n", "lC", function() require("lazy").check() end, { desc = "Lazy Check" }) -map("n", "ls", function() require("lazy").sync() end, { desc = "Lazy Sync" }) + +map("n", "lu", function() lazy.update() end, { desc = "Lazy Update" }) +map("n", "lC", function() lazy.check() end, { desc = "Lazy Check" }) +map("n", "ls", function() lazy.sync() end, { desc = "Lazy Sync" }) -- stylua: ignore end -- Disable LazyVim bindings @@ -153,3 +154,12 @@ map("x", "g/", "/\\%V", { silent = false, desc = "Search inside visual sele -- Search visually selected text (slightly better than builtins in Neovim>=0.8) map("x", "*", [[y/\V=escape(@", '/\')]]) map("x", "#", [[y?\V=escape(@", '?\')]]) + +-- Dashboard +map("n", "fd", function() + if Util.has("alpha-nvim") then + require("alpha").start(true) + elseif Util.has("dashboard-nvim") then + vim.cmd("Dashboard") + end +end, { desc = "Dashboard" }) diff --git a/config/nvim/lua/plugins/extras/coding/refactoring.lua b/config/nvim/lua/plugins/extras/coding/refactoring.lua index 4331037f..4e595acc 100644 --- a/config/nvim/lua/plugins/extras/coding/refactoring.lua +++ b/config/nvim/lua/plugins/extras/coding/refactoring.lua @@ -1,17 +1,12 @@ return { "ThePrimeagen/refactoring.nvim", - requires = { + dependencies = { { "nvim-lua/plenary.nvim" }, { "nvim-treesitter/nvim-treesitter" }, }, opts = {}, - config = function(_, opts) - require("lazyvim.util").on_load("telescope.nvim", function() - require("telescope").load_extension("refactoring") - end) - end, - -- stylua: ignore - keys = { - { "cR", function() require('telescope').extensions.refactoring.refactors() end, mode = { "n", "x" }, desc = "Refactor" }, - }, + -- stylua: ignore + keys = { + { "cR", function() require("refactoring").select_refactor() end, mode = { "n", "x", "v" }, desc = "Refactor" }, + }, } diff --git a/config/nvim/lua/plugins/extras/lazyvim/dashboard.lua b/config/nvim/lua/plugins/extras/lazyvim/dashboard.lua index 3a153fb2..de393379 100644 --- a/config/nvim/lua/plugins/extras/lazyvim/dashboard.lua +++ b/config/nvim/lua/plugins/extras/lazyvim/dashboard.lua @@ -4,21 +4,16 @@ return { vim.api.nvim_create_autocmd("TabNewEntered", { command = "Dashboard" }) local logo = [[ -  - ████ ██████ █████ ██ - ███████████ █████  - █████████ ███████████████████ ███ ███████████ - █████████ ███ █████████████ █████ ██████████████ - █████████ ██████████ █████████ █████ █████ ████ █████ - ███████████ ███ ███ █████████ █████ █████ ████ █████ -██████ █████████████████████ ████ █████ █████ ████ ██████ + ███╗ ██╗ ███████╗ ██████╗ ██╗ ██╗ ██╗ ███╗ ███╗ + ████╗ ██║ ██╔════╝██╔═══██╗ ██║ ██║ ██║ ████╗ ████║ + ██╔██╗ ██║ █████╗ ██║ ██║ ██║ ██║ ██║ ██╔████╔██║ + ██║╚██╗██║ ██╔══╝ ██║ ██║ ╚██╗ ██╔╝ ██║ ██║╚██╔╝██║ + ██║ ╚████║ ███████╗╚██████╔╝ ╚████╔╝ ██║ ██║ ╚═╝ ██║ + ╚═╝ ╚═══╝ ╚══════╝ ╚═════╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝ ]] logo = string.rep("\n", 8) .. logo .. "\n\n" opts.config.header = vim.split(logo, "\n") return opts end, - keys = { - { "fd", "Dash", desc = "Dashboard" }, - }, }