Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 09-29-2010, 10:36 AM   #1
LQ Newbie
Registered: Oct 2008
Posts: 18

Rep: Reputation: 0
Question vim: How to configure to use the mouse, AND to copy and paste


I have questions regarding vim and how to enable the mouse in it. There were some other threads about that issue, but I could not find a solution for my problem.

I would like to have the following actions enabled in vim:

1. To go to some place, I click the left mouse key
2. To copy text TO the vim editor, I mark the text first in some other window (browser, emacs, xterm) and then I middle-click (or shift-middle click).
3. To copy text FROM the vim editor, I select the text (left-click, hold down, select text, release left button) and then paste the text to somewhere else via the middle button
4. The same as (3) but TO the vim editor itself.

I have the following content of my .vimrc:

:set number
:set mouse=r
:set selectmode+=mouse
:behave xterm

With that configuration, the points 2-4 are working.
When I change mouse=r to mouse=a, then 1 AND 3 is working, where I have to press the shift key in addition to press the middle mouse button.

My question: How to enable all pieces 1-4, and at best without having the shift-key pressed down to be able to paste text? How should my .vimrc look like?


P.S. emacs is not a solution since I am working remotely over a large distance and the network is not suitable to have an emacs session opened at the remote pc.
Old 09-29-2010, 10:54 AM   #2
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
try a and r option it might help you.

:set mouse=ar
Old 09-30-2010, 03:35 AM   #3
LQ Newbie
Registered: Oct 2008
Posts: 18

Original Poster
Rep: Reputation: 0

your suggestion does not work. I have now the following .vimrc:

:set number
:set mouse=ar
:set selectmode+=mouse

and it looks that only point (1) of my list does work. I cannot copy text from/to the vim editor.

Any other ideas I can try?



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Can't copy-paste from one terminal to another using vim cola Slackware 11 12-18-2009 11:51 PM
copy-paste in vim proNick Linux - Newbie 5 02-17-2008 08:29 PM
How to copy paste into VIM ? EAD Linux - Software 15 12-12-2006 07:38 PM
Buggy copy n paste with vim in terminal Kovacs Slackware 1 09-05-2006 01:13 AM
cygwin vim copy/paste problem takahaya Linux - Software 2 03-31-2006 02:16 AM

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration