使 ctrl+enter 在行尾添加分号 [英] make ctrl+enter add semicolon to the end of the line
问题描述
Ctrl+enter in sublimetext 是创建新行的默认快捷方式,无论您的光标在当前行的哪个位置.但是,有时我需要在当前行的末尾添加一个分号,然后才能跳转到新行.
Ctrl+enter in sublimetext is a default shortcut to create a new line, no matter in what position your cursor are in the current line. However, sometimes I need to add a semicolon at the end of the current line before jump to a new line.
如何使ctrl+enter"快捷键在创建新行之前在当前行的末尾添加分号?甚至有可能吗?
How can i make the "ctrl+enter" shortcut add a semicolon to the end of the current line before create a new line? Is it even possible?
对不起我的英语.
推荐答案
在 AGS 的回答之后,我用类似的方法解决了我的问题.你可以这样做:
After AGS's answer, I solved my problem with similar approach. You can do this:
1.在文件夹 ~/.config/sublime-text-3/Packages/User
中创建一个宏文件:
1. Create a macro file in the folder ~/.config/sublime-text-3/Packages/User
with:
<代码>[{参数":{"to": "hardeol"},命令":move_to"},{参数":{人物": ";"},命令":插入"},{参数":{字符":\n"},命令":插入"}]
2.然后编辑您的键绑定 Preferences >键绑定 - 用户
.添加此:
2. Then edit your keybindings Preferences > Key Bindings - User
. Add this:
{ "keys": ["ctrl+enter"], "command": "run_macro_file", "args": {"file": "res://Packages/User/FILENAME.sublime-macro"} },
这篇关于使 ctrl+enter 在行尾添加分号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!