momodalo / vimtouch

vimtouch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't edit .vimrc

caoimhinp opened this issue · comments

This is a leftover issue from the Google code page - issue 7.

The menu option for vimrc is nice but it looks for ~/.vimrc
The app user's home directory on a Nexus 9 with Lollipop defaults to /data. The user doesn't have permissions to write to /data so the open fails as it tries to make a recovery file.

I assume that the vimrc file in the vim directory for the application is the one that is actually parsed. If so, then the app should open /data/data/net.momodalo.app.vimtouch/files/vim/vimrc which does have the appropriate permissions.

Until there is some standardization on $HOME I would hard code the location.

Hi caoimhinp -- you say that /data/data/net.momodalo.app.vimtouch/files/vim/vimrc has appropriate permissions for me to edit it, but I couldn't access it from my Moto G running Lollipop.
I tried by typing :cd /data/data/net.momodalo.app.vimtouch/files/vim/ from vim. Vim's file listing showed files in my /sdcard/ home directory, but I couldn't write files that I had opened via that listing.

This was a while back. I am now using v2.5r2, because it is a little more useable than the version in Google play (2.7r1). I'm hoping for a new version to appear.

Hey, ImLikeWhoa.
I'm testing on a Nexus 9.

That file is readable and writeable by root only on the Nexus 9.
The other issue is that $HOME is not that directory. The edit function in
the app tries to edit vimrc in $HOME.

On Tue, Mar 24, 2015 at 3:53 PM, ImLikeWhoa notifications@github.com
wrote:

Hi caoimhinp -- you say that
/data/data/net.momodalo.app.vimtouch/files/vim/vimrc has appropriate
permissions for me to edit it, but I couldn't access it from my Moto G
running Lollipop.

I tried by typing :cd /data/data/net.momodalo.app.vimtouch/files/vim/ from
vim. Vim's file listing showed files in my /sdcard/ home directory, but I
couldn't write files that I had opened via that listing.

This was a while back. I am now using v2.5r2, because it is a little more
useable than the version in Google play (2.7r1). I'm hoping for a new
version to appear.


Reply to this email directly or view it on GitHub
#90 (comment).

Thanks caoimhinp
I hope this gets gets resolved so that the user without root access can edit their own .vimrc file. Vimtouch used to work like that.
Best, ImLikeWhoa

On Mar 25, 2015, at 10:26 , caoimhinp wrote:

Hey, ImLikeWhoa.
I'm testing on a Nexus 9.

That file is readable and writeable by root only on the Nexus 9.
The other issue is that $HOME is not that directory. The edit function in
the app tries to edit vimrc in $HOME.

On Tue, Mar 24, 2015 at 3:53 PM, ImLikeWhoa notifications@github.com
wrote:

Hi caoimhinp -- you say that
/data/data/net.momodalo.app.vimtouch/files/vim/vimrc has appropriate
permissions for me to edit it, but I couldn't access it from my Moto G
running Lollipop.

I tried by typing :cd /data/data/net.momodalo.app.vimtouch/files/vim/ from
vim. Vim's file listing showed files in my /sdcard/ home directory, but I
couldn't write files that I had opened via that listing.

This was a while back. I am now using v2.5r2, because it is a little more
useable than the version in Google play (2.7r1). I'm hoping for a new
version to appear.


Reply to this email directly or view it on GitHub
#90 (comment).


Reply to this email directly or view it on GitHub.

Hello, I have used Vim touch on Android 4 with modified .vimrc. After upgrading to Android 5 (and unfortunately - resetting the device to factory settings) I am unable to do so. When I select the "edit vimrc" option in menu, it opens file ~/.vimrc that is readonly. The HOME seems to be pointing to /data - that is not writable. Seems like the issue mentioned above. Is there some workaround possible - till the issue is resolved correctly? Thanks.

Fortunately Yes, but with à rooted device

What I did is that I located the app data folder (/data/data/net.momodalo.app.vimtouch/files) and put my .vimrc in it. I even could get some plugin to work, and all theme files was working for me (badwolf).

Tell me if it worked for you...

Hey, biotician, thanks, but this did not work for me. My device is not rooted. And I am able to write to the mentioned folder - in fact, I have created a .vimrc there but the file gets ignored...

Indeed, it worked a month ago for me, but I now have an access denied (in
french) message now.

Something may have changed since the last time I tried.

A workaround could be to use the source command so followed by the path
to your vimrc (or any vim file)...
Good luck !

Le jeu. 30 juil. 2015 19:08, Robert Valík notifications@github.com a
écrit :

Hey, biotician, thanks, but this did not work for me. My device is not
rooted. And I am able to write to the mentioned folder - in fact, I have
created a .vimrc there but the file gets ignored...


Reply to this email directly or view it on GitHub
#90 (comment).

You may also try this
https://play.google.com/store/apps/details?id=com.termux
Le 30 juil. 2015 19:17, "Josuah" josuah.demangeon@gmail.com a écrit :

Indeed, it worked a month ago for me, but I now have an access denied
(in french) message now.

Something may have changed since the last time I tried.

A workaround could be to use the source command so followed by the path
to your vimrc (or any vim file)...
Good luck !

Le jeu. 30 juil. 2015 19:08, Robert Valík notifications@github.com a
écrit :

Hey, biotician, thanks, but this did not work for me. My device is not
rooted. And I am able to write to the mentioned folder - in fact, I have
created a .vimrc there but the file gets ignored...


Reply to this email directly or view it on GitHub
#90 (comment).

Installing vim through termux is the best way! And it's a way more up to
date version too! Thanks for the tip.

Em qui, 30 de jul de 2015 17:47, Josuah Demangeon notifications@github.com
escreveu:

You may also try this
https://play.google.com/store/apps/details?id=com.termux
Le 30 juil. 2015 19:17, "Josuah" josuah.demangeon@gmail.com a écrit :

Indeed, it worked a month ago for me, but I now have an access denied
(in french) message now.

Something may have changed since the last time I tried.

A workaround could be to use the source command so followed by the path
to your vimrc (or any vim file)...
Good luck !

Le jeu. 30 juil. 2015 19:08, Robert Valík notifications@github.com a
écrit :

Hey, biotician, thanks, but this did not work for me. My device is not
rooted. And I am able to write to the mentioned folder - in fact, I have
created a .vimrc there but the file gets ignored...


Reply to this email directly or view it on GitHub
<#90 (comment)
.


Reply to this email directly or view it on GitHub
#90 (comment).

rafaeln, biotician, thanks, that works - somehow. But I miss "Open in Vim" context menu in other applications. So not a clean solution. But the Termux is a really nice package for non-rooted devices.

I have Note 4 with external card. I tried Termux after I couldn't get Vimtouch working, and the problem I ran into with Termux was that it couldn't write to the external SD card. Even though that is now allowed in Lollipop, it looks like your application has to request permission. The user can't just give any random app such permission. I'd be happy to be wrong on this.

So, I went back to trying to get Vimtouch working. First thing I did was do a soft link of my files ( a vimwiki ) and my .vim directory from the external card to the vimtouch "home" directory, '~/'. To do this, just drop to a shell from within Vimtouch, e.g, :!sh. Then link as follows:
$ ln -s /storage/extSdCard/vimwiki ~/vimwiki
$ ln -s /storage/extSdCard/.vim ~/vim
Notice I renamed the .vim directory without the "dot". It seems that Vimtouch uses ~/vim for its configuration files. If you delete the ~/vim directory, it just gets recreated automatically.

This is ALMOST working, I'm having some difficulty getting the runtime path correct so pathogen will run and install all my plugins.

I'd like to hear from anyone who has successfully run Vimtouch on a Note 4 using Lollipop.

Any update to this?
For me '/data/data/net.momodalo.app.vimtouch/files/vim/vimrc' is writable, but if I do a change to that file, it is overwritten after next vim start. Actually the whole vimrc is replaced with some template on each start. So, it's not possible for me to configure vim at the moment. My device is Samsung Galaxy S5 with Marshmallow 6.0.1 on it. And it is rooted of course.

Any chance of an enhancement to allow non-rooted devices to have a custom vimrc please???

For instance, how about an optional vimrc in an accessible and editable (to non-root) part of the Android filesystem such as /storage/emulated/0/Download/vimrc

Any update to this?
For me '/data/data/net.momodalo.app.vimtouch/files/vim/vimrc' is writable, but if I do a change to that file, it is overwritten after next vim start. Actually the whole vimrc is replaced with some template on each start. So, it's not possible for me to configure vim at the moment. My device is Samsung Galaxy S5 with Marshmallow 6.0.1 on it. And it is rooted of course.

If you can access '/data/data/net.momodalo.app.vimtouch/files/vim/vimrc', the workaround is to set it readonly after modification: 'chmod 444 /data/data/net.momodalo.app.vimtouch/files/vim/vimrc'. Then vimtouch will load modified version.
Note its system vimrc is $VIM/vimrc, which is '/data/data/net.momodalo.app.vimtouch/files/vim/vimrc'

DroidVim

Indeed, DroidVim is nice.

commented

If you cannot access directly /data/data/net.momodalo.app.vimtouch/files/vim/vimrc, which is usually the case in non rooted devices, you should be able to access it from vim touch itself. Once edited and saved the file, you can change the attributes directly by executing the shell command in vim touch:
:!chmod 444 /data/data/net.momodalo.app.vimtouch/files/vim/vimrc
followed by enter (of course).
Since Vim Touch has access rights it should be able to execute the above command.
After execution Vim Touch should alert you that the file has been modified, you can safely ignore that by pressin enter.

As a note, if you want to edit again the file, before editing you will need to change the attributes from readonly to writable, from inside Vim Touch, using e.g.:
:!chmod 666 /data/data/net.momodalo.app.vimtouch/files/vim/vimrc