Skip to content

The yank (yy) and paste (p) behaviour of a fresh install of Spacemacs deviates from Vi's/Vim's behaviour #17150

@diverseFPT

Description

@diverseFPT

The sequence of commands yy followed by p results in a different outcome in a fresh install of Spacemacs, than is seen in vi/vim.

I saw this when I recently created a fresh install of Spacemacs on a new machine. On my older install of Spacemacs on a different machine, the behaviour matches that of Vi/Vim.

Steps to replicate:

  1. Create a fresh install of Spacemacs and start it up:

    $ emacs --version
    GNU Emacs 30.2, etc

    $ mkdir -p ~/spacemacs-clean/home

    $ git clone https://github.com/syl20bnr/spacemacs.git ~/spacemacs-clean/.emacs.d
    Cloning into '/home/gphilip/spacemacs-clean/.emacs.d', etc.

    $ HOME=~/spacemacs-clean/home emacs --init-directory ~/spacemacs-clean/.emacs.d

  2. Once the packages finish installing, switch to the scratch buffer and type in the following text:

Mary had a little lamb,
Little lamb, little lamb.
Mary had a little lamb,
Her fleece as white as snow.

  1. Go to normal mode. Place the cursor on the 'b' before the comma on the second line.
  2. Press yy
  3. Press p six times, one after the other.

This gives the following unexpected result:

Mary had a little lamb,
Little lambLittle lamb, little lamb.
,Little lamb, little lamb.
Little lamb, little lamb.
lLittle lamb, little lamb.
iLittle lamb, little lamb.
tLittle lamb, little lamb.
tle lamb.
Mary had a little lamb,
Her fleece as white as snow.

Vim, and my older Spacemacs installation, gives the following result, for steps 2 to 5:

Mary had a little lamb,
Little lamb, little lamb.
Little lamb, little lamb.
Little lamb, little lamb.
Little lamb, little lamb.
Little lamb, little lamb.
Little lamb, little lamb.
Little lamb, little lamb.
Mary had a little lamb,
Her fleece as white as snow.

As you can see, the new Spacemacs behaviour literally butchers the text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions