lualine.nvim icon indicating copy to clipboard operation
lualine.nvim copied to clipboard

feat: filename now supports oil.nvim

Open tronikelis opened this issue 1 year ago • 6 comments

https://github.com/nvim-lualine/lualine.nvim/issues/1077

This PR adds filename support for oil.nvim, so it's no longer the full path but how the user specified the path to be shown

To be honest this is kind of a selfish PR where I am modifying the vanilla component, and as I said in my previous PR it would be better to somehow extract this logic for the user to write himself, but maybe that's too much effort

tronikelis avatar Aug 31 '24 08:08 tronikelis

Why isn't this done inside the oil extension?

cgimenes avatar Nov 14 '24 17:11 cgimenes

Why isn't this done inside the oil extension?

Is it possible to do this easily? When I implemented this I remember checking out extensions and seeing some blocker that I can't recall.

If possible yeah, this should be an extension, but the only way I see is somehow extending the current filename to add support

tronikelis avatar Nov 14 '24 18:11 tronikelis

I don't think we would really need the filename component. AFAIK something like this would work as a custom component inside de oil extension:

function() {
      -- proper module exists validation
      local oil = require 'oil'
      return oil.get_current_dir() .. oil.get_cursor_entry().name
}

cgimenes avatar Nov 14 '24 18:11 cgimenes

I don't think we would really need the filename component. AFAIK something like this would work as a custom component inside de oil extension:

function() {
      -- proper module exists validation
      local oil = require 'oil'
      return oil.get_current_dir() .. oil.get_cursor_entry().name
}

The filename component automatically shrinks the path when it does not fit, without it I wouldn't be able to read the path when in a terminal split most of the time, without that it's not even worth adding it imo.

Your solution would show the full path all the time

tronikelis avatar Nov 14 '24 18:11 tronikelis

I see. So, we could move this shrinking logic to another place for it to be reusable. What do you think?

cgimenes avatar Nov 15 '24 13:11 cgimenes

I see. So, we could move this shrinking logic to another place for it to be reusable. What do you think?

That's one solution, but we are not really solving the root problem, the root problem is that getting the current directory should be exposed to the global config somehow, then everything would just work

tronikelis avatar Nov 15 '24 15:11 tronikelis