Skip to content

Plugin isn't working but keybindings have been mapped  #115

Closed

Description

@hpb0412

I am following the Neovim from Scratch tutorial but all features don't work.

My specs:

  • Mac M1 (Monterey: 12.1)

  • iterm2

  • Neovim info:

    NVIM v0.6.1
    Build type: Release
    LuaJIT 2.1.0-beta3
    Compiled by brew@HMBRW-A-001-M1-004.local
    
    Features: +acl +iconv +tui
    See ":help feature-compile"
    
       system vimrc file: "$VIM/sysinit.vim"
       fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.6.1/share/nvim"
  • My setup:

    -- comment.lua
    local status_ok, comment = pcall(require, "Comment")
    if not status_ok then
      vim.notify("Comment not found!")
      return
    end
    comment.setup()
    
    -- plugins.lua
    -- ...other stuffs
    use "numToStr/Comment.nvim"
    -- ...
    
    -- init.lua
    require "path.to.plugins"
    require "path.to.comment"

    I also try the instruction from the README.md of this repo

    use {
      'numToStr/Comment.nvim',
      config = function()
          require('Comment').setup()
      end
    }
  • I check the :map and found all keymaps have been mapped
    Screen Shot 2022-02-08 at 12 16 18 PM

  • Issue: using the gcc and/or other actions doesn't work at all.
    Ex: after typing the gcc the cursor converted to underline and no commenting out

Screen.Recording.2022-02-08.at.12.09.29.PM.mov
  • What i did:
    • Try to set mapping.basic to true (at the setup function call)
    • Try different languages: lua, html, css, js, jsx, ts => all doesn't work
    • Try 2 ways of configuration (mentioned above)
    • The only way that works:
      • mimic the mapping with neovim command line
      :lua require("Comment.api").call("toggle_current_linewise_op")
      • then type enter to confirm the command
      • then g@$

Activity

  1. numToStr commented on Feb 8, 2022

    @numToStr
    Owner

    Hmmm, this is interesting but I can't do much by myself as I don't use iTerm.


    Ok, so if all the mappings are set then running :normal gcc should work. Can you try running the command?

  2. hpb0412 commented on Feb 8, 2022

    @hpb0412
    Author

    Hi @numToStr,
    No worries, I totally understand of the device-dependent issue.

    FYI, the :normal gcc works 👍
    Hope it can give you some ideas about the issue.

    Thanks 🙇

  3. numToStr commented on Feb 8, 2022

    @numToStr
    Owner

    FYI, the :normal gcc works +1 Hope it can give you some ideas about the issue.

    Then I can only say that something is wrong with your config or setup. This plugin doesn't contain OS specific things, so I would doubt that this is related to this plugin. I would recommend asking other people (on neovim matrix or reddit) with a similar setup.

  4. hpb0412 commented on Feb 8, 2022

    @hpb0412
    Author

    I found the cause.

    I guessed it is because of some kind of key typing timeout.
    I went to configuration and found that my timeoutlen of neovim is 100 while default it should be 1000.
    Therefore I switch back to 1000 and the plugin works very well.

    Thank you 🙇

  5. added
    questionQuestion related to integration and other stuff
    on Feb 21, 2022
  6. pinned this issue on Feb 21, 2022
  7. changed the title [-]The plugin doesn't work on iterm2 / Mac OS[/-] [+]Plugin isn't working but keybindings have been mapped [/+] on Feb 21, 2022
  8. kohane27 commented on Apr 7, 2022

    @kohane27

    @hpb0412 I had the same issue as well. Turned out I copied some config from Chris@machine and he set the following:

    set timeoutlen=100 " time to wait for a mapped sequence to complete

    I assume the reason he did this was because we use Which-key. Setting it to 1000 means that the Which-key window would pop up only after a second, which is too long. Changing it to 500 seems to be a good middle ground.

  9. unpinned this issue on May 30, 2022
  10. caamittiwari commented on Jul 25, 2022

    @caamittiwari
     set timeoutlen=100 " time to wait for a mapped sequence to complete 
    

    this totally depends upon how fast u type the key and your system configuration if type fast u may decrease it and if not increase it
    plugin is working fine and very great plugin to use

  11. Vaisakhkm2625 commented on Aug 28, 2022

    @Vaisakhkm2625

    @hpb0412 I had the same issue as well. Turned out I copied some config from Chris@machine and he set the following:

    set timeoutlen=100 " time to wait for a mapped sequence to complete

    I assume the reason he did this was because we use Which-key. Setting it to 1000 means that the Which-key window would pop up only after a second, which is too long. Changing it to 500 seems to be a good middle ground.

    Thanks.. for me gcc itself wasn' working, and i was copied many things from Chris@machine.. :) now everything is working... thanks

  12. gyaaniguy commented on Mar 9, 2024

    @gyaaniguy

    I had the same issue when using vscode neovim extension + kickstart.nvim
    It had reduced the time to 300ms in init.lua . I changed it to 1000 and all is good now !
    vim.opt.timeoutlen = 1000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem rightquestionQuestion related to integration and other stuff

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions