preface

Github address: Autohotkey-scripts repository for my.ahk files.

This is a great tool to use when you find yourself typing something repeatedly (whether it’s a command line phrase you often use in programming or a phrase you often type in chat). After reading this guide, you’ll be able to customize your own shortcut keys and type common commands or phrases in seconds!

How to use within 30 seconds

Step 1

Download the AutoHotkey installer or.zipfile

Here download or directly git clone my repository, I have uploaded the installation program.

To download the installation program, double-click install. If you have any problems, go to the autohotkey. CHM file and open it up to see how to use it. It’s very detailed.

Step 2

downloadalex.ahk, double click it or right click andRun ScriptRun the file

To use the shortcut keys defined inside, try pressing the combination [and B (in order, first [then B).

Step 3

You can view and edit them directly using a code editor, such as Sublimealex.ahkfile

Sublime can install the AutoHotkey plugin to enable syntax highlighting, comment switching, auto-completion, and more when editing AHK files. If you make changes while the file is running, after you save the changes, you can right click the H icon in the notification bar and Reload This Script to make the changes take effect.





ICONS in action







Rerun the script

Simple syntax instructions

English input :*:[b:: this is the definition of shortcut keys, where :*: and :: Send, browser-sync start –server –files “**” Send, followed by your own custom input. Press [and B to trigger the shortcut key, which will automatically help you type what you have written.

; Browsersync :*:[b:: ; Press the shortcut key combination: '[' and' b 'Send, browser-sync start --server --files "**"; it will automatically type' browser-sync start --server --files' Return; Docsify local server startup command :*:[d::; press shortcut key combination: '[' and' d 'Send, Docsify Serve docs'; it will automatically help you type' docsify serve docs' ReturnCopy the code

The above method is for keyboard keys, can automatically help you to type your defined keyboard can be found on the key, so only suitable for English input. If you want to enter Chinese, please navigate to the hot word sketch section in alex.ahk file.

:*:]b:: ; Press shortcut key combinations: '] 'and' b 'FastInput(" [article recommended reading] "); It will automatically type 'return' for you, and you can change whatever you like inside the double quotes. FastInput {temp=%ClipBoard%; FastInput(FastWord) {temp=%ClipBoard%; Take what's on your sticky board and save it to a temporary variable sleep,50; Wait 50ms before executing the following statement ClipBoard=%FastWord%; Copy your custom phrase to the clipboard. Paste the contents of your ClipBoard ClipBoard=%temp%; Restore the original contents of your clipboard}Copy the code

Note: If the output Chinese phrase is found to be garbled, save the.ahk file as UTF-8 with BOM. In sublime editing you can do this: File -> Save With Encoding -> UTF-8 With BOM.





File saving format

Other features

; Run a program. Note: most programs will require a FULL file path. ; Run a program. Note: Most programs need to provide a full path. Run, %A_ProgramFiles%\Some_Program\Program.exe ; Run a website ; Run a website (use the default browser shortcut to open a website) Run, https://autohotkey.com; The above functions can be used as follows :: *:* A ::; Press shortcut key combinations: '*' and 'a' Run, https://autohotkey.com; Autohotkey return; Enter the current date and time quickly :*:]n::; GetNow () return getNow() {FormatTime, NowDateTime,, YYYY-MM-DD HH: MM :ss; 'YYYY-MM-d DDDD HH: MM :ss' => '2017-09-30 Saturday 14:37:47' send, %NowDateTime%}Copy the code

conclusion

Check autohotkey. CHM, you will find a lot of useful functions for you to play ~ MY personal use scenario is: fast input some common git commands, some common Chinese phrases and so on.