0

As @drew asked me to do here I'm asking one question per problem

I'm trying to enable/disable visual-fill-column when there is one window/multiple windows.

(defun my-visual-fill-one-window ()
  (global-visual-fill-column-mode -1)
  (if (one-window-p)
    (global-visual-fill-column-mode 1)
    (global-visual-fill-column-mode -1)))
    
(add-hook 'window-state-change-hook 'my-visual-fill-one-window)

Could it be possible to adapt this function to work not when there's only one window but when they are just split vertically

1

Try replacing one-window-p with window-full-width-p.

Function: window-full-width-p &optional window

This function returns non-nil if window has no other window to the left or right in its frame, i.e., its total width equals that of the root window on that frame. If window is omitted or nil, it defaults to the selected window.

https://www.gnu.org/software/emacs/manual/html_node/elisp/Window-Sizes.html.

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.