我正在学习关于 Laravel 的教程。我以前从未使用过它。教程说我应该使用 create a file withvim database/database.sql
但是当我这样做时我收到错误:
vim : The term 'vim' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ vim
+ ~~~
+ CategoryInfo : ObjectNotFound: (vim:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Run Code Online (Sandbox Code Playgroud)
我尝试从 vim.org 安装 vim,但不知道这是否正确。任何帮助是极大的赞赏。我正在使用 Windows 10。
除了从 vim.org 安装 Vim 之外,您还需要确保将它添加到 $PATH 以便从命令行使用它而不使用完整路径。在 Windows 上,您可以使用
控制面板->系统->编辑系统环境变量->点击环境变量->找到PATH
变量->点击“编辑”->检查Vim是否在这里,否则点击“新建”->点击“浏览”->导航到您安装的 Vim 可执行文件
将 vim 添加到 后PATH
,您应该可以从命令行使用它。您需要关闭并重新打开 Cmd/PowerShell。
小智 8
就我而言,重置/添加 VIM 环境变量没有帮助。
我设法通过安装Chocolatey Windows Package Manager解决了这个问题。
在具有管理员权限的 Powershell 中运行:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Run Code Online (Sandbox Code Playgroud)
然后:
choco install vim
并且refreshenv
您的 Vim 已准备好在 Powershell 中运行。
归档时间: |
|
查看次数: |
6334 次 |
最近记录: |