2
It seems my FreeBSD console is misconfigured (i guess). I cannot use home
or end
buttons in command line (it prints ~
), and in vi
left arrow is switching me from edit to command mode, which makes editing a little difficult. How can I know what's wrong and fix it?
I'm not a root, by the way, I just hope it's something with my profile or bash configuration.
Shell version: GNU bash, version 4.0.35(0)-release (i386-portbld-freebsd8.0)
UPD: fixed home
and end
keys in console by creating ~/.inputrc
and pasting this:
"\e[3~": delete-char
# this is actually equivalent to "\C-?": delete-char
# VT
"\e[1~": beginning-of-line
"\e[4~": end-of-line
# kvt
"\e[H":beginning-of-line
"\e[F":end-of-line
# rxvt and konsole (i.e. the KDE-app...)
"\e[7~":beginning-of-line
"\e[8~":end-of-line
"\e[1;5C": forward-word # Ctrl+right => forward word
"\e[1;5D": backward-word # Ctrl+left => backward word
(solution from here)
Still, left arrow in vi bothers me, and I cannot install vim on the machine (maybe it's some vi quirk, idk).
1Is this locally, or over ssh? – Jeremy Smyth – 2010-05-31T09:34:16.773
Over SSH. Client is NuSphere PHPEd embeded (though I may test with PuTTY). – Kuroki Kaze – 2010-05-31T09:42:28.673
No, PuTTY has the same problems. It must be server. – Kuroki Kaze – 2010-05-31T09:46:33.283
vi
does not support arrow keys. When it was written, keyboards had arrows on HJKL keys. – user1686 – 2010-05-31T18:22:05.063Shouldn't vi use .inputrc stuff? I have another GNU/Linux box where arrows in vi work just fine. – Kuroki Kaze – 2010-06-01T10:17:15.653
@Kuroki: 1) No.
inputrc
is for readline, andvi
uses ncurses. – user1686 – 2010-06-01T20:03:49.423@Kuroki: 2) That is most likely
vim
in "vi compatibility mode". (Try:version
to check if it is.) – user1686 – 2010-06-01T20:04:52.057start="2">
vi
is vim in compatibility mode andvim
command is not found :)