From e96f98dcf2f8632e8cc591be185abaad3b026c2c Mon Sep 17 00:00:00 2001 From: groveer Date: Tue, 16 May 2023 21:45:51 +0800 Subject: [PATCH] feat!: use executables on `$PATH` (#738) * fix: use commands in environment variables instead of absolute paths * fixup! fix: use commands in environment variables instead of absolute paths --------- Co-authored-by: Jint-lzxy <50296129+Jint-lzxy@users.noreply.github.com> --- lua/core/options.lua | 7 ++----- lua/modules/configs/tool/dap/dap-debugpy.lua | 4 ++-- lua/modules/configs/tool/dap/dap-lldb.lua | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lua/core/options.lua b/lua/core/options.lua index be10b18ee8..f9c10cf451 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -110,12 +110,9 @@ local function load_options() if not isempty(conda_prefix) then vim.g.python_host_prog = conda_prefix .. "/bin/python" vim.g.python3_host_prog = conda_prefix .. "/bin/python" - elseif global.is_mac then - vim.g.python_host_prog = "/usr/bin/python" - vim.g.python3_host_prog = "/usr/local/bin/python3" else - vim.g.python_host_prog = "/usr/bin/python" - vim.g.python3_host_prog = "/usr/bin/python3" + vim.g.python_host_prog = "python" + vim.g.python3_host_prog = "python3" end for name, value in pairs(global_local) do diff --git a/lua/modules/configs/tool/dap/dap-debugpy.lua b/lua/modules/configs/tool/dap/dap-debugpy.lua index bf92dc49f6..0b24e14bf4 100644 --- a/lua/modules/configs/tool/dap/dap-debugpy.lua +++ b/lua/modules/configs/tool/dap/dap-debugpy.lua @@ -28,7 +28,7 @@ dap.configurations.python = { }, } --- NOTE: for people using venv +-- NOTE: This setting is for people using venv -- pythonPath = function() -- -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself. -- -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within. @@ -41,6 +41,6 @@ dap.configurations.python = { -- elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then -- return cwd .. "/.venv/bin/python" -- else --- return "/usr/bin/python" +-- return "python3" -- end -- end, diff --git a/lua/modules/configs/tool/dap/dap-lldb.lua b/lua/modules/configs/tool/dap/dap-lldb.lua index 53aa9adfd7..ed1e628eb8 100644 --- a/lua/modules/configs/tool/dap/dap-lldb.lua +++ b/lua/modules/configs/tool/dap/dap-lldb.lua @@ -2,7 +2,7 @@ local dap = require("dap") dap.adapters.lldb = { type = "executable", - command = "/usr/bin/lldb-vscode", + command = "lldb-vscode", name = "lldb", } dap.configurations.cpp = {