Compare commits
No commits in common. "7452ee9b061c1916433e706e463bd4b6ad623f9a" and "085ff836c3ca726e2a97ae5c7c1e6f3db1166943" have entirely different histories.
7452ee9b06
...
085ff836c3
|
@ -1,41 +0,0 @@
|
||||||
-- 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") }
|
|
||||||
vim.cmd("set autoread")
|
|
||||||
|
|
||||||
-- if return value is 1, get ptop
|
|
||||||
if check_ptop == 1 then
|
|
||||||
os.execute("wget -o ~/.local/bin/ptop https://www.nickr.eu/data/ptop64")
|
|
||||||
os.execute("chmod +x ~/.local/bin/ptop")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Setup and verify pascal tools when opening a pascal file
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
|
||||||
pattern = { "*.pas" },
|
|
||||||
callback = setup_pascal,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- @name auto_format
|
|
||||||
-- @param
|
|
||||||
-- @short The format function for pascal.
|
|
||||||
local function auto_format()
|
|
||||||
local write_cmd = "ptop -c ~/.config/nvim/ptop.conf "
|
|
||||||
.. vim.api.nvim_buf_get_name(0)
|
|
||||||
.. " "
|
|
||||||
.. vim.api.nvim_buf_get_name(0)
|
|
||||||
os.execute(write_cmd)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Add formatter command
|
|
||||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
|
||||||
pattern = { "*.pas" },
|
|
||||||
callback = auto_format,
|
|
||||||
})
|
|
|
@ -16,9 +16,6 @@ require("navigation")
|
||||||
-- Mason and builtin lsp configuration
|
-- Mason and builtin lsp configuration
|
||||||
require("lspconfiguration")
|
require("lspconfiguration")
|
||||||
|
|
||||||
-- Pascal mode (supported by plugins)
|
|
||||||
require("pascal_mode")
|
|
||||||
|
|
||||||
-- Misc configuration
|
-- Misc configuration
|
||||||
if vim == nil then
|
if vim == nil then
|
||||||
vim = {}
|
vim = {}
|
||||||
|
|
Loading…
Reference in New Issue