Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Garfield247
nvim_lua
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
lazy
Breadcrumbs
nvim_lua
/
init.lua
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
38 lines (35 loc) · 1.36 KB
lazy
Breadcrumbs
nvim_lua
/
init.lua
Copy path
Top
File metadata and controls
Code
Blame
38 lines (35 loc) · 1.36 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- 1. 确保核心语言与工具链路径 (Apple Silicon/Intel Homebrew, Go, Pyenv, Local Bin) 注入至 Neovim PATH
local home = vim.env.HOME
local paths_to_ensure = {
"/opt/homebrew/bin",
"/opt/homebrew/sbin",
"/usr/local/bin",
"/usr/local/sbin",
home .. "/Documents/go/bin",
home .. "/go/bin",
home .. "/.pyenv/shims",
home .. "/.pyenv/bin",
home .. "/.local/bin",
}
for _, p in ipairs(paths_to_ensure) do
if vim.fn.isdirectory(p) == 1 and not vim.env.PATH:find(p, 1, true) then
vim.env.PATH = p .. ":" .. vim.env.PATH
end
end
-- 2. 隔离并绑定稳定可靠的 Python3 Provider
-- 优先级:Nvim 专属虚拟环境 -> 检验 pyenv which python3 退出码安全提取 -> 全局 python3 路径
local nvim_python_venv = home .. "/.local/share/nvim/python3-venv/bin/python3"
if vim.fn.executable(nvim_python_venv) == 1 then
vim.g.python3_host_prog = nvim_python_venv
elseif vim.fn.executable("pyenv") == 1 then
local pyenv_py = vim.fn.trim(vim.fn.system("pyenv which python3 2>/dev/null"))
if vim.v.shell_error == 0 and pyenv_py ~= "" and vim.fn.executable(pyenv_py) == 1 then
vim.g.python3_host_prog = pyenv_py
elseif vim.fn.executable("python3") == 1 then
vim.g.python3_host_prog = vim.fn.exepath("python3")
end
elseif vim.fn.executable("python3") == 1 then
vim.g.python3_host_prog = vim.fn.exepath("python3")
end
require("garfield.core")
require("garfield.lazy")
You can’t perform that action at this time.