kylechui / nvim-surround

Add/change/delete surrounding delimiter pairs with ease. Written with :heart: in Lua.
MIT License
3.19k stars 62 forks source link

leap.nvim compatibility #11

Closed yingzhu146 closed 2 years ago

yingzhu146 commented 2 years ago

NVIM v0.8.0-dev+1878-g7f8f8d6cb on a macboor air M1.

require("nvim-surround").setup({
    keymaps = { -- vim-surround style keymaps
        insert = "yf",
        visual = "F",
        delete = "df",
        change = "cf",
    },
    delimiters = {
        pairs = {
            ["("] = { "( ", " )" },
            [")"] = { "(", ")" },
            ["{"] = { "{ ", " }" },
            ["}"] = { "{", "}" },
            ["<"] = { "< ", " >" },
            [">"] = { "<", ">" },
            ["["] = { "[ ", " ]" },
            ["]"] = { "[", "]" },
        },
        separators = {
            ["'"] = { "'", "'" },
            ['"'] = { '"', '"' },
            ["`"] = { "`", "`" },
        },
        HTML = {
            ["t"] = true, -- Use "t" for HTML-style mappings
        },
        aliases = {
            ["a"] = ">", -- Single character aliases apply everywhere
            ["b"] = ")",
            ["B"] = "}",
            ["r"] = "]",
            ["q"] = { '"', "'", "`" }, -- Table aliases only apply for changes/deletions
        },
    }
})

The issue is - s is already taken by https://github.com/ggandor/leap.nvim. However, if I type cf/df/... with the config above, somehow leap is triggered.

kylechui commented 2 years ago

I'll preface this by saying that I don't use leap.nvim, but I will say that the insert/delete/change keybinds shouldn't interfere with leap's, since s is a suffix for nvim-surround's ys. If leap's S only applies to normal mode, then there's no conflict with nvim-surround either, since the visual mapping is only bound to visual mode (xmap).

With that aside, I tried your above config and wasn't able to replicate your bug; cf/df didn't trigger leap for me, instead changing/deleting the surrounding pair as intended. Maybe it has to do with the latest nightly?

Ramilito commented 2 years ago

I thought i had that issue before using vim-surround but turned out I wasn’t hitting ys fast enough, @yingzhu146 could you try that really fast?

yingzhu146 commented 2 years ago

thanks both of you @kylechui and @Ramilito!

I've tested it both with yf/cf/... and ys/cs/... settings, i.e.

