Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Move cursor on middle button paste in Sublime Text 3

(Note: this question is different from Middle button paste deleted text in Sublime 3 )

I'm using Sublime Text 3 on Linux (but it also applies to Sublime Text 2).

As expected, when I middle mouse button click, it copy-pastes the previously highlighted text. Unfortunately, it doesn't move the cursor to the end of the pasted text, which is the default behavior in all other apps I know (instead, it doesn't move the cursor at all).

Does anyone know how to change this behavior (do not move cursor on middle-button paste) to the expected one (move cursor to end of pasted text)?

like image 344
Boris Dalstein Avatar asked Jul 06 '15 17:07

Boris Dalstein


1 Answers

Just found a fix, it's actually super easy.

Just create a file named Default (Linux).sublime-mousemap with the following content:

[
    {
        "button": "button3",
        "press_command": "drag_select",
        "command": "paste_selection_clipboard"
    }
]

And save it in your Packages/User/ folder (in my case: /home/boris/.config/sublime-text-3/Packages/User/). That's it.

Explanation: the default mousemap does not have the line "press_command": "drag_select", which is the one telling Sublime to change the cursor position on click.

like image 101
Boris Dalstein Avatar answered Sep 19 '22 18:09

Boris Dalstein