Search code examples
vim

How can I go to end of parenthesis/brackets/quotes without switching insert mode in Vim?


I'm looking for a plugin that makes you get out of parenthesis/brackets/quotes/etc when you're inside them. I find it kind of hard having to ESC to command mode and typing A to get out of the parenthesis to go to the end of the line in Insert mode, is there a plugin that meets my needs?


Solution

  • A plugin would be overkill. Add this mapping to your ~/.vimrc:

    inoremap <C-e> <C-o>A
    
    • <C-o> is used to issue a normal mode command without leaving insert mode.
    • A, well… you know what it does.