Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim
This commit is contained in:
@ -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
4
lua/plugins/octo.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return { 'pwntester/octo.nvim',
|
||||
cmd = 'Octo',
|
||||
config = true,
|
||||
}
|
Reference in New Issue
Block a user