如何在Sublime Text 2中将光标移动到标签的末尾? [英] How to move the cursor to the end of the tag in Sublime Text 2?

查看:316
本文介绍了如何在Sublime Text 2中将光标移动到标签的末尾?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我键入标签的开头时,"Sublime Text"将自动完成标签的结尾并将光标定位在标签内.

When I type the start of a tag, Sublime Text will auto-complete the end of the tag and position the cursor inside the tag.

<code>|</code>

我使用|表示光标.因此,当我完成标记内的内容后,我想将光标移动到标记的末尾,如下所示:

I use | to represent the cursor. So when I finished the contents inside the tag, I want to move the cursor to the end of the tag like this:

<code>blabla</code>|

要执行此操作,现在我必须按向右"按钮逐个字符移动光标,这效率不高.是否有将光标直接移动到标签末尾的快捷方式?

To do this, now I have to press Right button to move the cursor character by character, which is not efficient. Is there any shortcut to move the cursor to the end of the tag directly?

推荐答案

您还可以创建一个宏.如果您的标签覆盖多行,这可能很有价值.将以下内容另存为Packages/User中的move_to_end_tag.sublime-macro.

You could also create a macro. This may be valuable if your tags cover multiple lines. Save the following as something like move_to_end_tag.sublime-macro in Packages/User.

[
    {
        "args":
        {
            "to": "tag"
        },
        "command": "expand_selection"
    },
    {
        "args":
        {
            "by": "characters",
            "forward": true
        },
        "command": "move"
    }
]

然后您可以为该操作创建一个快捷键.

You can then create a keybinding for the action.

{ 
    "keys": ["ctrl+shift+alt+right"], 
    "command": "run_macro_file", 
    "args": {"file": "res://Packages/User/move_to_end_tag.sublime-macro"} 
}

当然,您可以将键更改为任何您喜欢的键.

Of course, you can change the keys to whatever you like.

这篇关于如何在Sublime Text 2中将光标移动到标签的末尾?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