IVim: Difference between revisions
Line 50: | Line 50: | ||
* '''input mode''' – Editing Mode actual can edit text. | * '''input mode''' – Editing Mode actual can edit text. | ||
{| class="wikitableharmcenter" width=" | {| class="wikitableharmcenter" width="1100px" | ||
| style="vertical-align:top;" width="50%" | | |||
=== vi mode === | |||
{| class="wikitableharmcenter" width="475px" | |||
! width="100px" | Command | ! width="100px" | Command | ||
! width=" | ! width="375px" | Action | ||
|- | |- | ||
| k | | k | ||
Line 148: | Line 151: | ||
|} | |} | ||
| style="vertical-align:top;" width="50%" | | |||
=== Command mode === | |||
{| class="wikitableharmcenter" width="475px" | |||
! width="100px" | Command | |||
! width="375px" | Action | |||
|- | |||
| :g/X/s//x/g | |||
| style="text-align:left;" | Global Search and replace (X=search object x=replace object) | |||
|- | |||
| :r file | |||
| style="text-align:left;" | Import a file into the current file | |||
|- | |||
| :34 r file | |||
| style="text-align:left;" | Import a file into the current file after line 34 | |||
|- | |||
| :w | |||
| style="text-align:left;" | Write out the file to save changes | |||
|- | |||
| :w file | |||
| style="text-align:left;" | Write the file to named file | |||
|- | |||
| :wq | |||
| style="text-align:left;" | Save the file exit vi | |||
|- | |||
| :w! | |||
| style="text-align:left;" | Force save the file | |||
|- | |||
| :q! | |||
| style="text-align:left;" | Quit vi but don’t save changes | |||
|} | |||
<br> | |||
=== Input mode === | |||
{| class="wikitableharmcenter" width="475px" | |||
! width="100px" | Command | |||
! width="375px" | Action | |||
|- | |||
| a | |||
| style="text-align:left;" | Insert characters to the right of the cursor | |||
|- | |||
| A | |||
| style="text-align:left;" | Append characters to the current line | |||
|- | |||
| i | |||
| style="text-align:left;" | Insert characters to the left of cursor | |||
|- | |||
| I | |||
| style="text-align:left;" | Insert characters at the beginning of the current line | |||
|- | |||
| o | |||
| style="text-align:left;" | Add a new line after current line | |||
|- | |||
| O | |||
| style="text-align:left;" | Insert a new line above the current line | |||
|} | |||
|} | |||
== See also == | == See also == |
Revision as of 07:32, 18 June 2021
Boogaloo iVim
is a text editor on iOS based on Vi IMproved by Bram Moolenaar.
vi is a screen-oriented text editor originally created for the Unix operating system. The portable subset of the behavior of vi and programs based on it, and the ex editor language supported within these programs, is described by (and thus standardized by) the Single Unix Specification and POSIX. The original code for vi was written by Bill Joy in 1976, as the visual mode for a line editor called ex that Joy had written with Chuck Haley. [1]
Getting help on iVim
- Reddit, iVim HowTos.
Apple iCloud
All iCloud Documents are store in ~/Library/Mobile\ Documents/com~apple~CloudDocs. So:
Start by opening Terminal and then
$ cd ~/Library/Mobile\ Documents/com~apple~CloudDocs $ ls -Al .DS_Store .. bash
- SuperUser, Access iCloud Drive via terminal.
Interchange iMac with iPad
Let us assume that on an iMac there is a file created in the subdirectory ./Documents/Text on the iCloud Drive named Example.txt.
The easiest way to open this file on an iPad. This method works for iVim but also for other Apps.
- Open the App Files.
- Choose iCloud Drive under the tab Location in the left pane.
- Navigate to Documents and then Text.
- Now hold your finger on the filename Example and choose Share from the appearing list.
- On the 2nd row (with Airdrop, Messages, Mail...) go to the where More. Unless you see the App you wanna use for editing this file.
- From the appearing App list choose the required App. In this case that should be iVim.
- The file is now opened in iVim. Make some changes and write the file to disk using the vim command :w<enter>.
- Now iVim is showing where it save the result:
/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/Documents/Text/Example.txt
Where are my Files
Every App on an iPad has its own local storage. So you can not edit files that live in other Apps local storage.
Can you edit files in the iCloud?
Which files can be edited.
Basic Vi Commands
vi is one of the most commonly used editor program and included by default with every UNIX and Linux system. vi basically operates in 3 modes:
- vi mode – Standard Mode vi starts in.
- command mode – Command Mode vi after pressing the key colon (“:”).
- input mode – Editing Mode actual can edit text.
vi mode
|
Command mode
Input mode
|
See also
Reference
- ↑ Wikipedia vi, The text is based on the vi page on wikipedia.