sotte / presenting.vim

A simple tool for presenting slides in vim based on text files.
MIT License
300 stars 50 forks source link

Don't clobber the unnamed register when changing page #16

Closed lzh9102 closed 8 years ago

lzh9102 commented 8 years ago

Presenting.vim uses the command G$vggd to clear the content of the slide buffer. This clobbers the unnamed register (") with the content of the previous page. Here's the steps to show the effect:

  1. Open a markdown file
  2. Yank the first line (yy)
  3. Open the slide buffer (:PresentingStart)
  4. Switch to the next page (n)
  5. Close the slide buffer (q)
  6. Paste (p)

The pasted content is not the previously yanked line, but the entire content of the first slide page.

I first replaced the command with G$vgg"_d to discard the deleted content. Then, I realized that this command can be replaced with :%delete _, which is easier to read.

sotte commented 8 years ago

Great, thanks!