From bbe99318ad2de6fdc647ae9885198e63e262aa63 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Tue, 10 Oct 2023 06:58:21 +0530 Subject: remove run --- .config/nvim/lua/compile.lua | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.config/nvim/lua/compile.lua b/.config/nvim/lua/compile.lua index 8343cfe..f529b90 100644 --- a/.config/nvim/lua/compile.lua +++ b/.config/nvim/lua/compile.lua @@ -7,17 +7,16 @@ local openTerminal = function(command) term:toggle() end -local compilePath = vim.fn.getcwd() .. '/.compile' -local runPath = vim.fn.getcwd() .. '/.run' +local path = vim.fn.getcwd() .. '/.compile' -local checkGetFileContent = function(path, typ) +local run = function() local file_exists = os.rename(path, path) if file_exists then openTerminal( - 'echo "Directory: $(pwd)"; echo "' .. typ .. ' started at $(date +"%H:%M:%S")"; echo; ' + 'echo "Directory: $(pwd)"; echo "Compilation started at $(date +"%H:%M:%S")"; echo; ' .. 'bash ' .. path .. - '; echo; echo "' .. typ .. ' finished at $(date +"%H:%M:%S")"; read' + '; echo; echo "Compilation finished at $(date +"%H:%M:%S")"; read' ) return end @@ -35,14 +34,5 @@ set -xe end vim.keymap.set('n', 'zz', function() - checkGetFileContent( - compilePath, - 'Compilation' - ) -end) -vim.keymap.set('n', 'zx', function() - checkGetFileContent( - runPath, - 'Run' - ) + run() end) -- cgit v1.2.3