Results 1 to 10 of 10

Thread: VIM with no clipboard support

  1. #1

    Default VIM with no clipboard support

    Hello everyone,

    I'm working only with VIM and I would like to have clipboard support included which I can get to work.

    My machine is set upped with GNOME - 3.20.2,
    and below are all the packages I have installed for VIM:

    Code:
    dev:~ # rpm -qa | grep vim
    vim-data-7.4.326-12.1.noarch
    vim-7.4.326-12.1.x86_64
    So what else I need to get clipboard support for VIM on openSUSE ?

    Code:
    dev:~ # vim --version | grep clipboard
    -clipboard       +iconv           +path_extra      -toolbar
    +eval            +mouse_dec       +startuptime     -xterm_clipboard

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,875
    Blog Entries
    3

    Default Re: VIM with no clipboard support

    Quote Originally Posted by davidlubomirov View Post
    I'm working only with VIM and I would like to have clipboard support included which I can get to work.
    I'm not sure what you are expecting.

    It is working fine for me. But, as far as I know, it is "xterm" or "konsole" that is handling the clipboard, and "vim" is running only as a command line application. There is also a "gvim" that you can install, if you want a GUI interface version of "vim".
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  3. #3
    Join Date
    Apr 2015
    Location
    Singapore
    Posts
    20

    Default Re: VIM with no clipboard support

    Quote Originally Posted by davidlubomirov View Post
    Hello everyone,

    I'm working only with VIM and I would like to have clipboard support included which I can get to work.

    My machine is set upped with GNOME - 3.20.2,
    and below are all the packages I have installed for VIM:

    Code:
    dev:~ # rpm -qa | grep vim
    vim-data-7.4.326-12.1.noarch
    vim-7.4.326-12.1.x86_64
    So what else I need to get clipboard support for VIM on openSUSE ?

    Code:
    dev:~ # vim --version | grep clipboard
    -clipboard       +iconv           +path_extra      -toolbar
    +eval            +mouse_dec       +startuptime     -xterm_clipboard
    In vim you can use the visual mode to select what you need to copy than you can paste in either insert or normal mode. This is working within vim. If you need vim to handle the global clipboard, well that is a different story. Would recommend checking out xclip or just use the mouse to copy from vim (might need to disable the mouse tho first) and rely on the terminal emulator to paste in vim (ctrl+shift+v in most cases).
    For a start take a look at this: http://vim.wikia.com/wiki/Copy,_cut_and_paste

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,461
    Blog Entries
    2

    Default Re: VIM with no clipboard support

    There may be a solution I'm not aware of,
    I've only found that VIM has its own internal clipboard (which among other things supports "visual mode") but does not support the general "Shared clipboard" which would enable copy/pasting from and to other applications.

    So,
    I keep that in mind whether to use VIM in the first place or whether I should launch some other text editor.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,875
    Blog Entries
    3

    Default Re: VIM with no clipboard support

    Quote Originally Posted by tsu2 View Post
    I've only found that VIM has its own internal clipboard (which among other things supports "visual mode") but does not support the general "Shared clipboard" which would enable copy/pasting from and to other applications.
    I am often copying/pasting between vim and other applications. The terminal emulator handles the "Shared clipboard".
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  6. #6

    Default Re: VIM with no clipboard support

    Quote Originally Posted by nrickert View Post
    I am often copying/pasting between vim and other applications. The terminal emulator handles the "Shared clipboard".
    Sure.
    But AFAIK vim does have some X11 clipboard support built in as well.
    It's disabled in (open)SUSE though:
    Code:
    * Wed Jul 09 2014 kukuk@suse.de
    
    - Don't link non-gui version against X11, we don't need it [bnc#886237]
    (I don't have permissions to view the mentioned bug report though)

    And the Factory/Tumbleweed package has this additional entry:
    Code:
    * Sat Mar 11 2017 - kukuk@suse.de
     
    - Build default vim without X11 support, use update-alternatives
       to prefer gvim if installed for X11 support.

    Last edited by wolfi323; 07-Feb-2018 at 01:27.

  7. #7
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,461
    Blog Entries
    2

    Default Re: VIM with no clipboard support

    Interesting to know about the update-alternatives to re-direct to gvim,
    But I doubt that anyone talking about vim ordinarily thinks of gvim... People use vim for its use in a text console.

    Lack of support for the shared clipboard has existed for as long as I've ever used vim in openSUSE
    (@nrickert, not sure what you're looking at, I've never been able to do what you're describing. As long as the text is not within vim, I've also been able to use the enhanced console features of openSUSE, but not within vim)
    If I catch myself within vim and need to import text, I normally save the file, then open the file in some other text editor to paste, then if I still want to use vim then re-open in vim.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  8. #8
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,875
    Blog Entries
    3

    Default Re: VIM with no clipboard support

    Quote Originally Posted by tsu2 View Post
    (@nrickert, not sure what you're looking at, I've never been able to do what you're describing. As long as the text is not within vim, I've also been able to use the enhanced console features of openSUSE, but not within vim)
    For example, yesterday I added a comment to a bug report. I keep a list of bug reports that I have commented on. So I copied the bug number and description in bugzilla, then pasted them into the file with "vi" (really "vim") running in an "xterm".

    Sometimes I have to use the "klipper" (in the tray) to make that available for pasting with xterm.
    openSUSE Leap 15.1; KDE Plasma 5;
    testing Leap 15.2Alpha

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,461
    Blog Entries
    2

    Default Re: VIM with no clipboard support

    Quote Originally Posted by nrickert View Post
    For example, yesterday I added a comment to a bug report. I keep a list of bug reports that I have commented on. So I copied the bug number and description in bugzilla, then pasted them into the file with "vi" (really "vim") running in an "xterm".

    Sometimes I have to use the "klipper" (in the tray) to make that available for pasting with xterm.
    OK,
    I was able to do what you described...
    Instead of using vim commands to copy/paste(as described, they work only within vim), use the console menu "Edit" commands.
    So, this is possible only in a windowed console enhanced by openSUSE(typically every console except for xterm).

    Learned something new today...

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10

    Default Re: VIM with no clipboard support

    Quote Originally Posted by tsu2 View Post
    Interesting to know about the update-alternatives to re-direct to gvim,
    But I doubt that anyone talking about vim ordinarily thinks of gvim... People use vim for its use in a text console.
    Right, and that's probably the reason why X11 support for the normal vim is disabled in (open)SUSE.
    Otherwise it would pull in the X11 libraries also on a text mode installation e.g., I think...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •