Skip to main content
deleted 9 characters in body
Source Link
Terry
  • 81
  • 5

winwidth(0) returns the width of the current window. However, if vim has multiple vertical splits, forming multiple windows, winwidth(0) would only return the width of the current window.

For example, let say the terminal has 80 columns across. Without, any vertical splits, echo winwidth(0) would return 80. If <C-W>v is used however, echo winwidth(0) would return a smaller number, less than 80, equal to the width of one of the split windows.

How can I get the full terminal width without forcing the cursor to jump through all vertical splits (for example, with windcmd l)?

winwidth(0) returns the width of the current window. However, if vim has multiple vertical splits, forming multiple windows, winwidth(0) would only return the width of the current window.

For example, let say the terminal has 80 columns across. Without, any vertical splits, echo winwidth(0) would return 80. If <C-W>v is used however, echo winwidth(0) would return a smaller number, less than 80, equal to the width of one of the split windows.

How can I get the full terminal width without forcing the cursor to jump through all vertical splits (for example, with windcmd l)?

winwidth(0) returns the width of the current window. However, if vim has multiple vertical splits, forming multiple windows, winwidth(0) would only return the width of the current window.

For example, let say the terminal has 80 columns across. Without, any vertical splits, echo winwidth(0) would return 80. If <C-W>v is used however, echo winwidth(0) would return a number less than 80, equal to the width of one of the split windows.

How can I get the full terminal width without forcing the cursor to jump through all vertical splits (for example, with windcmd l)?

Source Link
Terry
  • 81
  • 5

How to get total width of Vim with vertical splits?

winwidth(0) returns the width of the current window. However, if vim has multiple vertical splits, forming multiple windows, winwidth(0) would only return the width of the current window.

For example, let say the terminal has 80 columns across. Without, any vertical splits, echo winwidth(0) would return 80. If <C-W>v is used however, echo winwidth(0) would return a smaller number, less than 80, equal to the width of one of the split windows.

How can I get the full terminal width without forcing the cursor to jump through all vertical splits (for example, with windcmd l)?