Hi
I recently installed two plugins (Telescope & Lazy.vim) for nvim, they work perfectly if I’m editing the init.lua file, but when I try to use them in other directory or file, they won’t work. Why does this happen?
VIDEO I USED TO INSTALL THE PLUGINS: https://www.youtube.com/watch?v=zHTeCSVAFNY&list=PLsz00TDipIffreIaUNk64KxTIkQaGguqn
Notes
I’m on Windows 10. I ran the :source %
command as the video above said and it worked, but not in other directories/files.
init.lua file content (at ~/.config/nvim/init.lua):
-- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require('lazy.view.config').keys.close = '<Esc>'
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- Setup lazy.nvim
require("lazy").setup({
spec = {
{
'nvim-telescope/telescope.nvim', tag = '0.1.5',
dependencies = { 'nvim-lua/plenary.nvim' }
},
},
install = { colorscheme = { "habamax" } },
checker = { enabled = true },
})
local builtin = require("telescope.builtin")
vim.keymap.set('n', '<C-p>', builtin.find_files, {})
Plugins installed: Telescope & Lazy vim
When I try to open Telescope (with ctrl + p), it doesn’t open.