You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I'd like it so that if I press Esc (leaving insert mode) without entering another subsequent character, the autocomplete won't trigger. So for example just entering (<Esc> would end up with ( or ('<Esc> would give me (', but entering ('h<Esc> would give me ('h'). Would this be possible at all? I sort of have this functionality with some basic vim mappings as follows:
But the main issue being is that for multiple char imappings, it doesn't show all the characters on the screen as you type, but just one at a time, which is a bit jarring. Any help would be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered:
There isn't really a nice way to prevent the autocomplete from happening for Esc, but you could instead make Esc delete end pairs if the pairs are empty.
-- lualocalis_pair= {
['{}'] =true,
['[]'] =true,
['\'\''] =true,
['\"\"'] =true,
['[\'\']'] =true,
['[\"\"]'] =true,
['{\'\'}'] =true,
['{\"\"}'] =true,
}
vim.keymap.set('i', '<esc>', function()
localline=vim.api.nvim_get_current_line()
localcol=vim.api.nvim_win_get_cursor(0)[2] +1-- {""}-- |-- The cursor is |ifis_pair[line:sub(col-2, col+1)] then-- del deletes the character on the cursorreturn'<del><del><esc>'end-- {}-- |ifis_pair[line:sub(col-1, col)] thenreturn'<del><esc>'endreturn'<esc>'end, { expr=true })
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi! I'd like it so that if I press Esc (leaving insert mode) without entering another subsequent character, the autocomplete won't trigger. So for example just entering
(<Esc>
would end up with(
or('<Esc>
would give me('
, but entering('h<Esc>
would give me('h')
. Would this be possible at all? I sort of have this functionality with some basic vim mappings as follows:But the main issue being is that for multiple char imappings, it doesn't show all the characters on the screen as you type, but just one at a time, which is a bit jarring. Any help would be appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: