I am using Ubuntu 12.04 Beta and Vim that has come with it. I am trying to use Vim to copy the content of a text file to Chrome browser.
I have tried +
, *
You can do it; just pipe to xclip.
gg
V
G
:'<,'>w !xclip
from here: in vim with xclip, yank to clipboard
I would open the file in the browser using a file URL:
file:///home/dave/some-file
Not super elegant but it works.
If you have run configure
as explained by @DrAl but you still can't get the GUI compiled in and you see this in the output of your ./configure
checking for X... (cached) no
Then you may have to delete the cache file that configure
created.
find . -name config.cache -delete
Then re-run configure
and make
and check src/vim --version
again - it should show that gui is included now.
I really enjoy this set of shortcuts:
" Add shortcut for clipboard registers
noremap <leader>p "*p
noremap <leader>y "+y
noremap <leader>d "+d
It is just an easier way then type "* and "+ every time.
You can also add shortcuts to your vimrc
# Copy and paste
vmap <C-c> "+yi
vmap <C-x> "+c
vmap <C-v> c<ESC>"+p
imap <C-v> <ESC>"+pa
It will allow you to Copy by Ctrl + C and Paste by Ctrl + V
Install the package vim-gnome
instead of vim
. It comes with clipboard
enabled.