I set lazy-loading with keys events for f and \f. f has no problem, but \f does a strange behavior.
This init.lua defines f and \f to launch telescope.nvim.
minmal
init.lua
local install_path = vim.fn.stdpath'data'..'/site/pack/packer/opt/packer.nvim'
if vim.fn.isdirectory(install_path) == 0 then
os.execute('git clone https://github.com/wbthomason/packer.nvim '..install_path)
vim.cmd'packadd packer.nvim'
end
require'packer'.startup(function()
use'wbthomason/packer.nvim'
use{
'nvim-telescope/telescope.nvim',
requires = {
'nvim-lua/popup.nvim',
'nvim-lua/plenary.nvim',
},
keys = {
[[\f]],
'f',
},
config = function()
for _, key in ipairs{[[\f]], 'f'} do
vim.api.nvim_set_keymap(
'n',
key,
[[<Cmd>lua require'telescope.builtin'.find_files()<CR>]],
{noremap = true}
)
end
end,
}
end)
nvim -i NONE -nu minimal.lua:PackerInstall & :PackerCompile:qaAnd then, type f at first, it has no problem.
nvim -i NONE -nu minimal.luaf, then it launches telescope.nvim.\f, then it launches again.But type \f at first...
nvim -i NONE -nu minimal.lua\f, then it does nothing!\f again, it launches telescope.nvim.f, \f goes good hereafter.Perhaps mappings starting with \ has some problems?
Thanks to the wonderful @nanotee, this should be resolved by #160. Sorry for the slow response otherwise!
Most helpful comment
Thanks to the wonderful @nanotee, this should be resolved by #160. Sorry for the slow response otherwise!