detect os for init.vim

This commit is contained in:
cscherrNT 2023-06-28 16:34:24 +02:00
parent 55df542a9d
commit f27f7c4ed6
1 changed files with 19 additions and 1 deletions

View File

@ -1,5 +1,19 @@
" check if firenvim is accessing this, load it's specific configs if so.
lua << EOF
local BinaryFormat = package.cpath:match("%p[\\|/]?%p(%a+)")
if BinaryFormat == "dll" then
function os.name()
return "Windows"
end
elseif BinaryFormat == "so" then
function os.name()
return "Linux"
end
elseif BinaryFormat == "dylib" then
function os.name()
return "MacOS"
end
end
if vim.g.started_by_firenvim == true then
vim.cmd('runtime firenvim.vim')
vim.cmd('runtime common.vim')
@ -8,4 +22,8 @@ else
vim.cmd('runtime main.vim')
end
if os.name() == "Windows" then
vim.cmd('runtime windows.vim')
end
EOF