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

Disable Indentline for dashboard #383

Open
jcmunozo opened this issue Jan 12, 2023 · 4 comments
Open

Disable Indentline for dashboard #383

jcmunozo opened this issue Jan 12, 2023 · 4 comments

Comments

@jcmunozo
Copy link

There is any way to disable for filestype? the indent lines is render on my dashboard :(

@NeumoNeumo
Copy link

Yes. You may use the following vimscript to disable indentline on your dashboard buffer.

augroup disableIndentlineDb
  autocmd!
  au FileType dashboard let b:indentLine_enabled = 0
augroup END

Check :help ft, :help au for more information

@jcmunozo
Copy link
Author

jcmunozo commented Mar 3, 2023

thank you for your reply, i am using Lua, so in the end I used this vim.cmd([[ autocmd User AlphaReady :IndentLinesDisable ]]) in the "goolord/apha-nvm" configuration. What do you think about it? is it a bad practice?

@NeumoNeumo
Copy link

You'd better use

vim.cmd[[
augroup disableIndentlineDb
  autocmd! -- clear cmds in this group first to avoid duplication
  au FileType dashboard let b:indentLine_enabled = 0
augroup END
]]

Every time you source your configuration. autocmd will register a new autocommand which may result in conflicts and performance degradation as mentioned in :h au:

:autocmd adds to the list of autocommands regardless of whether they are
already present. When your .vimrc file is sourced twice, the autocommands
will appear twice. To avoid this, define your autocommands in a group.

Besides, if you are preferable to a lua-style configuration for autocommands, please refer to :h nvim_create_autocmd

@jcmunozo
Copy link
Author

jcmunozo commented Mar 4, 2023

thanks, I will implement it, :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants