Sublime Forum

Macro: command to move to the beginning of text typed via macro

#1

hi all,
I wrote a macro to generate a simple Python docstring template as follows

        """ <title>

    <description>

    Args:

    Returns:

    Raises:

    Example:

    Note:

    """

how do I command ST to move the caret to highlight the word as the last step of the macro?

0 Likes

#2

What does the macro look like? If it’s literally a macro, then you would just include the appropriate key movement commands in your recording to go where you want it to go.

If it’s a snippet that you’re using, put $0 in the snippet at the location you want the cursor to be at when the snippet expands; if you don’t specify it, it’s assumed to be at the end of the snippet text.

1 Like