■ DroidVim (Text Editor)

DroidVim is a Vim for Android.
Vim 8.1 (Huge version), grep, diff and ctags are ready to use.
https://play.google.com/store/apps/details?id=com.droidvim

▼ Required - ARM (Android 4.1 and up), x86 (Android 4.3 and up)

■ Note:

How to quit:

  • Type ":qa" command
  • Tap "Q" button on the function bar
  • Tap "QUIT" on the navigation drawer

Direct/Normal input

By default it is set to "Direct input" (alphanumeric characters only) for normal mode commands. "Direct/Normal input"

Vim tutorial:

Type ":Vimtutor".

■ Troubleshooting:

  • By default it is set to "Direct input" (alphanumeric characters only) for normal mode commands. "Direct/Normal input"
  • If Vim freezes, tap "close window" on the menu.
  • Depending on the filer or cloud storage application, it may be set to read only when opening the file via the "Share (or Open with)" menu.
    In that case, use the "Storage" button or ask the filer or cloud storage developer.

Screen glitches

Using non-alphanumeric characters may cause screen glitches.
Vim and terminal can not handle "proportional fonts". Please use "monospaced fonts".

monospaced fonts
All character widths must be the same or double (fixed-width). For example, 'i' and 'W' must have the same character width.

* Beta: You can use proportional fonts by enabling the "Preferences> Fonts> Use proportional fonts" option. (Drawing speed will be slower)

■ Clipboard

Since DroidVim is running on the terminal emulator, you can not use the clipboard option (Basically it is for GVim). However, instead of the clipboard option DroidVim has several clipboard commands.
  • "*p - Paste text From the clipboard to Vim.
    The function bar button has the same function.
  • "*y - Copy text From Vim to the clipboard.
    The function bar button has the same function.
  • gY - Copy text From the unnamed register to the clipboard.
    e.g. yygY : Only on DroidVim

You can also copy/paste text by Android intent.

  • Paste - "Share" text from other apps
  • Copy - "Long press menu (or the menu button on the drawer)" -> "Share"

■ Storage access and Vimfiles

To access the internal storage, external SD card, USB memory, various cloud storages, start the file picker from the "Storage" button on the navigation drawer. (Android 4.4 and up)
Use the "Dropbox" button to access Dropbox files.

Internal storage

Vim's netrw can access the internal storage (e.g. :e.). You can access the internal storage using $INTERNAL_STORAGE.
:e $INTERNAL_STORAGE

If you are using Android 6 or later, please restart DroidVim after granting storage access permission.
* For Android Q or later, it is "Private Storage Area".

Startup directory

Home directory is in the application's private storage. (See :echo $HOME)

But when you start Vim, you may want to always edit the file in a specific internal storage directory. In that case, add the following to .vimrc.

" The internal storage is accessible with $INTERNAL_STORAGE cd $INTERNAL_STORAGE/path/to/directory
You can copy "Startup directory" of "Preferences" to the clipboard. ("*p or long press menu to paste)

Vimfiles (.vimrc and .vim)

* For Android Q or later, backup / restore your home directory using an application such as "Files".

Files in the home directory ($HOME) will be deleted during uninstallation. So we recommended that create .vimrc and vimfiles (.vim) in the internal storage. (It can be accessed with a filer app.) If you created .vimrc or vimfiles (.vim) in the internal storage, create a symbolic link with the following command via Vim.
  1. :cd $HOME
  2. :!rm .vimrc
    (Delete $HOME/.vimrc)
  3. :!ln -s $INTERNAL_STORAGE/path/to/.vimrc .vimrc
  4. :!rm -rf .vim
    (Delete $HOME/.vim)
  5. :!ln -s $INTERNAL_STORAGE/path/to/.vim .vim
(You can use $INTERNAL_STORAGE to access the internal storage.)

Home directory

We do not recommend it, but you can change the Vim home directory. Please use "Preferences"->"Home directory", or add the following to .vimrc.
" The internal storage is accessible with $INTERNAL_STORAGE let $HOME = $INTERNAL_STORAGE.'/path/to/home' cd $HOME
However, if you change $HOME, you may not be able to successfully write to files that require attribute modification. For viminfo, add the following to .vimrc
set viminfo+=n$APPFILES/home/.viminfo

■ Tips:

Direct/Normal input

By default it is set to "Direct input" (alphanumeric characters only) for normal mode commands.
Please change Direct/Normal input by the following method. (The "Input mode at startup" can be changed by preferences)

  • Tap "◇"button on the function bar.
  • One-line text box
  • Change input mode via Vim script or physical keyboard.
    "Text input mode"

Move Cursor

  • Swipe left or right in the lower half of the screen to move the cursor to the left or right
  • The [○] button swaps the top/bottom, left/right directions.
    It also synchronizes with the state of the [Ctrl] button. ([ESC] button to cancel)

One-line text box

When you start one-line text box (double tap at the bottom of the screen), you can use the usual input equivalent to a normal Android application.
It is convenient to change "Preferences" -> "◇ button" to "One-line text box".

Recommended keyboards

1. Gboard
2. AOSP keyboard and clones
3. Hacker's keyboard

HTML and Link.

  • Open HTML file in browser.
    - "Menu" -> "Share" -> \"File\"
    - Type :ShareIntent file
  • Open the URL under the cursor.
    - gx (:h gx)

Colorscheme

DroidVim supports a 256 terminal color scheme.

:colorscheme term256
Add :set bg=light or :set bg=dark depending on the background color of the terminal.

Plugins

You can install the VimScript plugin to .vim directory.
:h plugin

you can also use packadd.

:h packages

Samba

If you want to edit the file shared by Samba, try using the following application.

root

Since DroidVim is running on the terminal emulator, root access is possible by installing the su command. In a rooted environment, the vi command should also be available. We recommended using vi with shell or Ctrl+z. You can also use DroidVim's vim binary by running the suvim command.

■ Extra contents (in-app purchase):

Extra contents

Add the following packages required by some plugins.

  • Git - Version Control System.
  • Python - Programming Language.

Others

  • Markdown to html plugin (Experimental)

Donation

With one donation, you can use extra contents on all your devices, and you do not need a donation for updates.
If there is a problem please try "Uninstall -> Re-install" or "Clear the Play Store cache via Android Settings".

busybox-setup

When extra contents is installed on a specific device (e.g. Samsung devices), some commands (e.g. "ls") may not work.
In such a case, please use "busybox-setup sysbin".

  1. :shell or Ctrl-z
  2. busybox-setup sysbin

If problems still occur, initialize and setting commands.

Initialize

  1. busybox-setup clean
  2. busybox-setup

Setting commands

  1. For example, if ls does not work, execute busybox-setup sysbin ls or busybox-setup ls.
  2. If there is a command which does not work, do the same thing.
Option
all Add all busybox commands. (busybox-setup all)
{command} Add specified busybox command. (e.g. busybox-setup ls)
sysbin Use all commands of your device preferentially. (busybox-setup sysbin)
sysbin {command} Use specified command of your device preferentially. (e.g. busybox-setup sysbin ls)
clean Clear all additional commands. (busybox-setup clean)

If you run without options, the standard installation will be performed.

■ Text input mode

You can change the Text input mode from Vim script.

:ATEMod 2
0 Hide softkeyboard
1 Show softkeyboard
2 Toggle Softkeyboard
50 Normal input
51 Direct input : password
52 Direct input : URI
53 Direct input : Default
54 Direct input : Raw
55 Toggle "Normal input"/"Input mode at startup" See Preferences
56 One-line text box
61 Language switch (Shift+Space)
62 Language switch (Alt+Space)

It is possible to disable word suggestions in normal mode and enable word suggestions in insert mode.
Add follows in your .vimrc.

let g:imctrl_normal = 53 let g:imctrl_insert = 50

Also you can change the Text input mode from physical keyboard. See "IME shortcuts" preference.

Android Shortcuts

Layout switch [Ctrl]+[Space] If multiple layouts are available.
Language switch [Shift]+[Space] If IME can use multiple languages.
IME switch [Meta]+[Space] If multiple IMEs are available.
[Meta] means [Windows] key or [Command] key
(Android 7 and up)

■ Source code:

DroidVim is an open source project.
https://github.com/shiftrot/droidvim

■ Contact:

<< Prev  |  PageTop