Add ada mode
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 31s
Details
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 31s
Details
This commit is contained in:
parent
59dc3784af
commit
5b1d0d66de
|
@ -7,7 +7,7 @@ end
|
|||
-- @param
|
||||
-- @short Verify installation of ada tools or install them.
|
||||
local function setup_ada()
|
||||
vim.keymap.set("n", "<leader>cb", ":!gnatpp %<cr>")
|
||||
vim.keymap.set("n", "<leader>kk", ":!gnatpp %<cr>")
|
||||
vim.opt.tabstop = 3
|
||||
vim.opt.shiftwidth = 3
|
||||
end
|
||||
|
@ -30,3 +30,19 @@ vim.api.nvim_create_autocmd({ "BufLeave" }, {
|
|||
pattern = { "*.adb", "*.ads" },
|
||||
callback = leave_ada,
|
||||
})
|
||||
|
||||
-- @name format_file
|
||||
-- @param
|
||||
-- @short Run gnatpp as formatter on the current file.
|
||||
local function format_file()
|
||||
vim.cmd("checktime %")
|
||||
local write_cmd = "gnatpp " .. vim.api.nvim_buf_get_name(0)
|
||||
os.execute(write_cmd)
|
||||
vim.cmd("checktime %")
|
||||
end
|
||||
|
||||
-- Add formatter command
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
pattern = { "*.adb", "*.ads" },
|
||||
callback = format_file,
|
||||
})
|
||||
|
|
|
@ -23,7 +23,7 @@ require("lspconfiguration")
|
|||
require("pascal_mode")
|
||||
|
||||
-- Ada mode (supported by plugins)
|
||||
-- require("ada_mode")
|
||||
require("ada_mode")
|
||||
|
||||
-- Misc configuration
|
||||
if vim == nil then
|
||||
|
|
|
@ -62,4 +62,4 @@ require("screenkey").setup({
|
|||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>kk", ":Screenkey<CR>")
|
||||
-- vim.keymap.set("n", "<leader>kk", ":Screenkey<CR>")
|
||||
|
|
Loading…
Reference in New Issue