iTerm - Make your command line colorful

Today I want to introduce you to a tool: . This time we talk about development technology has nothing to do, just a tool. But even though it is a tool, it can improve your skill by a level. Let's take a look below. Every developer will inevitably use the command line. From the operation of the repository to running some scripts, the command line is inseparable. Although graphical interfaces are powerful these days, in many cases, using the command line is still the quickest way. iTerm git 

 

Introduction to iTerm

iTerm It is a completely free command-line application designed for Mac OS users. We can open its official website and take a look at www.iterm2.com : 

iTerm - Make your command line colorful

iTerm - Make your command line colorful

It's very geeky. We can click Downloads to enter the download page and choose a version suitable for your system. Here we download version 2.9, which is also a version with major improvements:

iTerm - Make your command line colorful

iTerm - Make your command line colorful

After downloading, let's start the journey. iTerm 

Of course, the website also has a Chinese version, you can also visit this address www.iterm2.cn iTerm  

When we open it, we will first see this interface: iTerm 

iTerm - Make your command line colorful

iTerm - Make your command line colorful

The standard command line application color matching, of course, this color scheme may not be lively enough, of course you can modify the color matching, we can open it to adjust the settings: Perferences 

iTerm - Make your command line colorful

iTerm - Make your command line colorful

After entering the setting interface, we can find the color scheme panel in the tab. In the drop-down box in the lower right corner, we can see that there are several built-in color schemes for us to choose, such as black style, white style, dark blue style, etc: Profiles  Colors 

iTerm - Make your command line colorful

iTerm - Make your command line colorful

 

iTerm Shortcuts

iTerm Of course, it's not just as simple as changing skins, it also provides a lot of convenient functions, making it easier for us to use the command line.

  • Text selection without a mouse : Provides a mechanism for selecting text without a mouse, called , don't underestimate this tiny little feature, it keeps you focused. When we use the command line, we often choose to copy and paste the text in the command line. For example , let’s take a command . We use the command to get a resolved domain name : iTerm  搜索 + Tab ping  ping  IP
    localhost:~ icafe$ ping z.cn
    PING z.cn (106.50.16.198): 56 data bytes
    ^C
    --- z.cn ping statistics ---
    1 packets transmitted, 0 packets received, 100.0% packet loss
     

I believe that everyone has had this experience: after the command is obtained , we want to copy it, we can only pick up the mouse, then select the paragraph precisely , and then copy it. Frequent switching between keyboard and mouse can affect our attention. ping  IP  IP

iTerm Provide us with a good method, we first press Cmd + F to bring up the search box, and then enter the prefix of this paragraph, such as 106: IP 

iTerm - Make your command line colorful

iTerm - Make your command line colorful

We found this text by searching, and the next magic thing is going to happen. We press the key at this time, we find that this text is automatically selected for us, and it is automatically copied to the clipboard for us: Tab  iTerm  IP 

iTerm - Make your command line colorful

iTerm - Make your command line colorful

Wherever we need to use this paragraph , press the key, and it can be copied. This small function saves us from having to switch frequently between the keyboard and the mouse, which is very practical. IP  Cmd + V 

  • 支持一键调出命令行: 我们有时会遇上这样一种情况,就是我们只想用命令行执行某一个特定的操作,然后就不需要它了。其实在这种情况下我们没有必要打开命令行应用的。比如我们就是想看一眼某个文件夹里面都有什么文件,类似这种操作我们其实没有必要单独开启一个命令行窗口的。

这就是 iTerm 的一键调起功能的作用啦,我们进入设置界面,进入 Keys 选项卡

iTerm - Make your command line colorful

iTerm – 让你的命令行也能丰富多彩

我们看设置界面的左下角,有一个 Hotkey 选项,我们将这个选项下的所有复选框打开,并且设置一个自定义的快捷键,我这里设置的是 Cmd + \。然后。。。 我们就可以退出 iTerm了。

iTerm - Make your command line colorful

iTerm – 让你的命令行也能丰富多彩

稍后呢。。 在我们需要命令行的时候,我们只需要按下我们刚才定义的快捷键,看。。 神奇的事情发生了:

iTerm - Make your command line colorful

iTerm – 让你的命令行也能丰富多彩

