Add ada formatting
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 1m24s Details

This commit is contained in:
Yannick Reiß 2024-10-07 07:46:40 +02:00
parent 99e59d66e3
commit cc1a7c9311
2 changed files with 30 additions and 0 deletions

27
lua/ada_mode.lua Normal file
View File

@ -0,0 +1,27 @@
-- Lua vim-dummy variable
if vim == nil then
local vim = {}
end
-- @name setup_ada
-- @param
-- @short Verify installation of ada tools or install them.
local function setup_ada()
vim.keymap.set("n", "<leader>cb", ":silent! gnatpp %<cr>")
end
-- Setup and verify ada tools when opening a ada file
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = { "*.adb", "*.ads" },
callback = setup_ada,
})
-- @name leave_ada
-- @param
-- @short Leave ada and reverse any changes to my editor defaults
local function leave_ada() end
vim.api.nvim_create_autocmd({ "BufLeave" }, {
pattern = { "*.pas" },
callback = leave_ada,
})

View File

@ -19,6 +19,9 @@ require("lspconfiguration")
-- Pascal mode (supported by plugins) -- Pascal mode (supported by plugins)
require("pascal_mode") require("pascal_mode")
-- Ada mode (supported by plugins)
require("ada_mode")
-- Misc configuration -- Misc configuration
if vim == nil then if vim == nil then
vim = {} vim = {}