Hi “[email protected]”
On 2015-07-16 Thursday at 18:52 +0000 [email protected] wrote: > Status: New > Owner: ---- > Labels: Type-Defect Priority-Medium > > New issue 385 by [email protected]: expansion of environment variables > fails in Vim backtick expression > https://code.google.com/p/vim/issues/detail?id=385 > > What steps will reproduce the problem? > > vim -u NONE -i NONE -N > :e `=$HOME . '/.vimrc'` > > What is the expected output? What do you see instead? > > Vim should open the .vimrc file in my HOME directory. Instead I see the > following error: > > E15: Invalid expression: /Users/pjuhas . '/.vimrc' > > It seems that $HOME gets expanded _before_ parsing the VimL expression in > backticks. This would be OK for shell-expanded backtick expressions, but > not for Vim expressions of the `=<expr>` kind. > > What version of the product are you using? On what operating system? > > Vim 7.4.712 on OS X Yosemite 10.10.4. This is likely independent of the OS. Your ex-command bears three problems. I will start with the innermost: (1) vim: E15 “invalid expression”: “expand()” should help. (2) shell: “cannot execute …“: Your shell probably cannot execute your .vimrc file, a command like “echo” or “print” is missing. Just dropping the shell command substitution should help. (3) vim: E172 “The ":edit" command only accepts one file name”: Using “:exe” should help: :exe 'e ' . expand('$HOME') . '/.vimrc' or slightly shorter :exe 'e ' . expand('~') . '/.vimrc' Please tell your intention more detailed, if I guessed it wrongly. -- Best regards, Roland Eggner -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
pgpHh3Jm6WMa2.pgp
Description: PGP signature
