0

This is my .vimrc configuration:

set columns=80
set linebreak

It works as expected but when call NerdTree Toggle the lines expand to fix the terminal window size. Even when NerdTree is deactivated the columns=80 settings doesn't come back. I have google it but just could find:

set winfixwidth

However it doesn't solve the problem.

0

1 Answer 1

0

If you want your lines to be set to a certain length, then use

set textwidth=80

This will set the number of columns to display and works well with NERDTree for me.

Ref: 1. https://stackoverflow.com/questions/3033423/vim-command-to-restructure-force-text-to-80-columns

4
  • Thanks for the advice. I works but again, after using the NerdTreeToggle, the lines change their width. Actually, if I use set columns=80 after a few seconds of enabling NerdTree the column and text width is refreshed to adopt the screen width.
    – crr1805
    Commented Jul 1, 2018 at 21:55
  • I am trying to understand what you mean by lines change their width? When you use textwidth, vim will put a new line \n after every 80 characters, unless you join the lines using something like J.
    – alpha_989
    Commented Jul 1, 2018 at 22:00
  • Is there a reason you want to use set column as well as set textwidth?
    – alpha_989
    Commented Jul 1, 2018 at 22:01
  • The vim documentation states that if VIM is unable to change the number of columns.. the display may get messed up.. From vim docs: vimdoc.sourceforge.net/htmldoc/options.html#'columns'
    – alpha_989
    Commented Jul 1, 2018 at 22:03

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.