我觉得有用的 iTerm2 功能

iTerm2 is well known as one of the most powerful, high-quality pieces of software available on the Mac, and deservedly so. It’s packed to the gills with features and settings that feel like they could take a lifetime to learn. Here are a few I’ve picked up over the years that have found their way into my daily usage.

iTerm2 被广泛认为是 Mac 上最强大、高质量的软件之一,实至名归。它充满了功能和设置,感觉学习这些可能需要一生的时间。以下是我多年来积累的一些,已经成为我日常使用的一部分。

By the way, I highly recommend enabling iTerm2’s built-in “Tip of the day” feature. It’s probably where I learned about most of the things I mention below.

顺便说一下,我强烈建议启用 iTerm2 内置的 “每日提示” 功能。这可能是我了解下面提到的大多数内容的地方。

iTerm2 tracks when each line gets emitted to the console and can show you the timestamps of those events. This is great either when your logs don’t contain timestamps of their own, or even if they do since iTerm presents a consistent interface in your time zone.

iTerm2 跟踪每行何时被发送到控制台,并可以向您显示这些事件的时间戳。这在您的日志没有自己的时间戳时非常有用,即使它们有,因为 iTerm 在 您的 时区中提供了一致的界面。

Hit ⌘+Shift+E to toggle them.

⌘+Shift+E 切换它们。

Show Timestamps feature in iTerm2 toggling on and off

2. Alert on next prompt

2. 下一个提示时提醒

With Shell Integration installed iTerm2 can alert you the next time it sees a new prompt. This is great for keeping track of when a long running command finishes. Kick off the command, hit ⌘+Option+A to set the alert, and then go do something else. iTerm will notify you when your command has finished running.

安装了 Shell Integration 后,iTerm2 可以在下次看到新提示时提醒您。这对于跟踪长时间运行的命令何时完成非常有用。启动命令,按 ⌘+Option+A 设置提醒,然后去做其他事情。当您的命令完成运行时,iTerm 会通知您。

The alert iTerm2 shows when a command finishes running

Another feature Shell Integration buys you is the ability to quickly jump between prompts. Use ⌘+Shift+Up and ⌘+Shift+Down to jump to the previous and next prompt respectively.

另一个 Shell Integration 为您带来的功能是能够快速在提示之间跳转。使用 ⌘+Shift+Up⌘+Shift+Down 分别跳转到上一个和下一个提示。

(In case you’re trying to find these commands in the menu bar, this feature actually jumps between “marks”. iTerm2 makes each prompt a mark automatically.)

(如果您试图在菜单栏中找到这些命令,这个功能实际上在 “标记” 之间跳转。iTerm2 会自动将每个提示标记为一个标记。)

I try to avoid reaching for my mouse as much as possible, so it’s nice to b...

开通本站会员,查看完整译文。

Home - Wiki
Copyright © 2011-2025 iteam. Current version is 2.140.1. UTC+08:00, 2025-02-01 14:00
浙ICP备14020137号-1 $Map of visitor$