GithubHelp home page GithubHelp logo

mpwang / perfect-margin Goto Github PK

View Code? Open in Web Editor NEW
84.0 3.0 9.0 6.74 MB

[emacs] auto center emacs windows, work with minimap and/or linum-mode

Emacs Lisp 100.00%
minimap linum-mode emacs-lisp emacs margin-area emacs-packages emacs-windows-resizing

perfect-margin's People

Contributors

akirak avatar ecofighter avatar mpwang avatar purcell avatar stasvlasov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

perfect-margin's Issues

It doesn't work when treemacs is activated

It's shown as follows:

perfect-margin-issue2.mp4

Is it by design, or an unexpected effect?

It may not be clear, since the example shown is in a small size, but when I full screen emacs, it'd become so apparent as the text is still too wide in the buffer. since perfect-margin doesn't work at all when treemacs is activated.


Here's the configuration:

  (use-package perfect-margin
    :ensure t
    :init
    (defcustom perfect-margin-ignore-regexps
      '("^minibuf" "^[[:space:]]*\\*")
      ;;'("^minibuf" "^[[:space:]]*\\*" "*Treemacs*")
      "List of strings to determine if window is ignored.
       Each string is used as regular expression to match the window buffer name."
      :group 'perfect-margin)
    (defcustom perfect-margin-ignore-filters
      '(window-minibuffer-p)
      "List of functions to determine if window is ignored.
       Each function is called with window as its sole arguemnt,
       returning a non-nil value indicate to ignore the window."
      :group 'perfect-margin)
    :custom
    (perfect-margin-visible-width 128)
    :config
    ;; enable perfect-mode
    (perfect-margin-mode t)
    ;; auto-center minibuffer windows
    (setq perfect-margin-ignore-filters nil)
    ;; auto-center special windows
    (setq perfect-margin-ignore-regexps nil)
    ;; add additinal bding on margin area
    (dolist (margin '("<left-margin> " "<right-margin> "))
      (global-set-key (kbd (concat margin "<mouse-1>")) 'ignore)
      (global-set-key (kbd (concat margin "<mouse-3>")) 'ignore)
      (dolist (multiple '("" "double-" "triple-"))
	(global-set-key (kbd (concat margin "<" multiple "wheel-up>")) 'mwheel-scroll)
	(global-set-key (kbd (concat margin "<" multiple "wheel-down>")) 'mwheel-scroll))))

Any ideas?

Display buffer uses width of text as window width for deciding placement of new windows

First of all, let me say that this package works very well indeed! Just what I needed for my 38" super-wide monitor. Thank you.
The only issue I have had is that if I have a single window (placed nicely in the centre of my monitor), if a new window pops up (e.g. asking for vc-log), Emacs splits the window vertically and places the new window below my current one. This is not ideal as there is plenty of room to split horizontally but Emacs doesn't know this due to the large margins.
I have solved this with some hard-coded values: I set the perfect-margin-visible-width to slightly more than half the screen/frame width and then set split-width-threshold to 1 less than that.
I am not expecting a fix to this issue as I don't think it's necessarily fixable and so I'm simply noting it here with a potential hacky solution.
Thanks again!

Window too small for splitting

I'm trying to use perfect-margin with doom and when I exec evil-window-vsplit it fails with Window too small for splitting, but I have only one window.

This package seems to break posframes

A lot of packages use posframe including ivy posframe, helm posframe, company posframe, etc. They all break with this package. The frame slowly gets wider and then the whole thing jumps off-screen. Maybe this package should ignore posframes?

thank you

I've been using this package for about a year, and it has saved my neck health in EXWM with a 32:9 display.

just discovered today that setting (setq perfect-margin-ignore-filters nil) centers the minibuffer, and it has absolutely made my day.

you're great, and thank you for your development!

Avoid margins in the which-key pane

Hi,

Thanks for your package. I'm always looking for this kind of center layout setup in all my editors. This one is working great, just two things:

  • Would it be possible to ignore the margins in the which-key pane or popup? I am using (perfect-margin-visible-width 100), and even with 100 width, there is some which-key menus that get cutoff.
  • Also, the start Doom emacs buffer keeps getting troubled by the margins, sometimes it is centered, sometimes goes completely left align. Is there anyway to avoid this behavior?

Thanks again.

Activate per buffer

First of all thanks for the package, it is an improvement over olivetti mode, I'm just missing a per-buffer activation (like olivetti has). Is it possible to achieve?

Thanks in advance.

Add support for perfect-margin to work in the main buffer when a sidebar like org-side-tree is opened.

First of all, thank you @mpwang for the energy and effort spent in this package. It has become a must need for a wide monitor that I use daily!


Perfect-margin seems to not keep working when a certain sidebar window is opened. Closing that sidebar would bring back effect of perfect-margin in the main buffer.

For those of you that may wonder, why not add a general solution to support various sidebar windows but to instead open an issue for a particular specific sidebar, see issue: #17

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.