LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-22-2020, 12:18 AM   #1
Ghost-Order
Member
 
Registered: Jan 2020
Distribution: Arch Linux
Posts: 52

Rep: Reputation: Disabled
Copy from vim and pasting to another application


I already did my search and found 2 possible solutions that unfortunately didn't work for me.

In this video the guy solves the problem installing gvim, but when I try to do that, my terminal says to me that vim is in conflict with gvim, so I just can have either vim or gvim and I would like to continue using just vim.

This is the output:

Code:
looking for conflicting packages...
:: gvim and vim are in conflict (vim-minimal). Remove vim? [y/N]
I also found another possible solution in this Stack Overflow question, unfortunately the accepted answer doesn't work for me, or maybe I didn't understand well how I should do it.

From what I understood:
1- Enter in visual selection mode and select the text you want.
2- Press "
3- Press either * or +
4- Press y

Vim recognizes the " command but no the + or * command, so as soon as I press * or + vim stops the ... command chain? (sorry I don't know what word I could use here lol).

By "recognizing" I mean that near the bottom right corner vim shows the command that was typed.

PD: I use Manjaro, the vim I installed was from my distro repo.

Last edited by Ghost-Order; 07-22-2020 at 12:20 AM.
 
Old 07-22-2020, 01:26 AM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,763

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Copy...highlight what you want to copy with the mouse
Paste into another application...either click on middle mouse or ctrl+v Either should work, but which depends on the app.
 
1 members found this post helpful.
Old 07-22-2020, 01:41 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,109

Rep: Reputation: 7367Reputation: 7367Reputation: 7367Reputation: 7367Reputation: 7367Reputation: 7367Reputation: 7367Reputation: 7367Reputation: 7367Reputation: 7367Reputation: 7367
when you install gvim you will have vim too, so you can safely remove that standalone vim (and also you can reinstall it if you really need that).
As it was stated you have vim-minimal installed currently which explains that behavior.
 
2 members found this post helpful.
Old 07-22-2020, 07:20 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,688

Rep: Reputation: Disabled
Quote:
Originally Posted by Ghost-Order View Post
1- Enter in visual selection mode and select the text you want.
2- Press "
3- Press either * or +
4- Press y
Yep. For me, this works in Neovim, but not in Vim.
Code:
$ vim -e --cmd 'ec has("clipboard")|q'
0
$ vim --version|grep -w clipboard
-clipboard         +keymap            +printer           +vertsplit
OTOH, it works if I invoke Vim as vimx (Fedora/RHEL/CentOS-specific quirk):
Code:
$ vimx -e --cmd 'ec has("clipboard")|q'
1
$ vimx --version|grep -w clipboard
+clipboard         +jumplist          +popupwin          +user_commands
Instead of clipboard feature as compiling option, Neovim uses external clipboard providers if available. And I have many:
Code:
$ rpm -qa wl-\* tmux xclip xsel
tmux-2.7-1.el8.x86_64
xclip-0.13-9.0.20191017.8d10aec.sero1.el8.x86_64
wl-clipboard-2.0.0-2.el8.x86_64
xsel-1.2.0-26.el8.x86_64
For details, see this answer.

But I prefer using terminal facilities for this, anyway. Depending on the terminal, this may be Ctrl+Shift+C/Ctrl+Shift+V (Alacritty), or Ctrl+Ins/Shift+Ins (URxvt), or both (gnome-terminal, xfce4-terminal). PuTTY/Pterm can be set to either.

Last edited by shruggy; 07-22-2020 at 07:46 AM.
 
Old 07-22-2020, 07:57 AM   #5
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,885
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Quote:
Originally Posted by scasey View Post
Copy...highlight what you want to copy with the mouse
Paste into another application...either click on middle mouse or ctrl+v Either should work, but which depends on the app.
This was my thinking. Well, mine was more "What's wrong with the old 'Highlight, copy, paste'?"

But that is truly a follow-up here. Which is whether or not that option was tried, and whether or not it was evaluated as unacceptable for some reason?
 
Old 07-22-2020, 10:31 AM   #6
Ghost-Order
Member
 
Registered: Jan 2020
Distribution: Arch Linux
Posts: 52

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
Copy...highlight what you want to copy with the mouse
Paste into another application...either click on middle mouse or ctrl+v Either should work, but which depends on the app.
It doesn't work for me, as soon as I start highlighting vim enters in visual selection mode, so I select the text I want then try to paste it to firefox for instance and it doesn't work.

Quote:
Originally Posted by pan64 View Post
when you install gvim you will have vim too, so you can safely remove that standalone vim (and also you can reinstall it if you really need that).
As it was stated you have vim-minimal installed currently which explains that behavior.
I didn't knew about that, thank you. Now I can just remap the "+y or "*y commands to a more friendly and quickly key combination.
 
  


Reply

Tags
vim



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] Fedora shows 'man vim' but when execute 'vim' got "bash: vim: command not found..." ? flash_os Linux - Newbie 19 01-03-2015 11:56 PM
Copying and pasting from web to vim changes some characters to periods szboardstretcher Linux - Software 1 07-03-2013 03:53 PM
Switching from vim to vim -g from inside vim iDragoon Linux - Software 4 05-15-2009 11:46 AM
Editor comparison: vim VS vim-lite, Cleaning vim Ruler2112 *BSD 4 04-13-2009 04:26 PM
copy pasting from X app to vim Furlinastis Linux - General 3 12-05-2005 09:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:24 PM.

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