added some custom fucntions and a new api
This commit is contained in:
23
lua/custom-functions.lua
Normal file
23
lua/custom-functions.lua
Normal 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
7
lua/plugins/remote.lua
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
return {
|
||||||
|
'chipsenkbeil/distant.nvim',
|
||||||
|
branch = 'v0.3',
|
||||||
|
config = function()
|
||||||
|
require('distant'):setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user