1

How can I switch to Vim mode in FreeBSD shell?

I echoed the value of $SHELL and it is /bin/csh however man csh opens tsch's manual page.

set -o and shopts are not available as well.

And /etc/inputrc (Readline) is not there too.

Should I install bash or is it possible to have Vim line editing mode rather than Emacs natively, without having to install other shells?

Thanks in advance.


I am on FreeBSD 11.

  • 1
    According to the tcsh manual, you should be able to use bindkey -v to switch to Vi keybindings. If you get the tcsh manual when you do man csh it probably means that csh is in fact tcsh or at least that tcsh is installed on the system already. – Kusalananda May 9 '17 at 11:54
  • Cool, thanks. I've actually came accross that command. I think its a feature of tcsh exclusively, and csh don't have vi mode at all. First, when I issued that command I expected the cursor to "drop" to the previous character as in the case with bash and fish, and zsh if I'm not wrong; it didn't, so I inferred it didn't switched the mode (after pressing Esc or ^[ that is). It's actually more appropriate to not to drop (the cursor) to the previous character when switching the mode, and it's faster. :) – user86041 May 9 '17 at 12:04
2

The csh shell does not have Vi keybindings, while tcsh has.

The tcsh shell is available in the FreeBSD base system (as is sh, which on FreeBSD is ash, the Almquist shell).

To switch to Vi keybindings with the tcsh shell, use

bindkey -v

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy