I recently switched to using Vi keybindings in bash shell as described here http://vim.wikia.com/wiki/Use_vi_shortcuts_in_terminal. It's great, except that ^L (Ctrl + l) does not clear screen any more. I tried the two options mentioned in the link but neither of them works. I also tried adding the line
alias ^L='clear'
in my .bashrc but that didn't work. Can someone suggest what else I can do?
Thanks!
With bash vi mode there are two keymaps, corresponding to vim's normal mode and insert modes, called vi-command and vi-insert. ctrl-L works by default in vi-command mode, so typing <esc><ctrl-l> will do it, but needs another keystroke "a" to get back to insert mode.
For ctrl-L to work in insert mode, you need a ~/.inputrc file, that specifies the keymap:
set keymap vi-insert
"\C-L": clear-screen
> alias ^L='clear'
You have to press enter to invoke an alias, and it has to be the first word on the line, not at all like the ctrl-L you're used to.
Regards, John Little