12

The yankring plugin for Vim creates a file in my home directory called yankring_history_v2.txt. How do I tell the plugin to store this file in another location?

cydonian
  • 1,686
  • 14
  • 22
  • I've opened a PR to address this issue on the original YankRing repo. Doesn't look like it's maintained, last PR was 4 years ago. But I didn't see a better-maintained repo. https://github.com/vim-scripts/YankRing.vim/pull/16 – cydonian Feb 01 '19 at 19:12

2 Answers2

18

Yankring looks for a variable called yankring_history_dir to know where to store this file. Add the following line to your .vimrc:

let g:yankring_history_dir = 'path/to/history/dir'
cydonian
  • 1,686
  • 14
  • 22
5

You can also change the file's name with yankring_history_file. For example, if you want it to be a hidden file in your home directory, leave yankring_history_dir as-is, and add this to your .vimrc:

let g:yankring_history_file = '.yankring_history'
Kankaristo
  • 2,515
  • 2
  • 20
  • 16