iTerm 以半透明的形式,在桌面的顶部显示了出来,我们可以在这里执行我们需要的命令,比如 ls 命令来查看某些目录的内容,当执行完我们需要的命令后,我们再次按下预设的快捷键,浮在上面的命令行界面消失了。这对于用完命令行总是忘记关闭窗口的懒人来说(比如我~),又是一大福音哦。

  • 命令行标记功能: 这个功能简单来说就是,我们在某一行按下 Cmd + Shift + M 将这行标记下来。随后我们在需要的时候,可以按下 Cmd + Shift + J 就可以立即跳回这一行了。
  • 正则表达式搜索: 这个就不用多说了吧,你可以任性的搜索,专为极客们准备,只需在调出搜索界面的时候,将 Regular Expression 选项钩上,你就可以使用正则表达式进行搜索了:
iTerm - Make your command line colorful

iTerm – 让你的命令行也能丰富多彩

  • 剪贴板历史纪录: 这个也是一个很方便的特性,iTerm 能够将我们在使用命令行过程中所有的复制粘贴操作保存下来,随后我们在任何地方按下 Cmd + Shift + H 就可以我们所有复制粘贴内容的列表:
iTerm - Make your command line colorful

iTerm – 让你的命令行也能丰富多彩

并且,还显示出了这些条目被复制的时间,从此以后,尽情的复制粘贴吧~

  • 快照返回:这个功能称得上是 iTerm 又一杀器,比如你在下午三点的时候执行了一些命令,然后过了几个小时,你又执行了其他的命令。如果这时候你想再回去看看下午三点那会儿你做了什么怎么办呢,答案就是用 iTerm 的快照返回功能。按下 Cmd + Option + B就会在界面上显示一个时间轴:
iTerm - Make your command line colorful

iTerm – 让你的命令行也能丰富多彩

这时候,我们按下键盘的左右箭头,时间轴就会自由的穿梭,这时 iTerm 上的命令行界面也随着变化成你选中的时间点的内容了。很神奇,很方便~

  • 标签排列切换:我们用命令行的时候,会发现用着用着,不知不觉就打开了很多个标签,比如像我这样:
iTerm - Make your command line colorful

iTerm – 让你的命令行也能丰富多彩

这时候,我们想在这么多标签中找一个窗口就很麻烦哦。这时候我们可以按下 Cmd + Option + E 键。。。

iTerm - Make your command line colorful

iTerm – 让你的命令行也能丰富多彩

又一件神奇的事情发生了,我们看到所有的标签都整齐的排列在屏幕上,并且屏幕左上角为我们展现了一个搜索框,我们可以根据需要输入我们记忆中要搜寻的内容,然后 iTerm 就会将和我们输入的关键词最匹配的标签高亮显示出来,我们再按下回车键,就可以切换到那个标签啦~

  • Smart selection : This small function is also very practical. We click the mouse four times in a row to select the text. At this time, the text will be selected intelligently according to the text content pointed by our mouse. For example, our mouse just points to one of the texts. At this time, if we click this four times in a row , it will help us to select this , instead of having to use the mouse to accurately point and drag to select this , just like this: iTerm  URL  URL智能选择 URL URL
iTerm - Make your command line colorful

iTerm - Make your command line colorful

We can easily select the content like this. In addition to the URL, it also includes the Email address, and the strings enclosed in double quotation marks are all 智能选择recognized objects.

The software developed by geeks fully considers the various needs of geeks~

iTerm - Make your command line colorful

iTerm - Make your command line colorful

It's a simple understanding of what I have on it, and I will share it with you here. It may not be profound, but it aims to inspire others and open up a new way of thinking for everyone. Just like practicing qigong, you need to constantly absorb nutrients from multiple places, so that your inner strength can be continuously enhanced. Although it will not show up in a short period of time, as time goes by, at a certain point of time, you suddenly find yourself Son is strong. iTerm 

The above features may not be fully remembered by everyone, but you can bookmark this article and read it in the future when you suddenly need it urgently.
mp

 

Original: http://swiftcafe.io/2015/07/25/iterm/

From: iTerm - Make your command line colorful

 

 

 

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326965553&siteId=291194637