Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Vim arrow keys and key repeat on new install
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
alienjon
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1709

PostPosted: Fri Jan 13, 2017 11:02 pm    Post subject: Vim arrow keys and key repeat on new install Reply with quote

I'm working in a new Gentoo install on a home server I built a few days ago. I installed Vim and found 2 oddities (at least compared to what I'm used to) with some default settings.

Firstly, I found that the arrow keys are producing the letters A, B, C, and D. A google search found that setting the following in the configuration should fix the issue:
/etc/vim/vimrc:
set nocompatible


Interestingly I found that this option was already set in vimrc, though the behavior was still occurring. I then realized that the results from Google mentioned adding this on a per-user basis. I created a .vimrc (for my root account, as I'm making edits to system files for the post-install) and added this line to it (it's the only line in it) and now the arrow keys work as expected. I'd MUCH rather this be set system wide, but my best guess is that something farther down in the Vim load process is resetting this option. I'm thinking of moving the line to the bottom of the conf, but wasn't sure if it would be fighting another setting and wanted to ask for any thoughts on a 'correct fix'.

The second issue is that there isn't any key repeat that appears to be enabled in Vim. I. E. Pressing and holding a key does not result in that key being repeated over and over until the key is released (particularly frustrating for the arrow keys). Unfortunately, I can't seem to find anything online about this particular problems (noted results are about repeating commands/functions in Vim or changing system wide key repeats (which works fine: I. E. In Bash).
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21724

PostPosted: Sat Jan 14, 2017 4:01 am    Post subject: Reply with quote

What is the output of emerge --pretend --verbose app-editors/{g,}vim? According to :help compatible, the mere presence of a user-private vimrc implies nocompatible. I have had per-user vimrc for useful purposes (tabstop, shiftwidth, personal mappings, etc.) for so long that I never needed to set nocompatible explicitly.

How are you calling Vim? What name are you using and what, if any, options are passed to it (including any from aliases)?
Back to top
View user's profile Send private message
alienjon
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1709

PostPosted: Sat Jan 14, 2017 9:45 pm    Post subject: Reply with quote

As a server build I don't have X installed, so I only have vim installed:
emerge -pv app-editors/vim:
[ebuild   R    ] app-editors/vim-8.0.0106::gentoo  USE="acl nls -X -cscope -debug -gpm -lua -luajit -minimal -perl -python -racket -ruby (-selinux) -tcl -vim-pager" PYTHON_TARGETS="python2_7 python3_4 (-python3_5)" 0 KiB


I do have an update, though. I discovered that my problem is likely not my vim setup and instead what I'm using to connect to the computer. With the server already setup I am ssh'ing into the computer from a desktop and my iPad. The problem turns out to only be when I use my iPad and not the Cygwin prompt or Putty from the desktop (I'm using Windows 10 there). I'm using an app called Reflection to log in. There are some settings (to configure the type of terminal) but I'm not sure what could be causing the behavior. I'll see if there are other apps I could try.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 21724

PostPosted: Sat Jan 14, 2017 10:13 pm    Post subject: Reply with quote

If your iPad app is setting some strange terminal type, that could cause all sorts of interesting problems. I would suggest debugging first with standard ssh, but since it works correctly even from Windows 10 using the Cygwin tools, that strongly suggests the iPad app is at fault. At the very least, it is confusing Vim into operating incorrectly. At worst, it is producing incorrect results on its own. Does the problem go away if you use a real keyboard?
Back to top
View user's profile Send private message
alienjon
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1709

PostPosted: Sat Jan 14, 2017 10:41 pm    Post subject: Reply with quote

I actually have a case w/ attached keyboard that I use vs. the software one built into the iPad. Given, this may still be causing something strange to happen (though key repeat works fine outside of Vim, such as in bash). I may try messing with the internal 'terminal type' (options include: VT{52, 102, *400-7, 400-8) or 'terminal ID' (options include: WRQ, VT{100, 101, 102, *220, 320, 420}. *=default option, I haven't messed around with the settings much, yet.

I'll play with those options and try another app, if I can.
Back to top
View user's profile Send private message
alienjon
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1709

PostPosted: Sun Jan 15, 2017 1:16 am    Post subject: Reply with quote

I tried each of the options I listed before (thought not every possible combination) and found that none of them made any difference (though I did find that key repeat works for the arrow keys, but not the letters). I tried a two other apps and found that one (Terminus) worked the same as the one I have been using (Reflection) in that the repeating didn't occur (the arrow keys still work - even the user account, which doesn't have the custom .vimrc). One other app, however (vSSH Lite) is working correctly. (Though, as the name implies, it's the only one of the 3 to be a free app that also has ads in it, unless you pay for the 'pro' version).

This is telling me that it likely is a settings issue somwhere in the app (though nothing that seems obvious to change).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum