Nvim

Here are several ways to navigate to files in Termux using command-line tools and shortcuts, depending on your needs (file viewing, editing, scripting, etc.):


🔹 1. Basic Navigation Commands

📁 Move Between Directories

cd /path/to/directory # Change to specific directory cd ~ # Home directory (/data/data/com.termux/files/home) cd .. # Go up one directory cd - # Switch to previous directory ls # List files in current directory ls -la # List all files with permissions


🔹 2. Search for Files

🔍 Locate Files by Name

find . -name "filename.ext" # Search recursively from current directory

🔍 Fuzzy Finder (faster, smarter)

pkg install fzf fzf # Browse and select files interactively


🔹 3. File Tree Browsing

📂 Use tree to view folder structure

pkg install tree tree # View directory structure tree -L 2 # Limit to 2 levels


🔹 4. Open Files

✏️ View/Edit files

cat filename # Display file content less filename # Scrollable viewer (press q to quit) nano filename # Edit using Nano (simple CLI editor) vim filename # Edit using Vim (powerful editor)


🔹 5. Graphical File Browsers (with X11 or GUI)

If you're using Termux with a VNC viewer or X server:

pkg install pcmanfm # Lightweight GUI file manager


🔹 6. Use ranger (CLI File Manager)

A powerful terminal-based file navigator.

pkg install ranger ranger # Launch file explorer in terminal

Controls: h (up dir), l (open), gg/G (top/bottom), q (quit)


🔹 7. Quick Jumping Tools

📚 Use bookmarks with z or autojump

pkg install z z foldername # Jump to frequently used folder


🔹 8. View Storage (shared /sdcard etc.)

To access Android shared storage:

termux-setup-storage # One-time setup for storage access cd /storage/emulated/0 # Access internal shared storage cd ~/storage/downloads # Shortcut to Downloads


🔹 9. Using Neovim as a File Browser

nvim .

Opens current folder in Neovim file tree (with plugins like nvim-tree, telescope, or fzf)


🔹 10. Bookmarking and Scripting

Save favorite locations:

alias proj="cd ~/projects/myapp"

Add to .bashrc or .zshrc for persistence.


🧠 Tips

Use pwd to check current path

Use TAB for autocomplete

Combine tools: cd $(fzf) to cd to selected folder


Would you like a script or shortcut that auto-opens ranger or fzf at boot or on a keypress?