Compare commits

..

5 Commits

Author SHA1 Message Date
THEON-1
269c827a7b keybind inc 2025-11-27 11:24:45 +01:00
THEON-1
4a1006a062 Lazy update 2025-11-27 11:24:33 +01:00
THEON-1
f08a9f933f added F6 for additional options in ftkeybinds 2025-11-21 20:14:36 +01:00
THEON-1
3dafac9fa7 blink fix 2025-11-21 20:14:06 +01:00
THEON-1
398cbda7ae changed arduino lsp settings 2025-11-21 15:52:32 +01:00
5 changed files with 61 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
{
"blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" },
"fzf-lua": { "branch": "main", "commit": "3b4a5d13adeb33f387d744b6ed777bb5401cba94" },
"fzf-lua": { "branch": "main", "commit": "9a0704e8af8f8442110ff22a83b5608366b235df" },
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
"image.nvim": { "branch": "master", "commit": "446a8a5cc7a3eae3185ee0c697732c32a5547a0b" },
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
@@ -10,10 +10,10 @@
"molten-nvim": { "branch": "main", "commit": "a286aa914d9a154bc359131aab788b5a077a5a99" },
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-lspconfig": { "branch": "master", "commit": "e0fae251f8459940331960106d4bd9457cec23de" },
"nvim-lspconfig": { "branch": "master", "commit": "de659c9c0d53df0e6b4747d8d1ef22ba1164291d" },
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
"nvim-treesitter": { "branch": "main", "commit": "bb83a676128d95c865e40ba71376d883bdadec14" },
"oil.nvim": { "branch": "master", "commit": "7e1cd7703ff2924d7038476dcbc04b950203b902" },
"nvim-treesitter": { "branch": "main", "commit": "d56ed0f7f90d6492ce422f5e0a9cb36d3169eb96" },
"oil.nvim": { "branch": "master", "commit": "01cb3a8ad7d5e8707041edc775af83dbf33838f4" },
"render-markdown.nvim": { "branch": "main", "commit": "6e0e8902dac70fecbdd8ce557d142062a621ec38" },
"undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" },
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }

View File

@@ -1,17 +1,30 @@
local function markdown()
local pandoc_process = vim.system({
"pandoc",
vim.fn.expand("%:p"),
"-o",
vim.fn.expand("%:p:r") .. ".pdf",
"--verbose",
})
local function markdown(options)
local options_list = {}
for opt in options:gmatch("%S+") do
table.insert(options_list, opt)
end
local cmd = vim.list_extend(
{ "pandoc" },
options_list
)
table.insert(cmd, "-s")
table.insert(cmd, vim.fn.expand("%:p"))
table.insert(cmd, "-o")
table.insert(cmd, vim.fn.expand("%:p:r") .. ".tex")
local pandoc_process = vim.system(cmd)
local pandoc_result = pandoc_process:wait()
vim.notify(pandoc_result.stdout, vim.log.levels.INFO);
vim.notify(pandoc_result.stderr, vim.log.levels.ERROR);
local pdflatex_process = vim.system({
"pdflatex",
vim.fn.expand("%:p:r") .. ".tex",
})
local pdflatex_result = pdflatex_process:wait()
--vim.notify((pandoc_result.stdout .. "\n\n" .. pdflatex_result.stdout):gsub("^%s*", ""):gsub("%s*$", ""), vim.log.levels.INFO);
vim.notify((pandoc_result.stderr .. "\n\n" .. pdflatex_result.stderr):gsub("^%s*", ""):gsub("%s*$", ""), vim.log.levels.ERROR);
end
local function arduino()
local function arduino(options)
local arduino_process = vim.system({
"arduino-cli",
"board",
@@ -54,7 +67,18 @@ local function arduino()
})
end
vim.keymap.set("n", "<F5>", function()
local function tex(options)
local pdflatex_process = vim.system({
"pdflatex",
vim.fn.expand("%:p"),
})
local pdflatex_result = pdflatex_process:wait()
vim.notify(pdflatex_result.stdout, vim.log.levels.INFO);
vim.notify(pdflatex_result.stderr, vim.log.levels.ERROR);
end
local function run_ft_action(options)
local default = {
__index = function()
return function() end
@@ -63,9 +87,16 @@ vim.keymap.set("n", "<F5>", function()
local fttable = {
["markdown"] = markdown,
["arduino"] = arduino,
["tex"] = tex,
}
setmetatable(fttable, default)
fttable[vim.bo.filetype]()
fttable[vim.bo.filetype](options)
end
vim.keymap.set("n", "<F5>", function () run_ft_action("") end)
vim.keymap.set("n", "<F6>", function()
run_ft_action(vim.fn.input("enter additional options"))
end)

View File

@@ -24,12 +24,12 @@ vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", {silent = true})
vim.keymap.set("n", "<leader>sb", function ()
local filetype = vim.bo.filetype
local mapping = {
jl = "julia",
julia = "julia",
jl = "/usr/bin/env julia",
julia = "/usr/bin/env julia",
sh = "bash",
zsh = "zsh",
py = "/usr/bin/env python3",
python = "/usr/bin/env python3",
py = "/usr/bin/env python",
python = "/usr/bin/env python",
}
local command = mapping[filetype]
if (command == nil) then return end

View File

@@ -1,5 +1,13 @@
vim.lsp.config("arduino_language_server", {
cmd = { "arduino-language-server", "--fqbn", "arduino:avr:micro" },
cmd = {
"arduino-language-server",
--"--fqbn",
--"arduino:avr:micro",
},
filetypes = {
"arduino",
"cpp",
},
})

View File

@@ -25,7 +25,6 @@ return {
completion = {
documentation = {
auto_show = true,
winblend = 0,
},
menu = {
winblend = 0,