Editing code or text on a mobile device can feel clunky without the right tools. Termux offers two excellent terminal-based editors: Emacs and Micro. Both let you write, edit, and manage files efficiently, whether you’re coding in Python, C/C++, or just taking notes.
In this guide, we’ll show you how to install and use both editors. If you’ve already tried other Termux utilities like quick Termux projects or automated scripts, these editors will fit seamlessly into your workflow.
Why Use Terminal Editors?
- Fast and lightweight – Runs on any Android device without heavy GUI.
- Powerful – Features like syntax highlighting, search, and multi-file management.
- Remote editing – Works over SSH or local Termux sessions.
- Integration – Combine with scripts and automation for custom workflows.
Terminal editors are essential for developers, sysadmins, and anyone managing files remotely — similar to how you’d rely on Netcat for networking tasks or Ngrok for tunneling.
Step 1: Update Termux
Before installing any editor, make sure Termux is up-to-date:
pkg update && pkg upgrade -y
This ensures all dependencies install smoothly.
Step 2: Install Emacs
Emacs is a feature-rich, classic text editor known for its extensibility. Install it with:
pkg install emacs -y
Once installed, open it by typing:
emacs
Basic commands to get started:
-
CTRL + X CTRL + F
– Open or create a file. -
CTRL + X CTRL + S
– Save the current file. -
CTRL + X CTRL + C
– Exit Emacs.
You can also install Emacs packages for syntax highlighting or programming modes — useful if you’re editing scripts like those in our Termux phishing demo or network tools.
Step 3: Install Micro Editor
Micro is a modern, user-friendly terminal editor. It’s lightweight and easy for beginners. Install it with:
pkg install micro -y
Open it with:
micro filename.txt
Micro commands are intuitive:
-
CTRL + S
– Save file. -
CTRL + Q
– Quit editor. -
CTRL + E
– Open command prompt inside Micro.
Micro also supports syntax highlighting for languages like Python, C/C++, Bash, and HTML — perfect if you’re editing scripts from our project examples.
Step 4: Customize Your Editors
Both editors can be customized for better productivity:
-
Emacs: Add init scripts in
~/.emacs
to load plugins or themes. -
Micro: Use
micro -plugin install
to add features like linting or git integration.
Customizing editors makes coding smoother, especially if you’re combining Termux scripts with voice commands or IoT management like in risk-based security automation.
Step 5: Integrate with Termux Workflow
You can edit scripts directly from Termux, then execute them without leaving the terminal:
micro my_script.sh
bash my_script.sh
This works well for C/C++ programs, Python scripts, or even automation scripts that send alerts like in network monitoring tips.
Conclusion
Installing Emacs or Micro in Termux gives you powerful editing capabilities on your Android device. Whether you’re a beginner or an advanced user, these editors let you write code, manage files, and integrate with scripts efficiently. Pair them with other Termux tools from our project collection to build a truly mobile development environment.
Once you’re comfortable, you’ll find that editing and running scripts on your phone is just as productive as using a laptop — and often more convenient for on-the-go work.
Top comments (0)