hoschi / yode-nvim

Yode plugin for NeoVim
MIT License
371 stars 3 forks source link

Mapping with `<Cmd>` instead of `:` don't work #9

Closed diegodox closed 2 years ago

diegodox commented 2 years ago

This plugin's demo blow my mind, awesome.

But, I'm not sure how to setup this plugin. My setting is below.

require('yode-nvim').setup()

and

vnoremap <Space>yc <Cmd>YodeCreateSeditorFloating<CR>

Just after selecting lines in <C-v>(visual lines) mode, I expect <Space>yc to create yode's floating buffer with lines I select. But, it create yode's floating buffer only with one line which my cursor is placed.

How to create yode's buffer with all selected lines?

hoschi commented 2 years ago

Glad you like it! This one is the mapping from the Readme with <Leader> replaced by <Space> and should work: map <Space>yc :YodeCreateSeditorFloating<CR>

Can you try it?

diegodox commented 2 years ago

Thank you for your advice.

I tried map <Space>yc :YodeCreateSeditorFloating<CR>. I still not get all selected lines, only get cursor line.

EDIT: Sorry I tried map <Space>yc <Cmd>YodeCreateSeditorFloating<CR>. It should be fixed if I tried : instead of <Cmd>.

I think I should try other plugins uninstalled.

List of the plugins I have installed. Do you have any ideas for other plugins that would prevent this plugin from working? Your plugin. - yode-nvim - plenary.nvim Maybe one of these? - coc.nvim - which-key.nvim I think they are not related. - winresizer - winshift.nvim - copilot.nvim - dein (package manager) - vim-startify - vim-rooter - lualine.nvim - Comment.nvim - vim-devicons - nvim-tree.lua - rnvimr - lazygit.nvim - nvim-treesitter - nvim-treesitter/playground - indent-blankline.nvim - nvim-ts-rainbow - telescope.nvim - vim-fugitive - gitsigins.nvim - close-buffers.nvim - undotree - gruvbox - vim-code-dark - telescope-coc.nvim - nvim-notify - neoscroll.nvim - crates.nvim - octo.nvim
hoschi commented 2 years ago

I don't see any problematic plugin that catches my eye. Can you execute :map <Space>yc and paste the output/screenshot?

diegodox commented 2 years ago

Here is my output for :map <Space>yc. temp

hoschi commented 2 years ago

Please try to disable "which-key". Also this <Cmd> thing is something I didn't see before.

diegodox commented 2 years ago

I found my mistake. Use : instead of <Cmd> fix this problem which I found on other issue on this plugin.

diegodox commented 2 years ago

Help for someone who meet same problem, difference between <Cmd> and : from help <Cmd>.

Both execute command, but <Cmd> doesn't change mode.

The pseudokey begins a "command mapping", which executes the command directly (without changing modes).

diegodox commented 2 years ago

I close this issue. Thank you @hoschi.

hoschi commented 2 years ago

Interesting, glad you could solve the problem. I'll adjust the title in case anyone else is looking for the problem.