require("nvim-surround").setup({
    keymaps = { -- vim-surround style keymaps
        insert = "yf",
        visual = "F",
        delete = "df",
        change = "cf",
    },
)

and the respective mappings.

Same result in both - see screencasts here:

(Note: the weird cmd-shift-o you can see in the keystrokes is is how I remapped ' and " respectively OS wide so just interpret that as ' and ")

https://user-images.githubusercontent.com/59233975/177004086-8bf7fb88-160b-427f-a187-dcbb9af92885.mov

https://user-images.githubusercontent.com/59233975/177004084-5f54caca-2bd3-4f0c-9c82-119d9b89ecd8.mov

The orange hints are from leap.nvim - you can see it's getting triggered and surround shows an error ( E492: Not an editor command: pfunc=v:lua.require('nvim-surround.utils').NOOP)

I have tried both fast and slow typing, same results

kylechui commented 2 years ago

I think I maybe see what's going on? I'm setting the operatorfunc using a vim.api.nvim_feedkeys call, which emulates user typing. Since it looks to me that the first two characters of the command (:o) are missing, I would guess that leap's consuming the first two characters as its input for searching the screen. I would maybe try deleting/reinstalling nvim-surround. If that doesn't work, can you let me know what functions the keymaps ys/ds/cs/S are mapped to? I don't actually know how to do this without using Telescope (:Telescope keymaps), but hopefully you can find some way to get that information to me

yingzhu146 commented 2 years ago

redir! > ~/.cache/maps.txt | silent verbose map | redir END | vsplit ~/.cache/maps.txt is probably the most convenient to get it for copy paste :)

here it is


n  <CR>        * <Cmd> Telescope frecency<CR>
    Last set from Lua
n  <Esc>       * <Cmd> noh <CR>
    Last set from Lua
n  !iÞ         * <Nop>
    Last set from Lua
n  !aÞ         * <Nop>
    Last set from Lua
n  !Þ          * <Nop>
    Last set from Lua
n  !           * <Cmd>lua require("which-key").show("!", {mode = "n", auto = true})<CR>
    Last set from Lua
x  #           * y?\V<C-R>"<CR>
x  *           * y/\V<C-R>"<CR>
n  <iÞ         * <Nop>
    Last set from Lua
n  <aÞ         * <Nop>
    Last set from Lua
n  <Þ          * <Nop>
    Last set from Lua
n  <           * <Cmd>lua require("which-key").show("<", {mode = "n", auto = true})<CR>
    Last set from Lua
n  >iÞ         * <Nop>
    Last set from Lua
n  >aÞ         * <Nop>
    Last set from Lua
n  >Þ          * <Nop>
    Last set from Lua
n  >           * <Cmd>lua require("which-key").show(">", {mode = "n", auto = true})<CR>
    Last set from Lua
n  B           * <Cmd> enew <CR>
    Last set from Lua
n  H           * <Cmd> tabp<CR>
    Last set from Lua
n  K           * <Cmd>lua require("which-key").execute(24)<CR>
    Last set from Lua
n  L           * <Cmd> tabp<CR>
    Last set from Lua
n  Q           * <Cmd> q!<CR>
    Last set from Lua
x  S           * <Lua function 38>
    Last set from Lua
n  X           * <Cmd> tabc<CR>
    Last set from Lua
n  Y           * y$
n  [d          * <Cmd>lua require("which-key").execute(20)<CR>
    Last set from Lua
n  [Þ          * <Nop>
    Last set from Lua
n  [           * <Cmd>lua require("which-key").show("[", {mode = "n", auto = true})<CR>
    Last set from Lua
n  ]Þ          * <Nop>
    Last set from Lua
n  ]           * <Cmd>lua require("which-key").show("]", {mode = "n", auto = true})<CR>
    Last set from Lua
n  am          * <Cmd> MaximizerToggle<CR>
    Last set from Lua
n  aÞ          * <Nop>
    Last set from Lua
n  a           * <Cmd>lua require("which-key").show("a", {mode = "n", auto = true})<CR>
    Last set from Lua
n  ar          * <Cmd> WinResizerStartResize<CR>
    Last set from Lua
x  aÞ          * <Nop>
    Last set from Lua
x  a           * <Cmd>lua require("which-key").show("a", {mode = "v", auto = true})<CR>
    Last set from Lua
n  ciÞ         * <Nop>
    Last set from Lua
n  caÞ         * <Nop>
    Last set from Lua
n  cÞ          * <Nop>
    Last set from Lua
n  c           * <Cmd>lua require("which-key").show("c", {mode = "n", auto = true})<CR>
    Last set from Lua
n  cf          * <Lua function 40>
    Last set from Lua
n  d]          * <Cmd>lua require("which-key").execute(22)<CR>
    Last set from Lua
n  diÞ         * <Nop>
    Last set from Lua
n  daÞ         * <Nop>
    Last set from Lua
n  dÞ          * <Nop>
    Last set from Lua
n  d           * <Cmd>lua require("which-key").show("d", {mode = "n", auto = true})<CR>
    Last set from Lua
n  df          * <Lua function 39>
    Last set from Lua
n  fff         * <Cmd>lua require("which-key").execute(34)<CR>
    Last set from Lua
n  ffws        * <Cmd> Telescope lsp_dynamic_workspace_symbols<CR>
    Last set from Lua
n  ffwl        * <Cmd>lua require("which-key").execute(33)<CR>
    Last set from Lua
n  ffwr        * <Cmd>lua require("which-key").execute(32)<CR>
    Last set from Lua
n  ffwa        * <Cmd>lua require("which-key").execute(31)<CR>
    Last set from Lua
n  ffl         * <Cmd>lua require("which-key").execute(30)<CR>
    Last set from Lua
n  ffc         * <Cmd>lua require("which-key").execute(29)<CR>
    Last set from Lua
n  ffd         * <Cmd>lua require("which-key").execute(28)<CR>
    Last set from Lua
n  ffr         * luaeval('require("which-key").execute(27)')
    Last set from Lua
n  ffs         * <Cmd>:Telescope lsp_document_symbols<CR>"
    Last set from Lua
n  ffh         * <Cmd>lua require("which-key").execute(25)<CR>
    Last set from Lua
n  fq          * <Cmd>lua require("which-key").execute(23)<CR>
    Last set from Lua
v  fkkw        * <Cmd> KittySendSelection<CR>
    Last set from Lua
x  fkkÞ        * <Nop>
    Last set from Lua
x  fkÞ         * <Nop>
    Last set from Lua
v  fkkl        * <Cmd> KittySendLines<CR>
    Last set from Lua
n  fkkn        * <Cmd> KittyNu<CR>
    Last set from Lua
n  fkkf        * <Cmd> KittySendFile<CR>
    Last set from Lua
n  fkkh        * <Cmd> KittyHs<CR>
    Last set from Lua
n  fkkw        * <Cmd> KittySendWord<CR>
    Last set from Lua
n  fkkc        * <Cmd> KittySendCell<CR>
    Last set from Lua
n  fkki        * <Cmd> KittyIPy<CR>
    Last set from Lua
n  fkkÞ        * <Nop>
    Last set from Lua
n  fkkl        * <Cmd> KittySendCurrentLine<CR>
    Last set from Lua
v  f/          * <Esc><Cmd>lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())<CR>
    Last set from Lua
