voldikss / vim-floaterm

:computer: Terminal manager for (neo)vim
MIT License
2.48k stars 78 forks source link

floaterm toggle not responding to which-key #406

Open hopezh opened 1 year ago

hopezh commented 1 year ago

I'm using LazyVim to install floaterm, with the following keymap config in the floaterm.lua file in LazyVim/lua/plugins folder to create a new floaterm window or toggle a floaterm window:

return {
  {
    "voldikss/vim-floaterm",
    keys = {
      { "<leader>ot", "<cmd>FloatermNew<cr>", desc = "new floaterm" },
      { "<leader>to", "<cmd>FloatermToggle<cr>", desc = "toggle floaterm" },
    },
  },
}

However, once the floterm window is open, which-key's keymap to is not working anymore, whatever I type will be the input of the terminal line, i.e. the floaterm window is not responding to which-key anymore.

May I ask how to make floaterm responds to which-key key maps? Thanks.

If you are using neovim, just run :checkhealth floaterm and post the content

below.

floaterm: 
- ERROR No healthcheck found for "floaterm" plugin.
jkellz-dev commented 1 year ago

I am getting the same thing:

floaterm: health#floaterm#check

common ~
- Platform: macos
- Nvim: NVIM v0.9.0
- Plugin: 59c1fd5

terminal ~
- OK Terminal emulator is available

floating ~
- OK Floating window is available
ScheiklP commented 1 year ago

Same here

floaterm: health#floaterm#check
========================================================================
## common
  - INFO: Platform: linux
  - INFO: Nvim: NVIM v0.9.0-dev-254+gde500095b
  - INFO: Plugin: bd0aee3

## terminal
  - OK: Terminal emulator is available

## floating
  - OK: Floating window is available
ScheiklP commented 1 year ago

Same here

floaterm: health#floaterm#check
========================================================================
## common
  - INFO: Platform: linux
  - INFO: Nvim: NVIM v0.9.0-dev-254+gde500095b
  - INFO: Plugin: bd0aee3

## terminal
  - OK: Terminal emulator is available

## floating
  - OK: Floating window is available
return {
    'voldikss/vim-floaterm',
    init = function()
        vim.g.floaterm_keymap_toggle = '<F1>'
    end,
}

This one seems to work for me.

SonicZentropy commented 1 year ago

I have tried about everything at this point and @ScheiklP method is the only one that works for me, as well. Thanks for the solution!

asumaran commented 6 months ago

I have tried about everything at this point and @ScheiklP method is the only one that works for me, as well. Thanks for the solution!

Defining shortcuts using the "keys" option didn't work for me to toggle terminals. putting it in the init options works for me too.