You are not logged in.
There's this annoying problem I've been experiencing for a while now that I haven't been able to fix.
I'm running urxvt-unicode-256color as my terminal emulator. When I'm using vim in insert mode, accidentally hitting the arrow keys inserts A B C D or into the file. I don't use the arrows keys, but accidentally hitting them can get really annoying. I've read all sorts of ways to resolve this and none of the seem to work. The only way I was able to get around this was to set $TERM to be xterm, but that seems like a weird fix for this.
Is there another way of solving this?
Offline
Is there another way of solving this?
Map the keys in vim to something useful or to nothing at all.
BTW, I have the same setup and my cursor keys result in movement like hjkl, so:
- check if you're using vim and not vi,
- change your settings in .vimrc.
Last edited by karol (2010-10-27 10:29:36)
Offline
set your TERM to rxvt-256color, make sure vim is not in compatible mode (and that you are actually using vim and not vi)
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
set your TERM to rxvt-256color
Not quite so. With rxvt-unicode-256color 9.07-10 TERM has changed to rxvt-unicode.
I had to enter this line to my /etc/DIR_COLORS definitions file ("TERM rxvt-unicode"). My ~/.bashrc does evaluate the current DIR_COLORS settings (which set the LS_COLORS environment variable):
# Use current DIRCOLORS settings
eval `dircolors -b /etc/DIR_COLORS`
Therefore urxvt will then use the proper terminal definitions next time it is called.
To know or not to know ...
... the questions remain forever.
Offline
Well, simply set URxvt*termName: to rxvt-unicode then.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
nan wrote:Is there another way of solving this?
Map the keys in vim to something useful or to nothing at all.
BTW, I have the same setup and my cursor keys result in movement like hjkl, so:
- check if you're using vim and not vi,
- change your settings in .vimrc.
I've already mapped the keys to do nothing. But it doesn't seem to work. I'm using map and imap, I've also use set t_ku, etc.
How do I check if I'm using vim as opposed to vi? I've already installed the vim package.
I have set nocompatible in my .vimrc but it doesn't seem to do anything.
set your TERM to rxvt-256color, make sure vim is not in compatible mode (and that you are actually using vim and not vi)
My term vairable is already set to rxvt-unicode.
Offline
Are you executing `vi` or `vim`?
And to see what you are running.. :version
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
I'm executing vim. The version is 7.3
Offline
What do you get when pressing Ctrl-V followed by the left arrow key in your shell?
Offline
When I press Ctrl-V then left arrow I get ^[[D
Offline
A very curious thing is that the arrow keys work fine when I use vi and not vim.... gvim also works as expected...
Offline
Try commenting out setting in your $HOME/.vimrc and see if you can find one setting which is causing the foo.
Offline
A fully commented .vimrc or simply deleteing the .vimrc both do not fix the problem.
Offline
karol wrote:nan wrote:Is there another way of solving this?
Map the keys in vim to something useful or to nothing at all.
BTW, I have the same setup and my cursor keys result in movement like hjkl, so:
- check if you're using vim and not vi,
- change your settings in .vimrc.I've already mapped the keys to do nothing. But it doesn't seem to work. I'm using map and imap, I've also use set t_ku, etc.
How do I check if I'm using vim as opposed to vi? I've already installed the vim package.
I have set nocompatible in my .vimrc but it doesn't seem to do anything.
Mr.Elendig wrote:set your TERM to rxvt-256color, make sure vim is not in compatible mode (and that you are actually using vim and not vi)
My term vairable is already set to rxvt-unicode.
Set it to 'rxvt-256color'
Offline
Still no luck.
I did export TERM=rxvt-256color then echo $TERM to make sure it was set properly. However, the results are still the same.
Offline
I already have that set.
This is my .vimrc
filetype plugin indent on
syntax on
set nocompatible
set number
set autoindent
set smartindent
set tabstop=4
set shiftwidth=4
set showmatch
set guioptions-=m
set guioptions-=T
set vb t_vb=
set ruler
set incsearch
colorscheme soruby
set guifont=ProFont\ 7
set grepprg=grep\ -nH\ $*
let g:tex_flavor='latex'
let g:Tex_MultipleCompileFormats = "pdf"
set runtimepath=~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after
set vb t_vb=
I've removed the mappings for the arrows keys since they don't seem to work.
Offline
I'm convinced that there is something wrong with my vim installation on my machine...
I sshed to a remote server, checked that my $TERM was set to rxvt-unicode, started vim with no .vimrc and everything was fine.
Any idea what's wrong with my local installation of vim?
Offline
I've exactly the same problem. "set nocompatible" is set in .vimrc , but I still get ABCD when pressing the arrowkeys.
Offline
To test try:
$ vim -u NONE
If it still doesn't work try testing with a differnet terminal program (eg xterm).
Offline