[chore] nvim: run lua-ls formatter over everything

This commit is contained in:
dogeystamp 2024-04-02 14:16:39 -04:00
parent 95fefd2304
commit c423d2a5f8
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
4 changed files with 49 additions and 47 deletions

View File

@ -140,6 +140,7 @@ function M.compile(file)
local subdir = M.dbg_dir(file) local subdir = M.dbg_dir(file)
vim.fn.execute("make " .. subdir .. "/binary " .. "-f $XDG_CONFIG_HOME/nvim/makefile") vim.fn.execute("make " .. subdir .. "/binary " .. "-f $XDG_CONFIG_HOME/nvim/makefile")
end end
keymap("<leader>dc", M.compile) keymap("<leader>dc", M.compile)
function M.write_input(file) function M.write_input(file)
@ -148,6 +149,7 @@ function M.write_input(file)
local inp_file = M.dbg_dir(file) .. "/input" local inp_file = M.dbg_dir(file) .. "/input"
vim.fn.writefile(vim.fn.getreg("+", 1, 1), inp_file) vim.fn.writefile(vim.fn.getreg("+", 1, 1), inp_file)
end end
function M.run_input(file) function M.run_input(file)
file = gf(file) file = gf(file)
if not dapui.elements.console then if not dapui.elements.console then
@ -160,9 +162,9 @@ function M.run_input(file)
let @x = join(readfile(b:nvimdbg_inp_file), "\n") .. "\n\n" let @x = join(readfile(b:nvimdbg_inp_file), "\n") .. "\n\n"
normal G"xp normal G"xp
]] ]]
end) end)
end end
keymap("<leader>rw", M.write_input) keymap("<leader>rw", M.write_input)
keymap("<leader>ri", M.run_input) keymap("<leader>ri", M.run_input)
@ -212,15 +214,15 @@ end
dap.configurations.python = { dap.configurations.python = {
{ {
-- dap parts -- dap parts
type = "python"; type = "python",
request = "launch"; request = "launch",
name = "launch file"; name = "launch file",
-- debugger parts -- debugger parts
program = "${file}"; program = "${file}",
-- this could be smarter (e.g., try to find a virtual env) -- this could be smarter (e.g., try to find a virtual env)
pythonPath = function() return "/usr/bin/python" end; pythonPath = function() return "/usr/bin/python" end,
console = "integratedTerminal"; console = "integratedTerminal",
} }
} }