2

I am trying to follow the documentation online but I ran into a bit of a stumbling block.

Upon adding this code to my .vimrc:

set rtp^="/home/z/.opam/system/share/ocp-indent/vim"
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
execute "set rtp+=" . g:opamshare . "/merlin/vim"

I ended up with the following error:

E115: Missing quote: ''')
E116: Invalid arguments for function substitute(system('opam config var share'),'\n$','',''')
E15: Invalid expression: substitute(system('opam config var share'),'\n$','',''')
line  202:
E121: Undefined variable: g:opamshare
E15: Invalid expression: "set rtp+=" . g:opamshare . "/merlin/vim"

Any help would be much appreciated.

I have not run opam user-setup install yet because I am unsure if that would rectify the issue.

Thank you!

Richard-Degenne
  • 2,892
  • 2
  • 26
  • 43
zeldangit
  • 45
  • 4
  • 4
    The last argument to `substitute()` should be `''`, not `'''`: `let g:opamshare = substitute(system('opam config var share'), '\n$', '', '')` – dkim Apr 27 '17 at 00:43
  • Thank you dkim! That was indeed the issue. I don't know how I managed to screw up a copy and paste but I guess I did. – zeldangit Apr 27 '17 at 15:49

0 Answers0