Giter Site home page Giter Site logo

jinzaizhichi / vimios Goto Github PK

View Code? Open in Web Editor NEW

This project forked from larki/vimios

0.0 1.0 0.0 11.73 MB

A port of Vim to iOS 9+

Swift 0.14% Objective-C 0.22% Vim Script 43.05% Makefile 1.77% NSIS 0.06% Shell 0.11% C 50.19% Groff 2.01% Awk 0.09% Perl 0.26% Batchfile 0.02% PostScript 0.30% Smalltalk 0.12% Emacs Lisp 0.14% NewLisp 0.18% Ruby 0.17% SystemVerilog 0.13% C++ 0.82% Module Management System 0.21% Python 0.01%

vimios's Introduction

VimIOS - A port of Vim to iOS 9+

Disclaimer: This is a side project of mine - no promises and no warranties. If you like it, feel free to let me know, and please feel free to improve on it, there is a lot to do.

This project is based on the Vim port of applidium, which has been inactive for a few years. Nonetheless, it is a full working port of Vim. However, in the meantime iOS has gained many features of which this port did not take advantage. I rewrote large parts of it with the goal of improving the Vim experience under iOS 9, in particular on iPads with an external keyboard.

The new key features are:

  • Split View and Slide Over support
  • Full external keyboard support
  • Importing and exporting files from Vim to other apps is now possible.
  • The app now looks great on retina displays.
  • Upgrade to Vim 7.4

Acknowledgements

Obviously, I used the code of Applidiums Vim port, and Vim itself. I had to make minor changes in the Vim source code a few times, so I include a modified version of the Vim code base. Note that Vim is charity ware, see here for the Vim license. The app icon was taken from here.

Setup

Clone the repository and use XCode to compile it for your iOS 9+ device.

Usage

Open the app and just start typing. If you have an external keyboard, you should be all set. If you need an escape key, or F1, longpress anywhere on the screen. This will open a tool bar with a few buttons. But instead of escape, you can also use <C-[>.

You can get this help by using the command :help ios.

File management.

This version of Vim comes with a version of the netrw file browser. Use the command e . to start it. You will likely see the following items:

.vim/
Inbox/
.viminfo
.vimrc

If .vimrc does not exist, you can create it, if you wish.

You can write your files anywhere, except for the Inbox/ folder, see below. Use F1 to get help on how to use the file browser. You can create directories with d and delete directories/files with `D'.

The Inbox folder

This is a special folder. Files imported from other applications will be saved there. Note that you cannot save to the Inbox folder manually. In particular, if you import a file and make changes, then you have to save the new file somewhere outside the Inbox folder.

Importing files from other applications

If you would like to edit a file in Vim that is currently in the sandbox of another application (e.g. the brilliant Working Copy), simply go to this app and use standard iOS dialog "Open in another app". Pick VimIOS, the file will be copied to the VimIOS sandbox, and Vim will be opened. Similarly, if you receive a text file via Airdrop, you can open it in VimIOS.

Important: The file will be imported and saved into the directory Inbox. If you want to make changes to this file, you have to save it outside the Inbox directory.

Exporting files to other applications

I added two commands to commands to Vim which allow you to export files.

  • :Share opens the standard iOS dialog "Open in other app". You can also export your file via Airdrop.
  • :Mail opens a slightly different dialog, which allows you to export your text as the body of an email.

Customization

In the .vim folder (create it, if it doesn't exist), you can add plugins and themes as usual. I have not tested many plugins; obviously those utilizing many features external to Vim will not work, as iOS does not provide a shell to Vim.

You can create and customize a .vimrc file as usual. Some graphical features will probably not work.

Todo:

It would be very nice to implement the new iOS document picker feature, which would allow Vim to open files directly from the sandbox of a (compatible) app, such as several cloud storage providers. Unfortunately, this has to be implemented by someone with an Apple Developer subscription, as access to CloudKit is necessary. Also note that this would require the implementation of an at least rudimentary document management system, as the document picker extension works with the UIDocument class.

vimios's People

Contributors

larki avatar xslim avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.