mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-08 10:02:29 +00:00
chore(nvim): telescope config tweaks
This commit is contained in:
@@ -14,6 +14,10 @@ return {
|
|||||||
-- https://github.com/polirritmico/telescope-lazy-plugins.nvim
|
-- https://github.com/polirritmico/telescope-lazy-plugins.nvim
|
||||||
{ 'polirritmico/telescope-lazy-plugins.nvim' },
|
{ 'polirritmico/telescope-lazy-plugins.nvim' },
|
||||||
|
|
||||||
|
-- Neovim plugin. Telescope.nvim extension that adds LuaSnip integration.
|
||||||
|
-- https://github.com/benfowler/telescope-luasnip.nvim
|
||||||
|
{ 'benfowler/telescope-luasnip.nvim' },
|
||||||
|
|
||||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||||
-- Only load if `make` is available
|
-- Only load if `make` is available
|
||||||
{
|
{
|
||||||
@@ -21,6 +25,10 @@ return {
|
|||||||
build = 'make',
|
build = 'make',
|
||||||
cond = vim.fn.executable 'make' == 1,
|
cond = vim.fn.executable 'make' == 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Import modules with ease
|
||||||
|
-- https://github.com/piersolenski/telescope-import.nvim
|
||||||
|
{ 'piersolenski/telescope-import.nvim' },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local t = require 'telescope'
|
local t = require 'telescope'
|
||||||
@@ -51,6 +59,23 @@ return {
|
|||||||
-- Must be a valid path to the file containing the lazy spec and setup() call.
|
-- Must be a valid path to the file containing the lazy spec and setup() call.
|
||||||
lazy_config = vim.fn.stdpath 'config' .. '/init.lua',
|
lazy_config = vim.fn.stdpath 'config' .. '/init.lua',
|
||||||
},
|
},
|
||||||
|
import = {
|
||||||
|
-- Imports can be added at a specified line whilst keeping the cursor in place
|
||||||
|
insert_at_top = true,
|
||||||
|
-- Optionally support additional languages or modify existing languages...
|
||||||
|
custom_languages = {
|
||||||
|
{
|
||||||
|
-- The filetypes that ripgrep supports (find these via `rg --type-list`)
|
||||||
|
extensions = { 'js', 'ts' },
|
||||||
|
-- The Vim filetypes
|
||||||
|
filetypes = { 'vue' },
|
||||||
|
-- Optionally set a line other than 1
|
||||||
|
insert_at_line = 2, ---@type function|number
|
||||||
|
-- The regex pattern for the import statement
|
||||||
|
regex = [[^(?:import(?:[\"'\s]*([\w*{}\n, ]+)from\s*)?[\"'\s](.*?)[\"'\s].*)]],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,6 +83,8 @@ return {
|
|||||||
pcall(t.load_extension, 'harpoon')
|
pcall(t.load_extension, 'harpoon')
|
||||||
pcall(t.load_extension, 'git_worktree')
|
pcall(t.load_extension, 'git_worktree')
|
||||||
pcall(t.load_extension, 'lazy_plugins')
|
pcall(t.load_extension, 'lazy_plugins')
|
||||||
|
pcall(t.load_extension, 'luasnip')
|
||||||
|
pcall(t.load_extension, 'import')
|
||||||
|
|
||||||
-- Enable telescope fzf native, if installed
|
-- Enable telescope fzf native, if installed
|
||||||
pcall(t.load_extension, 'fzf')
|
pcall(t.load_extension, 'fzf')
|
||||||
@@ -67,10 +94,12 @@ return {
|
|||||||
-- See `:help telescope.keymap`
|
-- See `:help telescope.keymap`
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
vim.keymap.set('n', '<leader>/', function()
|
||||||
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
||||||
require('telescope.builtin').current_buffer_fuzzy_find(themes.get_dropdown {
|
require('telescope.builtin').current_buffer_fuzzy_find(
|
||||||
winblend = 10,
|
themes.get_dropdown {
|
||||||
previewer = true,
|
winblend = 20,
|
||||||
})
|
previewer = true,
|
||||||
|
}
|
||||||
|
)
|
||||||
end, { desc = '[/] Fuzzily search in current buffer]' })
|
end, { desc = '[/] Fuzzily search in current buffer]' })
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user