n  f/          * <Cmd>lua require("which-key").execute(19)<CR>
    Last set from Lua
v  fg          * viw"ay:exec ":Telescope grep_string search=".expand(@")<CR>
    Last set from Lua
n  fe          * <Cmd> NvimTreeToggle<CR>
    Last set from Lua
n  fcm         * <Cmd> Telescope git_commits <CR>
    Last set from Lua
n  fkvh        * <Cmd> Telescope highlights<CR>
    Last set from Lua
n  ffw         * <Cmd> Telescope live_grep <CR>
    Last set from Lua
n  fs          * <Cmd> Telescope find_files hidden=true no_ignore=true<CR>
    Last set from Lua
n  fkvo        * <Cmd> Telescope vim_options<CR>
    Last set from Lua
n  fkgf        * <Cmd> Telescope gh pull_request_files<CR>
    Last set from Lua
n  fkgp        * <Cmd> Telescope gh pull_request<CR>
    Last set from Lua
n  fkgi        * <Cmd> Telescope gh issues<CR>
    Last set from Lua
n  ftk         * <Cmd> Telescope keymaps <CR>
    Last set from Lua
n  fkgr        * <Cmd> Telescope gh run<CR>
    Last set from Lua
n  ffo         * <Cmd> Telescope oldfiles <CR>
    Last set from Lua
n  fkgb        * <Cmd> Telescope git_branches<CR>
    Last set from Lua
n  fkgc        * <Cmd> Telescope git_commits<CR>
    Last set from Lua
n  fo          * <Cmd> Telescope file_browser hidden=true respect_gitignore=false<CR>
    Last set from Lua
n  ffb         * <Cmd> Telescope buffers <CR>
    Last set from Lua
n  fkgs        * <Cmd> Telescope git_status <CR>
    Last set from Lua
n  fa          * <Cmd> Telescope live_grep_args<CR>
    Last set from Lua
n  fkgÞ        * <Nop>
    Last set from Lua
