-
Notifications
You must be signed in to change notification settings - Fork 311
Description
| badd `=a:expr` |
The above line adds a named buffer. Since only unnamed buffers are skipped by viminfo vim-lsp leaves file-marks in viminfo when enabled. This seems unnecessary for a temporary buffer, and 'viminfo'-option is global-only with no buffer-local equvalent. There is only :help viminfo-r-flag for excluding paths which only works with real files (and can't use globbing to work around it afaik, I have tried).
You can find entries such as:
> ~/VS.Vim.Buffer: 1: VS.Vim.Buffer.Default
" 1 0
The name here is VS.Vim.Buffer: 1: VS.Vim.Buffer.Default and appears after starting an empty vim session (the hidden buffer is available on :b 2 in empty vim-session or can be shown with :ls!.
This also affects other functionality such as v:oldfiles, :browse oldfiles that uses viminfo file-marks to build the list.
Since the name includes buffer-id, this will grow over time. But these temporary buffers have never been files and the file-marks has no use.
If started in another directory ~/src/vim/, its starting to build up another pile under a new namespace.
> ~/src/vim/VS.Vim.Buffer: 1: VS.Vim.Buffer.Default
" 1 0
There is no obvious workaround to this as as there is no way to control which named buffers vim saves file-marks for.
An alternative could be global variables (viminfo-!), if this needs to be stored.