robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
6a87ef75b3
master
1-- Lua implementations of "vimfn" builtin functions (via `func_lua`). 2-- 3-- Functions defined here are pure Lua, they don't have any explicit C impl, so they are named with 4-- the "f_xx" convention, for discoverability. 5 6local M ={} 7 8--- Returns the hostname of the machine. 9--- @return string 10function M . f_hostname () 11return vim . uv . os_gethostname () 12end 13 14--- Returns all environment variables as a dictionary. 15--- @return table<string, string> 16function M . f_environ () 17local env =vim . uv . os_environ () ---@type table<string, string> 18if vim . fn . has ( 'win32' ) == 1 then -- Vim/legacy behavior: force uppercase keys on Windows. #39443 19local upper ={} --- @type table<string, string> 20for k , v in pairs ( env ) do 21upper [ k : upper ()] =v 22end 23return upper 24end 25return env 26end 27 28return M