n  fkgn        * <Cmd> Neogit <CR>
    Last set from Lua
n  ffÞ         * <Nop>
    Last set from Lua
n  ffa         * <Cmd> Telescope find_files follow=true no_ignore=true hidden=true <CR>
    Last set from Lua
n  fkc         * <Cmd> Telescope commands<CR>
    Last set from Lua
n  fr          * <Cmd> Telescope jumplist<CR>
    Last set from Lua
n  fkh         * <Cmd> Telescope help_tags<CR>
    Last set from Lua
n  fl          * <Cmd> Telescope current_buffer_fuzzy_find<CR>
    Last set from Lua
n  fkm         * <Cmd> Telescope man_pages<CR>
    Last set from Lua
n  f.          * <Cmd>:Telescope command_history<CR>"
    Last set from Lua
n  fh          * <Cmd> :Telescope resume<CR>
    Last set from Lua
n  fg          * viw"ay:exec ":Telescope grep_string search=".expand(@")<CR>
    Last set from Lua
n  fth         * <Cmd> Telescope themes <CR>
    Last set from Lua
n  fpÞ         * <Nop>
    Last set from Lua
n  fpt         * <Cmd> Telescope terms <CR>
    Last set from Lua
n  fkva        * <Cmd> Telescope autocommands<CR>
    Last set from Lua
n  fgÞ         * <Nop>
    Last set from Lua
n  fgt         * <Cmd> Telescope git_status <CR>
    Last set from Lua
n  fkvÞ        * <Nop>
    Last set from Lua
n  fkÞ         * <Nop>
    Last set from Lua
n  fkvk        * <Cmd> Telescope keymaps<CR>
    Last set from Lua
n  fv          * <Cmd>lua require("which-key").execute(16)<CR>
    Last set from Lua
n  fwk         * <Cmd>lua require("which-key").execute(11)<CR>
    Last set from Lua
n  fwÞ         * <Nop>
    Last set from Lua
n  fwK         * <Cmd>lua require("which-key").execute(10)<CR>
    Last set from Lua
n  ftt         * <Cmd>lua require("which-key").execute(9)<CR>
    Last set from Lua
n  fuÞ         * <Nop>
    Last set from Lua
n  fuu         * <Cmd> :NvChadUpdate <CR>
    Last set from Lua
n  frÞ         * <Nop>
    Last set from Lua
n  frn         * <Cmd> set rnu! <CR>
    Last set from Lua
n  fn          * <Cmd> set nu! <CR>
    Last set from Lua
n  fcÞ         * <Nop>
    Last set from Lua
n  fcd         * <Cmd> cd %:h<CR>
    Last set from Lua
n  ftr         * <Cmd> :Trouble<CR>
    Last set from Lua
n  fm          * <Cmd> :SymbolsOutline<CR>
    Last set from Lua
n  fx          * <Cmd>lua require("which-key").execute(5)<CR>
    Last set from Lua
n  ftn         * <Cmd> tabnext <CR><Space>
    Last set from Lua
n  ftÞ         * <Nop>
    Last set from Lua
n  ftp         * <Cmd> tabprevious <CR>
    Last set from Lua
n  fbÞ         * <Nop>
    Last set from Lua
n  fbc         * <Cmd>lua require("which-key").execute(2)<CR>
    Last set from Lua
x  fiÞ         * <Nop>
    Last set from Lua
v  fid         * <Cmd>lua require("which-key").execute(1)<CR>
    Last set from Lua
n  fiÞ         * <Nop>
    Last set from Lua
n  fid         * <Cmd> DashWord<CR>
    Last set from Lua
x  fÞ          * <Nop>
    Last set from Lua
x  f           * <Cmd>lua require("which-key").show("f", {mode = "v", auto = true})<CR>
    Last set from Lua
n  fÞ          * <Nop>
    Last set from Lua
n  f           * <Cmd>lua require("which-key").show("f", {mode = "n", auto = true})<CR>
    Last set from Lua
