Adds automatic reopening
This commit is contained in:
parent
88bda96496
commit
6dd971b541
2 changed files with 30 additions and 4 deletions
|
|
@ -1,12 +1,21 @@
|
|||
local fs = {}
|
||||
|
||||
local function startswith(string, start)
|
||||
return string:sub(1, #start) == start
|
||||
end
|
||||
|
||||
function fs.getCurrentPath()
|
||||
local currentBuffer = vim.fn.expand("%")
|
||||
print(currentBuffer)
|
||||
end
|
||||
|
||||
function fs.getRootPath()
|
||||
local initialArguments = vim.v.argv
|
||||
local requestedFile = initialArguments[#initialArguments]
|
||||
|
||||
local path = vim.fs.abspath(requestedFile)
|
||||
|
||||
if vim.fn.isdirectory(path) == 1 then
|
||||
return path
|
||||
end
|
||||
|
||||
return LazyVim.root()
|
||||
end
|
||||
|
||||
return fs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue