mirror of
https://github.com/boxpositron/absolute-vim.git
synced 2026-02-28 19:50:38 +00:00
11 lines
228 B
Lua
11 lines
228 B
Lua
function GetProjectRoot()
|
|
local git_root = vim.fn.systemlist("git rev-parse --show-toplevel")[1]
|
|
if git_root == nil then
|
|
return vim.fn.getcwd()
|
|
else
|
|
return git_root
|
|
end
|
|
end
|
|
|
|
return GetProjectRoot
|