The easiest way would be to install the gvim package, which has support for clipboard functionality. Your ~/.vimrc file will work for gvim also.
During the installation you’ll be asked to remove vim, since the two packages conflict with each other.
After installing gvim you’ll notice that vim --version | grep -i "clipboard" will mark clipboard and xterm_clipboard as present.
After that, you can use "+y to copy (while in Visual mode) from Vim to the clipboard and "+p for pasting to Vim from the clipboard.
To make it easier, you can create key bindings for copying/pasting to/from clipboard in your ~/.vimrc file. Something like that for example:
noremap <C-c> "+y
noremap <C-v> "+p
(you can use whatever keybindings you like better in your config file)
Error detected while processing /home/firestar/.vimrc:
line 26:
E492: Not an editor command: clipboard+=unnamedplus
Press ENTER or type command to continue
If you are using native vim and create new file ~/.vimrc without editing, then it works with copy to KDE clipboard by pressing Ctrl + Shift + c . But it broke or disable highlight, syntax and other many features.
If you need syntax and highlight, the file .vimrc adds:
syntax on
colo elflord
But other many features are missing, not good idea.
Enable visual mouse to select text, but it broke copy to clipboard.