update 2020-10: with vim 8.1 copy and paste to and from system-clipboard seems to work

  1. select the text with the mouse
  2. Ctrl+Shift+C to copy from vim 8.1 into system clipboard
  3. switch over to other application
  4. Ctrl+V or middle mouse button to insert

tested under:

hostnamectl; # what system?
   Static hostname: giada
         Icon name: computer-desktop
           Chassis: desktop
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 4.19.0-10-amd64
      Architecture: x86-64

vim --version; # what vim version?
VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 15 2019 16:41:15)
Included patches: 1-875, 878, 884, 948, 1046, 1365-1368, 1382, 1401
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version with GTK3 GUI.  Features included (+) or not (-):

if that does not work

the user might have installed an older version of vim.

vim is an excellent very powerful editor that can handle documents of 100.000 lines and more. hint: vim does not have PER DEFAULT access to system clipboard (for whatever reason not enabled per default) two options:

    • install gvim
    • recompile vim

about clipboard registers: there are many more than just one (basically as many as user’s keyboard has chars 🙂 the system clipboard in vim is represented by + (plus) register this is “the one” register that is also used by other gui applications like pluma (very nice text editor as well)

alternative: install gvim

hostnamectl|tail -n 3; # tested on +MATE Desktop
  Operating System: Debian GNU/Linux 9 (stretch)
            Kernel: Linux 4.9.0-13-amd64
      Architecture: x86-64

su - root;
apt update;
apt install gvim;
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package gvim is a virtual package provided by:
  vim-gtk3 2:8.0.0197-4+deb9u3
  vim-gtk 2:8.0.0197-4+deb9u3
  vim-athena 2:8.0.0197-4+deb9u3
You should explicitly select one to install.

apt install vim-gtk3;

in gvim this works as well as expected:

  1. open file
  2. mouse highlight text
  3. go to menu and select “copy”

nice 🙂

colorize: to get the nice black background go:

[ESC]
:colorscheme torte
[ENTER]
# or (save settings permanent)
# white text on black background
echo "colorscheme torte" >> ~/.vimrc

# green text on black background
echo "colorscheme elflord" >> ~/.vimrc

# and restart vim or gvim

excellent video: here is A SUPBER VIDEO explaining copy and pasting outside of vim 🙂 THANKS! WELL DONE!

vim performance compared to other editors:

the onemillionlines.txt text editor benchmark:

let’s generate some very large text files

# generate a file with 1 million lines of text
# and messure the time it takes for the computer to generate those lines
time for i in $(seq 1 1000000); do echo "generating line number $i"; echo "$i another line to test if the editor can handle it" >> onemillionlines.txt; done

took lenovo t440 laptop with i5 and ssd:

generating line number 999996
generating line number 999997
generating line number 999998
generating line number 999999
generating line number 1000000

real	0m27.398s
user	0m19.728s
sys	0m7.492s

half a minute to generate this file

then for some reason it generates 1 million and 1 line

wc -l onemillionlines.txt; # count line numbers in file
1000001 temp.txt

du -hs onemillionlines.txt; # file size
54M	temp.txt; # 54MBytes

not exactly 1 million

now try to open that file with one’s favorite text editor and see if it “folds” (if it gives up and crashes)

or if not: how long it takes to digest that massive file

in vim it takes 3 seconds to open that file

vim v8: one million lines? yes even without breaking a sweat

pluma: folds after around 500.000 lines “blackout”

all recordings made with very excellent https://www.maartenbaert.be/simplescreenrecorder/

LibreOffice Writer 5.2 (Java)?

no way.

loading is slow.

editing the file is unusable slow X-D

what is it?

apt show vim-gtk3

Package: vim-gtk3
Version: 2:8.0.0197-4+deb9u3
Priority: extra
Section: editors
Source: vim
Maintainer: Debian Vim Maintainers <pkg-vim-maintainers ÄT lists PUNKT alioth PUNKT debian PUNKT org>
Installed-Size: 3,047 kB
Provides: editor, gvim, vim, vim-lua, vim-perl, vim-python, vim-ruby, vim-tcl
Depends: vim-common (= 2:8.0.0197-4+deb9u3), vim-gui-common (= 2:8.0.0197-4+deb9u3), vim-runtime (= 2:8.0.0197-4+deb9u3), libacl1 (>= 2.2.51-8), libc6 (>= 2.15), libcairo2 (>= 1.4.10), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.37.3), libgpm2 (>= 1.20.4), libgtk-3-0 (>= 3.21.5), libice6 (>= 1:1.0.0), liblua5.2-0, libpango-1.0-0 (>= 1.37.5), libpangocairo-1.0-0 (>= 1.14.0), libperl5.24 (>= 5.24.0), libpython3.5 (>= 3.5.0~b1), libruby2.3 (>= 2.3.0~preview2), libselinux1 (>= 1.32), libsm6, libtcl8.6 (>= 8.6.0), libtinfo5 (>= 6), libx11-6, libxt6
Suggests: cscope, fonts-dejavu, gnome-icon-theme, vim-doc
Homepage: http://www.vim.org/
Tag: uitoolkit::gtk
Download-Size: 1,264 kB
APT-Manual-Installed: yes
APT-Sources: https://ftp.halifax.rwth-aachen.de/debian stretch/main amd64 Packages
Description:

