From 8d34de9e2ab66d506bc117a9dbfe05ea158d7cd0 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sun, 10 Nov 2024 19:31:54 +0100 Subject: use lua functions for telescope keymaps --- lua/maps/find.lua | 64 ++++++++++++++++++------------------------------------- 1 file changed, 21 insertions(+), 43 deletions(-) (limited to 'lua/maps/find.lua') diff --git a/lua/maps/find.lua b/lua/maps/find.lua index d886d8a..5c1b244 100644 --- a/lua/maps/find.lua +++ b/lua/maps/find.lua @@ -1,49 +1,27 @@ -vim.api.nvim_set_keymap( - "n", - "p", - ":Telescope find_files", - { silent = true, noremap = true } -) +vim.keymap.set("n", "p", function() + require("telescope.builtin").find_files() +end) -vim.api.nvim_set_keymap( - "n", - "b", - ":Telescope buffers", - { silent = true, noremap = true } -) +vim.keymap.set("n", "b", function () + require("telescope.builtin").buffers() +end) -vim.api.nvim_set_keymap( - "n", - "gc", - ":Telescope git_commits", - { silent = true, noremap = true } -) +vim.keymap.set("n", "gc", function () + require("telescope.builtin").git_commits() +end) -vim.api.nvim_set_keymap( - "n", - "gb", - ":Telescope git_branches", - { silent = true, noremap = true } -) +vim.keymap.set("n", "gb", function() + require("telescope.builtin").git_branches() +end) -vim.api.nvim_set_keymap( - "n", - "gcl", - ":Telescope conflicts", - { silent = true, noremap = true } -) +vim.keymap.set("n", "gcl", function() + require("telescope.builtin").conflicts() +end) -vim.api.nvim_set_keymap( - "n", - "f", - ":Telescope live_grep", - { silent = true, noremap = true } -) - -vim.api.nvim_set_keymap( - "n", - "e", - ":Telescope file_browser", - { silent = true, noremap = true } -) +vim.keymap.set("n", "f", function() + require("telescope.builtin").live_grep() +end) +vim.keymap.set("n", "e", function() + require("telescope").extensions.file_browser.file_browser() +end) -- cgit v1.2.3-18-g5258