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

How do I set my shift width to indent two spaces when scripting for python in MacVim?
vim ftplugin cant link executable
How do you move the cursor to the end of a string in Vim?
Aligning words without delimiters?
vim-bookmark cannot display correct symbol in gvim (Windows)
how to save complex grep output in gvim
Delete tab at the beginning of the line in navigation mode
Is there a FileType name for files without suffix in vim?
vim: remove delay when inserting text in visual block mode [duplicate]
why cscope does not show complete result list?
Vim: No lines in buffer
Why FZF does not work when I open it from vim intro?
Vim 7.4+ Mapping
Why fortran in vim keeps automatically line break
definition for tabs in vimrc doesn't work as expected
How can I save my vim split windows layout?

Categories

HOME
google-chrome-extension
grep
electronics
google-project-tango
uber-api
google-translate
handsontable
etl
correlation
moonmail
fortumo
django-simple-history
systemc
graphlab
alpine
scichart
reverse-proxy
extjs5
captiveportal
claims-based-identity
crosstab
p-value
spark-jobserver
filezilla
opentype
kendo-datasource
bcd
bosh
google-qpx-express-api
phpfreechat
repo
rotational-matrices
bytecode-manipulation
xcode-extension
automake
hilbert-curve
unobtrusive-validation
ruby-on-rails-3.1
bootstrap-dialog
total-commander
eclipse-gef
qcombobox
angular2-meteor
wso2carbon
google-datalayer
pango
colorama
csound
media-player
linode
pycaffe
setuptools
removechild
file-writing
underscore.js-templating
pcf
django-debug-toolbar
storekit
angstrom-linux
prettytensor
rvest
revolution-r
tcpserver
rtbkit
reactive-banana
execute
cartesian-product
icu4j
collapse
retina
wireshark-dissector
fouc
iis-arr
mono-embedding
gwidgets
file-copying
has-many-through
android-radiobutton
reactfx
htmlcleaner
industrial
terminal-services
bulkloader
file-locking
gridcontrol
clipper
e4x
hosts-file
enter
ohm
nsdatecomponents
psi
cinema-4d
celltable
mongomapper
subviews
paster
ncqrs
firefox-5
mtj
privilege
yagni
document-conversion

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App