TextMate 中的自动完成

发布于 2024-09-29 04:27:46 字数 332 浏览 0 评论 0原文

在对应用程序的长时间延迟和普遍缓慢感到恼火后,我最近从 Coda 切换到了 TextMate。 TM 有一些烦恼,但主要是因为我已经习惯了其中之一。然而,让我抓狂的一个方面是缺乏自动完成功能。

例如,在 Coda 的 CSS 文档中,我可以开始输入 fo,Coda 将弹出字体样式、字体粗细等列表。选择其中之一将显示可用属性,粗体、浅色等,再次可选。在 TextMate 中,我已经开始使用 Bundle 自动完成快捷方式,但它们非常无用,因为您必须为较短的片段键入几乎整个内容。

有什么方法可以让 TextMate 复制 Coda 在您键入时自动建议的行为吗?如果没有,还有其他编辑器可以吗(BBEdit?)?谢谢。

I've recently switched to TextMate from Coda after getting annoyed by the long delays and general slowness of the app. There are a few annoyances in TM but it's mainly because I'm used to one over the other. One aspect that is driving me nuts however is the lack of automatic auto-complete.

For example, in a CSS document in Coda I could begin typing fo and Coda would pop up a list of font-style, font-weight etc. Selecting one of these would then show available properties, bold, light etc, again selectable. In TextMate I've begun using the Bundle auto-completition shortcuts but they're pretty useless as you have to type practically the whole thing for shorter snippets.

Is there any way of making TextMate replicate Coda's behaviour of automatically suggesting as you type? If not, are there any other editors that do (BBEdit?)? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

睫毛溺水了 2024-10-06 04:27:46

按转义键会自动为您完成。至少现在是这样。
也许它并不像人们希望的那样无缝,但它确实有效。

TextMate 对 ⎋(转义)有一个简单而有效的补全功能。
它将根据当前的匹配完成当前单词
文档。如果有多个匹配项,您可以循环浏览这些匹配项
连续按 ⎋。也可以向后循环
使用⇧⎋。

来源

Pressing escape autocompletes for you. At least nowadays.
Maybe it's not as seamless as one would like, but it works.

TextMate has a simple yet effective completion function on ⎋ (escape).
It will complete the current word based on matches in the current
document. If there are multiple matches, you can cycle through these
by pressing ⎋ continuously. It is also possible to cycle backwards
using ⇧⎋.

Source

爱情眠于流年 2024-10-06 04:27:46

首先安装 TextMate 包“GetBundles”

我相信这两个终端命令可以做到这一点:

cd ~/Library/Application\ Support/TextMate/Bundles
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/

然后,在 TextMate 中,按 Ctrl+Cmd+T (这应该是一个非常熟悉的快捷方式)打开窗口在您当前范围内有效的捆绑包。输入“获取捆绑包”或“获取捆绑包”,然后在找到正确的捆绑包后按 Enter 键。这将打开一个窗口来搜索一堆存储库中的捆绑包。右上角是一个搜索框。输入“CSS”。有 5-6 个 CSS 包可用,我会尝试一下,看看是否有一个适合您的需求。

TextMate 的核心没有内置这种代码解析功能,但我知道至少有一个包(PHP 包,现在包含在 TM 中)可以做到这一点。

Install the TextMate bundle "GetBundles" first

I believe these two terminal commands will do it:

cd ~/Library/Application\ Support/TextMate/Bundles
svn co http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/

Then, in TextMate, press Ctrl+Cmd+T (this should be a very familiar shortcut) to bring up the window of bundles that are valid in your current scope. Type 'get bundles' or 'getbundles' and press enter when you are on the right bundle. This opens a window to search a bunch of repos for bundles. In the upper right is a search box. Enter 'CSS'. There are 5-6 CSS bundles available, I would try them out and see if one fits your needs.

TextMate doesn't have that kind of that kind of code parsing built in to the core but I know of at least one bundle (the PHP bundle, now included with TM) that does it.

笑叹一世浮沉 2024-10-06 04:27:46

您可以尝试 Espresso (http://macrabbit.com/espresso/):它的自动完成功能类似。

You might try Espresso (http://macrabbit.com/espresso/): its auto-complete is similar.

情泪▽动烟 2024-10-06 04:27:46

Textmate 还具有选项卡触发器,这非常有用,并且非常接近自动在 TextMate 上完成。

例如,如果您输入“head”然后按 Tab,则会自动显示:

<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page Title</title>

Textmate 已经为一些 HTML 标签内置了此功能,但数量非常少。因此,您可能需要一个捆绑包来扩展选项卡触发器以涵盖所有类型的标签。

如果您执行 Brandon 和 matkins 已经告诉您的所有操作并搜索“HTML+”捆绑包(也可以找到 在 GitHub 上),这将允许选项卡触发器几乎所有可能的 HTML 元素和属性。

然后,例如,您可以输入“p”,然后输入选项卡按钮,这将自动显示:

<p></p>

光标位于两个标签之间。

您也许能够找到类似的 CSS 和其他东西的捆绑包 - 我还没有看过。

同样,据我所知,这与 Textmate 所能实现的标签自动完成最为接近。

Textmate also has tab triggers, which can be very useful and are as close as it gets to auto-complete on TextMate.

For example, if you type in "head" and then press tab, this will show up automagically:

<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Page Title</title>

Textmate already has this built in for a few HTML tags, but only a very small number. So, you'll probably want to get a bundle that will expand tab triggers to cover all kinds of tags.

If you do everything that Brandon and matkins have already told you to do and search for the "HTML+" bundle (which can also be found on GitHub), this will allow tab triggers for almost all possible HTML elements and attributes.

Then, for example, you can type "p" and then the tab button and this will show up automagically:

<p></p>

with the curser in between the two tags.

You may be able to find similar bundles for CSS and other things – I haven't looked yet.

Again, this is as close to tag autocompleting that Textmate can get, as far as I have found.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文