From dee8905946e1a7d165aecf9f817055164e7b6eb0 Mon Sep 17 00:00:00 2001 From: JafarAbdi Date: Thu, 6 Feb 2025 19:51:30 +0000 Subject: [PATCH] Fix pixi detection --- fish/config.fish | 4 ++++ neovim/.config/nvim/init.lua | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/fish/config.fish b/fish/config.fish index be079f4..194587e 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -871,6 +871,10 @@ function ros_kill $(pgrep -af gzclient | cut -d' ' -f1) end +function reset_cuda + sudo modprobe -r nvidia_uvm && sudo modprobe nvidia_uvm +end + function postexec --on-event fish_postexec echo -e '\a' end diff --git a/neovim/.config/nvim/init.lua b/neovim/.config/nvim/init.lua index 9bb2f41..83dc48c 100644 --- a/neovim/.config/nvim/init.lua +++ b/neovim/.config/nvim/init.lua @@ -227,8 +227,10 @@ end local runners = { python = function(file_path, root_dir, is_test) local python_executable = "python3" - if vim.uv.fs_stat(vim.fs.joinpath(root_dir, ".pixi")) ~= nil then - python_executable = vim.fs.joinpath(root_dir, ".pixi", "envs", "default", "bin", "python") + local pixi_python_executable = + vim.fs.joinpath(root_dir, ".pixi", "envs", "default", "bin", "python") + if vim.uv.fs_stat(pixi_python_executable) ~= nil then + python_executable = pixi_python_executable end if is_test then if not file_path:match("^test_") and not file_path:match("_test%.py$") then @@ -1149,7 +1151,8 @@ local servers = { type = "directory", }) if #pixi > 0 then - if vim.fn.isdirectory(vim.fs.joinpath(pixi[1], "envs", "default")) == 1 then + local pixi_python_executable = vim.fs.joinpath(pixi[1], "envs", "default", "bin", "python") + if vim.uv.fs_stat(pixi_python_executable) then options.workspace.environmentPath = pixi[1] .. "/envs/default" end end