Vi IMproved - enhanced vi editor - with GTK3 GUI

 Vim is an almost compatible version of the UNIX editor Vi.
 .
 Many new features have been added:
- multi level undo
- syntax  highlighting
- command line history
- on-line help
- filename completion
- block operations
- folding
- Unicode support, etc.

 This package contains a version of vim compiled with a GTK3 GUI
 and support for scripting with Lua, Perl, Python, Ruby, and Tcl.

What are the differences between the vim versions?

“Including the

vim

package, there appear to be at least six “vim-variants” (not including available documentation, or plugin packages) as well as the main

vim

package in both the

main

and

universe

repositories.

Below is a brief summary of each (links go to package description and dependencies in Ubuntu LTS release 16.04 “Xenial”):

  • vimVim compiled and set up with a rather standard set of features. This package does not provide a GUI version of Vim or scripting language support. See the other vim-* packages if you need more (or less).In order to install this package, run
    sudo apt-get install vim
  • jvim-cannaJapanized VIM (Canna version)This package allows the entering of Kanji from the console.In order to install this package, run
    sudo apt-get install jvim-canna

    Depends upon the

    libcanna1g

    libraryDoes not appear to support Perl, Python, Ruby, or TCL scripting.

  • vim-athena – enhanced vi editor – compiled with an Athena GUIThis package is compiled with the Athena GUI as opposed to GTK+ or Gnome.See this askubuntu answer for additional details.In order to install this package, run
    sudo apt-get install vim-athena

    Supports Perl, Python, Ruby, and TCL scripting.

  • vim-gnome/vim-gtk3 – enhanced vi editor – compiled with a GNOME GUI (GTK2 before 17.10, GTK3 from 17.10)In order to install this package, run
    sudo apt-get install vim-gnome

    Depends upon the

    libgnome2

    librarySupports Perl, Python, Ruby, and TCL scripting.

  • vim-gtk – enhanced vi editor – compiled with the GTK2 GUIUsed in KDE/Kubuntu-like environmentsIn order to install this package, run
    sudo apt-get install vim-gtk

    Supports Perl, Python, Ruby, and TCL scripting.

  • vim-nox – enhanced vi editorLike vim-tiny, vim-nox is a minimal vim installation and does not have a GUI. It comes with mouse support, but no clipboard support, IIRC.In order to install this package, run
    sudo apt-get install vim-nox

    Supports Perl, Python, Ruby, and TCL scripting.

  • vim-tiny – enhanced vi editor – compact versionvim-tiny is included as the default vim on Ubuntu distributions and comes with many optional features disabled(e.g. multi-level undo).See this askubuntu answer for details on its feature set(or lack thereof).In order to install this package, run
    sudo apt-get install vim-tiny

    Does not support Perl, Python, Ruby, or TCL scripting.As close to being vi without being vi.


Locally, to see which features are supported in a particular installed vim package, running the following command:

vim --version

will provide a list of features included(or excluded) in the particular package.”

src: https://askubuntu.com/a/281972

thanks all involved

admin