Cursor placement in Templates plugin (preferably also for Daily Notes template)

One neat feature from text expanders is cursor hints (link from Espanso site) where you could place your text cursor anywhere you want it to be placed in the expanded text after typing instead of having it at the end, which requires added mouse movement if you want to type somewhere in the middle of the text expansion.

So far, the Templates plugin does not have this. Adding a template to your note would always place the cursor at the end of the added text. Same problem with the daily notes template, except the cursor is placed at the beginning of the note. Would be great to have the option to place the cursor where desired. :grin:

23 Likes

i made a similar feature request like this using common snippet syntax: Template Plugin Improvement --- Tab Stops ${1}

3 Likes

+1 on ability to position cursor in templates. Drafts uses <|> to signify where cursor is to be position after a template is created.

1 Like

Fully support this feature, cursor placement carrying over to the template inserted would save a lot of time, especially on very long templates.

Related to excessive scrolling: My “Page Up” and “Page Down” keyboard keys work in moving up and down in a note, but the “Home” and “End” keys do not. Having home and end key functionality to jump to the top or bottom of the note would be a great update.

2 Likes

Plus one for this. I’m using templates as a kind of built in text expander and cursor placement would really speed up my workflow. Thanks.

1 Like

Another +1 from me. This would be a timesaver for sure!

You could use Templater’s tp.file.cursor(order?: number) function.

If you do, I’d advise changing the hotkey “Templater: Jump to next cursor location” to something like Ctrl+Tab (or Cmd+Tab) since default Alt+Tab (Opt+Tab) switches between applications on my Linux machine.

I use this in my Daily Notes template. After filling in the template data, it will jump to the first specified cursor location <% tp.file.cursor(1) %>, erase this text and put the cursor there to type.

When pressing Ctrl+Tab (in my case), it jumps to <% tp.file.cursor(2) %>, erases that text and positions the cursor there.

Thus, it’s only a “one-time jump-through”, but still quite helpful.

8 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.