Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: icon hl color #145

Closed
1 task done
adriancmiranda opened this issue Jul 22, 2023 · 1 comment
Closed
1 task done

feature request: icon hl color #145

adriancmiranda opened this issue Jul 22, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@adriancmiranda
Copy link

adriancmiranda commented Jul 22, 2023

Did you check existing requests?

  • I have searched the existing issues

Describe the feature

I noticed that it is possible to pass tables in the 'columns' property as well, but I would like to customize two other properties: removing the extra space added to the icon and changing the color of the directory icon, something more like:

columns = {
	{
		'icon',
		directory = {
			icon = '',
			color = '#E0AF68',
			name = 'OilDir',
		},
		default_file = {
			icon = '',
			color = '#E0AF68',
			name = 'OilFile',
		},
	},
},

and not simply:

columns = {
	{
		'icon',
		directory = '',
		default_file = '',
	},
},

I'm not sure if I misunderstood something or if there is another way to achieve this.

Provide background

The idea is to have a bit more freedom in customization (but again, I'm not sure if I misunderstood something and this is already possible, if so, disregard).

image

I would like to achieve a result closer to this.
image

Additional details

I'm trying to understand how can I use highlight function conf. I tried to just pass at columns.directory table, but with no sucess.

I tried to use:
image
but the result is not exactly what I expect:
image

@adriancmiranda adriancmiranda added the enhancement New feature or request label Jul 22, 2023
@adriancmiranda adriancmiranda changed the title feature request: feature request: icon hl color Jul 22, 2023
@stevearc
Copy link
Owner

stevearc commented Aug 9, 2023

Okay, I've added the ability to configure the padding. You should be able to do

require("oil").setup({
  columns = { { "icon", add_padding = false } },
})

To change the color, you should configure the highlight group. There are two groups: OilDir for the directory name and OilDirIcon for the icon. For example

vim.api.nvim_set_hl(0, 'OilDirIcon', {fg = "#E0AF68"})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants