-
Notifications
You must be signed in to change notification settings - Fork 251
Easier way to set local
options
#155
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
Comments
The short answer is that the neo-tree buffer has a filetype of |
Thanks!, I think it's a hacky solution but works, I wonder if can be setted at buffer creation |
set signcolumn=no
when open neo-tree
bufferset local
options
I could certainly create another way for you to add
require("neo-tree").setup({
buffer_enter = function()
vim.cmd("setlocal signcolumn=2")
end
})
For your specific use case, 3 is the ideal solution, but 1 and 2 can be reused for other things and will allow conditional logic, like having different settings for a float vs sidebar vs split. |
Yeah, the 3 looks good, but you can tree make a combination of 2 and 3, something like this require("neo-tree").setup({
buffer_options = { SETTINGS HERE } | function()
-- allow buffer_options to be a table or function
end
}) |
I ended up going with the event solution, just to keep the number of config strategies down. There are now 4 new events that can be used to set/unset options that should apply to the neo-tree buffers:
For example, to use them to hide the cursor in a neo-tree window, you could do something like this: require('neo-tree').setup({
event_handlers = {
{
event = "neo_tree_buffer_enter",
handler = function()
vim.cmd 'highlight! Cursor blend=100'
end
},
{
event = "neo_tree_buffer_leave",
handler = function()
vim.cmd 'highlight! Cursor guibg=#5f87af blend=0'
end
}
},
}) |
I have signcolumn setted to 2, but in file explorer I don't want the signcolumn, looks weird, or is there an option to this?
The text was updated successfully, but these errors were encountered: