Git Product home page Git Product logo

sublimity's Introduction

sublimity.el

sublime 風のスムーススクロール、ミニマップ、集中モード

smooth-scrolling, minimap and distraction-free mode (inspired by the sublime editor)

Screencast

screencast.png

NOTE: INCOMPATIBLE CHANGES IN THE LATEST VERSION

  • obsolete functions are now removed

Installation

Require this script and some of “sublimity-scroll”, “sublimity-map” and “sublimity-attractive”

(require 'sublimity)
;; (require 'sublimity-scroll)
;; (require 'sublimity-map)
;; (require 'sublimity-attractive)

then call command “M-x sublimity-mode” (or put the following expression in your init file).

(sublimity-mode 1)

Notes

When you turn sublimity-mode on, “auto-hscroll-mode” is automatically disabled, and “sublimity-auto-hscroll-mode” will work instead. Therefore, to disable horizontal scrolling, set “sublimity-auto-hscroll-mode” but not “auto-hscroll-mode”.

Customization

sublimity-scroll (smooth scrolling)

You may configure the speed of smooth-scroll by setting two variables.

(setq sublimity-scroll-weight 10
      sublimity-scroll-drift-length 5)

Scroll is basically divided into (weight + drift-length) steps. for example, with the configuration above, 100 lines of scrolling is divided into 15 (= 10 + 5) steps

(17 15 14 12 11 8 7 5 4 2 1 1 1 1 1)

and it looks smoother than 1 step scroll. Note that last 5 steps are all 1 line scrolls, because drift-length is set 5. So you may make scroll more smooth by setting drift-length greater. try :

(setq sublimity-scroll-weight 5
      sublimity-scroll-drift-length 10)

With the configuration above, scroll is divided into 15 steps again,

(30 24 18 12 6 1 1 1 1 1 1 1 1 1 1)

but the last 10 steps are all 1 line scrolls. this looks smoother but perhaps more annoying for some users.

sublimity-map (minimap)

sublimity-map-size, fraction, text-scale

(setq sublimity-map-size 20)
(setq sublimity-map-fraction 0.3)
(setq sublimity-map-text-scale -7)

“sublimity-map-fraction” defines the maximum fraction of width that minimap can get. “sublimity-map-text-scale” is passed to “text-scale-set” on minimap setup.

sublimity-map-setup-hook

(add-hook 'sublimity-map-setup-hook
          (lambda ()
            (setq buffer-face-mode-face '(:family "Monospace"))
            (buffer-face-mode)))

“sublimity-map-setup-hook” will run when minimap is created.

sublimity-map-set-delay

(sublimity-map-set-delay 5)

With the setting above, minimap is displayed after 5 seconds of idle time. When sublimity-map-set-delay is called with nil, then minimap is shown with no delay. This defers from setting delay to 0, especially when used with sublimity-scroll, in the sense that minimap looks not deleted at all but gets worse performance.

sublimity-attractive (distraction-free mode)

sublimity-attractive-centering-width

(setq sublimity-attractive-centering-width 110)

When a positive integer is set, buffer width is truncated to this value and drawn centered. To cancel this feature, set this value nil.

sublimity-attractive-hide-xxxx

Following functions are available to hide some UI parts.

(sublimity-attractive-hide-bars)
(sublimity-attractive-hide-vertical-border)
(sublimity-attractive-hide-fringes)
(sublimity-attractive-hide-modelines)

sublimity's People

Contributors

zk-phi-test avatar toxaris avatar zk-phi avatar featheredtoast avatar syohex avatar

Watchers

James Cloos avatar  avatar

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.