n  gr          * <Cmd> Telescope lsp_references<CR>
    Last set from Lua
n  gi          * <Cmd>lua require("which-key").execute(26)<CR>
    Last set from Lua
n  gd          * <Cmd> Telescope lsp_definitions<CR>
    Last set from Lua
n  gD          * <Cmd>lua require("which-key").execute(21)<CR>
    Last set from Lua
n  ghÞ         * <Nop>
    Last set from Lua
n  ghr         * <Cmd> Telescope gh run<CR>
    Last set from Lua
x  gÞ          * <Nop>
    Last set from Lua
x  g           * <Cmd>lua require("which-key").show("g", {mode = "v", auto = true})<CR>
    Last set from Lua
n  g~iÞ        * <Nop>
    Last set from Lua
n  g~aÞ        * <Nop>
    Last set from Lua
n  g~Þ         * <Nop>
    Last set from Lua
n  gUiÞ        * <Nop>
    Last set from Lua
n  gUaÞ        * <Nop>
    Last set from Lua
n  gUÞ         * <Nop>
    Last set from Lua
n  guiÞ        * <Nop>
    Last set from Lua
n  guaÞ        * <Nop>
    Last set from Lua
n  guÞ         * <Nop>
    Last set from Lua
n  gÞ          * <Nop>
    Last set from Lua
n  g           * <Cmd>lua require("which-key").show("g", {mode = "n", auto = true})<CR>
    Last set from Lua
   gc          * <Cmd>lua require("packer.load")({'Comment.nvim'}, { keys = "gc", prefix = "" }, _G.packer_plugins)<CR>
    Last set from Lua
   gb          * <Cmd>lua require("packer.load")({'Comment.nvim'}, { keys = "gb", prefix = "" }, _G.packer_plugins)<CR>
    Last set from Lua
x  iÞ          * <Nop>
    Last set from Lua
x  i           * <Cmd>lua require("which-key").show("i", {mode = "v", auto = true})<CR>
    Last set from Lua
n  j             <Plug>(faster_move_j)
    Last set from Lua
n  k             <Plug>(faster_move_k)
    Last set from Lua
n  s           * <Cmd>lua require("which-key").execute(4)<CR>
    Last set from Lua
v  s           * <Cmd>lua require("which-key").execute(3)<CR>
    Last set from Lua
n  viÞ         * <Nop>
    Last set from Lua
n  vaÞ         * <Nop>
    Last set from Lua
n  vÞ          * <Nop>
    Last set from Lua
n  v           * <Cmd>lua require("which-key").show("v", {mode = "n", auto = true})<CR>
    Last set from Lua
n  ycÞ         * <Nop>
    Last set from Lua
n  ycn         * <Cmd>lua require("which-key").execute(6)<CR>
    Last set from Lua
n  yiÞ         * <Nop>
    Last set from Lua
n  yaÞ         * <Nop>
    Last set from Lua
n  yÞ          * <Nop>
    Last set from Lua
n  y           * <Cmd>lua require("which-key").show("y", {mode = "n", auto = true})<CR>
    Last set from Lua
n  yf          * <Lua function 37>
    Last set from Lua
x  zÞ          * <Nop>
    Last set from Lua
x  z           * <Cmd>lua require("which-key").show("z", {mode = "v", auto = true})<CR>
    Last set from Lua
n  zfiÞ        * <Nop>
    Last set from Lua
n  zfaÞ        * <Nop>
    Last set from Lua
n  zfÞ         * <Nop>
    Last set from Lua
n  zÞ          * <Nop>
    Last set from Lua
n  z           * <Cmd>lua require("which-key").show("z", {mode = "n", auto = true})<CR>
    Last set from Lua
