vim


Vim “yank” does not seem to work


I'm fairly new to Vim. Tonight, I learned about the "yank" command, but when I try to use it in MacVim, it doesn't do anything. Neither Y nor y{motion} do anything. I tried with a default .vimrc to rule out any weird config issues.
Google-fu is failing me. This feels like a noobie issue. Am I missing something obvious?
yank by itself merely copies the line into a clipboard - you will need to paste it onto the next line or onto the Preceding one to use the copied line. To cut the line as well, use delete.
It does not do anything visible - just like Ctrl-C (Edit/Copy) in other editors. Try the command p (paste) after it - that's the equivalent of Ctrl-V - to put what was yanked into the document.
The yank command pulls text into a clipboard. For example yy simply yanks the current line into the common clipboard. You can "paste" the contents of the clipboard with p. You can also yank into named buffers using something like "ayw to yank the text from the current position to the end of the word into a buffer named a. The correspond put is "ap.
If you have the setting set clipboard=unnamedplus in your .vimrc then this will not be working.
For OSX you have to use set clipboard=unnamed
For Linux you will probably need to use set clipboard=unnamedplus
If your using Ubuntu or Mint the only solution that seemed to work for me was to uninstall vim and install the package "vim-gnome" instead. Then adding the line:
set clipboard=unnamedplus
to my .vimrc worked as expected.

Related Links

Is there a way to configure Vim grepprg option to avoid waiting until the external tool has finished searching?
Entering command correctly in visual mode
Activating alternate Diff mode via a function call in Vim/gVim
Vim: Receive char on function to tabularize
vim creates copies of my files after saving?
How do I get a specific file extension to behave as if .html in .vimrc file?
How do I get great auto indenting with Vim and Yaml?
Skip undo step in Vim
Vim autocommand produces E488: Trailing characters
Problem in seaching whole word in Vim (dash character)
Is it possible to have 2 Nerd Trees in same view in vim
VIM: Filename passed to source from within SourcePre autocommand?
Vim show strange  characters over putty
A Stop button in VIM
A tricky VI / VIM remapping question
Vim Textmate fuzzyfinder showing abbreviated paths

Categories

HOME
ms-access
deployment
c#-4.0
deezer
mfc
angular-material
tesseract
setup-deployment
electronics
sql-server-2016
mvvmcross
indesign
in-app-purchase
uber-api
swagger-ui
qore
webrequest
kentor-authservices
offline
task
windows-phone-7
seaborn
footer
reactive-cocoa
sms-gateway
amazonsellercentral
paging
intentfilter
extjs5
p-value
centos6.5
brunch
libuv
bcd
preg-match-all
functor
repo
textmate
geopositioning
mapdb
lto
twitch
android-fingerprint-api
quadratic-programming
powershell-dsc
vao
paxos
domain-model
togetherjs
hittest
blacklist
setuptools
log4c
elements
pcf
multiple-regression
holder.js
disque
energy
uid
coveralls
wyam
embedded-code
cakephp-3.1
sortedlist
streambase
fpml
wordpress-theme-customize
tld
undefined-reference
hyprlinkr
flexmojos
ivyde
padarn
yui-compressor
delphi-6
first-responder
dotnethighcharts
jquery-ui-layout
punbb
pydot
subgurim-maps
servicehost
digest-authentication
dmx512
revisions
libs
zune
rtml

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App