Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

scrolling with a wheel mouse in vim

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
curmudgeon
Veteran
Veteran
Posts: 1746
Joined: Fri Aug 08, 2003 1:39 pm

scrolling with a wheel mouse in vim

  • Quote

Post by curmudgeon » Thu Jan 12, 2012 2:25 pm

When in vim, the wheel on the whieel mouse moves three lines at a time. Is there any way to change that to one line. Yes, I read this (and tried the suggestions), but nothing changed: http://vimdoc.sourceforge.net/htmldoc/scroll.html

This machine has kde, and I have have used system settings to change it so that konsole only scrolls one line at a time. Although when there is no scroll bar, the wheel mouse acts as up and down arrows displaying the command history - is there some way to get that even when there is a scroll bar? I have tried shift, ctrl, and alt, but none of those work.
Top
katfish
Tux's lil' helper
Tux's lil' helper
Posts: 147
Joined: Mon Nov 14, 2011 1:14 am

Re: scrolling with a wheel mouse in vim

  • Quote

Post by katfish » Thu Jan 12, 2012 9:38 pm

curmudgeon wrote: This machine has kde, and I have have used system settings to change it so that konsole only scrolls one line at a time. Although when there is no scroll bar, the wheel mouse acts as up and down arrows displaying the command history - is there some way to get that even when there is a scroll bar? I have tried shift, ctrl, and alt, but none of those work.
Have a look at /etc/inputrc - I guess that's a good point to start dealing with your issue.
Top
curmudgeon
Veteran
Veteran
Posts: 1746
Joined: Fri Aug 08, 2003 1:39 pm

Re: scrolling with a wheel mouse in vim

  • Quote

Post by curmudgeon » Thu Jan 12, 2012 10:27 pm

curmudgeon wrote:Have a look at /etc/inputrc - I guess that's a good point to start dealing with your issue.
That is an initialization file for readline (not saying that it can't handle a wheel mouse, but I don't see any indication or documentation that it does).
Top
katfish
Tux's lil' helper
Tux's lil' helper
Posts: 147
Joined: Mon Nov 14, 2011 1:14 am

  • Quote

Post by katfish » Fri Jan 13, 2012 12:01 am

yep, but is wheeling the mouse not almost same as typing pg up/dn on the CLI?
Top
wired_
Retired Dev
Retired Dev
User avatar
Posts: 15
Joined: Fri Feb 13, 2009 7:14 am
Location: Athens, Greece
Contact:
Contact wired_
Website

  • Quote

Post by wired_ » Fri Jan 13, 2012 11:54 am

Your console probably sends three up/down keystrokes to vim when you use the scroll wheel.

What you really want is to enable mouse support in vim, then you'll be able to set the wheel scroll amount to one line.

Put the following in your ~/.vimrc:

Code: Select all

set mouse=a
map <ScrollWheelUp> <C-Y>
map <ScrollWheelDown> <C-E>
This will change other things as well. For example, selecting text will activate and use vim's visual mode (thus ignoring line numbers). Use shift to select text the old way.

http://vimdoc.sourceforge.net/htmldoc/t ... ouse-using
Alex Alexander
wired @ gentoo
stupid _ in forum nick because someone else has wired
Top
curmudgeon
Veteran
Veteran
Posts: 1746
Joined: Fri Aug 08, 2003 1:39 pm

  • Quote

Post by curmudgeon » Sat Jan 14, 2012 8:11 pm

wired_ wrote:Your console probably sends three up/down keystrokes to vim when you use the scroll wheel.
It shouldn't. I have "System Settings / Input Devices / Mouse / Advanced / Mouse wheel scrolls by" set to "1 line."

And the vim documentation says that the default for vim is three lines.
wired_ wrote:What you really want is to enable mouse support in vim, then you'll be able to set the wheel scroll amount to one line.

Put the following in your ~/.vimrc:

Code: Select all

set mouse=a
map <ScrollWheelUp> <C-Y>
map <ScrollWheelDown> <C-E>
Didn't work. It still scrolls by three lines.
wired_ wrote:http://vimdoc.sourceforge.net/htmldoc/t ... ouse-using
Didn't see that before. Seems that there is a lot of documentation (but none of it is working for me).
Top
ppurka
Advocate
Advocate
Posts: 3257
Joined: Sun Dec 26, 2004 5:05 pm

  • Quote

Post by ppurka » Sat Jan 14, 2012 11:37 pm

curmudgeon wrote:
wired_ wrote:What you really want is to enable mouse support in vim, then you'll be able to set the wheel scroll amount to one line.

Put the following in your ~/.vimrc:

Code: Select all

set mouse=a
map <ScrollWheelUp> <C-Y>
map <ScrollWheelDown> <C-E>
Didn't work. It still scrolls by three lines.
wired_ wrote:http://vimdoc.sourceforge.net/htmldoc/t ... ouse-using
Didn't see that before. Seems that there is a lot of documentation (but none of it is working for me).
These map commands work for me. I am using urxvt. So, maybe it is a combination of konsole+vim which is messing things up for you?
emerge --quiet redefined | E17 vids: I, II | Now using kde5 | e is unstable :-/
Top
Post Reply

7 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic