From 38f6ac9103cbbb47d210d4209efdee2331791ca9 Mon Sep 17 00:00:00 2001 From: JP Appel Date: Mon, 23 Dec 2024 15:43:35 -0500 Subject: Change some telescope themes --- nvim/init.lua | 4 +- nvim/lua/plugins/telescope.lua | 99 +++++++++++++++++++++++++++--------------- 2 files changed, 66 insertions(+), 37 deletions(-) (limited to 'nvim') diff --git a/nvim/init.lua b/nvim/init.lua index df8171b..f2fc6dd 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -3,11 +3,11 @@ -- ==================== HOME = os.getenv("HOME") -HOSTNAME = vim.loop.os_gethostname() +HOSTNAME = vim.uv.os_gethostname() -- bootstrap lazynvim if not installed local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then +if not vim.uv.fs_stat(lazypath) then vim.fn.system({ "git", "clone", diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua index e9f9c26..3da81e6 100644 --- a/nvim/lua/plugins/telescope.lua +++ b/nvim/lua/plugins/telescope.lua @@ -1,45 +1,74 @@ return { - 'nvim-telescope/telescope.nvim', -- fuzzy finder + 'nvim-telescope/telescope.nvim', -- fuzzy finder dependencies = { 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons' }, cmd = 'Telescope', keys = { - {"ff", function() - require("telescope.builtin").find_files() - end, - desc = "Search for files (respcting .gitignore)" - }, - {"fb", function() - require("telescope.builtin").buffers() - end - }, - {"fg", function() - require("telescope.builtin").live_grep() - end - }, - {"fq", function() - require("telescope.builtin").quickfix() - end - }, - {"fl", function() - require("telescope.builtin").loclist() - end - }, - {"fd", function() - require("telescope.builtin").diagnostics() - end - }, - {"fr", function() - -- TODO: if lsp supports reference provider and lsp is attached - -- [telescope.builtin.lsp_*]: server does not support referencesProvider - if #vim.lsp.get_clients({bufnr = 0}) > 0 then - require("telescope.builtin").lsp_references() - else - require("telescope.builtin").grep_string() + { + "ff", + function() + local builtin = require("telescope.builtin") + builtin.find_files() + end, + desc = "Search for files (respcting .gitignore) using Telescope" + }, + { + "fF", + function() + require("telescope.builtin").find_files({ hidden = true, no_ignore_parent = true }) + end, + desc = "Search for files (including hidden) using Telescope" + }, + { + "fb", + function() + require("telescope.builtin").buffers() + end, + desc = "Search for open buffers using Telescope" + }, + { "fg", function() + require("telescope.builtin").live_grep() end - end - } + }, + { + "fq", + function() + local themes = require("telescope.themes") + require("telescope.builtin").quickfix(themes.get_ivy({})) + end, + desc = "Search in the the quickfix buffer using Telescope" + }, + { + "fl", + function() + local themes = require("telescope.themes") + require("telescope.builtin").loclist(themes.get_ivy({})) + end, + desc = "Search within a location list using Telescope" + }, + { + "fd", + function() + local themes = require("telescope.themes") + require("telescope.builtin").diagnostics(themes.get_ivy({})) + end, + desc = "Search through diagnostics using Telescope" + }, + { + "fr", + function() + -- TODO: if lsp supports reference provider and lsp is attached + -- [telescope.builtin.lsp_*]: server does not support referencesProvider + local themes = require("telescope.themes") + if #vim.lsp.get_clients({ bufnr = 0 }) > 0 then + require("telescope.builtin").lsp_references(themes.get_ivy({})) + else + require("telescope.builtin").grep_string(themes.get_ivy({})) + end + end, + desc = "Search for refences via grep or a language server using Telescope" + } } } -- cgit v1.2.3