diff options
author | Squibid <me@zacharyscheiman.com> | 2025-05-06 16:51:24 -0500 |
---|---|---|
committer | Squibid <me@zacharyscheiman.com> | 2025-05-06 16:51:24 -0500 |
commit | 7c3289fded1f75f6e060f56bd06edc2a327744d9 (patch) | |
tree | bf579e6eb1de84237a74ef13ce67703c15266afe /lua/conf/plugins/telescope.lua | |
parent | 3094bf2a3983b375f4adeccd25c3b12bbbded2aa (diff) | |
download | nvim-7c3289fded1f75f6e060f56bd06edc2a327744d9.tar.gz nvim-7c3289fded1f75f6e060f56bd06edc2a327744d9.tar.bz2 nvim-7c3289fded1f75f6e060f56bd06edc2a327744d9.zip |
kitchen sink again :(
Diffstat (limited to 'lua/conf/plugins/telescope.lua')
-rw-r--r-- | lua/conf/plugins/telescope.lua | 79 |
1 files changed, 37 insertions, 42 deletions
diff --git a/lua/conf/plugins/telescope.lua b/lua/conf/plugins/telescope.lua index b08d65d..66c098a 100644 --- a/lua/conf/plugins/telescope.lua +++ b/lua/conf/plugins/telescope.lua @@ -1,55 +1,48 @@ -local misc = require('core.misc') +local misc = require("core.misc") local map = misc.map -return { 'nvim-telescope/telescope.nvim', +return { "nvim-telescope/telescope.nvim", disable = not vim.fn.has("nvim-0.9.0"), requires = { - 'nvim-lua/plenary.nvim', - { 'nvim-telescope/telescope-fzf-native.nvim', + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", config = function() vim.cmd("make") end - } + }, + "mollerhoj/telescope-recent-files.nvim", + "nvim-telescope/telescope-ui-select.nvim" }, + function() local telescope = require("telescope") - local actions = require('telescope.actions') - local action_layout = require("telescope.actions.layout") - - local function telescopew() - if vim.o.columns <= 80 then - return vim.o.columns - else - return 0.8 - end - end + local actions = require("telescope.actions") telescope.setup { defaults = { borderchars = { - prompt = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, - results = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, - preview = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, + prompt = { " ", " ", " ", " ", " ", " ", " ", " " }, + results = { " ", " ", " ", " ", " ", " ", " ", " " }, + preview = { " ", " ", " ", " ", " ", " ", " ", " " }, }, winblend = 0, - layout_strategy = 'horizontal', - sorting_strategy = 'descending', - scroll_strategy = 'limit', + layout_strategy = "horizontal", + sorting_strategy = "descending", + scroll_strategy = "limit", layout_config = { horizontal = { - width = telescopew(), height = 20, - prompt_position = 'bottom', - anchor = 'N', + prompt_position = "bottom", + anchor = "N", } }, mappings = { i = { ["<esc>"] = actions.close, - ['<C-j>'] = actions.move_selection_next, - ['<C-k>'] = actions.move_selection_previous, - ['<C-u>'] = actions.preview_scrolling_up, - ['<C-d>'] = actions.preview_scrolling_down, + ["<C-j>"] = actions.move_selection_next, + ["<C-k>"] = actions.move_selection_previous, + ["<C-u>"] = actions.preview_scrolling_up, + ["<C-d>"] = actions.preview_scrolling_down, } } }, @@ -59,29 +52,31 @@ return { 'nvim-telescope/telescope.nvim', } -- load in the fzf extension - telescope.load_extension('fzf') + telescope.load_extension("fzf") + telescope.load_extension("recent-files") + telescope.load_extension("ui-select") -- keymaps - local telebuilt = require('telescope.builtin') - map('n', '<leader>f', function() - telebuilt.fd { follow = true } - end, { desc = 'Find files.' }) - map('n', '<leader>s', telebuilt.live_grep, { desc = 'Find string in project.' }) - map('n', '<leader>b', telebuilt.current_buffer_fuzzy_find, { - desc = 'Find string in current buffer.', + local telebuilt = require("telescope.builtin") + map("n", "<leader>f", function() + telescope.extensions["recent-files"].recent_files { follow = true } + end, { desc = "Find files." }) + map("n", "<leader>s", telebuilt.live_grep, { desc = "Find string in project." }) + map("n", "<leader>b", telebuilt.current_buffer_fuzzy_find, { + desc = "Find string in current buffer.", }) - map('n', '<leader>i', telebuilt.help_tags, { - desc = 'find help tags.', + map("n", "<leader>i", telebuilt.help_tags, { + desc = "find help tags.", }) -- find over specific directories - map('n', '<leader>tc', function() - require('telescope.builtin').find_files { + map("n", "<leader>tc", function() + require("telescope.builtin").find_files { cwd = vim.fn.stdpath("config") } end, { desc = "find config files" }) - map('n', '<leader>tp', function() - require('telescope.builtin').find_files { + map("n", "<leader>tp", function() + require("telescope.builtin").find_files { cwd = vim.fs.joinpath(vim.fn.stdpath("data"), "site/pack/deps/opt") } end, { desc = "find files in plugin directory" }) |