Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Enabling sections for specific filetypes #206

Answered by lukas-reineke
RayZ0rr asked this question in Q&A
Discussion options

You must be logged in to vote

The way you have it, it gets evaluated just once when you start Neovim. Instead, you want to make enabled a function, that returns a boolean.
Also, your usage of print is wrong, and you don't need to use vim.fn.exists

enabled = function()
    return vim.g.asyncrun_status ~= nil and vim.bo.filetype == 'qf'
end

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RayZ0rr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants