helix.vim icon indicating copy to clipboard operation
helix.vim copied to clipboard

[Draft] Support for JetBrains IdeaVim

Open ristomatti opened this issue 1 year ago • 7 comments

This adds preliminary support for IdeaVim. I'm currently still fiddling with the config, but I thought I'll make a draft PR for discoverability and potential feedback.

Some background/caveats:

I used Vim as my go-to editor for quick edits in the terminal for ~10 years but I never really spent time to properly learn it. Due to that most of this is a result of trial and error. I switched over to Helix around January after battling with NeoVim for a few months and it clicked pretty much right away.

Progress:

  • [x] Support enough mappings for basic practical use
  • [x] Include (comment) links to required plugins
  • [x] Verify remaps to helix.vim mapping are actually needed
  • [ ] Verify included set commands align with Helix defaults
  • [x] ~~Verify unmaps of arrow keys makes sense to include~~
  • [x] Update README.md for better discoverability

ristomatti avatar Sep 19 '24 23:09 ristomatti

Take your time to make changes. When you feel that you have a version that is good enough for public use, let me know and we can merge this.

chtenb avatar Sep 20 '24 15:09 chtenb

@chtenb I'll do that. Would it make sense for me to prefix the commits (and possible future ones)? For example IdeaVim: Support x, y, z?

ristomatti avatar Sep 20 '24 15:09 ristomatti

Yeah, that sounds fine, but I don't care too much about the commit messages here

chtenb avatar Sep 20 '24 17:09 chtenb

Yeah, that sounds fine, but I don't care too much about the commit messages here

I was thinking about discoverability as well. It'd help spotting if there's relevant changes. Another reason is to simplify coming up with commit messages. Even if it won't matter to you, it does to me. :grin:

ristomatti avatar Sep 20 '24 21:09 ristomatti

I've added a checklist for tasks I'm planning to do before removing the draft status.

ristomatti avatar Sep 20 '24 22:09 ristomatti

Update: I've ditched the arrow keys unmaps (I'll leave them broken). I've also fixed <C-w> remaps, I had accidentally put also the following key within the brackets :facepalm:. I discovered that while a frustating debugging session trying to figure out why indent from > kept waiting for the next character.

ristomatti avatar Oct 03 '24 15:10 ristomatti

@chtenb I believe this is ok for review. The only thing left is to check is if these two set command are needed:

set matchit
set multiple-cursors

...these are IdeaVim's built in emulation of Vim plugins with the same name. With argtextobj I was able to support maa (match around argument).

Most of the remaps turned out unnecessary, but these seemed to behave more Helix-like in IdeaVim:

nnoremap e ve
nnoremap E vE
nnoremap w vw
nnoremap W vW
nnoremap b vb
nnoremap B vB

noremap X 0V
xnoremap X <nop>

xnoremap , <Esc><Esc>

ristomatti avatar Oct 03 '24 23:10 ristomatti

I've removed unused plugins and changed the set commands to align with Helix defaults AFAIK. No changes planned for this PR unless requested. :sweat_smile:

ristomatti avatar Oct 04 '24 22:10 ristomatti

Thanks for the thorough review!

ristomatti avatar Oct 06 '24 13:10 ristomatti