Closed Axlefublr closed 3 months ago
Here's an example of how this ends up looking. Here at the top left, I have the separated_path element (with a separator of /
). This way, it just looks like a normal path.
Without this change, it would show ~
as home/username
no clue how I'd configure this through path_func
. I assume I'd have to change the implementation of unique_path
, but I can't understand that code at all. Or do I somehow change path_func without relying on unique_path
? Can you elaborate?
when you call this function when building your own custom heirline
configuration:
status.component.separated_path {
max_depth = -1,
separator = "/",
path_func = function(self) return vim.fn.fnamemodify(vim.api.nvim_buf_get_name(self.bufnr), ":~") end,
}
the default usage of separated path using the unique_path
for the path function actually doesn't make much sense to waste computation to calculate this because it would never come up. It only makes sense given a different path_func
so it's better to leave it up to the user to handle that on their own. Hopefully that makes sense!
📑 Description
It's very common to see $HOME as ~, to the point of it being weird when it's not presented as ~
So, this PR makes
separated_path
display the $HOME part of the path as ~, if possible.ℹ Additional Information