[mini.indentscope] how does one disable indentscope in insert mode? #276
Answered
by
echasnovski
mystilleef
asked this question in
Q&A
-
Hello, How does one disable In particular, the disable function in the code below doesn't work. Also looked at the docs and didn't find any Any pointers are appreciated. local function disable_mini_indentscope()
vim.b.miniidentscope_disable = true
local status, indent = pcall(require, "mini.indentscope")
if status then
indent.undraw()
end
end
local function enable_mini_indentscope()
vim.b.miniidentscope_disable = false
local status, indent = pcall(require, "mini.indentscope")
if status then
indent.auto_draw()
end
end |
Beta Was this translation helpful? Give feedback.
Answered by
echasnovski
Mar 21, 2023
Replies: 1 comment 1 reply
-
You'd need to define these autocommands before vim.cmd([[
augroup InsertDisable
au!
au InsertEnter * lua vim.b.miniindentscope_disable = true
au InsertLeave * lua vim.b.miniindentscope_disable = false
augroup END]]
)
require('mini.indentscope').setup() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mystilleef
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'd need to define these autocommands before
require('mini.indentscope').setup()
.Try something like this: