Vim Tips Wiki
Register
We recommend that you log in before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your Watchlist. Creating an account is quick and free.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 30: Line 30:
 
inoremap <expr><silent> <Esc> <C-r>=pumvisible() ? "\<C-y>" : "\<Esc>"<CR>
 
inoremap <expr><silent> <Esc> <C-r>=pumvisible() ? "\<C-y>" : "\<Esc>"<CR>
 
</pre>
 
</pre>
 
Word to the wise, mapping over <Esc> can cause an issue in terminal vim where arrow keys will print letters A through D along with a newline rather than moving. To avoid the issue, simply omit the mapping over <Esc>.
 
   
 
For scrolling using PgUp/PgDn, one can also map Ctrl-u and Ctrl-d to PgUp and PgDn respectively
 
For scrolling using PgUp/PgDn, one can also map Ctrl-u and Ctrl-d to PgUp and PgDn respectively
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel Editing help (opens in new window)