3

The screenshot of vim-gitgutter clearly shows its author uses some kind of continuation line character when wrap is on. How do I get that? I thought I could find it listed in :help 'listchars', but it's not.

enter image description here

3

Use the 'showbreak' option. From :h 'showbreak':

'showbreak' 'sbr'      string (default "")
                       global or local to window |global-local|

       String to put at the start of lines that have been wrapped.

It looks to me like they are using the Unicode character ↪ (Rightwards Arrow with Hook, U+21AA). To enter a Unicode character into Vim, use :h i_CTRL-V.

After typing Ctrl+v, you can hit u and type the hexadecimal representation of the desired Unicode character (as specified in :h i_CTRL-V_digit).

So, to type ↪, you would perform the following keypresses while in insert or command-line mode:

Ctrl+v u 21aa


Then, you can set showbreak=↪ in your .vimrc.

1
  • 1
    It's a bit strange it has an option for its own and isn't part of listchars.
    – Enlico
    Nov 27 '20 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.