Packer.nvim: packer does not detect \... mappings at the first time

Created on 12 Jan 2021  路  1Comment  路  Source: wbthomason/packer.nvim

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)

  1. nvim -i NONE -nu minimal.lua
  2. :PackerInstall & :PackerCompile
  3. :qa

And then, type f at first, it has no problem.

  1. nvim -i NONE -nu minimal.lua
  2. type f, then it launches telescope.nvim.
  3. And type \f, then it launches again.

But type \f at first...

  1. nvim -i NONE -nu minimal.lua
  2. type \f, then it does nothing!
  3. type \f again, it launches telescope.nvim.
  4. f, \f goes good hereafter.

Perhaps mappings starting with \ has some problems?

Most helpful comment

Thanks to the wonderful @nanotee, this should be resolved by #160. Sorry for the slow response otherwise!

>All comments

Thanks to the wonderful @nanotee, this should be resolved by #160. Sorry for the slow response otherwise!

Was this page helpful?
0 / 5 - 0 ratings