v  zb          * <Cmd>call smoothie#do("zb") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  zb          * <Cmd>call smoothie#do("zb") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  z-          * <Cmd>call smoothie#do("z-") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  z-          * <Cmd>call smoothie#do("z-") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  zz          * <Cmd>call smoothie#do("zz") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  zz          * <Cmd>call smoothie#do("zz") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  z.          * <Cmd>call smoothie#do("z.") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  z.          * <Cmd>call smoothie#do("z.") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  z<CR>       * <Cmd>call smoothie#do("z\<CR>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  z<CR>       * <Cmd>call smoothie#do("z\<CR>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  zt          * <Cmd>call smoothie#do("zt") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  zt          * <Cmd>call smoothie#do("zt") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  z^          * <Cmd>call smoothie#do("z^") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  z^          * <Cmd>call smoothie#do("z^") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  z+          * <Cmd>call smoothie#do("z+") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  z+          * <Cmd>call smoothie#do("z+") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  <M-i>       * <Cmd>lua require("which-key").execute(18)<CR>
    Last set from Lua
n  <M-v>       * <Cmd>lua require("which-key").execute(17)<CR>
    Last set from Lua
n  <M-h>       * <Cmd>lua require("which-key").execute(15)<CR>
    Last set from Lua
n  <C-H>       * <C-W>h
    Last set from Lua
n  <C-C>       * <Cmd> %y+ <CR>
    Last set from Lua
n  <C-K>       * <C-W>k
    Last set from Lua
n  <C-S>       * <Cmd> w <CR>
    Last set from Lua
n  <C-J>       * <C-W>j
    Last set from Lua
v  <C-Bslash>  * <c-\><C-N>
    Last set from Lua
n  <F6>        * :!open %:p<CR>
    Last set from Lua
n  <F7>        * :!chmod +x %<CR>
    Last set from Lua
n  <F3>        * :redir! > /tmp/aucommands.txt | silent autocmd | redir END | vsplit /tmp/aucommands.txt <CR>
    Last set from Lua
n  <F10>       * :redir! > /tmp/mappings.txt | silent verbose map | redir END | vsplit /tmp/mappings.txt <CR>
    Last set from Lua
n  <F9>        * <Cmd> Messages<CR>
    Last set from Lua
n  <F5>        * %:SnipRun
    Last set from Lua
n  <F2>        * <Cmd>lua require("which-key").execute(8)<CR>
    Last set from Lua
n  <F8>        * <Cmd>lua require("which-key").execute(7)<CR>
    Last set from Lua
n  <C-N>       * <Cmd> NvimTreeToggle <CR>
    Last set from Lua
n  <C-W>Þ      * <Nop>
    Last set from Lua
n  <C-W>       * <Cmd>lua require("which-key").show("\23", {mode = "n", auto = true})<CR>
    Last set from Lua
v  <Plug>(faster_vmove_k) * v:lua.faster("k")
    Last set from ~/.local/share/nvim/site/pack/packer/opt/faster.nvim/plugin/faster.vim line 10
v  <Plug>(faster_vmove_j) * v:lua.faster("j")
    Last set from ~/.local/share/nvim/site/pack/packer/opt/faster.nvim/plugin/faster.vim line 9
n  <Plug>(faster_move_gk) * :<C-U>lua require('faster').move("gk")<CR>
    Last set from ~/.local/share/nvim/site/pack/packer/opt/faster.nvim/plugin/faster.vim line 7
n  <Plug>(faster_move_gj) * :<C-U>lua require('faster').move("gj")<CR>
    Last set from ~/.local/share/nvim/site/pack/packer/opt/faster.nvim/plugin/faster.vim line 6
n  <Plug>(faster_move_k) * :<C-U>lua require('faster').move("k")<CR>
    Last set from ~/.local/share/nvim/site/pack/packer/opt/faster.nvim/plugin/faster.vim line 5
