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)
I'm hooking it to
window-state-changed-hook because it looked like the most suited one but maybe I could do better (the main problem being that if I use ivy-posframe it's considered as a second window, the mode is disabled, the text is instantly flushed to the left and as soon as the posframe is closed the mode is enabled again and the text centered)