Giter VIP home page Giter VIP logo

Comments (4)

ayamir avatar ayamir commented on July 21, 2024
local home = os.getenv("USERPROFILE")  -- this works for me

Does it works for Window10 too? I'm sorry because I have also upgraded to Windows11 but I use neovim in WSL2 on Windows.

from nvimdots.

hfziu avatar hfziu commented on July 21, 2024

Does it works for Window10 too? I'm sorry because I have also upgraded to Windows11 but I use neovim in WSL2 on Windows.

Yes. It also works for Windows 10. (Although not all the plugins are compatible with Windows)

When executing from PowerShell, the default behavior of the lua script

os.getenv("VAR")

seems to be searching in $env: for "VAR", i.e., $env:VAR instead of $VAR/$variable:VAR

Assuming that my home directory is C:\Users\user_name, the values of the mentioned variables are as follows:

$env:HOMEDRIVE  # C:
$env:HOMEPATH  # \Users\user_name
$env:USERPROFILE  # C:\Users\user_name
$env:HOME  # non-exist
$HOME  # C:\Users\user_name
$variable:HOME  # same as $HOME

As a result, os.getenv("HOME") will return nil.

from nvimdots.

1096015776 avatar 1096015776 commented on July 21, 2024

it just a path var,maybe you can setting,or let home = your path string

from nvimdots.

ayamir avatar ayamir commented on July 21, 2024

Does it works for Window10 too? I'm sorry because I have also upgraded to Windows11 but I use neovim in WSL2 on Windows.

Yes. It also works for Windows 10. (Although not all the plugins are compatible with Windows)

When executing from PowerShell, the default behavior of the lua script

os.getenv("VAR")

seems to be searching in $env: for "VAR", i.e., $env:VAR instead of $VAR/$variable:VAR

Assuming that my home directory is C:\Users\user_name, the values of the mentioned variables are as follows:

$env:HOMEDRIVE  # C:
$env:HOMEPATH  # \Users\user_name
$env:USERPROFILE  # C:\Users\user_name
$env:HOME  # non-exist
$HOME  # C:\Users\user_name
$variable:HOME  # same as $HOME

As a result, os.getenv("HOME") will return nil.

Thanks, I will fix this.

from nvimdots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.