-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execute commands (e.g. compile files) from iVim, locally. #23
base: master
Are you sure you want to change the base?
Conversation
…(using libc calls) Allows for better file management internally.
Separate functionality added: when a function calls "system(rmdir /path/to/directory)" or "system(rm /path/to/file)", execute these calls locally using standard lib calls to rmdir() and removefile(). This is really useful when using netrw: the file explorer shows files, lets us edit them... but not delete directories. Also temporary directories created when editing are not always removed when the app crashes. This lets us clean up the working area ourselves. It is a separate addition from the previous one. They can be merged separately if needed. Their only common point is "#define USE_SYSTEM". |
Here are some of my thoughts concerning the external command part:
|
I understand your issues. They all come from sandbox limitations: an app can only work on apps inside its sandbox. Open-in-place is a small workaround, but it only applies to opening the file, and to the file itself (the permission does not extend to its directory, so there's no way to access other files, or create a file). If I understand you, you would prefer to have the commands inside the iVim binary, working on the files inside the iVim sandbox. I can do that too (I did for rmdir, for example). |
inside its sandbox. Especially useful with rmdir (not available otherwise) and gunzip (edit gzipped files in place)
Here is a revised attempt. All commands are now executed inside of iVim's sandbox. The commands currently available are: ls touch rm cp ln link mv mkdir rmdir chown chgrp chflags chmod du df chksum sum stat readlink compress uncompress gzip gunzip. Of these, the ones that I found really useful are:
The other commands are mostly available as a proof of concept. You will need the file_cmds_ios framework, from my port of blinkshell (https://github.com/holzschu/blink , in the AppleSource/file_cmds-264.50.1 directory ). I haven't found how to share the source between the two github repositories, sorry. |
Most plugins check the existence of the command before activation.
Need to place string end at the beginning of each file name
I've only skimmed most of the above and don't know github's UI all that well, so apologies if this has already been discussed or even addressed in commits, but the change to the entitlements file doesn't look right to me, and there seem to be some whitespace-only changes to |
I reverted the entitlement file, and cancelled the whitespace-only changes. |
scp://, sftp:// http://...
@terrychou What is the current status? |
max number of Python interpreters
ios_system settings.
The idea is, while you're editing a file, you might want to run an external tool on it (python, lua, latex...)
This used to be impossible on iOS. With this modification, when you hit ":make" in Vim (or ), it calls OpenURL with the specific scheme "blinkshell://" and transfers the command to blinkshell (another app, see here: https://github.com/blinksh/blink ) who then executes the command. The URL looks like: "blinkshell://command%20flags%20name_of_the_file".
This only works if the file is inside the blinkshell sandbox, and has been "opened-in-place" (an iOS 11 fonctionnality). I extract the original name and position of the file from its mirrorURL, so blinkshell acts on the original file.
Obviously, direct commands such as "!ls" and "!pwd" also work, but again only inside blinkshell sandbox.