3

Currently, indented lines will wrap all the way to the left of the text area. This is what they look like:

    This is a long line of text that is indented wi
th tabs. In order for it to properly fit inside the
 screen, it must be wrapped.

I'd rather have them wrap to the end of indentation, like this:

    This is a long line of test that is indented wi
    th tabs. In order for it to properly fit inside
    the screen, it must be wrapped.

Using NeoVim v0.9.1, how?

1

1 Answer 1

3

To enable this feature, you can add the following line to your (Neo)Vim configuration file, typically located at ~/.vimrc for Vim or ~/.config/nvim/init.vim for Neovim:

set breakindent

If you'd like to enable this just for the current session, you can run the command:

:set breakindent

in command mode.


You can also customize the behavior further with the breakindentopt option. For example, to set an additional indent for wrapped lines, you could use:

set breakindentopt=shift:2

This would add an extra 2 spaces of indentation to each wrapped line. You can replace 2 with your preferred number of spaces.

Remember to reload your configuration file after editing it or restart (Neo)Vim to apply the changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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