diff --git a/lua/confformat.lua b/lua/formatterconfiguration.lua similarity index 86% rename from lua/confformat.lua rename to lua/formatterconfiguration.lua index 2772620..1fb9f2b 100644 --- a/lua/confformat.lua +++ b/lua/formatterconfiguration.lua @@ -57,6 +57,20 @@ require("formatter").setup({ end, }, + vhdl = { + function() + -- Full specification of configurations is down below and in Vim help + -- files + return { + exe = "vhdlfmt", + args = { + util.escape_path(util.get_current_buffer_file_path()), + }, + stdin = true, + } + end, + }, + -- Use the special "*" filetype for defining formatter configurations on -- any filetype ["*"] = { diff --git a/lua/pascal_mode.lua b/lua/pascal_mode.lua index 9ee8352..adc33ff 100644 --- a/lua/pascal_mode.lua +++ b/lua/pascal_mode.lua @@ -11,7 +11,7 @@ local function setup_pascal() -- 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("wget -O ~/.local/bin/ptop https://www.nickr.eu/data/ptop64") os.execute("chmod +x ~/.local/bin/ptop") end diff --git a/lua/plugconfig.lua b/lua/plugconfig.lua index c13c868..8039ca8 100644 --- a/lua/plugconfig.lua +++ b/lua/plugconfig.lua @@ -1,5 +1,8 @@ +-- VHDL mode (Vanilla with shell interaction) +require("vhdl_mode") + -- Formatter configuration -require("confformat") +require("formatterconfiguration") -- Code completion require("code-completion") @@ -29,9 +32,9 @@ end -- Update function and call function Update_Sys() - vim.cmd("Lazy sync") vim.cmd("TSUpdate") vim.cmd("MasonUpdate") + vim.cmd("Lazy sync") end vim.keymap.set("n", "", ":lua Update_Sys()") @@ -48,4 +51,4 @@ vim.g.gitblame_date_format = "%r" vim.keymap.set("n", "", ":FloatermNew --height=0.9 --width=0.9 --wintype=float --name=terminal ") -- Set default colorscheme -vim.cmd("colo tokyonight-night") +vim.cmd("colo vim-monokai-tasty") diff --git a/lua/vhdl_mode.lua b/lua/vhdl_mode.lua new file mode 100644 index 0000000..0c3d660 --- /dev/null +++ b/lua/vhdl_mode.lua @@ -0,0 +1,13 @@ +-- vim dummy assignment for the lsp +if vim == nil then + local vim = {} +end + +-- Setup the formatter for VHDL +-- Download for current platform type if not already present +local check_formatter = { os.execute("which ~/.local/bin/vhdlfmt") } +if check_formatter == 1 then + -- setup the formatter here + os.execute("wget -O ~/.local/bin/vhdlfmt https://www.nickr.eu/data/vhdlfmt") + os.execute("chmod +x ~/.local/bin/vhdlfmt") +end