Possible to run vim functions in key mappings? #1036
Replies: 7 comments 3 replies
|
Hi! TL;DR: I'll be happy to answer your questions and help you with a PR, but maintainers are currently focused on more fundamental features like remote development and Fleet IDE support. IdeaVim does support Vim script and can interpret things (it understands that Regarding the functions you have: You can use the sin() function as a reference for implementing your own functions: https://github.com/JetBrains/ideavim/blob/master/vim-engine/src/main/kotlin/com/maddyhome/idea/vim/vimscript/model/functions/handlers/SinFunctionHandler.kt |
|
Hi lippfi. Thanks for your detailed answer! I'm happy to take a stab at this. I just started looking into it and had a few questions:
I've got a basic implementation of the Could it be that other parts of this mapping are not implemented? Maybe the tertiary operator? Can you spot what the issue might be?
My vnoremap / "sy/\V<C-R>=escape(@",'/')<CR>I think it's because it looks like IdeaVim doesn't support nested command prompts. Here normally the first prompt (i.e. the search prompt) would be triggered when you press In the meantime, I was able to get an alternative way that achieves the same thing by yanking the output of the vnoremap / "sy:let @/='\V' . escape(@s, '/')<CR>/<C-R>s<CR>N
According IdeaVim's code, the I could try to add an entry specifically for "hlsearch". For that I would need to access the underlying Thanks in advance! |
I don't think so, I've just tried: and it worked, so it's either
You are absolutely right, I hadn't thought about that, thank you. The
You can see that project root has the
|
|
Here's the first PR for the |
|
Here's the PR for |
|
BTW, something kind of not related. I've started implementing an IntelliJ port of vim-switch. I'm actually almost done with it, but then it occurred to me: wouldn't it be better to instead implement any missing functions/features in IdeaVim that the plugin would require? So my question to you is: When you declare a plugin with something like: |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I've got these key mappings in my regular Vim config:
BTW, those mappings are to make search functionality work a bit more similar to how search works in a browser or even with IntelliJ's built-in search.
However, those mappings don't work in IdeaVim. I assume maybe because IdeaVim can't interpret Vim functions and statements like
getcmdtype(),&hlsearch, orv:hlsearch? Are there any ways to make this work, or do you think this functionality could be added?Thank you.
All reactions