Skip to content

Commit 87336bb

Browse files
author
David Hendén
committed
break out telescope to its own plugin file
change telescope key from [s]earch to [f]ind comment out telescope keys i dont knwo or use
1 parent bfd60f3 commit 87336bb

File tree

3 files changed

+183
-190
lines changed

3 files changed

+183
-190
lines changed

init.lua

Lines changed: 5 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -234,183 +234,6 @@ require('lazy').setup({
234234
--
235235
-- Use the `dependencies` key to specify the dependencies of a particular plugin
236236

237-
{ -- Fuzzy Finder (files, lsp, etc)
238-
'nvim-telescope/telescope.nvim',
239-
event = 'VimEnter',
240-
branch = '0.1.x',
241-
dependencies = {
242-
'nvim-lua/plenary.nvim',
243-
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
244-
'nvim-telescope/telescope-fzf-native.nvim',
245-
246-
-- `build` is used to run some command when the plugin is installed/updated.
247-
-- This is only run then, not every time Neovim starts up.
248-
build = 'make',
249-
250-
-- `cond` is a condition used to determine whether this plugin should be
251-
-- installed and loaded.
252-
cond = function()
253-
return vim.fn.executable 'make' == 1
254-
end,
255-
},
256-
{ 'nvim-telescope/telescope-ui-select.nvim' },
257-
258-
-- Useful for getting pretty icons, but requires a Nerd Font.
259-
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
260-
},
261-
config = function()
262-
-- Telescope is a fuzzy finder that comes with a lot of different things that
263-
-- it can fuzzy find! It's more than just a "file finder", it can search
264-
-- many different aspects of Neovim, your workspace, LSP, and more!
265-
--
266-
-- The easiest way to use Telescope, is to start by doing something like:
267-
-- :Telescope help_tags
268-
--
269-
-- After running this command, a window will open up and you're able to
270-
-- type in the prompt window. You'll see a list of `help_tags` options and
271-
-- a corresponding preview of the help.
272-
--
273-
-- Two important keymaps to use while in Telescope are:
274-
-- - Insert mode: <c-/>
275-
-- - Normal mode: ?
276-
--
277-
-- This opens a window that shows you all of the keymaps for the current
278-
-- Telescope picker. This is really useful to discover what Telescope can
279-
-- do as well as how to actually do it!
280-
281-
-- [[ Configure Telescope ]]
282-
-- See `:help telescope` and `:help telescope.setup()`
283-
require('telescope').setup {
284-
-- You can put your default mappings / updates / etc. in here
285-
-- All the info you're looking for is in `:help telescope.setup()`
286-
--
287-
defaults = {
288-
-- mappings = {
289-
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
290-
-- },
291-
-- },
292-
layout_strategy = 'horizontal',
293-
pickers = {
294-
current_buffer_fuzzy_find = {
295-
theme = 'ivy',
296-
previewer = false,
297-
},
298-
buffers = {
299-
sort_lastused = true,
300-
-- theme = "dropdown",
301-
theme = 'ivy',
302-
layout_config = { height = 10 },
303-
previewer = false,
304-
mappings = {
305-
i = { ['<c-d>'] = require('telescope.actions').delete_buffer },
306-
n = { ['<c-d>'] = require('telescope.actions').delete_buffer },
307-
},
308-
},
309-
find_files = {
310-
theme = 'ivy',
311-
layout_config = { height = 10 },
312-
previewer = false,
313-
},
314-
oldfiles = {
315-
sort_lastused = true,
316-
theme = 'ivy',
317-
layout_config = { height = 10 },
318-
previewer = false,
319-
},
320-
command_history = {
321-
sort_lastused = true,
322-
theme = 'ivy',
323-
layout_config = { height = 10 },
324-
previewer = false,
325-
},
326-
},
327-
328-
--[[
329-
layout_config = {
330-
331-
width = function(_, max_columns)
332-
local percentage = 0.7
333-
local max = 70
334-
return math.min(math.floor(percentage * max_columns), max)
335-
end,
336-
337-
height = function(_, _, max_lines)
338-
local percentage = 0.7
339-
local min = 70
340-
return math.max(math.floor(percentage * max_lines), min)
341-
end,
342-
343-
-- preview_cutoff = 120,
344-
},
345-
--]]
346-
--[[
347-
layout_config = {
348-
-- defaults = {
349-
layout_strategy = 'vertical',
350-
height = vim.o.lines, -- maximally available lines
351-
width = vim.o.columns, -- maximally available columns
352-
prompt_position = 'top',
353-
-- preview_height = 0.6, -- 60% of available lines
354-
},
355-
--]]
356-
},
357-
extensions = {
358-
['ui-select'] = {
359-
require('telescope.themes').get_dropdown(),
360-
},
361-
},
362-
}
363-
364-
-- Enable Telescope extensions if they are installed
365-
pcall(require('telescope').load_extension, 'fzf')
366-
pcall(require('telescope').load_extension, 'ui-select')
367-
368-
-- See `:help telescope.builtin`
369-
local builtin = require 'telescope.builtin'
370-
vim.keymap.set('n', '<leader>sc', builtin.colorscheme, { desc = '[S]earch [C]colorscheme' })
371-
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
372-
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
373-
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
374-
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
375-
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
376-
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
377-
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
378-
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
379-
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
380-
381-
-- Slightly advanced example of overriding default behavior and theme
382-
-- vim.keymap.set('n', '<leader>/', builtin.current_buffer_fuzzy_find, { desc = '[/] Fuzzily search in current buffer' })
383-
vim.keymap.set('n', '<leader>/', function()
384-
builtin.current_buffer_fuzzy_find {
385-
previewer = false,
386-
}
387-
end, { desc = '[/] Fuzzily search in current buffer' })
388-
--[[
389-
vim.keymap.set('n', '<leader>/', function()
390-
-- You can pass additional configuration to Telescope to change the theme, layout, etc.
391-
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
392-
winblend = 20,
393-
previewer = false,
394-
})
395-
end, { desc = '[/] Fuzzily search in current buffer' })
396-
--]]
397-
398-
-- It's also possible to pass additional configuration options.
399-
-- See `:help telescope.builtin.live_grep()` for information about particular keys
400-
vim.keymap.set('n', '<leader><leader>', function()
401-
builtin.live_grep {
402-
grep_open_files = true,
403-
prompt_title = 'Live Grep in Open Files',
404-
}
405-
end, { desc = '[S]earch [/] in Open Files' })
406-
407-
-- Shortcut for searching your Neovim configuration files
408-
vim.keymap.set('n', '<leader>sn', function()
409-
builtin.find_files { cwd = vim.fn.stdpath 'config' }
410-
end, { desc = '[S]earch [N]eovim files' })
411-
end,
412-
},
413-
414237
{ -- Lush colorscheme helper
415238
'rktjmp/lush.nvim',
416239
-- if you wish to use your own colorscheme:
@@ -430,7 +253,9 @@ require('lazy').setup({
430253
},
431254
},
432255
},
256+
433257
{ 'Bilal2453/luvit-meta', lazy = true },
258+
434259
{
435260
-- Main LSP Configuration
436261
'neovim/nvim-lspconfig',
@@ -919,9 +744,10 @@ require('lazy').setup({
919744
-- require 'plugins.debug',
920745
-- require 'plugins.indent_line',
921746
-- require 'plugins.lint',
922-
require 'plugins.autopairs',
747+
require 'plugins.telescope',
748+
-- require 'plugins.autopairs',
923749
require 'plugins.neo-tree',
924-
require 'plugins.gitsigns', -- adds gitsigns recommend keymaps
750+
require 'plugins.gitsigns',
925751
require 'plugins.codeium',
926752
require 'plugins.chatgpt',
927753
require 'plugins.auto-session',

lazy-lock.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,45 @@
33
"auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" },
44
"catppuccin": { "branch": "main", "commit": "f67b886d65a029f12ffa298701fb8f1efd89295d" },
55
"cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" },
6-
"codeium.nvim": { "branch": "main", "commit": "27d2b1ce8c7ba14dbf6e4504bdea8e5548be5476" },
6+
"codeium.nvim": { "branch": "main", "commit": "ebed4f7cc8a18184d8332d421ca10bed5f7d59a1" },
77
"conform.nvim": { "branch": "master", "commit": "70019124aa4f2e6838be9fbd2007f6d13b27a96d" },
88
"copilot.vim": { "branch": "release", "commit": "87038123804796ca7af20d1b71c3428d858a9124" },
9-
"cyberdream.nvim": { "branch": "main", "commit": "4f8dcaa5a989ef207f7a06ffaf5db9d17b9f9156" },
9+
"cyberdream.nvim": { "branch": "main", "commit": "77c27cb822b638d7b332cfff6c6fb09473a7d180" },
1010
"fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" },
1111
"flybuf.nvim": { "branch": "main", "commit": "fe1fbd9699f6988a1db3b2e2ffa599154784c6e1" },
1212
"gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" },
1313
"indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" },
1414
"kanagawa.nvim": { "branch": "master", "commit": "18ae5771b22d8f913ef541c827a8180b4cb12c8a" },
15-
"lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" },
15+
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
1616
"lazydev.nvim": { "branch": "main", "commit": "8620f82ee3f59ff2187647167b6b47387a13a018" },
1717
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
1818
"lush.nvim": { "branch": "main", "commit": "45a79ec4acb5af783a6a29673a999ce37f00497e" },
1919
"luvit-meta": { "branch": "main", "commit": "55709f183b0742a7e4f47688c284f81148ad4dc0" },
20-
"mason-lspconfig.nvim": { "branch": "main", "commit": "c6c686781f9841d855bf1b926e10aa5e19430a38" },
20+
"mason-lspconfig.nvim": { "branch": "main", "commit": "97d9f1d3ad205dece6bcafd1d71cf1507608f3c7" },
2121
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
2222
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
23-
"mini.nvim": { "branch": "main", "commit": "546b9c8bd8ebba594bd18811e54bd3e6f9a662ec" },
23+
"mini.nvim": { "branch": "main", "commit": "b1af49d98233180c6045e81f4aef5b663d032b62" },
2424
"neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
2525
"newpaper.nvim": { "branch": "main", "commit": "ff1038a92f0a5d6a5e705becb086ccf38c27046d" },
2626
"nightfox.nvim": { "branch": "main", "commit": "595ffb8f291fc4a9bef3201a28b7c0379a41cdee" },
2727
"nui.nvim": { "branch": "main", "commit": "53e907ffe5eedebdca1cd503b00aa8692068ca46" },
2828
"nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" },
29-
"nvim-cmp": { "branch": "main", "commit": "b555203ce4bd7ff6192e759af3362f9d217e8c89" },
30-
"nvim-lspconfig": { "branch": "master", "commit": "a8ef5e6e497b3ebeaaf35b939c07c211563b2e05" },
29+
"nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" },
30+
"nvim-lspconfig": { "branch": "master", "commit": "8121483b8132b7053120fafd83728178fb3febf6" },
3131
"nvim-tree.lua": { "branch": "master", "commit": "68fc4c20f5803444277022c681785c5edd11916d" },
32-
"nvim-treesitter": { "branch": "master", "commit": "6935286b4ee3d938954e446d657eebee71b4d07a" },
32+
"nvim-treesitter": { "branch": "master", "commit": "622a4a6ba76d1de52b72a965159213ae655b4ac7" },
3333
"nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" },
3434
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
3535
"onedark": { "branch": "master", "commit": "67a74c275d1116d575ab25485d1bfa6b2a9c38a6" },
3636
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
37-
"snacks.nvim": { "branch": "main", "commit": "d312053f78b4fb55523def179ac502438dd93193" },
37+
"snacks.nvim": { "branch": "main", "commit": "14e89401da348f5d14509fca164fb7bcec83e597" },
3838
"telescope-fzf-native.nvim": { "branch": "main", "commit": "dae2eac9d91464448b584c7949a31df8faefec56" },
3939
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
4040
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
4141
"todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" },
42-
"tokyonight.nvim": { "branch": "main", "commit": "45d22cf0e1b93476d3b6d362d720412b3d34465c" },
42+
"tokyonight.nvim": { "branch": "main", "commit": "7bb270adaa7692c2c33befc35f5567fc596a2504" },
4343
"trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" },
4444
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
45-
"which-key.nvim": { "branch": "main", "commit": "8ab96b38a2530eacba5be717f52e04601eb59326" },
45+
"which-key.nvim": { "branch": "main", "commit": "1f8d414f61e0b05958c342df9b6a4c89ce268766" },
4646
"zenbones.nvim": { "branch": "main", "commit": "3c0b86bb912d41d191d90c019a346f6a1d27f588" }
4747
}

0 commit comments

Comments
 (0)