chromium-vim icon indicating copy to clipboard operation
chromium-vim copied to clipboard

Loading cvimrc doesn't work

Open aaronjensen opened this issue 9 years ago • 12 comments

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.

aaronjensen avatar Jun 10 '15 14:06 aaronjensen

I have same problem.

oniatsu avatar Jun 11 '15 01:06 oniatsu

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 avatar Jun 11 '15 01:06 oniatsu

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

oniatsu avatar Jun 11 '15 01:06 oniatsu

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.

oniatsu avatar Jun 11 '15 01:06 oniatsu

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

mdkcore0 avatar Jun 26 '15 13:06 mdkcore0

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!

mrap avatar Nov 12 '15 18:11 mrap

@mrap Can not work for me.

yxjxx avatar Jan 21 '16 14:01 yxjxx

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

dabbeg avatar May 12 '16 19:05 dabbeg

@dabbeg Yes, it works.

yxjxx avatar May 13 '16 02:05 yxjxx

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

adamalbrecht avatar Sep 26 '16 16:09 adamalbrecht

@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.

sandric avatar Apr 14 '18 14:04 sandric

@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.

  • [x] Checked "Allow access to file URLS" for cvim in the extension view of the 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.

andremeireles avatar May 06 '20 17:05 andremeireles