1995eaton / chromium-vim

Vim bindings for Google Chrome.
https://chrome.google.com/webstore/detail/cvim/ihlenndgcmojhcghmfjfneahoeklbjjh
MIT License
2.26k stars 325 forks source link

Loading cvimrc doesn't work #312

Open aaronjensen opened 9 years ago

aaronjensen commented 9 years ago

I tried:

let configpath = '/path/to/your/.cvimrc'
set localconfig 

using both my home dir as ~ and my fully expanded home dir in two separate tries.

Both times, I restarted Chrome and opened the cvim options. I got a modal that said there was an error loading the configuration file.

oniatsu commented 9 years ago

I have same problem.

oniatsu commented 9 years ago

And, I tryied :source /Users/some/path/.cvimrc, then the message is showned.

cvim error: "file:///some/path/.cvimrc" could not be opened for parsing

But I can open the file by this command :file /Users/some/path/.cvimrc.

oniatsu commented 9 years ago

I have succeeded it. The option needs permission of accessing local file URLs.

oniatsu commented 9 years ago

I found a problem that the set localconfig is effective only once.

I saved the cVimrc at Chrome's option page, and then the cVimrc was reflected and copied from local .cvimrc. However I changed local .cvimrc after that, the cVimrc at Chrome's option page was not reflected from new local .cvimrc.

I wish the local .cvimrc is reloaded every starting times.

mdkcore0 commented 9 years ago

I have the same issue from @oniatsu, the config is reflected from the local file, but I want to add it to my dotfiles, so I can use the same config from cVim at work and at home

mrap commented 9 years ago

The documentation for using set localconfig is a bit hidden in :help. But here's how to do it.

  1. Add let configpath = '/path/to/your/.cvimrc' and set localconfig to your local cvimrc file.
  2. In browser, :source /path/to/your/.cvimrc
  3. Go to :settings and put only set localconfig in the cvimrc textarea.
  4. Click Save!
yxjxx commented 8 years ago

@mrap Can not work for me.

dabbeg commented 8 years ago

Checking "Allow access to file URLS" for cvim in the extension view of my browser and following the steps @mrap mentioned worked for me.

yxjxx commented 8 years ago

@dabbeg Yes, it works.

adamalbrecht commented 8 years ago

@mrap @dabbeg Thank you for those instructions - I would have never figured it out otherwise.

sandric commented 6 years ago

@mrap didnt worked for me. So If I set both let configpath = '/home/sandric/.cvimrc' and set localconfig in settings, and then save - all working, but as @oniatsu mentioned, if you change config file outside of settings tab - it not reloaded, if though I go to settings after change - changes appears in textarea and if I click save - changes appears. If I wont set let configpath = '/home/sandric/.cvimrc' in settings and leave just set localconfig as was suggested - it simply can not read config, I dont know how it even should work since how extension will know where to look for config in the firstplace. So I consider this as simple caching bug, and it not some "hidden feature". Also, what bugs me even more, if simply visiting settings path and clicking "save" reloads config, then calling :source pathto cvimrc makes nothing.

andremeireles commented 4 years ago

@sandric this was my workaround.

Windows - Vivaldi Browser

I had to put let configpath and set localconfig in both places: browser and .cvimrc file. :source only on browser.

I think this allowed a loop and the config now is reloaded every time i start the browser or open :settings.

The path is with slash, not backslash.