Emacs is a simple and customizable text editor that you can use in the Termux terminal. It gives you many useful tools for writing and editing files. You can use it to create new files, edit code, search text, and more, while its keyboard shortcuts make editing faster. It is useful for working with different types of files in Termux.
Here’s what you can do with Emacs in Termux:
- Create and edit text files.
- Write and edit programming code.
- Jump to a specific line and column.
- Search and work with large text files.
- Insert the contents of another file.
- Run Emacs Lisp expressions.
- Load Emacs Lisp files.
- Customize Emacs for your workflow.
Install Emacs in Termux
You can install it in Termux with a single command. Open Termux and run the command below to start the installation.
First, update the Termux packages.
pkg update && pkg upgrade -yInstall Emacs.
pkg install emacs -yCheck the installed version.
emacs --versionThat’s it! Emacs is now installed on Termux and you can start using it in the terminal.
Use Emacs in Termux
You can use Emacs with different commands for editing files and changing how the editor starts. Here are some useful commands and shortcuts that are easy to use in Termux.
Run Emacs normally.
emacsEmacs will open in your Termux terminal.
To open an existing file:
emacs filename.txtFor example:
emacs notes.txtCreate a new file by opening a filename that does not exist:
emacs newfile.txtOpen a file and start at a specific line:
emacs +10 filename.txtOpen a file at a specific line and column:
emacs +10:5 filename.txtOpen Emacs without loading your normal configuration files:
emacs -QChange to a directory before starting Emacs:
emacs --chdir ~/DocumentsOpen a file using the --file option:
emacs --file filename.txtInsert the contents of a file into the current buffer:
emacs --insert filename.txtEvaluate an Emacs Lisp expression:
emacs --eval '(message "Hello from Emacs")'Load an Emacs Lisp file:
emacs --load filename.elCall an Emacs Lisp function:
emacs --funcall function-nameShow the Emacs help:
emacs --helpShow the installed Emacs version:
emacs --versionYou can also use the following common keyboard shortcuts inside Emacs:
Ctrl + x, Ctrl + f— Open a file.Ctrl + x, Ctrl + s— Save the current file.Ctrl + x, Ctrl + w— Save the file with a new name.Ctrl + x, Ctrl + c— Exit Emacs.Ctrl + x, Ctrl + e— Evaluate the Emacs Lisp expression before the cursor.Ctrl + g— Cancel the current command.Ctrl + s— Search forward.Ctrl + r— Search backward.Ctrl + a— Move to the beginning of the line.Ctrl + e— Move to the end of the line.Alt + x— Run an Emacs command.
For more information about Emacs command-line options, use:
emacs --helpEnd Note
Emacs is a simple editor that gives you many useful options for working with files in the Termux terminal. You can use its commands and shortcuts to edit files, write code, and manage your work easily. It can be a helpful editor for your daily file and coding tasks in Termux.

