Move cursor to the beginning of the command line in Neovim
I’m very used to bash/zsh shortcuts for going to beginning <C-a>
or the end of a line <C-e>
, I use it very frequently when I’m in a zsh Terminal.
And it really annoys me that Neovim default shortcut to go to the beginning of the command line is <C-b>
weres it’s <C-e>
to go to the end of the line.
Let’s fix this little annoyance in my nvim lua config. Create a mapping with the following :
vim.api.nvim_set_keymap('c', '<C-a>', '<Home>', {silent = false})
Just reload your config and you should be able to use <C-a>
to return to the beginning of the command line.
Simple as that, but a real game changer.