home: vim: lua: utils: add 'is_ssh'
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Bruno BELANYI 2023-02-11 22:16:35 +00:00
parent 5bce2fafde
commit e04fa74412
1 changed files with 18 additions and 0 deletions

View File

@ -20,6 +20,24 @@ M.is_executable_condition = function(cmd)
return function() return M.is_executable(cmd) end
end
-- whether or not we are currently in an SSH connection
-- @return boolean ssh connection
M.is_ssh = function()
local variables = {
"SSH_CONNECTION",
"SSH_CLIENT",
"SSH_TTY",
}
for _, var in ipairs(variables) do
if string.len(os.getenv(var) or "") ~= 0 then
return true
end
end
return false
end
-- list all active LSP clients for current buffer
-- @param bufnr int? buffer number
-- @return table all active LSP client names