Neovim in Termux – Installation & Usage Commands

Neovim is a powerful command-line text editor that is used to create and edit text files, source code, and configuration files. It is an improved version of Vim with better performance and modern features. You can install and use Neovim in Termux to edit files using simple terminal commands.

Here’s what you can do with Neovim in Termux:

  • Create and edit text files.
  • Write source code.
  • Edit Linux configuration files.
  • Open multiple files and tabs.
  • View files in read-only mode.
  • Learn a modern terminal text editor.

Install Neovim in Termux

Below are the simple commands to install Neovim in Termux. Copy and run each command one by one to install the editor.

Update Termux packages.

pkg update && pkg upgrade -y

Install Neovim.

pkg install neovim -y

Check the installed version.

nvim --version

Neovim is now installed and ready to use.

Use Neovim in Termux

After installing Neovim in Termux, you can use different commands to create files, edit documents, open multiple files, and perform other text editing tasks. Below are some commonly used Neovim commands for beginners.

Create or open a file.

nvim file.txt

Show the Neovim help menu.

nvim --help

Display the installed version.

nvim --version

Open a file in read-only mode.

nvim -R file.txt

Open two files in horizontal windows.

nvim -o file1.txt file2.txt

Open two files in vertical windows.

nvim -O file1.txt file2.txt

Open files in separate tabs.

nvim -p file1.txt file2.txt

Execute a command after opening a file.

nvim +"set number" file.txt

Start Neovim without loading user configuration.

nvim --clean

Open a custom configuration file.

nvim -u ~/.config/nvim/init.lua

Open a saved session.

nvim -S Session.vim

Start Neovim in diff mode.

nvim -d file1.txt file2.txt

These are some of the most useful Neovim commands for beginners. You can use them to open files, manage windows, edit text, and perform different editing tasks in Termux.

Essential Neovim Keyboard Shortcuts

  • i : Enters insert mode.
  • Esc : Returns to normal mode.
  • :w : Saves the current file.
  • :q : Quits Neovim.
  • :wq : Saves the file and exits.
  • :q! : Exits without saving changes.
  • dd : Deletes the current line.
  • yy : Copies the current line.
  • p : Pastes the copied or deleted line.
  • u : Undoes the last change.
  • Ctrl + r : Redoes the last undone change.
  • /text : Searches for text in the current file.
  • :set number : Displays line numbers.

End Note

Neovim is one of the most popular terminal text editors used by developers and Linux users. After installing it in Termux, you can easily manage files, write code, and edit text using simple commands.

SHARE THIS POST: