diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2023-10-10 06:58:21 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2023-10-10 06:58:21 +0530 |
| commit | bbe99318ad2de6fdc647ae9885198e63e262aa63 (patch) | |
| tree | 26872d50e7f8030b28b6d4eec0fd78b30d98a808 /.config/nvim/lua/compile.lua | |
| parent | dce9dc6101446f7a7379498f76972c78d9699fda (diff) | |
remove run
Diffstat (limited to '.config/nvim/lua/compile.lua')
| -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) |
