Move cursor on middle button paste in Sublime Text 3

懵懂的女人 提交于 2019-12-12 08:22:10

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/31251691/move-cursor-on-middle-button-paste-in-sublime-text-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!