gabesoft / evil-mc

Multiple cursors implementation for evil-mode
MIT License
387 stars 36 forks source link

Support for AUCTeX commands? #29

Open 3rd3 opened 8 years ago

3rd3 commented 8 years ago

I'm wondering what is in the way of supporting for example simply inserting a backslash (the AUCTeX TeX-insert-backslash command). What does need to be done to add support for it?

gabesoft commented 8 years ago

You just need to add it to the known commands. See evil-mc-known-commands.el

3rd3 commented 7 years ago
  (nconc evil-mc-known-commands
         '(
           (TeX-insert-backslash . ((:default . evil-mc-execute-default-call-with-count)))
           (LaTeX-insert-left-brace . ((:default . evil-mc-execute-default-call-with-count)))
           (LaTeX-insert-right-brace . ((:default . evil-mc-execute-default-call-with-count)))
           (LaTeX-babel-insert-hyphen . ((:default . evil-mc-execute-default-call-with-count)))
           (TeX-insert-sub-or-superscript . ((:default . evil-mc-execute-default-call-with-count)))
           (TeX-insert-dollar . ((:default . evil-mc-execute-default-call-with-count)))
           ))

This is what I got so far, however inserting a dollar sign does not automatically insert the closing dollar sign for some reason. Also, the keys following the pass through command C-q are not recognized. I couldn't figure out which command is called because one cannot call describe-key in between as it seems. The other command work just fine.

gabesoft commented 7 years ago

If you want to see what command it's trying to execute just run evil-mc-executing-debug-on and you should see the debug statements in the Messages buffer when you try to run a command with the cursors enabled. But, the commands above are a good start. I'll add them in when I get a chance

3rd3 commented 6 years ago

When inserting a dollar sign with debug on I simply get these messages:

evil-mc Execute TeX-insert-dollar for all cursors
evil-mc Execute TeX-insert-dollar with evil-mc-execute-default-call-with-count [3 times]

However, it still only inserts a dollar sign at the main cursor.

3rd3 commented 6 years ago

Maybe it is actually some smartparens function that needs to be whitelisted such that the second dollar sign is inserted as well?

gabesoft commented 6 years ago

You could try disabling smartparens just to see if the issue is caused by it