n  <Plug>(faster_move_j) * :<C-U>lua require('faster').move("j")<CR>
    Last set from ~/.local/share/nvim/site/pack/packer/opt/faster.nvim/plugin/faster.vim line 4
   <Plug>(SmoothieBackwards) * <Cmd>call smoothie#backwards() <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 71
   <Plug>(SmoothieForwards) * <Cmd>call smoothie#forwards()  <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 70
   <Plug>(SmoothieUpwards) * <Cmd>call smoothie#upwards()   <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 69
   <Plug>(SmoothieDownwards) * <Cmd>call smoothie#downwards() <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 68
v  <PageUp>    * <Cmd>call smoothie#do("\<PageUp>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  <PageUp>    * <Cmd>call smoothie#do("\<PageUp>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  <S-Up>      * <Cmd>call smoothie#do("\<S-Up>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  <S-Up>      * <Cmd>call smoothie#do("\<S-Up>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  <C-B>       * <Cmd>call smoothie#do("\<C-B>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  <C-B>       * <Cmd>call smoothie#do("\<C-B>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  <PageDown>  * <Cmd>call smoothie#do("\<PageDown>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  <PageDown>  * <Cmd>call smoothie#do("\<PageDown>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  <S-Down>    * <Cmd>call smoothie#do("\<S-Down>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  <S-Down>    * <Cmd>call smoothie#do("\<S-Down>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  <C-F>       * <Cmd>call smoothie#do("\<C-F>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  <C-F>       * <Cmd>call smoothie#do("\<C-F>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  <C-U>       * <Cmd>call smoothie#do("\<C-U>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  <C-U>       * <Cmd>call smoothie#do("\<C-U>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
v  <C-D>       * <Cmd>call smoothie#do("\<C-D>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
n  <C-D>       * <Cmd>call smoothie#do("\<C-D>") <CR>
    Last set from ~/.local/share/nvim/site/pack/packer/start/vim-smoothie/plugin/smoothie.vim line 62
o  <Plug>(leap-backward) * <Lua function 122>
    Last set from Lua
x  <Plug>(leap-backward) * <Lua function 121>
    Last set from Lua
n  <Plug>(leap-backward) * <Lua function 120>
    Last set from Lua
o  <Plug>(leap-forward) * <Lua function 119>
    Last set from Lua
x  <Plug>(leap-forward) * <Lua function 118>
    Last set from Lua
n  <Plug>(leap-forward) * <Lua function 117>
    Last set from Lua
o  <Plug>(leap-cross-window) * <Lua function 116>
    Last set from Lua
x  <Plug>(leap-cross-window) * <Lua function 115>
    Last set from Lua
n  <Plug>(leap-cross-window) * <Lua function 114>
    Last set from Lua
o  <Plug>(leap-backward-x) * <Lua function 113>
    Last set from Lua
x  <Plug>(leap-backward-x) * <Lua function 112>
    Last set from Lua
n  <Plug>(leap-backward-x) * <Lua function 111>
    Last set from Lua
o  <Plug>(leap-forward-x) * <Lua function 110>
    Last set from Lua
x  <Plug>(leap-forward-x) * <Lua function 109>
    Last set from Lua
n  <Plug>(leap-forward-x) * <Lua function 108>
    Last set from Lua
n  <Plug>SnipClose   :lua require'sniprun.display'.close_all()<CR>
    Last set from Lua
n  <Plug>SnipReplMemoryClean   :lua require'sniprun'.clear_repl()<CR>
    Last set from Lua
n  <Plug>SnipInfo   :lua require'sniprun'.info()<CR>
    Last set from Lua
n  <Plug>SnipReset   :lua require'sniprun'.reset()<CR>
    Last set from Lua
n  <Plug>SnipRTerminate   :lua require'sniprun'.terminate()<CR>
    Last set from Lua
n  <Plug>SnipRunOperator   :set opfunc=SnipRunOperator<CR>g@
    Last set from Lua
n  <Plug>SnipRun   :lua require'sniprun'.run()<CR>
    Last set from Lua
v  <Plug>SnipRun   :lua require'sniprun'.run('v')<CR>
    Last set from Lua
n  <Plug>SnipLive   :lua require'sniprun.live_mode'.toggle()<CR>
    Last set from Lua
