Replies: 4 comments
-
|
vim.pack's not-quite-as-friendly with Telescope's dependency graph since plenary/telescope-fzf-native are transitive: vim.pack.add({
{ src = 'https://github.com/nvim-lua/plenary.nvim' },
{ src = 'https://github.com/nvim-telescope/telescope.nvim' },
})
-- fzf-native needs a `make` step, so either prebuild or:
vim.pack.add({ { src = 'https://github.com/nvim-telescope/telescope-fzf-native.nvim',
build = function() vim.fn.system({'make'}) end } })Then |
Beta Was this translation helpful? Give feedback.
-
|
@MukundaKatta This looks promising, thank you. I will also abandon my idea of running Lazy and vim.pack side by side during migration; this attempt has already proven troublesome.
|
Beta Was this translation helpful? Give feedback.
-
|
@MukundaKatta I have now moved to a new setup which does not use vim.api.nvim_create_autocmd({ "PackChanged", "VimEnter" }, {
callback = my_telescope_setup_callback,
})Like you, Evgeni Chasnovski's suggests using hooks for dedicated events PackChangedPre | PackChanged, but I had to add VimEnter to get reliable activation of Telescope. |
Beta Was this translation helpful? Give feedback.
-
|
This is how I did it: -- FILE: nvim/plugin/telescope.lua
-- AUTOCOMMANDS
-- WARN: This is a build for installation (and also update) step, so it must
-- come before adding the plugins in order to get triggered.
vim.api.nvim_create_autocmd('PackChanged', {
desc = 'telescope: build extensions and setup it up in order',
callback = function(ev)
local name, kind = ev.data.spec.name, ev.data.kind
if name == 'telescope-fzf-native.nvim' and (kind == 'install' or kind == 'update') then
vim.system({ 'make' }, { cwd = ev.data.path })
end
end,
})
-- SETUP
vim.pack.add {
-- Order matters to respect dependency tree.
'https://github.com/nvim-lua/plenary.nvim',
'https://github.com/nvim-telescope/telescope.nvim',
'https://github.com/nvim-telescope/telescope-fzf-native.nvim',
}
require('telescope').setup {
extensions = {
fzf = {
fuzzy = true,
override_generic_sorter = true,
override_file_sorter = true,
case_mode = 'smart_case',
},
},
}
require('telescope').load_extension 'fzf'
-- KEYMAPS
local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>f', builtin.find_files, { desc = 'pick files' })
-- ...
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to move from
Lazytovim.packwhere possible, and I am wondering about how best to configure Telescope. Given that Telescope has various dependencies, and that the available instructions focus on using Lazy, I wonder if any of you have a working vim.pack based configuration you might be willing to share? Thank you.Beta Was this translation helpful? Give feedback.
All reactions