Skip to content

Unusable file-marks "VS.Vim.Buffer.Default" building up in viminfo #1337

@dezza

Description

@dezza

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions