13 Commits

Author SHA1 Message Date
nichkara
5afb974b78 Fix ada leave buffer error
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 1m16s
2025-11-01 07:28:23 +01:00
nichkara
7b3f516848 VHDL LSP integration update
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 42s
2025-10-22 20:38:43 +02:00
nichkara
19b0ce44bc vhdl example config
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 45s
2025-10-22 10:44:05 +02:00
Nick
aa7025dfc7 nickr -> nichkara update and removal of unused code
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 37s
2025-10-19 07:09:40 +02:00
Nick
576bb711bb nickr -> nichkara update 2025-10-19 07:08:35 +02:00
Nick
ff55d76f71 Remove nix shell 2025-10-19 07:07:40 +02:00
Nick
b14e810dec Remove old plugins 2025-10-19 07:03:45 +02:00
Nick
19a27a004e Unset ada keymaps when leaving ada buffers 2025-10-19 07:01:20 +02:00
Nick
fb966de276 Beautify ada_mode to conform to lua standards 2025-10-19 06:52:52 +02:00
nichkara
ead1e9baa8 Makefile snippet for gccvarset to create clangd project file
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 32s
2025-10-12 10:06:50 +02:00
nichkara
bfc3c57d19 Migration of lspconfig to vim.lsp
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 39s
2025-10-12 10:03:04 +02:00
nichkara
d55b376ba8 Show intendation
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 31s
2025-09-23 07:35:38 +02:00
nichkara
f96b560ca7 Remove ts-rainbow as it is deprecated
Some checks failed
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 35s
2025-09-23 07:28:44 +02:00
14 changed files with 120 additions and 141 deletions

View File

@@ -0,0 +1,7 @@
snippet copy_1_2_w3 "Copy current cell modifying cells +1,+2"
Copy (from) (to) (with): >[-]>[-]<<[->+>+<<]>>[-<<+>>]<<
endsnippet
snippet add_1_2 "Add from 1 to 2"
Add (from) (to): [->+<]>
endsnippet

View File

@@ -35,3 +35,7 @@ endsnippet
snippet A "All"
endsnippet
snippet . "Dot"
·
endsnippet

View File

@@ -75,7 +75,18 @@ if t[19] == "y":
t[19] = "Created!"
if t[20] == "y":
system(f"git init > /dev/null")
t[20] = "Initialized repository!"`
t[20] = "Initialized repository!"``!p
from os import system
if "cl" in t[2].split(' ') and t[19] == "y":
with open(".clangd", "w") as w:
config = f"""
CompileFlags:
Add: [{t[8].split(' ').join(', ')}]
Remove: []
Compiler: {t[3]}
""" w.write(config)
`
$0
endsnippet

13
UltiSnips/veryl.snippets Normal file
View File

@@ -0,0 +1,13 @@
snippet module "Create a new module" b
${1:pub } module ${2:module_name} (
$3
) {
$0
}
endsnippet
snippet embed "Add embed"
embed (inline) sv{{{
$1
}}}$0
endsnippet

View File

@@ -1,8 +1,3 @@
-- Lua vim-dummy variable
if vim == nil then
local vim = {}
end
-- @name Prove
-- @param
-- @short Run gnatprove
@@ -12,7 +7,7 @@ function Prove()
vim.api.nvim_buf_set_lines(0, 0, -1, false, run_cmd)
vim.cmd(":%!bash")
buffer_loaded = true
Buffer_loaded = true
end
-- @name Run
@@ -24,25 +19,24 @@ function Run()
vim.api.nvim_buf_set_lines(0, 0, -1, false, run_cmd)
vim.cmd(":%!bash")
buffer_loaded = true
Buffer_loaded = true
end
function Close_Prove()
if buffer_loaded then
buffer_loaded = false
if Buffer_loaded then
Buffer_loaded = false
vim.cmd("bd!")
end
end
vim.keymap.set("n", "pp", ":lua Close_Prove()<cr>")
vim.keymap.set("n", "<leader>pp", ":lua Prove()<cr>")
vim.keymap.set("n", "<leader>op", ":lua Run()<cr>")
-- @name setup_ada
-- @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", "pp", ":lua Close_Prove()<cr>")
vim.keymap.set("n", "<leader>pp", ":lua Prove()<cr>")
vim.keymap.set("n", "<leader>op", ":lua Run()<cr>")
vim.opt.tabstop = 3
vim.opt.shiftwidth = 3
end

View File

@@ -6,6 +6,7 @@ vim.opt.completeopt = { "menu", "menuone" }
-- shortmess is used to reduce verbocity
-- vim.opt.shortmess = vim.opt.shortmess + { c = true }
-- ERROR: Unable to load module
local cmp = require("cmp")
cmp.setup({
-- configuration

View File

@@ -71,6 +71,16 @@ require("formatter").setup({
end,
},
veryl = {
function()
return {
exe = "veryl fmt",
args = {},
stdin = false,
}
end,
},
-- Use the special "*" filetype for defining formatter configurations on
-- any filetype
["*"] = {

View File

@@ -10,6 +10,7 @@ local linters = {
tex = { "proselint" },
plaintex = { "proselint" },
ada = { "gnat", "gcc", "adals", "cspell" },
vhdl = {},
}
local fixers = {
@@ -24,11 +25,14 @@ local fixers = {
python = { "yapf" },
pascal = { "ptop" },
haskell = { "fourmolu" },
rust = { "rustfmt" },
}
vim.g.ale_linters = linters
vim.g.ale_fix_on_save = 0
vim.g.ale_fixers = fixers
-- vim.g.ale_vhdl_ghdl_options = "--std=08 --workdir=src/"
vim.keymap.set("n", "<leader>lf", ":ALEFix<CR>")
vim.keymap.set("n", "<leader>lp", ":ALEFindReferences<CR>")
vim.keymap.set("n", "<leader>lr", ":ALEFindReferences<CR>")
vim.keymap.set("n", "<leader>ln", ":ALENext<CR>")

View File

@@ -15,41 +15,14 @@ require("mason-lspconfig").setup({
},
})
-- require("mason-lspconfig").setup_handlers({
-- function(asm_lsp)
-- require("lspconfig")[asm_lsp].setup({})
-- end,
-- function(clangd)
-- require("lspconfig")[clangd].setup({})
-- end,
-- function(lua_ls)
-- require("lspconfig")[lua_ls].setup({})
-- end,
-- function(hls)
-- require("lspconfig")[hls].setup({})
-- end,
-- function(rust_analyzer)
-- require("lspconfig")[rust_analyzer].setup({})
-- end,
-- function(vhdl_ls)
-- require("lspconfig")[vhdl_ls].setup({})
-- end,
-- function(verible)
-- require("lspconfig")[verible].setup({})
-- end,
-- function(vimls)
-- require("lspconfig")[vimls].setup({})
-- end,
-- function(texlab)
-- require("lspconfig")[texlab].setup({})
-- end,
-- function(als)
-- require("lspconfig")[als].setup({})
-- end,
-- })
vim.lsp.enable("verible")
vim.lsp.config("verible", { cmd = { "verible-verilog-ls", "--rules_config_search" } })
require("lspconfig").verible.setup({
cmd = { "verible-verilog-ls", "--rules_config_search" },
vim.lsp.enable("clangd")
vim.lsp.config("clangd", {
cmd = { "clangd" },
root_markers = { ".clangd" },
filetypes = { "c", "cpp" },
})
-- @name file_exists
@@ -81,10 +54,13 @@ local function get_config_file()
end
end
require("lspconfig").als.setup({
settings = {
ada = {
projectFile = get_config_file(),
},
},
vim.lsp.enable("als")
vim.lsp.config("als", { projectFile = get_config_file() })
vim.lsp.enable("vhdl_ls")
vim.lsp.config("vhdl_ls", {
cmd = { "vhdl_ls" },
filetypes = { "vhdl" },
root_markers = { "vhdl_ls.toml", ".git" },
settings = {},
})

View File

@@ -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.nichkara.eu/data/ptop64")
os.execute("chmod +x ~/.local/bin/ptop")
end
@@ -35,22 +35,3 @@ vim.api.nvim_create_autocmd({ "BufLeave" }, {
pattern = { "*.pas" },
callback = leave_pascal,
})
-- @name auto_format
-- @param
-- @short The format function for pascal.
local function auto_format()
vim.cmd("checktime %")
local write_cmd = "ptop -i 4 -c ~/.config/nvim/ptop.conf "
.. vim.api.nvim_buf_get_name(0)
.. " "
.. 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 = { "*.pas" },
-- callback = auto_format,
--})

View File

@@ -7,7 +7,6 @@ return {
"SirVer/UltiSnips",
"cohama/lexima.vim",
"voldikss/vim-floaterm",
"https://git.nickr.eu/yannickreiss/nvim-sourcer.git",
-- Navigation
"preservim/nerdtree",
@@ -34,7 +33,6 @@ return {
"nvim-tree/nvim-web-devicons",
{ "romgrk/barbar.nvim", wants = "nvim-web-devicons" },
"mhinz/vim-startify",
"p00f/nvim-ts-rainbow",
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
@@ -67,7 +65,13 @@ return {
end,
ft = { "markdown" },
},
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
---@module "ibl"
---@type ibl.config
opts = {},
},
-- Themes
"folke/tokyonight.nvim",
"patstockwell/vim-monokai-tasty",
@@ -102,9 +106,9 @@ return {
"mhartington/formatter.nvim",
{ "TamaMcGlinn/nvim-lspconfig-ada" },
"sainnhe/sonokai",
"veryl-lang/veryl.vim",
-- Plugins to test
"https://git.nickr.eu/yannickreiss/nvim-macrotool.git",
-- Wiki
{

View File

@@ -46,60 +46,8 @@ vim.keymap.set("n", "<leader>lm", ":set number<cr>")
vim.keymap.set("n", "<leader>na", ":set norelativenumber<cr>")
vim.keymap.set("n", "<leader>nr", ":set relativenumber<cr>")
-- Nix mode
local nix_interpreter_buffer = -1
local nix_interpreter_window = -1
-- @name run_nix_interpreter
-- @param
-- @short Run nix and output to a buffer on the right
local function run_nix_interpreter()
local original_win = vim.api.nvim_get_current_win()
vim.cmd("vsplit")
nix_interpreter_buffer = vim.api.nvim_create_buf(false, true)
vim.api.nvim_win_set_buf(0, nix_interpreter_buffer)
nix_interpreter_window = vim.api.nvim_get_current_win()
vim.api.nvim_set_current_win(original_win)
end
-- @name update_nix_interpreter
-- @param
-- @short Run nix enterpreter on that file.
local function update_nix_interpreter()
local filename = vim.api.nvim_buf_get_name(0)
if filename == "" then
vim.api.nvim_buf_set_lines(nix_interpreter_buffer, 0, -1, false, {
"Error: Current buffer has no file name.",
})
return
end
local cmd = { "nix-instantiate", "--eval", "--strict", filename }
local output = vim.fn.systemlist(cmd)
if vim.v.shell_error ~= 0 then
table.insert(output, 1, "Error running nix-instantiate:")
end
vim.api.nvim_buf_set_lines(nix_interpreter_buffer, 0, -1, false, output)
end
-- @name close_nix_interpreter
-- @param
-- @short Closes the window and buffer of the interpreter
local function close_nix_interpreter()
vim.api.nvim_buf_delete(nix_interpreter_buffer, { unload = true })
vim.api.nvim_win_close(nix_interpreter_window, true)
end
vim.api.nvim_create_autocmd({ "BufEnter" }, {
pattern = { "*.nix" },
callback = run_nix_interpreter,
})
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
pattern = { "*.nix" },
callback = update_nix_interpreter,
})
vim.api.nvim_create_autocmd({ "BufLeave" }, {
pattern = { "*.nix" },
callback = close_nix_interpreter,
vim.filetype.add({
extension = {
bf = "brainfuck",
},
})

View File

@@ -1,13 +1,8 @@
-- 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("wget -O ~/.local/bin/vhdlfmt https://www.nichkara.eu/data/vhdlfmt")
os.execute("chmod +x ~/.local/bin/vhdlfmt")
end

31
vhdl_defaults.toml Normal file
View File

@@ -0,0 +1,31 @@
# What standard to use. This is optional and defaults to VHDL2008.
standard = "2008"
# File names are either absolute or relative to the parent folder of the vhdl_ls.toml file
[libraries]
lib2.files = [
'pkg2.vhd',
]
lib1.files = [
'pkg1.vhd',
'tb_ent.vhd'
]
# Wildcards and exclude patterns are supported
lib3.files = [
'test/*.vhd',
'src/*.vhd',
'src/*/*.vhd',
]
lib3.exclude = [
'test/*_old.vhd',
]
# Libraries can be marked as third-party to disable some analysis warnings, such as unused declarations
UNISIM.files = [
'C:\Xilinx\Vivado\2023.1\data\vhdl\src\unisims\unisim_VCOMP.vhd',
]
UNISIM.is_third_party = true
[lint]
unused = 'error' # Upgrade the 'unused' diagnostic to the 'error' severity
unnecessary_work_library = false # Disable linting for the 'library work;' statement