Open Machine-Maker opened 1 year ago
I think you can do it using a function like this:
mappings = {
i = {
j = {
k = function()
-- Escape insert mode when jk is pressed
if vim.bo.filetype == 'Yourfiletype' then
-- Type 'jk' normally when inside filetype 'Yourfiletype'
-- <c-v> is used to avoid mappings
return "<c-v>j<c-v>k"
end
return "<esc>"
end
}
}
}
It'd be nice if there was a setting for a condition function to be called to see if the mapping should be "applied". My usecase specifically is disabling it within TelescopePrompts