Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
out of nowhere my copying and pasting doesnt work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
picarica
Apprentice
Apprentice


Joined: 11 Aug 2018
Posts: 189

PostPosted: Tue Aug 06, 2019 12:50 am    Post subject: out of nowhere my copying and pasting doesnt work Reply with quote

so ill post a little video to show what is wrong thi happend suddenly and i cannot fix it, i think it happend after i installed xclip.

so what isnt working
    select to copy
    pasting using middle mouse button
    something i forgot


here is video for download

wathch online at gyfcat
Back to top
View user's profile Send private message
calavicci
n00b
n00b


Joined: 28 Mar 2006
Posts: 49

PostPosted: Tue Aug 06, 2019 5:08 pm    Post subject: Reply with quote

There are two different problems you're having.

First, the missing "I" is because you're not accounting for vi. Vi doesn't know about any clipboard mechanism - it's designed for the console. When you try to paste, you're just sending vi all the keystrokes of the characters in the copied content. The "I" tells vi to enter insert mode, not to put an "I" in the buffer. Since it's therefore then in insert mode, all the rest appears as expected. You might try gvim instead if you really want a vi that behaves in (somewhat) X-typical ways; if that still doesn't make sense, try gedit.

Second, the spacing is wrong because vi doesn't know that you aren't just typing into it. It's got an automatic spacing plugin. Try ":set noautoindent" and ":set nosmartindent" before pasting.

Additionally, note that "highlight to select/middle mouse to paste" is an X mechanism, while "Ctrl+C to select/Ctrl+V to paste" is a separate mechanism provided by your toolkit or some other part of your DE.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14972

PostPosted: Wed Aug 07, 2019 1:54 am    Post subject: Reply with quote

calavicci wrote:
First, the missing "I" is because you're not accounting for vi. Vi doesn't know about any clipboard mechanism - it's designed for the console.
That's only partially correct. Modern Vim knows how to interact with the X server, even in console mode. However, the user must take care to tell Vim to load the contents of the X clipboard, not to tell the terminal to use the clipboard. Primary is available as the register *; clipboard is available as the register +. With the right compile options and configuration, Vim running in a terminal can still be an X client and access the clipboard directly. This also enables you to copy text from Vim into the X clipboard, even when the presentation in your terminal is suboptimal (for example, if you had wrap off, or showbreak on).
calavicci wrote:
Second, the spacing is wrong because vi doesn't know that you aren't just typing into it. It's got an automatic spacing plugin. Try ":set noautoindent" and ":set nosmartindent" before pasting.
Why not use :set paste, which is specifically designed and documented for this purpose? It resets more options than you describe, and it knows how to revert them when you :set nopaste later.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments 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