I’ve been unable to use the C-rightarrow and C-leftarrow to get forwad word and backward word behavior when using emacs within a ssh to my dreamhost host. I finally figured out how to fix the problem. In my .emacs file:
(global-set-key "\M-[1;5C"Â 'forward-word) ; Ctrl+right->forward word
(global-set-key "\M-[1;5D"Â 'backward-word); Ctrl+left-> backward word
You might be interested in my entire .emacs file, which adds a few niceties:
(set-background-color "light grey")
(global-font-lock-mode 1)
(transient-mark-mode 1)
(setq default-tab-width 3);
(setq standard-indent 3);
(setq inhibit-startup-message t);
(global-set-key "\M-[1;5C" 'forward-word)Â Â Â Â ; Ctrl+right->forward word
(global-set-key "\M-[1;5D" 'backward-word) ; Ctrl+left ->backward word