This commit is contained in:
Oliver Hartmann 2023-01-31 08:38:58 +01:00
commit a15e7cba84
3 changed files with 30 additions and 0 deletions

View File

@ -51,6 +51,7 @@
"nvim-treesitter": { "branch": "master", "commit": "cda8b291ef6fc4e04036e2ea6cf0de8aa84c2656" },
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
"nvim-web-devicons": { "branch": "master", "commit": "a421d183ef37dfa13f51a5805bed2381aebf9080" },
"octo.nvim": { "branch": "master", "commit": "7900dc0cd37e7bb5d4175a37c9c4c3dfb94a1f7b" },
"overseer.nvim": { "branch": "master", "commit": "cebb263509fa6cb52c63544845a721dd826b3c15" },
"plenary.nvim": { "branch": "master", "commit": "1c7e3e6b0f4dd5a174fcea9fda8a4d7de593b826" },
"project.nvim": { "branch": "main", "commit": "685bc8e3890d2feb07ccf919522c97f7d33b94e4" },

View File

@ -98,6 +98,25 @@ return {
end
end
local function getVenvFromJson(jsonfile)
if not vim.fn.filereadable(jsonfile) then
return nil
end
local f = io.open(jsonfile, 'r')
if not f then
return nil
end
local data = f:read('*a')
f:close()
if data then
local jdata = vim.json.decode(data)
if jdata['venvPath'] ~= nil and jdata['venv'] ~= nil then
return jdata['venvPath'] .. '/' .. jdata['venv']
end
end
return nil
end
local function getPythonEnv()
local venv = os.getenv('VIRTUAL_ENV')
if venv ~= nil then
@ -109,6 +128,12 @@ return {
end
local cwd = vim.fn.getcwd()
local jsonVenv = getVenvFromJson(cwd .. '/pyrightconfig.json')
if jsonVenv ~= nil then
return jsonVenv
end
if vim.fn.executable(cwd .. '/venv/' .. getVenvSuffix()) == 1 then
return cwd .. '/venv/' .. getVenvSuffix()
elseif vim.fn.executable(cwd .. '/.venv/' .. getVenvSuffix()) == 1 then

4
lua/plugins/octo.lua Normal file
View File

@ -0,0 +1,4 @@
return { 'pwntester/octo.nvim',
cmd = 'Octo',
config = true,
}