detect os for init.vim
This commit is contained in:
parent
55df542a9d
commit
f27f7c4ed6
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue