Skip to main content

Timeline for vim.keymap.set issue

Current License: CC BY-SA 4.0

17 events
when toggle format what by license comment
Sep 20, 2023 at 11:04 comment added Vivian De Smedt You can do all the actions in the mapping in particular vim.o.cmdheight = 2 is the lua version of :set cmdheight=2.
Sep 20, 2023 at 7:37 comment added HRC In my case, I just would like to create a key mapping triggered in visual mode, and it can show some information in command line. But I don't expect that nvim will stay in visual mode. 😅 :set cmdheight does make it show the information. Thanks. By the way, is it possible to "dynamically set cmdheight"? For example, :set cmdheight=2 only takes effect in some step of the keymapping. When the keymapping is ended, it gets cmdheight back to :set cmdheight=1.
Sep 19, 2023 at 3:11 comment added Vivian De Smedt Unless you increase the message root by changing cmdheight ;-). But why do you need to see these messages?
Sep 19, 2023 at 2:58 comment added HRC Hmm... so it is necessary to explicitly make the current buffer leaving visual mode (so that the message will not be hidden by -- VISUAL --) ?
Sep 18, 2023 at 10:20 history edited Vivian De Smedt CC BY-SA 4.0
added 148 characters in body
Sep 18, 2023 at 5:53 comment added Vivian De Smedt I believe the mapping is correctly triggered but the messages are hidden in visual mode.
Sep 18, 2023 at 3:17 comment added HRC Thanks for the suggestion. :message does show the printing result I expect, while the printing result does not appear when I tried to trigger the key mapping. 😓 I update the post and upload the .gif picture to show what happens when I tried to trigger the mapping.
Sep 15, 2023 at 11:54 history edited Vivian De Smedt CC BY-SA 4.0
added 121 characters in body
Sep 15, 2023 at 11:53 comment added Vivian De Smedt What is your run the command :messages? The messages are sometime hidden (in particular in visual mode). You maybe to list them using the :messages command.
Sep 15, 2023 at 8:13 comment added HRC In this .gif picture, I first type v<Right><Right> for selecting some characters, press the <Space> key on the keyboard and then press key n trying to trigger the mapping. The result shows in that .gif picture. Is any step I doing wrong? 😥
Sep 14, 2023 at 3:07 comment added Vivian De Smedt I'm lost :-/ Do you confirm that you type [space][n]?
Sep 14, 2023 at 2:53 comment added HRC Keystroke v without using mouse.
Sep 13, 2023 at 6:41 comment added Vivian De Smedt How do you select? Using v and some move or using the mouse?
Sep 12, 2023 at 5:38 comment added HRC Hi. I've tried your suggestion and updated/edited the post. The conclusion is: it doesn't work. 😵
Sep 12, 2023 at 5:00 comment added Vivian De Smedt Thanks for the feedback. When I try on my version it works well. Did you try with with a very simplifier version of init.lua? What if you start Neovim with nvim --clean?
Sep 12, 2023 at 4:42 comment added HRC Thanks for replying. I've defined <leader> using vim.g.mapleader = ' ' in the previous section. Checking echo "'" . g:mapleader . "'", it gives ' ' meaning that <leader> is <Space>. Furthermore, the result of :verbose xmap <Space>n shows x <Space>n * <Lua {the path of the file setting this mapping} Lua>. I think <leader> should be <Space> as I expect. But when I try this mapping, it still doesn't work and stays in visual mode. 😥
Sep 11, 2023 at 7:09 history answered Vivian De Smedt CC BY-SA 4.0