简体   繁体   中英

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)?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM