diff --git a/lazy-lock.json b/lazy-lock.json index 3254c84..0d68518 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,17 +1,15 @@ { - "alpha-nvim": { "branch": "main", "commit": "2b3cbcdd980cae1e022409289245053f62fb50f6" }, - "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, - "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "bb3a17efc797c34c054463174e5522442576ebd8" }, - "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, - "neo-tree.nvim": { "branch": "v3.x", "commit": "cea666ef965884414b1b71f6b39a537f9238bdb2" }, + "alpha-nvim": { "branch": "main", "commit": "6c6a89d5b068b5251c8bdf0dd57bb921bcfeeb09" }, + "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "0a695750d747db1e7e70bcf0267ef8951c95fc83" }, + "mason.nvim": { "branch": "main", "commit": "16ba83bfc8a25f52bb545134f5bee082b195c460" }, + "neo-tree.nvim": { "branch": "v3.x", "commit": "ebd66767191714e008ce73b769518a763ff31bdc" }, "night-owl.nvim": { "branch": "main", "commit": "86ed124c2f7e118670649701288e024444bf91e5" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-lspconfig": { "branch": "master", "commit": "4d3b3bb8815fbe37bcaf3dbdb12a22382bc11ebe" }, - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-context": { "branch": "master", "commit": "59f318a65d42a5c4037796886a8874fd57f774fc" }, - "nvim-web-devicons": { "branch": "master", "commit": "0422a19d9aa3aad2c7e5cca167e5407b13407a9d" }, - "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, - "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" } + "nvim-lspconfig": { "branch": "master", "commit": "9573948c38bfabeec353ae7dd7d3ffec4c506a6b" }, + "nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" }, + "nvim-treesitter-context": { "branch": "master", "commit": "b311b30818951d01f7b4bf650521b868b3fece16" }, + "snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" }, + "vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" } } diff --git a/lua/echavemann/init.lua b/lua/echavemann/init.lua index ca16b54..65df1aa 100644 --- a/lua/echavemann/init.lua +++ b/lua/echavemann/init.lua @@ -6,10 +6,10 @@ vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("UserLspConfig", {}), callback = function(ev) local opts = { buffer = ev.buf } - vim.keymap.set("n", "gd", require("telescope.builtin").lsp_definitions, opts) + vim.keymap.set("n", "gd", function() Snacks.picker.lsp_definitions() end, opts) vim.keymap.set("n", "gD", function() vim.lsp.buf.declaration() end, opts) vim.keymap.set("n", "gt", function() vim.lsp.buf.type_definition() end, opts) - vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, opts) + vim.keymap.set("n", "gr", function() Snacks.picker.lsp_references() end, opts) end, }) diff --git a/lua/echavemann/lazy/alpha.lua b/lua/echavemann/lazy/alpha.lua index 97a967a..8159dcc 100644 --- a/lua/echavemann/lazy/alpha.lua +++ b/lua/echavemann/lazy/alpha.lua @@ -15,9 +15,9 @@ function M.config() [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]], } dashboard.section.buttons.val = { - dashboard.button("f", " " .. " Find file", ":Telescope find_files "), - dashboard.button("h", "󰄉 " .. " Recent files", ":Telescope oldfiles "), - dashboard.button("t", " " .. " Find text", ":Telescope live_grep "), + dashboard.button("f", " " .. " Find file", "lua Snacks.picker.files()"), + dashboard.button("h", "󰄉 " .. " Recent files", "lua Snacks.picker.recent()"), + dashboard.button("t", " " .. " Find text", "lua Snacks.picker.grep()"), dashboard.button("c", " " .. " Config", ":e $MYVIMRC "), dashboard.button("q", " " .. " Quit", ":qa"), } diff --git a/lua/echavemann/lazy/snacks.lua b/lua/echavemann/lazy/snacks.lua new file mode 100644 index 0000000..753fccc --- /dev/null +++ b/lua/echavemann/lazy/snacks.lua @@ -0,0 +1,19 @@ +return { + { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + picker = { enabled = true }, + }, + keys = { + { "f", function() Snacks.picker.files() end, desc = "Find Files" }, + { "o", function() Snacks.picker.buffers() end, desc = "Buffers" }, + { "r", function() Snacks.picker.grep() end, desc = "Live Grep" }, + { "h", function() Snacks.picker.recent() end, desc = "Recent Files" }, + { "y", function() Snacks.picker.lsp_workspace_symbols() end, desc = "Workspace Symbols" }, + { "g", function() Snacks.picker.grep_word() end, desc = "Grep Word" }, + }, + } +} diff --git a/lua/echavemann/lazy/telescope.lua b/lua/echavemann/lazy/telescope.lua deleted file mode 100644 index 7eec411..0000000 --- a/lua/echavemann/lazy/telescope.lua +++ /dev/null @@ -1,52 +0,0 @@ -return { - { - "nvim-telescope/telescope.nvim", - - dependencies = { - "nvim-lua/plenary.nvim", - 'nvim-tree/nvim-web-devicons' - }, - config = function() - local options = { - defaults = { - vimgrep_arguments = { - "rg", - "-L", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - file_sorter = require("telescope.sorters").get_fuzzy_file, - file_previewer = require("telescope.previewers").vim_buffer_cat.new, - grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, - qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, - mappings = { - n = { ["q"] = require("telescope.actions").close }, - }, - }, - - extensions_list = { "themes", "terms" }, - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - }, - } - require("telescope").setup(options) - local builtin = require('telescope.builtin') - - vim.keymap.set("n", "o", builtin.buffers, {}) - vim.keymap.set("n", "f", builtin.find_files, {}) - vim.keymap.set("n", "r", builtin.live_grep, {}) - vim.keymap.set("n", "h", builtin.oldfiles, {}) - vim.keymap.set("n", "y", builtin.lsp_dynamic_workspace_symbols, {}) - vim.keymap.set("n", "g", require("telescope.builtin").grep_string, {}) - end - } -}