“在终端中打开文件夹”对于聚光灯或阿尔弗雷德
Spotlight 中是否有任何方法可以在终端窗口中打开文件夹,方法是在搜索结果中提供“在终端中打开”选项,或者(理想情况下)在选择结果时按住某个键?基本上,按住命令将“打开包含文件夹”的方式相同,因此按住选项(或任何键)可以“在终端中打开”。
或者,有没有办法设置 Alfred 应用程序,以便它始终在终端中打开文件夹搜索结果?这可能会更好,然后我可以专门使用 ctrl-space 来打开终端中的文件夹,并使用命令空间(Spotlight)来打开其他所有内容。
我能找到的最接近的东西是“cdto”应用程序,它在 Finder 中添加了一个“在终端中打开”按钮。这很好,但能够直接从 Spotlight 或通过按键来执行此操作会方便得多。
Is there any way in Spotlight to have a folder open in a Terminal window, either by providing an "Open in Terminal" option in search results, or (ideally) by holding down a key when selecting a result? Basically the same way holding down command will "Open containing folder" maybe make it so holding option (or whatever key) could "Open in Terminal".
Alternately, is there a way to setup the Alfred app so that it will always open folder search results in the Terminal? that might be even better, then I could use ctrl-space exclusively for opening folders in the Terminal and command-space (Spotlight) for everything else.
The closest thing I can find to anything like these is the "cdto" application, which adds an "Open in Terminal" button to the Finder. This is nice, but being able to do this directly from Spotlight or with a keypress would be much more convenient.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我发现这是最快的方法,无需任何外部修改。
要求:Dock 中需要有 iTerm 或 Terminal:
I've found this to be the fastest method without any external tinkering.
Requirement: need to have iTerm or Terminal in the Dock:
这个问题很老了,你现在无疑已经找到了答案;为了完整起见:Alfred 的最新版本允许人们从 Alfred 内部搜索/导航文件系统,并对找到的文件夹或文件执行操作。一个文件夹操作是“在此处打开终端”,这似乎就是您所要求的。
This question is old and you undoubtedly found the answer by now; for the sake of completeness: the latest version of Alfred allows one to search/navigate the filesystem from within Alfred, and take action on the folder or file found. One folder action is "Open Terminal Here", which seems to be what you are asking for.
试试这个工具:
https://github.com/nmadhok/OpenInTerminal
对于 Mac 程序员来说,这是一个非常方便的工具,因为它让您直接在终端中打开该文件夹。您可以选择多个文件夹以在多个终端窗口中打开它们。您还可以选择文件以在终端中打开父目录。该应用程序可以与 Finder 配合使用,也可以不与 Finder 配合使用,这是一个优点!
Try this tool:
https://github.com/nmadhok/OpenInTerminal
This is a really handy tool for programmers on Mac as it lets you open the folder directly in Terminal. You can select multiple folders to open them in multiple terminal windows. You can also select files to open the parent directory in Terminal. This application works with Finder as well as without Finder which is a plus!
使用这个 Alfred 扩展
https://github.com/LeEnno/alfred-terminalfinder
然后只是 lob关闭输入并将其设置为热键..我有一个可以在终端中打开当前查找器,反之亦然
use this Alfred extension
https://github.com/LeEnno/alfred-terminalfinder
then just lob off the input and set it to a hotkey.. I have one to open the current finder in terminal and vice-versa
@Verboze - 我仍在寻找答案:)
也许应该将其迁移到堆栈交换或另一个使用非编程主题的主题,例如系统管理。尽管可以说命令行对于编程至关重要……
Windows 有“命令提示符”。 Linux 有 Nautilus 的“在终端中打开”。 世界上最先进的操作系统什么都没有(我能说的最好的)。
为了完整起见,我确实查看了可自定义的工具栏(“将您最喜欢的工具栏拖到此处”;但我最喜欢的工具栏不见了)。我还发现了一个旧的 Action Script 或 Automator Script 不起作用(文章很旧,无法遵循)。
我确实找到了一个名为“CD To...”的程序,但它损坏了。打开第一个终端后,程序会打开两个终端。我不确定开发人员还犯了什么其他编程错误,我真的不想尝试。
@Verboze - I'm still looking for an answer :)
Perhaps it should be migrated to stack exchange or the other one used non-programming topics, such as system administrivia. Though a case could be made that the command line is essential to programming.....
Windows has "Command Prompt Here". Linux has Nautilus' "Open In Terminal". The world's most advanced operating system has nothing (the best I can tell).
For completeness, I did look at the customizable toolbar ('drag your favorites here'; but my favorite is missing). I also found an old Action Script or Automator Script that did not work (the article was old, and it could not be followed).
I did find a program called "CD To...", but its broken. Upon opening the first terminal, the program opens two terminals. I'm not sure what other programming mistakes were made by the developer, and I really don't want to experiment.
检查这个: https://github.com/miromannino/alfred-new-terminal-window< /a>
它在当前空间中打开一个新的 Terminal/iTerm 窗口。
按住 alt 键,新窗口也会在当前最前面的 Finder 文件夹中打开。
对于我来说,这几乎足以满足我的日常工作了!
希望有帮助!
Check this: https://github.com/miromannino/alfred-new-terminal-window
It opens a new Terminal/iTerm window in the current space.
Holding the alt key, the new window is also opened opened in the current frontmost Finder folder.
For me that is almost sufficient for my daily work!
Hope it helps!