We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's been implemented in Spacemacs for a while and it really should be part of this package considering that it only makes sense as a part of it.
(defun spacemacs/move-buffer-to-window (windownum follow-focus-p) "Moves a buffer to a window, using the spacemacs numbering. follow-focus-p controls whether focus moves to new window (with buffer), or stays on current" (interactive) (let ((b (current-buffer)) (w1 (selected-window)) (w2 (winum-get-window-by-number windownum))) (unless (eq w1 w2) (set-window-buffer w2 b) (switch-to-prev-buffer) (unrecord-window-buffer w1 b))) (when follow-focus-p (select-window (winum-get-window-by-number windownum)))) (defun spacemacs/swap-buffers-to-window (windownum follow-focus-p) "Swaps visible buffers between active window and selected window. follow-focus-p controls whether focus moves to new window (with buffer), or stays on current" (interactive) (let* ((b1 (current-buffer)) (w1 (selected-window)) (w2 (winum-get-window-by-number windownum)) (b2 (window-buffer w2))) (unless (eq w1 w2) (set-window-buffer w1 b2) (set-window-buffer w2 b1) (unrecord-window-buffer w1 b1) (unrecord-window-buffer w2 b2))) (when follow-focus-p (winum-select-window-by-number windownum))) (dotimes (i 9) (let ((n (+ i 1))) (eval `(defun ,(intern (format "buffer-to-window-%s" n)) (&optional arg) ,(format "Move buffer to the window with number %i." n) (interactive "P") (if arg (spacemacs/swap-buffers-to-window ,n t) (spacemacs/move-buffer-to-window ,n t)))) (eval `(defun ,(intern (format "move-buffer-window-no-follow-%s" n)) () (interactive) (spacemacs/move-buffer-to-window ,n nil))) (eval `(defun ,(intern (format "swap-buffer-window-no-follow-%s" n)) () (interactive) (spacemacs/swap-buffers-to-window ,n nil))) ))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It's been implemented in Spacemacs for a while and it really should be part of this package considering that it only makes sense as a part of it.
The text was updated successfully, but these errors were encountered: