Changed telescope layout to have preview vertically

This commit is contained in:
2025-01-31 13:37:33 +11:00
parent 70c668cd2c
commit 3493b0c0fc

View File

@@ -1,30 +1,31 @@
return { return {
"nvim-telescope/telescope.nvim", "nvim-telescope/telescope.nvim",
tag = "0.1.5", tag = "0.1.5",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim" "nvim-lua/plenary.nvim",
}, },
config = function() config = function()
require('telescope').setup({}) require("telescope").setup({
defaults = { layout_strategy = "vertical" },
})
local builtin = require('telescope.builtin') local builtin = require("telescope.builtin")
vim.keymap.set('n', '<leader>pf', builtin.find_files, {}) vim.keymap.set("n", "<leader>pf", builtin.find_files, {})
vim.keymap.set('n', '<C-p>', builtin.git_files, {}) vim.keymap.set("n", "<C-p>", builtin.git_files, {})
vim.keymap.set('n', '<leader>pws', function() vim.keymap.set("n", "<leader>pws", function()
local word = vim.fn.expand("<cword>") local word = vim.fn.expand("<cword>")
builtin.grep_string({ search = word }) builtin.grep_string({ search = word })
end) end)
vim.keymap.set('n', '<leader>pWs', function() vim.keymap.set("n", "<leader>pWs", function()
local word = vim.fn.expand("<cWORD>") local word = vim.fn.expand("<cWORD>")
builtin.grep_string({ search = word }) builtin.grep_string({ search = word })
end) end)
vim.keymap.set('n', '<leader>ps', function() vim.keymap.set("n", "<leader>ps", function()
builtin.grep_string({ search = vim.fn.input("Grep > ") }) builtin.grep_string({ search = vim.fn.input("Grep > ") })
end) end)
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {}) vim.keymap.set("n", "<leader>vh", builtin.help_tags, {})
end end,
} }