2025-04-25 23:09:00
github.com
Empty Enter Expander inserts a command into the prompt with a few keystrokes.
It is currently written for the zsh
. The bash
version is not published yet.
Commands are stored in a module directory that contains files and folders with lowercase letters at the beginning of their names, which act as shortcuts.
The tool is activated by pressing Enter on an empty command.
After that, the following keys are pressed to activate the commands::
1
,1
,1
,Enter
to change the directory to the project’s folderg
,s
,Enter
to view the git statusg
,l
,Enter
to view the git log
Expander uses a directory where the commands are stored.
It is called a module directory.
The module directory might be located in ~/Tools/expander-example-module
.
Let’s say you have a lengthy Git command.
Prepare a script that will output it.
Place the prepared script in the module directory within the subdirectory g Git
and name the file l Log
.
# Contents of the example script
# Save as "~/Tools/expander-example-module/g Git/l Log"
echo 'git log --pretty=format:"%h %an : %s %d" --graph'
Note the use of lowercase letters at the beginning.
These will serve as key shortcuts.
You can now store your own commands in a structure that you prefer.
Clone this project and configure the module directory along with the other settings.
# Contents of the tool's configuration
# Place it in the "~/.zprofile" file
setopt HIST_IGNORE_SPACE
export EMPTY_ENTER_EXPANDER_MODULE_PATH="/Users/user/Tools/expander-module-one"
source ~/Tools/empty-enter-expander/zsh-function.zsh 2>/dev/null || :
zle -N empty-enter-expander
bindkey "^M" empty-enter-expander
Open a new shell to apply the configuration.
Hit Enter on an empty command to activate the expander.
It will open a listing of stored commands, so you do not have to remember them.
Then press the g
and l
keys to insert the example command into the prompt.
Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.
Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!
Help Power Techcratic’s Future – Scan To Support
If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.
As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!
BITCOIN bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge Scan the QR code with your crypto wallet app |
DOGECOIN D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA Scan the QR code with your crypto wallet app |
ETHEREUM 0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a Scan the QR code with your crypto wallet app |
Please read the Privacy and Security Disclaimer on how Techcratic handles your support.
Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.