TaDaa / vimade

An eye friendly plugin that fades your inactive buffers and preserves your syntax highlighting!
MIT License
486 stars 8 forks source link

[feature request] add list of regex buffer filters to exclude fading on #15

Closed sdothum closed 5 years ago

sdothum commented 5 years ago

Some plugins open multiple windows eg yankring. Would be nice to be able to provide a regex expression to be able to exclude fading of associated buffer windows when any are in focus, and faded when not.

TaDaa commented 5 years ago

Nice idea -- would something like VimadeIgnore [expr] or VimadeExclude [expr] suit your needs? -- The list itself I think will be exposed through the config.

Not quite sure what [expr] will be yet -- seems like it to start it should at least support matching on filetype, buffer/file name.

sdothum commented 5 years ago

Hadn't thought about filetype but I could see some having a use for that. As for var naming, perhaps g:VimadeGroupBuf and g:VimadeGroupFt or g:VimadeGroup (if you don't need to distinguish between filetype and buffer name -- filetypes would most likely be defined as exact matches, names as regex). Tuples would be another alternative if you do need to make the distinction.

I don't have any particular preference for var naming or how you define the specification -- whatever is easiest for you to implement and is consistent with your coding. But simple regex grouping on ft and buffer/filename would be awesome.

TaDaa commented 5 years ago

Starting to work on this -- should have it out there some time this week

TaDaa commented 5 years ago

Sorry for the delay -- I think this should do what you are looking for. I steered away from the config to try and keep the logic moreso just vimscript in a vimrc.

Added the following commands: VimadeBufDisable - remove and ignore fading for the current buffer VimadeBufEnable - re-enable fading for current buffer VimadeWinDisable - remove and ignore fading for the current window VimadeWinEnable - re-enable fading for current window

usage examples: au! BufWinEnter Dockerfile VimadeBufDisable - Disables fading for buffers loaded that are named Dockerfile

au! FileType nerdtree VimadeBufDisable - Disables fading for buffers with the nerdtree filetype>

sdothum commented 5 years ago

Thank you! This works for the Yankring plugin that caught my attention with it's multiple windows.

Great work.

hrqmonteiro commented 3 years ago

Sorry for the delay -- I think this should do what you are looking for. I steered away from the config to try and keep the logic moreso just vimscript in a vimrc.

Added the following commands: VimadeBufDisable - remove and ignore fading for the current buffer VimadeBufEnable - re-enable fading for current buffer VimadeWinDisable - remove and ignore fading for the current window VimadeWinEnable - re-enable fading for current window

usage examples: au! BufWinEnter Dockerfile VimadeBufDisable - Disables fading for buffers loaded that are named Dockerfile

au! FileType nerdtree VimadeBufDisable - Disables fading for buffers with the nerdtree filetype>

Tried using the au! FileType nerdtree VimadeBufDisable, and got this ton of errors when opening Nerdtree:

2021-03-07_18-09