Ask Your Question
2

how to add feature to vim?

asked 2014-03-17 13:18:12 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

My vim doesn't have the clipboard feature and so i can't copy to the system's clipboard. how to i add that feature to vim?

edit retag flag offensive close merge delete

Comments

1

do you use shift+insert to paste to the vim ?

sysek gravatar imagesysek ( 2014-03-17 13:41:19 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-03-17 13:48:31 -0500

hmaarrfk gravatar image

updated 2014-03-17 13:51:49 -0500

I think you might want to look into vim-x11, I think that one is compiled with x11 clipboard support.

sudo yum install vim-X11

My .vimrc has this line in it.

set clipboard=unnamedplus " shared system clipboard.

you might also want to try unnamed instead of unnamedplus

I have to say, that it works with certain shells and not others (eg. works well with bash, doesn't work so well with fish).

You might also want to look into paste mode

" <F2>: enter paste mode (while in insert mode) to paste from outside vim safely
noremap <F2> :set invpaste paste?<cr>
set pastetoggle=<F2>
edit flag offensive delete link more

Comments

should i first uninstall vim (sudo yum erase vim)? and will it remove the current vimrc (witch have many custom settings)?

bla bla gravatar imagebla bla ( 2014-03-17 13:54:19 -0500 )edit
1

You should not modify /etc/vimrc - use the personal settings in ~/.vimrc instead. If you modified /etc/vimrc do: yum remove vim-common; yum install vim-common. yum reinstall vim-common won't restore the original `/etc/vimrc due to the fact that %config(noreplace) (see https://ask.fedoraproject.org/en/question/35805/pamdrpmnew-on-first-update/ and http://pkgs.fedoraproject.org/cgit/vim.git/tree/vim.spec ) does not apply to yum reinstall.

marcindulak gravatar imagemarcindulak ( 2014-03-20 11:20:44 -0500 )edit

I don't think there is a package called vim, just install vim-x11. I don't know of a case where yum modifies anything in your home directory. Typically, new versions of software try to retain your configurations and not modify your dot files.

hmaarrfk gravatar imagehmaarrfk ( 2014-03-20 12:08:38 -0500 )edit

@hmaarrfk - have you read my comment above?

marcindulak gravatar imagemarcindulak ( 2014-03-20 13:28:07 -0500 )edit

Maybe, your comment is far more complete than mine.

hmaarrfk gravatar imagehmaarrfk ( 2014-03-21 17:39:16 -0500 )edit
1

I've tried to add the recomended line, but still doesn't work. I've vim-X11 and vim-enhanced installed

set clipboard=unnamedplus " shared system clipboard.

I've also did what is sugested here but still doesn't help

roberto68 gravatar imageroberto68 ( 2015-10-07 06:23:16 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2014-03-17 13:18:12 -0500

Seen: 833 times

Last updated: Oct 07 '15