diff options
| -rw-r--r-- | .config/nvim/lua/compile.lua | 20 | 
1 files 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)  | 
