pindexis / marker

The terminal command palette
MIT License
2.02k stars 106 forks source link

Add intelligent placeholder #12

Open CaptainQuirk opened 8 years ago

CaptainQuirk commented 8 years ago

Hi,

I find myself reentering the same text string over and over again. Would it be possible for you to make placeholder references ?

For example when doing

  touch %1 && chmod +x %1

Only filling the first placeholder would be enough, the second one being filled automatically.

pindexis commented 8 years ago

This is a nice feature, but a little bit complex to implement :( The reason is that I have to listen to all insertions and update the command accordingly, and there's no simple way to do the listening. Therefore I'm reluctant to implement it. A possible alternative would be: file=%% && touch $file && chmod +x $file

CaptainQuirk commented 8 years ago

Hi !

Thanks for your reponse ! I think that it's not that big an issue if the whole operation is not live. I'm more interested in the final result than in some fancy stuff ! Especially if it's not doable ;-). That being said, couldn't it be implemented by replacing the dynamic placeholders on a user action, whether by a MARKER_KEY_NEXT_PLACEHOLDER, or by a new key mapping ?

This would lead to the following scenarios:

Action triggered by MARKER_KEY_NEXT_PLACEHOLDER

Action triggered by a new key mapping