diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2024-06-18 12:22:04 +0530 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2024-06-18 12:22:04 +0530 |
| commit | fae3bcc8c9a51e5315d01139b3ae39c0178fee6c (patch) | |
| tree | 80efa6743716598789679ad8eece6d575ae7bbf4 /config/nvim/lua/compile.lua | |
| parent | 2ef439d8f512b7293e36ad85b4ffb9709f366dfb (diff) | |
update
Diffstat (limited to '')
| -rw-r--r-- | config/nvim/lua/compile.lua | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/config/nvim/lua/compile.lua b/config/nvim/lua/compile.lua deleted file mode 100644 index f529b90..0000000 --- a/config/nvim/lua/compile.lua +++ /dev/null @@ -1,38 +0,0 @@ -local openTerminal = function(command) - local Terminal = require('toggleterm.terminal').Terminal - local term = Terminal:new({ - cmd = command, - direction = 'horizontal' - }) - term:toggle() -end - -local path = vim.fn.getcwd() .. '/.compile' - -local run = function() - local file_exists = os.rename(path, path) - - if file_exists then - openTerminal( - 'echo "Directory: $(pwd)"; echo "Compilation started at $(date +"%H:%M:%S")"; echo; ' - .. 'bash ' .. path .. - '; echo; echo "Compilation finished at $(date +"%H:%M:%S")"; read' - ) - return - end - - local file = io.open(path, 'w') - - file:seek('set') - file:write([[#!/bin/sh -set -xe -]] - ) - file:close() - print('Created ' .. path) - return nil -end - -vim.keymap.set('n', 'zz', function() - run() -end) |