n  <Plug>PlenaryTestFile * :lua require('plenary.test_harness').test_directory(vim.fn.expand("%:p"))<CR>
    Last set from ~/.local/share/nvim/site/pack/packer/opt/plenary.nvim/plugin/plenary.vim line 9
n  <C-L>       * <C-W>l
    Last set from Lua
kylechui commented 2 years ago

Hi, can you update to the latest commit on branch implement-dot-repeat and let me know if that fixes the issue? I think it should resolve #15, which seems to be a similar (if not the same) issue as the one you are experiencing.

yingzhu146 commented 2 years ago

just tested, no dice :/

yingzhu146 commented 2 years ago

it seems behaving differently though - still getting E492: Not an editor command: pfunc=v:lua.require('nvim-surround.utils').NOOP but leap doesn't light up anymore? even with s map

kylechui commented 2 years ago

Can you let me know exactly which maps you're using for which plugins? I've gotten a bit lost with which one's what---also for all of the nvim-surround keymaps that you decide on using, can you run :verbose nmap [map] (e.g. :verbose nmap ys)? The 500+ line message you replied with earlier is a bit unwieldy.

yingzhu146 commented 2 years ago

Sure. For leap I'm using the default maps.


s{char}{char}              Jump to the first character of {char}{char}
                           in the forward direction.
S{char}{char}              Jump to the first character of {char}{char}
                           in the backward direction.

for surround I tried multiple - the last statement (where leap doesn't appear to light up - only getting the NOOP error) I'm using


keymaps = { -- vim-surround style keymaps
        insert = "ys",
        visual = "S",
        delete = "ds",
        change = "cs",
    },

here's ys

n  y           * <Cmd>lua require("which-key").show("y", {mode = "n", auto = true})<CR>
        Last set from Lua
n  ys          * <Lua function 38>
        Last set from Lua

here's cs

n  c           * <Cmd>lua require("which-key").show("c", {mode = "n", auto = true})<CR>
        Last set from Lua
n  cs          * <Lua function 41>
        Last set from Lua
kylechui commented 2 years ago

I'm still unable to reproduce the error, even after installing both which-key and leap.nvim:

    use({
        "kylechui/nvim-surround",
        config = function()
            require("nvim-surround").setup()
        end,
    })
    use({
        "ggandor/leap.nvim",
        config = function()
            require("leap").set_default_keymaps()
        end,
    })
    use({
        "folke/which-key.nvim",
        config = function()
            require("which-key").setup({})
        end,
    })

I'm sorry to ask this again, but can you try uninstalling all three and use the packer code that I've included above in your config? The keybinds shouldn't have any conflicts with one another

yingzhu146 commented 2 years ago

Just uninstalled/reinstalled everything with the default configs you sent above. I think the keymap issue is gone since you updated since I don't see leap flicker anymore and I'm just facing a second (possibly unrelated?) issue - which is that there's an error whatever action I try to do e.g. csqb doesn't do anything and I get E492: Not an editor command: pfunc=v:lua.require('nvim-surround.utils').NOOP

Happy to open a separate issue for that.

Thanks so much for your help!

kylechui commented 2 years ago

Can you try the same default config I sent above again but with only nvim-surround and which-key? I have a feeling this might be the same as (#15). Modified config for you convenience:

    use({
        "kylechui/nvim-surround",
        config = function()
            require("nvim-surround").setup()
        end,
    })
    use({
        "folke/which-key.nvim",
        config = function()
            require("which-key").setup({})
        end,
    })
kylechui commented 2 years ago

@yingzhu146 Can you see if the error is still persisting on the latest commit on the main branch? I just resolved #15 so it might have resolved your issue as well

kylechui commented 2 years ago

Closing this issue due to inactivity; if the issue persists, feel free to reopen

yingzhu146 commented 2 years ago

Hi Kyle, looks like it was indeed #15 - newest commit resolves!