简体   繁体   English

Submlime Text 2-Mac上的Windows键行为?

[英]Submlime Text 2 - Windows key behavior on Mac?

I'm using a Mac for development, but 15 years of Windows experience before that means certain keystrokes are hard-wired (like Home for beginning of line, etc). 我使用Mac进行开发,但是在拥有15年Windows经验之前,这意味着某些按键是硬连线的(例如Home代表行首等)。

Is there a simple way to get Sublime Text 2 on my Mac to behave more like a Windows editor? 有没有一种简单的方法可以让Mac上的Sublime Text 2表现得更像Windows编辑器? I am used to Visual Studio.net on Windows. 我习惯于Windows上的Visual Studio.net。

I see two possible methods to solve your problem. 我看到了两种可能的方法来解决您的问题。 The first is to find an OS X keybinding that does what you want. 首先是找到可以满足您需求的OS X键盘绑定。 Then in the ST console enter sublime.log_commands(True) . 然后在ST控制台中输入sublime.log_commands(True) Then execute the command. 然后执行命令。 This will give you the command so you can create a custom key binding. 这将为您提供命令,以便您可以创建自定义键绑定。 The second is to search for a key binding where you know the proper behavior exists in the Windows key map file (in your case home ). 第二种是在您知道Windows键映射文件(在您的情况下为home )中存在正确行为的情况下搜索键绑定。 In either case, the goal is to get a command and any necessary arguments. 无论哪种情况,目标都是获取命令和任何必要的参数。

You can now create a custom key binding. 现在,您可以创建自定义键绑定。 Go to Preferences -> Key Bindings - User . 转到Preferences -> Key Bindings - User Insert the key binding you desire here. 在此处插入所需的键绑定。 For your particular case, you would want something like the following. 对于您的特殊情况,您需要以下内容。

[
    { "keys": ["home"], "command": "move_to", "args": {"to": "bol", "extend": false} }
]

Of course remove the square braces if you already have an entry. 当然,如果您已有条目,请删除方括号。 Additionally, you can change the keys to something else if you need to, but since you said you wanted to rebind home , I assume that is what you want. 另外,您可以根据需要将密钥更改为其他密钥,但是由于您说过要重新绑定home ,因此我认为这是您想要的。

I had a hard time getting used to Mac after I switched from Windows. 从Windows切换后,我很难适应Mac。 Took me quite a while but you know, you have to get used to a few frequently used shortcuts. 花了我一段时间,但您知道,您必须习惯一些常用的快捷方式。

Here are a few shortcuts. 这里有一些捷径。

Command + left arrow - beginning of the line, right arrow - end of the line, up arrow - beginning of the document, down arrow - end of the document. Command +左箭头-行的开始,右箭头-行的结束,向上箭头-文档的开始,向下箭头-文档的结束。

Alt or Option + left arrow - beginning of the word, right arrow - end of the word. Alt或Option +左箭头-单词的开头,右箭头-单词的结尾。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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