cohama / lexima.vim

Auto close parentheses and repeat by dot dot dot...
1.01k stars 46 forks source link

Ctrl-h in insert mode #73

Closed arwtyxouymz closed 6 years ago

arwtyxouymz commented 6 years ago

Hi

I use lexima.vim and it is very useful plugin. But I wonder if lexima has the feature what i want to do.

For example, If I input (, lexima complete ) automatically. So my cusrsor state become (|). In this state, if I input Ctrl+h, only opening bracket is deleted, and the state become |). I want to delete closing bracket too.

Does the lexima have this feature?

hydeik commented 6 years ago

I added following new rules in my vimrc.

call lexima#add_rule({'char': '<C-h>', 'at': '(\%#)',   'delete': 1})
call lexima#add_rule({'char': '<C-h>', 'at': '{\%#}',   'delete': 1})
call lexima#add_rule({'char': '<C-h>', 'at': '\[\%#\]', 'delete': 1})
call lexima#add_rule({'char': '<C-h>', 'at': '"\%#"',   'delete': 1})
call lexima#add_rule({'char': '<C-h>', 'at': "'\\%#'",  'delete': 1})
call lexima#add_rule({'char': '<C-h>', 'at': '`\%#`',   'delete': 1})

Hope this helps you.

cohama commented 6 years ago

Added g:lexima_ctrlh_as_backspace option.

Please add below in your vimrc.

let lexima_ctrlh_as_backspace = 1

You can always use <C-h> as <BS>.