Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 37s
38 lines
873 B
Lua
38 lines
873 B
Lua
-- Lua vim-dummy variable
|
|
if vim == nil then
|
|
local vim = {}
|
|
end
|
|
|
|
-- @name setup_pascal
|
|
-- @param
|
|
-- @short Verify installation of pascal tools or install them.
|
|
local function setup_pascal()
|
|
local check_ptop = { os.execute("which ptop") }
|
|
|
|
-- if return value is 1, get ptop
|
|
if check_ptop == 1 then
|
|
os.execute("wget -O ~/.local/bin/ptop https://www.nichkara.eu/data/ptop64")
|
|
os.execute("chmod +x ~/.local/bin/ptop")
|
|
end
|
|
|
|
vim.opt.spell = false
|
|
end
|
|
|
|
-- Setup and verify pascal tools when opening a pascal file
|
|
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
|
pattern = { "*.pas" },
|
|
callback = setup_pascal,
|
|
})
|
|
|
|
-- @name leave_pascal
|
|
-- @param
|
|
-- @short Leave pascal and reverse any changes to my editor defaults
|
|
local function leave_pascal()
|
|
vim.opt.spell = true
|
|
end
|
|
|
|
vim.api.nvim_create_autocmd({ "BufLeave" }, {
|
|
pattern = { "*.pas" },
|
|
callback = leave_pascal,
|
|
})
|