MobileCode is a code editor designed for mobile phones. It edits files locally on the device.
Many commands are inspired by vim. MobileCode, however, is always in "insert mode". You enact commands by tapping a menu button rather than entering "normal mode". For example, to delete a line in vim, you would type ESC-d-d. In MobileCode, you tap the menu button, then tap "Cut line".
The menu button is a floating transparent button. You can move it by dragging it.
In supported languages, files are rendered as nested "blocks". This can be disabled by "Disable blocks". Blocks are similar to code folding. They are divided by blank lines with balanced {}, recursively. A typical C file might appear as a block labeled "#include <...>", then a block for each section of global variables, and then a block for each function. A block's "label" is determined heuristically: if it looks like a function, it is the function name; if it starts with a comment, it is the comment; otherwise, it is the first nonblank line. Tap them to expand. When searching, results which match block labels appear first.
When lines are too long, their right edge is yellow. Tapping this will wrap the line.
In supported languages, when tapping the edge of an overlong line, the line is "expanded": a pretty-printed view of the line is shown, and modifications to the view format the view into a single line and overwrite the underlying line. These changes happen as you type; you do not need to close the expansion for changes to be "synced".
If expansions are not supported for the language, or if "Flow line" is tapped instead, the line will wrap around the edges of the screen.
Deletes and copies the line the cursor is on. See Copy (Select) for the commands that appear after. (vim: dd)
Disables blocks. The file is shown as most editors would typically show it. Blocks will not be used again, even on supported files, until Enable blocks is pressed.
Shows the file as a series of nested blocks. Supported files will automatically use blocks when opened.
Inserts a line below the current one and moves the cursor to its start. Indentation is copied. (vim: o)
Looks for the regex in the text. As matches are navigated, the screen scrolls to each one (unlike search). (vim: /)
Hides the find overlay.
Navigates to the first match in the text.
Navigates to the next match in the text, wrapping. If no match is selected, it selects the first one relative to the screen.
Navigates to the previous match in the text, wrapping. If no match is selected, it selects the first one before the screen.
Wraps the line around the edges of the screen.
The first input buffer is a regex. Matches are searched from the start of the file. At each match, there is an option to replace the match with the second input buffer. <Enter> moves the cursor between the two buffers. (vim: :%s//gc)
Stops matching and returns to where the screen was before.
Replaces the selected match with the second buffer.
Moves to the next match.
Scrolls to the top of the file.
Android only. Asks Termux to run $PREFIX/usr/bin/mobilecodecmd. Specifically, sends a RUN_COMMAND intent to Termux with RUN_COMMAND_PATH set to /data/data/com.termux/files/usr/bin/mobilecodecmd. For this to work, you must add 'allow-external-apps = true' to ~/.termux/termux.properties, and create the command.
Deletes the newline preceding the next line and replaces any indentation it had with a single space. (vim: J)
Pastes the system clipboard contents at the cursor.
Pastes the system clipboard contents at the start of the next line and adjusts its indentation. (vim: preceded by Cut line, it is like d-d-p)
Writes the file to its location. Note that expanded lines are merely views of their underlying line; whether they are expanded or not has no effect on how they are saved (always as a single line).
Opens a file picker, then updates the file's save location and saves it there.
Starts selecting from the cursor's location. Wherever you tap, the selection will be updated to be between the tapped location and the location the cursor was when you originally tapped Select. Pressing backspace will cut the selection (copy and delete). (vim: v)
Stops selecting.
Copies the selection to the system keyboard.
Blocks often start with blank lines. When a block is expanded but the previous block is not, these blank lines are hidden. If the selection is right after these hidden blank lines, tapping "Include pre lines" will include them in the selection.
The first input buffer is a regex. Each match within the selection is replaced with the second input buffer. <Enter> moves the cursor between the two buffers. Each replacement is indicated visually. (vim: :'<,'>s//g)
Does not replace any of the matches.
Replaces each of the matches as shown in the text.
When shown, replaces will attempt to match the case of the text they matched. For example, if replacing foo with bar, FOO becomes BAR, and Foo becomes Bar. Tapping will change the behavior to something else.
When shown, replaces will replace their matched text with the exact contents of the second input buffer. Tapping will change the behavior to something else.
Like Select, except the entire line under the cursor is selected, and any line tapped moves the selection to include the entire tapped line. (vim: V)
Redoes the previous Undo.
Moves the cursor to the start of its line. This will appear when you tap close to the start of the line.
Undoes the previous change to the text.
Every file is backed up before it is opened. This screen will show you your backups chronologically, as well as how much space they are all taking up. Clearing them will delete them all. Tapping an individual backup allows you to view it Read-only, which you can then Save as somewhere and edit. Diff will show the difference between the backup and what is stored on disk. Restore will overwrite what is on disk with the backup's contents.
Opens a new blank file. It isn't saved anywhere until you press Save and give it a location.
Decreases the global font size by 10%.
Increases the global font size by 10%.
Displays the licenses of code and assets used by MobileCode.
Shows a debug log of MobileCode.
Opens a system file picker to choose a file to edit.
Enter a URL to save its contents locally. If you copy the URL and then come back to MobileCode, it will offer to use the clipboard's contents as the URL. If the URL is a GitHub repo URL, it will download the default branch. If the URL ends in .zip, it will unzip it. Otherwise, it simply saves the contents of the URL as the file.
Every saved URL will be listed. You can see how much space they take up and delete them. When you tap one, if it is a directory, you can browse its contents for a file to open. Otherwise, the file itself is directly opened.
Every file edited is listed here. You can tap X to remove it from the history, or search to refine the results. Tapping an entry will open it and move it to the top of the list.
The file listed is currently open, and tapping this will return to editing where you left off.