You are not logged in.

#1 2016-03-09 19:43:43

obi
Member
Registered: 2016-03-06
Posts: 9

Vim Urxvt arrowkey-problem

Hi, I am having a problem with my vim. When I switch to insert mode and use my arrow keys, vim will just insert  A, B, C, or D and a newline. This has nothing to do with my config, as I already tried running a freshly installed vim without a .vimrc-file and ran into the same problem. Strangely, everything works just fine when I run vim with root privileges. Also, vim only behaves like this if its executed in urxvt. When i run vim using the gnome-terminal for instance, it works fine, regardless of the user privileges.

Last edited by obi (2016-03-09 19:54:17)

Offline

#2 2016-03-09 20:01:33

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Vim Urxvt arrowkey-problem

That's normal behaviour for legacy vi on Unix systems. I don't know if I've ever seen it in vi on Arch, but I'm sure I've never seen it in vim. So for starters, are you sure you're running vim and not vi?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2016-03-09 21:28:33

obi
Member
Registered: 2016-03-06
Posts: 9

Re: Vim Urxvt arrowkey-problem

Yes, I am 100% sure, because vi is not even installed on my system. I'm also using the newest version of vim.

Offline

#4 2016-03-09 21:43:23

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Vim Urxvt arrowkey-problem

Please paste your .vimrc


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2016-03-09 21:43:56

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Vim Urxvt arrowkey-problem

Yeah, I didn't see your edit before posting; that pretty much ruled out my suspicion.

Is there anything in the environment related to terminal that changes when sudo is used: 'env' vs 'sudo env' ?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#6 2016-03-09 21:49:13

obi
Member
Registered: 2016-03-06
Posts: 9

Re: Vim Urxvt arrowkey-problem

Here's my .vimrc:

set nocompatible

"---Visuals---

syntax enable

set background=dark
colorscheme default

set encoding=utf8

set t_Co=256

set showmatch
set mat=2

set number

"---Text & Indents---

set expandtab
set smarttab
set ai
set si

set shiftwidth=4
set tabstop=4

"---Filetypes---

filetype on
au BufNewFile,BufRead *.rs set filetype=rust

Offline

#7 2016-03-09 21:49:59

bstaletic
Member
Registered: 2014-02-02
Posts: 658

Re: Vim Urxvt arrowkey-problem

This sounds to me like you've set compat in your .vimrc.

Offline

#8 2016-03-09 21:54:07

obi
Member
Registered: 2016-03-06
Posts: 9

Re: Vim Urxvt arrowkey-problem

alphaniner wrote:

Is there anything in the environment related to terminal that changes when sudo is used: 'env' vs 'sudo env' ?

No, I don't think so.

Offline

#9 2016-03-09 21:59:48

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Vim Urxvt arrowkey-problem

bstaletic wrote:

This sounds to me like you've set compat in your .vimrc.

This was my thought (and what it defaults to without a config); but OP has edited their first post to say it works fine in other terminals, just not in Urxvt.

What is the value of $TERM in urxvt?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2016-03-09 22:04:05

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Vim Urxvt arrowkey-problem

Also, OP originally said he tried without .vimrc...


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#11 2016-03-09 22:12:24

obi
Member
Registered: 2016-03-06
Posts: 9

Re: Vim Urxvt arrowkey-problem

Hah, that solved my problem, ty guys.
I have just set TERM to 'xterm-256color', and works.

Offline

#12 2016-03-09 22:14:45

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Vim Urxvt arrowkey-problem

Don't set your TERM: it will just break more things... Your terminal should be able to pick up the appropriate terminfo, unless you have forced it somwehere in your shell initialisation files.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

Board footer

Powered by FluxBB