inoremap <Up> <NOP> inoremap <Down> <NOP> inoremap <Left> <NOP> inoremap <Right> <NOP> noremap <Up> <NOP> noremap <Down> <NOP> noremap <Left> <NOP> noremap <Right> <NOP>
This is what I use to disable cursor navigation, to help me stick to hjkl :)
But it also disables the cursor on the command bar... normally the arrow keys let you cycle through the history
Is it possible to disable the cursor keys ONLY for navigation, and not for the history?
Alternatively, you could use the CmdWinEnter autocmd event to unmap arrow keys for the command-line window. cnoremap works to disable the up arrows in command line mode..
The vim editor is derived from vi. It also utilizes the same hjkl keys to replace the functionality of arrow keys. Among vim users, hjkl keys are preferred and advantageous to use. You never have to leave the first row, allowing you to be speedier while working in vim editor.
Tap 'Layout & keys' Check or uncheck 'Arrow Keys'
Vim uses hjkl because vi did. Vi used hjkl because its creator's keyboard didn't have physical cursor keys. Instead, the arrows were printed on the hjkl keys.
Add the following in your .vimrc
file:
" Disable Arrow keys in Normal mode map <up> <nop> map <down> <nop> map <left> <nop> map <right> <nop> " Disable Arrow keys in Insert mode imap <up> <nop> imap <down> <nop> imap <left> <nop> imap <right> <nop>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With