pin-buffer

πŸ“Pins buffer to current window in GNU/Emacs

GPL-3.0 License

Stars
2

πŸ“ pin-buffer for GNU/Emacs

When you switch a buffer in GNU/Emacs it could reuse any of opened windows to place new buffer content. Sometimes this behavior is annoying. The extension just pins buffer to current window in GNU/Emacs. It will omited during switching buffers and not used for popups until you unpin it (or close it).

  • toggles buffer state between dedicated/normal
  • displays πŸ“Œ in modeline for dedicated mode
  • it's all

Install with straight

(use-package pin-buffer
  :bind ("<f11>" . 'pin-buffer)
  :straight (pin-buffer :type git :host github :repo "grafov/pin-buffer"))

Usage

Just call M-x pin-buffer to toglle current buffer.

Explanation

The code uses "dedicated window" feature of Emacs. You could do it in your manner without this extension. Just check this code for idea:

  (let (window (get-buffer-window (current-buffer)))
	 (if (set-window-dedicated-p window
						 (not (window-dedicated-p window)))))

Similar plugins

License

Under terms of GPL v3. See LICENSE file.