From 88a870eb6934374714be974981f528d15fe0b637 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Mon, 24 Jul 2023 16:44:12 -0500 Subject: [PATCH] feat(nvim): add run key for asm --- dots/.config/nvim/after/ftplugin/asm.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dots/.config/nvim/after/ftplugin/asm.lua b/dots/.config/nvim/after/ftplugin/asm.lua index b27a5553..66d13735 100644 --- a/dots/.config/nvim/after/ftplugin/asm.lua +++ b/dots/.config/nvim/after/ftplugin/asm.lua @@ -1 +1,20 @@ vim.opt_local.commentstring = "# %s" + +vim.keymap.set("n", "fr", function() + local curr_file = vim.fn.expand("%:p") + vim.fn.expand("%:p") + local curr_dir = vim.fn.expand("%:p:h") + vim.fn.expand("%:p") + require("toggleterm").exec( + string.format( + "as %s -o %s/obj.o && ld %s/obj.o -o %s/out && %s/out", + curr_file, + curr_dir, + curr_dir, + curr_dir, + curr_dir + ) + ) +end, { + buffer = true, +})