added some custom fucntions and a new api

This commit is contained in:
venus
2026-05-31 19:46:05 -05:00
parent ccbebb5ceb
commit 2fe6a440b7
2 changed files with 30 additions and 0 deletions

23
lua/custom-functions.lua Normal file
View File

@@ -0,0 +1,23 @@
-- lua/custom-functions.lua
-- A library file with custom functions for cleaner code elsewhere
local C = {}
function C.runLastCommand()
-- TODO fix implementation
local term = require("toggleterm.terminal").get(1)-- Get terminal ID 1
-- Save position and buffer context
if term then
local original_window = vim.api.nvim_get_current_win()
local saved_view = vim.fn.winsaveview()
-- Using \r (carriage return) or \n\n often bypasses shell interceptors
-- term:send("clear\r")
term:send("test_dev.sh\r")
vim.api.nvim_set_current_win(original_window)
vim.fn.winrestview(saved_view)
else
vim.notify("Terminal 1 is not open yet!", vim.log.levels.WARN)
end
-- Return logic
end
return C

7
lua/plugins/remote.lua Normal file
View File

@@ -0,0 +1,7 @@
return {
'chipsenkbeil/distant.nvim',
branch = 'v0.3',
config = function()
require('distant'):setup()
end
}