This article was first published on wechat public number — interesting things in the world, handling reprint please indicate the source, otherwise will be held responsible for copyright. Wechat account: A1018998632, QQ group: 859640274
I’ve been using the MAC for a while now, and as a lazy programmer, I’ve spent about a week building my MAC into a super efficient work tool. Here’s one of the results.
- The picture above is of a one-click exit from some work app and then getting ready to work in a Windows virtual machine
- There was also a GIF, but it was too big, so put it directly into a video, and you can watch it if you are interested: One click to work
1. How to build your own shortcut key system (the theory, if you don’t want to see, can skip this chapter and go to the next chapter on practice)
We all know that keyboard shortcuts keep our hands on the keyboard, which reduces the need to switch between keyboard and mouse (the trackpad) and improves productivity. But they vary from software to software, from platform to platform (Windows, MAC, Linux…) The shortcut keys are also different, so how to use a set of shortcut keys once and for all all software platform?
1. Make all platforms follow one specification
As we said earlier, there are several platforms, so first we need to identify a platform as the base. I moved from The Windows platform to the MAC, and I didn’t want to change my shortcut habits, so I kept up with the standard shortcut keys of Windows. (I think most people do, so it has some applicability.)
2. Look at software and find commonalities
Through observing various kinds of software, we can see the following common operation aspects, no matter Windows or MAC. The following is an example of MAC software
- 1. If we look carefully at the top menu of the software, we will find that the items of File, Edit, View, window and help are common to most apps.Of course it could be a different name) Besides help, we have four more items to write about:
- 1. File:
- 1. Open a new TAB, open a file, close a TAB and save a file, which are available in most apps
- 2. Edit:
- 1. Copy, paste, cut, select all, find, redo, undo and search are common to most apps
- 2. Search the previous one and search the next one, which are shared by a few apps
- 3. View: As the interface layout of each app is different, I will just give a few examples.
- 1.Safari: Show/hide bookmarks sidebar, Show/hide Reading sidebar
- 2.Android Studio, CLion, IDEA: Show/hide various sidebars
- Evernote: Show/hide the sidebar
- 4. Window:
- 1. Previous TAB page, next TAB page, merge all Windows, which are shared by most apps
- 1. File:
- 2. Lenovo operations we need to perform on the APP every day:
- 1. Screen partition: the whole screen, the left half, the right half, the upper left quarter, the upper right quarter, the lower left quarter, the lower right quarter
- 2. Minimize and full screen
- 3. Close the software
- 4. Preferences
- 5. Forward and backward
3. Use software to find personality
The front is to find commonality, after looking for. In daily use of software, we may find that some functions of a certain software are used almost every once in a while. At this time, these special functions need to be extracted. Again, take the Mac as an example
- 1.Finder: We’ll find certain directories that we use frequently, downloads, desktop, user directories, Applications, files…
- 2.Safari: Bookmarks
- 3. Personal work software: Android Studio, Photo Shop, IDEA, Sublime, VS Code… A variety of projects
4. Global shortcut keys
For some actions that are app specific but we need to use this functionality across all apps, we need to use global shortcuts
- 1. Open up common applications: Safari, Finder, Chrome, etc., where we switch from one another all the time, it’s important to have a handy shortcut
- 2. Global functions of an app: translation, note-taking, emailing, etc
5. Classification of shortcut keys
We know that both Windows and MAC have four function keys: Shift, Alt (Option), CTRL (Command), and Win (Command). I’m going to classify these shortcuts as I want them to be, because my shortcuts are Windows compliant, so take Windows as an example
- 1. Shift + letters: Uppercase output, as everyone knows
- 2. CTRL + letters: edit related shortcut keys, such as file add and delete, open, save, text selection, cut, find and so on
- 3. Alt (Option)+ letters: Control related shortcut keys, such as adding and closing software Windows, previous and next tabs, etc
- 4. Win (Command)+ letters: In MAC, the function of the Command key is the function of the Windows Alt key, so repeated, can be recycled into a key combination
- 5. Combination key + letter: there are two uses for global key
- 1. Direct combination: there are many ways of this combination, but it is more troublesome to press each time
- 2. Use a tool to replace a discarded key (such as the command key or fn key) with a combination key. To press this key, press multiple keys.
2. How to Build your own shortcut key System (Practice)
1. The following practices are based on the following rules:
- 1. Built-in keyboard based on MacBook Pro 2017
- 2. Most shortcuts are based on Windows conventions
- 3. A few shortcuts are custom based
2. Introduction of the two software
- 1. The Karabiner – elements:
- 1. Function: Can be any two keys on the keyboard function exchange
- 2. My use: Switch fn for Mac’s built-in keyboard with left Control, left option with left command, and right command and right option with home and end.
- 3.Karabiner-elements download address
- 2. The rid_device_info_keyboard Maestro:
- 1. Functions: You can define a shortcut key to achieve a series of fixed operations
- 2. My use: Next, I will set the shortcut keys according to the operations described in the previous chapter
- 1. Copy, paste, cut, Select all, find, redo, undo, search, save file, open file, all the above operations follow Windows, CTRL + letters. But we know that on the MAC these shortcuts are command+ letters, so we need to convert them:
- 1. Add a new script:
- 2. Name the script and add one to the scriptThe trigger(that is, the script is executed when the operation is performed), which I am using hereKeytrigger, which is the script that fires when certain keys are pressed:
- 3. Fill the trigger with CTRL + C and click Add Action. A list of actions will pop up.
- 4. We added an action to trigger a button and filled it with Command + C. The script now indicates that the command+ C action will be triggered when we press CTRL + C:
- 5. In this way, we can convert all the above actions to the standard shortcut keys for Windows platform, and the process is the same.
- 1. Add a new script:
- 2. Open new TAB, close TAB, Previous TAB, next TAB, Forward, Back. Many apps have tabs, such as Safari, Finder, Sublime, Evernote, IDEA, etc. IDE shortcuts can be defined according to your personal preference. Or Windows, or Mac standard. I found through practice that using Alt (Command before key conversion)+ direction keys, etc., most suitable for hand:
- 1. Previous/Next TAB: Alt + left arrow key/right arrow key,
- 2. Forward/Back: CTRL + Alt + Left arrow key/right arrow key
- 3. Open/close tabs: Alt + plus/Delete key,
- 4. As for the definition of scripts, follow the previous section
- 1. Previous/Next TAB: Alt + left arrow key/right arrow key,
- 3. Operations such as opening sidebars/toolbars can be defined as Alt + number. The advantage of this is that if there are more toolbars, you can expand them and remember them easily
- 4. Whole screen, left half, right half, upper left quarter, upper right quarter, lower left quarter, lower right quarter, minimize, full screen, similar operations like these, we can make oneScript set, with a shortcut key + letter to achieve all functions:
- 1. Add oneGroup:
- 2. Add the first script to the collection, addKey trigger, added the action to resize app window:
- 3. Click in the action added in the previous stepThe resize by menuWe will find many functions in the menu, enough to meet our needs, we can chooseFull Screen:
- 4. At this point, a function that covers the entire screen of the app window is born:
- 5. There is only one function at this point, so we can follow similar actions to define other functions. One thing to note is,Key triggers for all scripts under this group need to be set to the same shortcut as shown:
- 6. When we have done the above, we can try to trigger the shortcut key and see that all the scripts are displayed in a menu, and we only need to select a script trigger by pressing a letter:
- 1. Add oneGroup:
- 5. Open commonly used software, open not commonly used software, close current software, these are simple to say, because it is a function that can be done in one action
- 1. Open common software:
- 2. Open uncommon software: You can use a collection of scripts to reduce the number of shortcuts
- 3. Close the current software:
- 1. Open common software:
- 6. Shortcuts to open a folder in the Finder are tricky. We have used only one action in a script, where we can perform a sequence of actions in order to accomplish this complex function:
- 1. First set Finder to the current app
- 2. Using a timer, stop executing the script until the Finder is the current application
- 3. When you press CTRL +G, you can open Finder and see a feature like thisGo to folder…Here is what triggers this function:
- 4. Trigger the DELETE key to delete the current path
- 5. Go to folder in **… Fill in the target path in the ** window
- 6. Trigger return, which will get you to the destination folder
- 7. Of course, if you have more folders, you can use the script collection. Similarly, more functions can be superimposed by small functions like this
- 1. Copy, paste, cut, Select all, find, redo, undo, search, save file, open file, all the above operations follow Windows, CTRL + letters. But we know that on the MAC these shortcuts are command+ letters, so we need to convert them:
- 3.KeyBoard Maestro download address
Add more functions to the shortcut key system
If THERE’s one thing I don’t like about the Keyboard Maestro, it’s the lack of graphical interfaces. I had no idea how to make a search feature. That’s when Alfred came to my rescue, and I think a lot of people have used this software, and there’s a lot of information about it, so I’m just going to talk about what no one else has.
1. My plugin
Of course I have collected a lot of plugins, some of which have been modified by myself and are now available for you to use.
- 1.Things: Use Things to quickly define your day
- 2.NetWork: You can view the wifi list and connect to wifi
- ItermFinder: You can open paths between Finder and Iterm
- 4.Top: View the Top memory applications
- 5.Restart: Restarts the application
- 6.Kill: Kills the application directly
- 7.Fakenum: Obtain test data
- 8.Ip: Obtain the Ip address of the current PC
- 9.HiddenFile: Show or hide hidden files
- 10.EverNote: Directly fill in notes, or query notes
- 11.Douban: Find movie, music and book ratings on Douban
- 12.Dash: Look in Dash
- Copy Url: Copies the Url of the current web page
- 14.BiliBili: Look at station B
- Baidu: If you search in Baidu, the entry will be displayed in advance
- 16.AboutMac: Views the MAC information
- 17. Zhihu: If you search in Zhihu, the entries will be displayed in advance
- 18. Find the meaning of translated words and speak English
- 19.ADB: Do Android will know, do ADB operations
2. Integrate Alfred with Keyboard Maestro
I’m going to assume that you already know a little bit about Alfred, but if you really don’t, check out this tutorial. Minority’s Alfred tutorial
- 1.Alfred’s weaknesses: Alfred has fewer actions than Keyboard Maestro’s many. A simple simulated keystroke requires AppleScript to implement, let alone more complex actions.
- 2.Keyboard Maestro’s Disadvantages:
- 1. As mentioned above, KM does not have a convenient search interface.
- 2.Alfred makes it easier to execute scripts in scripting languages like Pyhotn and PHP
- 3. Mutual call between Alfred and Keyboard Maestro: it is convenient to combine the two software as long as they can call each other
- Alfred calls KM: We know that most of the entry to KM is now a shortcut key, so we can use a template AppleScript in Alfred to trigger the shortcut key to call KM:
- 1. Create Alfred’s Workflows and fill in a keyword trigger:
- 2. Create a script executable:
- 3. Fill in the execution code, which is very simple. Lines 1 and 3 are left unchanged by defaultosascriptIs the default, followed by the AppleScript path:
- Lines 1 and 3 do not need to be changed. The number in the second line represents letters. Four function keys can be filled in curly braces. So what this script means is, press Alt (option)+37 for the letter.Click to see which letter the array represents:
- 5. At this point we can easily call KM from Alfred
- 1. Create Alfred’s Workflows and fill in a keyword trigger:
- 2.KM calls Alfred: This is easy because Alfred has shortcut keys and a search window, so you can call Alfred from the handy build script from the previous tutorial
- Alfred calls KM: We know that most of the entry to KM is now a shortcut key, so we can use a template AppleScript in Alfred to trigger the shortcut key to call KM:
3. Alfred download
Alfred download address
Other software and Tips
- 1. PopClip:
- 1. Use: it can be integrated into the shortcut key system through KM
- 2. Function: You can perform various operations on the selected text
- 3. Plug-in download
- 4. Software download
- 1. Use: it can be integrated into the shortcut key system through KM
- 2. The company:
- 1. Usage: The function of quick notes can be integrated into the shortcut key system through KM:
- 2. The function:
- 1. Quickly record text without switching apps
- 2. You can easily find notes through the Alfred plugin
- 1. Usage: The function of quick notes can be integrated into the shortcut key system through KM:
- 3. The Dash:
- 1. Programmer’s treasure book, through the previous Alfred plugin linkage, easy to find the Api
- 2. Software download
- 4. AirMail:
- 1. A more convenient mail client than the original mail, which can easily integrate into the shortcut key system
- 2. Software download
- 5. MindNode:
- 1. Simple and convenient mind mapping application. Md’s articles can be directly converted into mind maps through the PopClip plugin MD2mm
- 2. Software download
- 6. Parallels Desktop:
- 1. The best VMS under Mac can switch between Mac and Windows by using KM definition scripts
- 2. [software download] (HTTP: / / www.sdifen.com/pd132.html
No angst peddling, no clickbait. Share some interesting things about the world. Topics include but are not limited to: science fiction, science, technology, the Internet, programmers, computer programming. The following is my wechat public number: Interesting things in the world, dry goods waiting for you to see.