diff --git a/README.md b/README.md index 3ab0657..ead8f1e 100644 --- a/README.md +++ b/README.md @@ -550,6 +550,7 @@ sections = { path = 0, -- 0: Just the filename -- 1: Relative path -- 2: Absolute path + -- 3: Absolute path, with tilde as the home directory shorting_target = 40, -- Shortens path to leave 40 spaces in the window -- for other components. (terrible name, any suggestions?) diff --git a/lua/lualine/components/filename.lua b/lua/lualine/components/filename.lua index dfaf3f3..f68dba7 100644 --- a/lua/lualine/components/filename.lua +++ b/lua/lualine/components/filename.lua @@ -43,6 +43,9 @@ M.update_status = function(self) elseif self.options.path == 2 then -- absolute path data = vim.fn.expand('%:p') + elseif self.options.path == 3 then + -- absolute path, with tilde + data = vim.fn.expand('%:p:~') else -- just filename data = vim.fn.expand('%:t')