vim使用快捷键_如何使用Vim样式键盘快捷键进行OS X选项卡导航

vim使用快捷键_如何使用Vim样式键盘快捷键进行OS X选项卡导航

vim使用快捷键

vim使用快捷键_如何使用Vim样式键盘快捷键进行OS X选项卡导航

After switching to OS X when I got a new MacBook Air, one of the first things I needed to duplicate was my extremely customized AutoHotkey setup — the most important of which is using the J and K keys to navigate throughout tabbed windows easily. Yeah, I’m a Vim user.

当我获得一台新的MacBook Air时,切换到OS X后,我需要复制的第一件事就是我极为定制的AutoHotkey设置-其中最重要的是使用J和K键轻松浏览选项卡式窗口。 是的,我是Vim用户。

I’ve never been a fan of having to use CTRL + TAB to switch from one tab to the next — to start with, you have to move your hands from the home row, and it’s awkward, and why should I have to do that just because somebody decided that keyboard shortcut before tabs became popular? If you think about it, if tabbed browsers were popular back when keyboard shortcuts were being invented, they would have definitely reserved some of the good shortcuts for switching tabs.

我从来都不喜欢使用CTRL + TAB从一个选项卡切换到下一个选项卡-首先,您必须将手从主行移开,这很尴尬,为什么我必须这样做仅仅因为有人决定在选项卡流行之前使用键盘快捷键? 如果您考虑一下,如果在发明键盘快捷键时使用选项卡式浏览器又很流行,那么它们肯定会保留一些用于切换选项卡的良好快捷键。

On Windows, I’ve always used an AutoHotkey script to make things the way I wanted them:  ALT + J and ALT + K for selecting previous and next tabs. Once you get used to it, it’s extremely awesome, and so much faster than using CTRL + TAB. Of course, I also hacked CTRL + T and CTRL + W into ALT + T and ALT + W so I could open new tabs and close them without moving my hands from the home row.

在Windows上,我一直使用AutoHotkey脚本按照我想要的方式进行操作:ALT + J和ALT + K用于选择上一个和下一个选项卡。 一旦习惯了,它就非常棒,而且比使用CTRL + TAB快得多。 当然,我也将CTRL + T和CTRL + W分别入侵了ALT + T和ALT + W,这样我就可以打开新的选项卡并关闭它们,而无需将手从首页移开。

Over on OS X, it turns out that it’s incredibly simple and easy to use CMD + J and CMD + K for next/previous tab navigation, and it works in most applications that support tabs, like Terminal, Safari, or Google Chrome.

在OS X上,事实证明,使用CMD + J和CMD + K进行下一个/上一个选项卡导航非常简单易行,并且可以在支持选项卡的大多数应用程序中使用,例如Terminal,Safari或Google Chrome。

And yes… I realize that in Vim you would be using H and L for moving left and right. The problem is that in OS X you can’t really use CMD + H since it’s an integral part of the operating system, so if you remap it, you’ll be missing out on another great feature. So using J and K works better.

是的……我意识到在Vim中,您将使用H和L左右移动。 问题在于,在OS X中您不能真正使用CMD + H,因为它是操作系统不可或缺的一部分,因此,如果重新映射它,则会错过另一个重要功能。 因此,使用J和K效果更好。

Just open up System Preferences and head to Keyboard.

只需打开系统偏好设置并转到键盘。

vim使用快捷键_如何使用Vim样式键盘快捷键进行OS X选项卡导航

Select the Keyboard Shortcuts section and then Application Shortcuts. Create a new shortcut key, leave it set to All Applications, and type Select Next Tab into the box, giving it the keyboard shortcut of CMD + K.  Repeat with Select Previous Tab and CMD + J.

选择键盘快捷方式部分,然后选择应用程序快捷方式。 创建一个新的快捷键,将其设置为“所有应用程序”,然后在框中键入“选择下一个选项卡”,为其提供键盘快捷键CMD +K。重复“选择上一个选项卡”和“ CMD + J”。

vim使用快捷键_如何使用Vim样式键盘快捷键进行OS X选项卡导航

When finished, it should look like this:

完成后,它应如下所示:

vim使用快捷键_如何使用Vim样式键盘快捷键进行OS X选项卡导航

All you have to do is open up an application that supports tabs, and get used to a much faster navigation system.

您要做的就是打开一个支持标签的应用程序,并习惯于速度更快的导航系统。

翻译自: https://www.howtogeek.com/166616/how-to-use-vim-style-keyboard-shortcuts-for-os-x-tab-navigation/

vim使用快捷键