anler / centered-window-mode

Keep your text centered when there's only one window.
143 stars 12 forks source link
emacs emacs-windows-resizing

NOTE: Due to a lack of time to solve the issues of this project and the responsabilities derived from my recent paternity, I'm looking for someone to transfer the ownership of the project and who's willing to keep working in it.

[[https://raw.githubusercontent.com/ikame/centered-window-mode/master/img/s-1.png]] [[https://raw.githubusercontent.com/ikame/centered-window-mode/master/img/s-2.png]] [[https://raw.githubusercontent.com/ikame/centered-window-mode/master/img/s-3.png]]

** Manual installation

First, download =centered-window-mode.el= in your emacs load path.

Then, to make it available, add this to your configuration file:

+begin_src emacs-lisp

(require 'centered-window-mode)

+end_src

** Installation via el-get

If you use [[https://github.com/dimitri/el-get][el-get]], the emacs package manager, simply add =centered-window-mode= to your packages list.

** Installation via use-package

If you use [[https://github.com/jwiegley/use-package][use-package]], simply add the following to your init file.

+BEGIN_SRC elisp

(use-package centered-window :ensure t)

+END_SRC

** On-the-fly

Simply type =M-x centered-window-mode= in any buffer.

** Permanent

To make this permanent, add this to your emacs configuration file:

+begin_src emacs-lisp

(require 'centered-window-mode) (centered-window-mode t)

+end_src

Adding vertical padding to an Emacs window is kind of hard, I have tried a lot of different solutions but most of them add a lot of complexity and source of bugs to the mode. Currently there are the options =cwm-use-vertical-padding= (default =nil=, set to =t= if you want this feature) and =cwm-frame-internal-border= (default =70=) to add some padding to the frame, it's far from ideal but I have found it at most acceptable for most of the use cases where I need this feature.

Copyleft (ɔ) Anler Hernández Peral

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.