在Sublime Text 3中的中间按钮粘贴上移动光标 [英] Move cursor on middle button paste in Sublime Text 3
问题描述
(注意:此问题不同于我在Linux上使用Sublime Text 3(但它也适用于Sublime Text 2).
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.
只需创建一个名为Default (Linux).sublime-mousemap
的文件,其内容如下:
Just create a file named Default (Linux).sublime-mousemap
with the following content:
[
{
"button": "button3",
"press_command": "drag_select",
"command": "paste_selection_clipboard"
}
]
并将其保存在您的Packages/User/文件夹中(在我的情况下为:/home/boris/.config/sublime-text-3/Packages/User/).就是这样.
And save it in your Packages/User/ folder (in my case: /home/boris/.config/sublime-text-3/Packages/User/). That's it.
说明:默认的鼠标地图没有"press_command": "drag_select"
行,这是告诉Sublime在单击时更改光标位置的行.
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.
这篇关于在Sublime Text 3中的中间按钮粘贴上移动光标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!