diff --git a/init.lua b/init.lua index 83983de..7f4af20 100644 --- a/init.lua +++ b/init.lua @@ -39,5 +39,3 @@ require("lazy").setup({ -- automatically check for plugin updates checker = { enabled = false }, }) - - diff --git a/lua/custom/trouble.lua b/lua/custom/trouble.lua index e22abbc..6a3899b 100644 --- a/lua/custom/trouble.lua +++ b/lua/custom/trouble.lua @@ -15,14 +15,16 @@ vim.keymap.set("n", "xQ", "Trouble qflist toggle", { desc = "Qu -- Telescope integration -- local actions = require("telescope.actions") -local open_with_trouble = require("trouble.sources.telescope").open -- local add_to_trouble = require("trouble.sources.telescope").add - -require("telescope").setup({ - defaults = { - mappings = { - i = { [""] = open_with_trouble }, - n = { [""] = open_with_trouble }, +local ok, telescope = pcall(require, "telescope") +if ok then + local open_with_trouble = require("trouble.sources.telescope").open + telescope.setup({ + defaults = { + mappings = { + i = { [""] = open_with_trouble }, + n = { [""] = open_with_trouble }, + }, }, - }, -}) + }) +end