numToStr / FTerm.nvim

:fire: No-nonsense floating terminal plugin for neovim :fire:
MIT License
743 stars 23 forks source link

Call User autocmd event to custom the window #13

Closed delphinus closed 3 years ago

delphinus commented 3 years ago

I want to set options such as winblend and winhl for the window. It calls FTermOpen event with this.

autocmd User FTermOpen set winblend=10
numToStr commented 3 years ago

I am more in favour of exposing winhl and winblend as a config option rather than autocommand. Thoughts?

delphinus commented 3 years ago

It should be good. But this autocmd event is also useful to do any other settings when FTerm is opened, such as mappings, other window-level options, other autocmd, and so on.

For another suggestion, floaterm sets its own filetype for the term. We can use it as the same purpose. It can be also good.

autocmd FileType Floaterm set winblend=10
numToStr commented 3 years ago

Ahh, I like the filetype idea. So, if I am understanding correctly, either autocmd User FTermOpen ... or autocmd FileType FTerm ... will work for your use case. Right?

delphinus commented 3 years ago

Yeah. Precisely, a bit differs. autocmd method will occur everytime it creates “Windows”. And FileType method will occur everytime it creates “Buffers”.

BTW, either is fine for me ;) I'll re-create PR for filetypes.