7

I'm using pycharm and ideavim plugin for vim-like editing.

When I using :normal command, I was told "Not an editor command: normal"

Is there an alternative way to be done my work (for multi-lines run same macro), or there's a way to add normal command in ideavim?

jixiang
  • 400
  • 1
  • 2
  • 10

2 Answers2

7

ideavim doesn't (yet) support normal command. But if you want to apply macro on multiple lines, you could add j/k , +/- or other linewise motions in your macro, so that it will automatically process multiple lines.

E.g a simple macro: dd to delete a line. If you added j -> ddj and do x@y it will delete x lines.

Kent
  • 189,393
  • 32
  • 233
  • 301
  • smart way, I've been tried before , but can be confused when I do a complex edition.(If I get last j forgot, I must record marco again.) And I must count myself for lines, annoying... – jixiang Dec 16 '15 at 10:13
  • But this way you won't know how many times to run the macro and have to think too much about the number of times to run the macro. Instead it would be better to visual select the lines and then simply apply the macro like in normal vim. – theprogrammer Jun 27 '21 at 04:09
1

TL;DR: IdeaVim 1.9+ -> .ideavimrc -> set noideadelaymacro

IdeaVim supports the normal command as of 1.9: https://github.com/JetBrains/ideavim/pull/169#issuecomment-971393643

But it appears as though it isn't working fully yet, and so needs to be activated, https://youtrack.jetbrains.com/issue/VIM-830/Implement-the-normal-command#focus=Comments-27-5641084.0-0:

  • "We've released IdeaVim 1.9.0 and, unfortunately, it doesn't have the :norm command enabled by default..."
  • "...we've faced some issues in the IJ platform that break the experience of working with IdeaVim..."
  • "...you can add set noideadelaymacro command into your ~/.ideavimrc. This will: Enable the :norm command..."
jeffrey.d.m
  • 616
  • 8
  • 23