Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Can't select text in terminal after Stretch upgraded VIM 8

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
leveret
Posts: 9
Joined: 2017-06-26 10:56

Can't select text in terminal after Stretch upgraded VIM 8

#1 Post by leveret »

I recently upgraded to Debian 9 Stretch. It includes VIM 8.

Previously, I could select text with the mouse and copy and paste it using the terminal application. Now this initiates "visual" mode which I have read the documentation for.

Using the mouse, it selects text using VIM instead of the terminal, and I cannot copy it.

I can't see any way of disengaging this, except recompiling with visual mode disabled.

There must be a way, right?

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Can't select text in terminal after Stretch upgraded VIM

#2 Post by GarryRicketson »

Have you tried reading the manual or anything ?
https://vimhelp.appspot.com/vim_faq.txt.html#faq-15.9
Note that by default, the 'selectmode' option will be set to empty, so that
always visual mode is used.

For more information, read

'selectmode'
Select-mode
:behave

faq-15.10
15.10. How do I visually select the last copy/pasted text?

You can use the '[ and '] marks to visually select the last copy/pasted
text. The '[ mark is set to the beginning of the last changed/yanked text
and the '] mark is set to the end of the last changed/yanked text. To
visually select this block of text use the command '[v']

leveret
Posts: 9
Joined: 2017-06-26 10:56

Re: Can't select text in terminal after Stretch upgraded VIM

#3 Post by leveret »

i have tried many things in the docs. i can move to selectmode for example, but it doesn't change this behaviour.

in further googling, i did just stumble upon 'set mouse=r' which allows copy to work on a selection. though adding this via .vimrc seems to have unintended consequences like turning off colour in vim.

i would really appreciate some guidance on the correct way to deal with this. thanks

to clarify: i just want the behaviour as it was in jessie/vim 7.4

Bulkley
Posts: 6387
Joined: 2006-02-11 18:35
Has thanked: 2 times
Been thanked: 39 times

Re: Can't select text in terminal after Stretch upgraded VIM

#4 Post by Bulkley »

My stretch uses Vim 2:8.0.0197-4. Where did you get "VIM 8"?

What you could do is purge your vim and all its configs and then reinstall vim with

Code: Select all

apt-get install vim
.

leveret
Posts: 9
Joined: 2017-06-26 10:56

Re: Can't select text in terminal after Stretch upgraded VIM

#5 Post by leveret »

Code: Select all

vim is already the newest version (2:8.0.0197-4).

Code: Select all

vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Apr 23 2017 12:10:29)

reinob
Posts: 1198
Joined: 2014-06-30 11:42
Has thanked: 99 times
Been thanked: 47 times

Re: Can't select text in terminal after Stretch upgraded VIM

#6 Post by reinob »

leveret wrote:I recently upgraded to Debian 9 Stretch. It includes VIM 8.

Previously, I could select text with the mouse and copy and paste it using the terminal application. Now this initiates "visual" mode which I have read the documentation for.

Using the mouse, it selects text using VIM instead of the terminal, and I cannot copy it.

I can't see any way of disengaging this, except recompiling with visual mode disabled.

There must be a way, right?
If the program supports mouse (like vim apparently does, I tested it with midnight commander), then you need to press SHIFT in order to bypass it and let the terminal program (I use xfce4-terminal) handle it.

leveret
Posts: 9
Joined: 2017-06-26 10:56

Re: Can't select text in terminal after Stretch upgraded VIM

#7 Post by leveret »

in stretch, VIM 8 uses a new defaults.vim file in /usr/share/vim/vim80/

in this file i commented out the

Code: Select all

set mouse=a
and it had the desired result. i don't run vim heavily customised, so i am happy with this.

Post Reply