Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to expand Windows Shell Shortcuts like %LocalAppData%? #11821

Closed
ni554n opened this issue Feb 9, 2024 · 3 comments
Closed

How to expand Windows Shell Shortcuts like %LocalAppData%? #11821

ni554n opened this issue Feb 9, 2024 · 3 comments
Labels
question the issue author asks something

Comments

@ni554n
Copy link

ni554n commented Feb 9, 2024

Additional context and details

~> nvim "%LocalAppData%\nvim\init.lua"                                                            1 02/10/24 02:44:03 AM
Error:   × Invalid literal
   ╭─[entry #6:1:1]
 1 │ nvim "%LocalAppData%\nvim\init.lua"
   ·                           ────┬────
   ·                               ╰── unrecognized escape after '\' in string
   ╰────
@ni554n ni554n added the question the issue author asks something label Feb 9, 2024
@maxomatic458
Copy link
Contributor

@ni554n you can do $env.LOCALAPPDATA
but im not sure how you would expand this to a path
$env.LOCALAPPDATA\some\path does not seem to work

@fdncred
Copy link
Collaborator

fdncred commented Feb 9, 2024

The nushell equivalent is to use string interpolation.

 nvim $"($env.LOCALAPPDATA)/nvim/init.lua"

Here's another way

nvim ([$env.LOCALAPPDATA nvim init.lua] | path join)

There are probably more ways too.

@maxomatic458
Copy link
Contributor

thats pretty confusing for such a basic thing in my opinion.
I think something like this $env.LOCALAPPDATA\some\path should also work.

@ni554n ni554n closed this as completed Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question the issue author asks something
Projects
None yet
Development

No branches or pull requests

3 participants