Search code examples
windowskeyboard-shortcutswindow-management

Moving window on the screen


Is there any shortcuts to move/drag the window(box) on the screen when the window is not maximized without changing its dimension? Say I want to drag the vim/emacs editor window to the left side/middle/right side of my screen so it doesn't cover the cmd window.


Solution

  • With library frame-cmds.el you have commands to move the selected frame around. Bind them to repeatable keys (just hold the key pressed).

    • move-frame-left - suggested binding: M-<left>.
    • move-frame-right - suggested binding: M-<right>.
    • move-frame-up - suggested binding: M-<up>.
    • move-frame-down - suggested binding: <M-down>.

    Option move-frame-wrap-within-display-flag non-nil means wrap frame movements within the display.