local signcolumn setting #104
-
I'm using I've tried require'neo-tree'.setup {
event_handlers = {
{
event = "vim_win_enter",
handler = function(arg)
vim.cmd [[setlocal scl=auto]]
end
}
}
} but this will set |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 3 replies
-
Yes, the vim_win_enter is just using the vim autocmd event directly and fires for all events once subscribed. You could use that and add a check for the filetype, or do the same in a generic vim BufEnter event. Either way the key is to check the filetype first: require'neo-tree'.setup {
event_handlers = {
{
event = "vim_win_enter",
handler = function(arg)
if vim.bo.filetype == "neo-tree" then
vim.cmd [[setlocal scl=auto]]
end
end
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Thanks this worked perfectly! require'neo-tree'.setup {
event_handlers = {
{
event = "vim_buffer_enter",
handler = function(arg)
if vim.bo.filetype == "neo-tree" then
vim.cmd [[setlocal scl=auto]]
end
end
}
}
} |
Beta Was this translation helpful? Give feedback.
-
Glad to hear it worked out! I'm going to convert this to a discussion for others to find. |
Beta Was this translation helpful? Give feedback.
-
For anyone else interested in this, please see this comment on #155 and let me know your thoughts. |
Beta Was this translation helpful? Give feedback.
-
I think we can use event_handlers = {
{
event = "neo_tree_buffer_enter",
handler = function(arg)
vim.cmd [[
setlocal signcolumn=no
]]
end,
}
}, |
Beta Was this translation helpful? Give feedback.
I think we can use
neo_tree_buffer_enter
event instead of the generalvim_buffer_enter
event.