-
-
Notifications
You must be signed in to change notification settings - Fork 582
Bash For Windows and VIM Arrow Keys
Arrow keys will work out of the box if you use the automatically-generated {bash}
task.
See the docs for details: https://conemu.github.io/en/BashOnWindows.html
This edit may no longer work on the latest conemu builds (as of 5/17/16), and may even impede functioning. Use at your own risk
Make sure ctrl+v is NOT bound to paste in conemu. (use ctrl+shift+v or something)
(AND remote .bashrc - to fix vim in ssh sessions):
if [ -d /mnt/c/WINDOWS ] || [ $LC_WINDOWS10 ]; then
export WINDOWS10=0
fi
if [ $WINDOWS10 ]; then
export LC_WINDOWS10=$WINDOWS10
fi
(AND remote .vimrc - to fix vim in ssh sessions):
let windows10=$WINDOWS10
if windows10 == '0'
set t_ku=(ctrl+v , UP arrow)
set t_kd=(ctrl+v , DOWN arrow)
set t_kr=(ctrl+v , RIGHT arrow)
set t_kl=(ctrl+v , LEFT arrow)
endif
In vim, this will appear as "set t_ku=^[[A" or something like that.
With both the bashrc and vimrc changes in place, local and remote vim both have working arrow keys, without breaking arrow keys in non-windows10 shells.
The fix requires that /etc/ssh/sshd_config AcceptEnv accepts variables in "LC_", and /etc/ssh/ssh_config (or .ssh/config) SendEnv sends "LC_", which is the default for Ubuntu openssh clients and servers.