Skip to content

[Feature Request] Allow customization of EndOfBuffer ~ character #3820

@fvgs

Description

@fvgs

Problem

As mentioned in #2679, the ~ character displayed in the first column of rows that are not part of the file is currently hard coded and cannot be customized from within Vim.

Existing workarounds

hi EndOfBuffer ctermfg=0 guifg=bg

or

  1. Change the hard coded ~ to a space and compile a custom Vim

    vim/src/screen.c

    Lines 2262 to 2263 in 1ac56c2

    /* put '~'s on rows that aren't part of the file. */
    win_draw_end(wp, '~', ' ', row, wp->w_height, HLF_EOB);

The first is problematic for terminal emulators utilizing background transparency as the ~ characters remain visible.

The latter requires maintaining an up to date fork of Vim with a tiny change.

Proposal

Add a setting to customize the character inserted in the first column of EndOfBuffer rows and the character inserted in the non-first columns of EndOfBuffer rows.

The proposed syntax is similar to that for setting listchars, specifically for setting tab characters where the second character is repeated.

e.g.

set endofbufferchars="  "
set endofbufferchars=""
set endofbufferchars="••"

Alternatives

a. Change the hard coded ~ to a hard coded space.
b. Add a flag to enable/disable showing the ~ characters, replacing them with spaces when disabled.
c. Add a setting to customize just the character inserted in the first column of EndOfBuffer rows.

Next steps

I would be happy to introduce a PR implementing this and would welcome some guidance as a first time contributor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions