7

I often program with lines no more than 80 characters long. I start with an 80-character-wide terminal, but sometimes due to a plugin runs or after creating a vsplit results in the editing area being less than 80 characters wide.

For example, :set number will take four columns from the editing area and use them for line numbers. After this, using :vertical resize, only changes the size relative to other splits, it doesn't widen the window.

Is there a way to keep the width of the editing area at a fixed width or to quickly resize the editing area or the window to a specified width?

  • 1
    set columns=90 will resize a gvim, but unfortunately that's the total width, not the width of the displayed text. So you'd have to use 84+ with numbers on. – derobert Feb 18 '15 at 17:03
  • 1
    Are you talking about (internal) Vim-windows, or the Terminal itself, or both? – Runium Feb 18 '15 at 18:18
  • I'm talking about both. If the Vim window needs to be larger than the terminal width, I'd like the terminal to expand. Perhaps this isn't possible within vim... – drs Feb 19 '15 at 11:57
2

Take a look at the various window functions. For example ctrl-w = will set all splits to equal width. There are also methods to set the window to a certain width, increase/decrease width by N, always maintain equal width, etc... :help window-resize

| improve this answer | |
2

Ctrl+W+ (n) >/<: For right/left
Ctrl+W+ (n) +/-: For up/down
where n = any number.

| improve this answer | |
0

:vertical resize 80 will set your current vsplit to 80 characters wide

| improve this answer | |

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.