From e0fcecd7c41e6f63071290cb92d3cab12aa4cf7d Mon Sep 17 00:00:00 2001 From: Len Smith Date: Thu, 26 Oct 2023 22:29:50 -0700 Subject: [PATCH] Update Telescope config --- nvim/lua/user/keymaps.lua | 9 ++++++++- nvim/lua/user/telescope.lua | 10 ++++++++-- nvim/lua/user/whichkey.lua | 12 +++++++++--- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/nvim/lua/user/keymaps.lua b/nvim/lua/user/keymaps.lua index 9ef2745..195755f 100644 --- a/nvim/lua/user/keymaps.lua +++ b/nvim/lua/user/keymaps.lua @@ -2,6 +2,8 @@ local opts = { noremap = true, silent = true } -- Shorten function name local keymap = vim.api.nvim_set_keymap +local horizontalLayout = + '{ layout_strategy = "vertical", layout_config = { width = 0.95, height = 0.95, preview_height = { 0.7, min = 10 } } }' --Remap space as leader key keymap("", "", "", opts) @@ -61,7 +63,12 @@ vim.keymap.set("n", "", "(YankyCycleBackward)") -- open git files keymap("n", "", ":Telescope git_files", opts) -keymap("n", "ff", ':lua require("telescope").extensions.live_grep_args.live_grep_args()', opts) +keymap( + "n", + "ff", + ':lua require("telescope").extensions.live_grep_args.live_grep_args(' .. horizontalLayout .. ")", + opts +) -- ctrl-save keymap("n", "", ":w!", opts) diff --git a/nvim/lua/user/telescope.lua b/nvim/lua/user/telescope.lua index eb27ee0..e055d17 100644 --- a/nvim/lua/user/telescope.lua +++ b/nvim/lua/user/telescope.lua @@ -4,15 +4,21 @@ if not status_ok then end local actions = require("telescope.actions") +local horizontalLayout = + '{ layout_strategy = "vertical", layout_config = { width = 0.95, height = 0.95, preview_height = { 0.7, min = 10 } } }' telescope.setup({ defaults = { - prompt_prefix = " ", selection_caret = " ", path_display = { "smart" }, shorten_path = true, - + layout_strategy = "vertical", + layout_config = { + vertical = { width = 0.95 }, + horizontal = { width = 0.95 }, + preview_height = { 0.7, min = 10 }, + }, mappings = { i = { [""] = actions.cycle_history_next, diff --git a/nvim/lua/user/whichkey.lua b/nvim/lua/user/whichkey.lua index 593176a..9dae9bc 100644 --- a/nvim/lua/user/whichkey.lua +++ b/nvim/lua/user/whichkey.lua @@ -3,6 +3,9 @@ if not status_ok then return end +local horizontalLayout = + '{ layout_strategy = "vertical", layout_config = { width = 0.95, height = 0.95, preview_height = { 0.7, min = 10 } } }' + local setup = { plugins = { marks = true, -- shows a list of your marks on ' and ` @@ -130,9 +133,12 @@ local mappings = { ":LazyGit", "Lazy Git", }, - o = { "Telescope git_status", "Open changed file" }, + o = { + "Telescope git_status(" .. horizontalLayout .. ")}), ", + "Open changed file", + }, c = { "Telescope git_commits", "Checkout commit" }, - B = { "Telescope git_branches", "Checkout branch" }, + B = { "Telescope git_branches theme=ivy", "Checkout branch" }, d = { "Gitsigns diffthis HEAD", "Diff", @@ -196,12 +202,12 @@ local mappings = { a = { "Telescope current_buffer_fuzzy_find", "Search In Buffer" }, b = { "Telescope git_branches", "Checkout branch" }, c = { "Telescope colorscheme", "Colorscheme" }, - o = { "Telescope vim_options", "Options" }, J = { "Telescope jumplist", "Jumplist" }, h = { "Telescope help_tags", "Find Help" }, M = { "Telescope man_pages", "Man Pages" }, m = { "Telescope marks", "Marks" }, o = { "Telescope git_status", "Open changed file" }, + O = { "Telescope vim_options", "Options" }, r = { "Telescope oldfiles", "Open Recent File" }, --f = { "Telescope live_grep", "Rg" }, mapped in keymaps now G = { "Telescope lazygit", "Lazygit" },