TextMate:转到行中第一个非空白字符的快捷方式
我真的很喜欢 TextMate。然而,在使用了很长一段时间并搜索了几次之后,我一直无法找到一个快捷方式,可以按照我想要的方式将我带到行的开头。我通常希望光标位于行的开头,但在空格之后。
例如,在下面的代码中,如果光标位于 puts 'hi'
行的末尾,然后我输入 ⌘ ←
,它将把光标放在行的最开头,我宁愿将光标放在行开头的“p”旁边。有这样的捷径吗?
class Test
def greet
puts 'hi'
end
end
I really like TextMate. However, after using it for a long time and searching several times, I haven't been able to find a shortcut that takes me to the beginning of the line the way I want. I commonly want the cursor at the beginning of the line, but after the whitespace.
For example, in the following code if the cursor is at the end of the line with puts 'hi'
, and then I type ⌘ ←
, it will put the cursor at the very beginning of the line, and I would rather that it put the cursor next to the 'p' at the beginning of the line. Is there such a shortcut?
class Test
def greet
puts 'hi'
end
end
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
虽然这不是一键式解决方案,但当我想这样做时,我按...
Although it's not a one-keypress solution, when I want to do that I press...
我目前没有安装 textmate,但我相信您可以录制一个宏,跳转到行首,然后向前搜索
(?<=\s*)(?=[^\s] +)
。I don't have textmate installed at the moment but I believe you can record a macro that jumps to the beginning of the line then searches forward for
(?<=\s*)(?=[^\s]+)
.这里已经很好地解释了:
我将
home
绑定到此宏。It has been nicely explained here:
I bound
home
to this macro.