zk-phi / sublimity Goto Github PK
View Code? Open in Web Editor NEWSmooth-scrolling and minimap like sublime editor
Smooth-scrolling and minimap like sublime editor
First, thanks for the wonderful package @zk-phi. It really gives a useful relative context to scroll operations.
On my computer, the frame redisplays too quickly to give a good sense of context from the smooth scrolling behavior even with many more scroll steps added. I have been using a customizable delay between animation frames which can be tuned to a pleasant result, and does not contribute any delay when set to zero. I will submit a pull request for it.
Vim-minimap has a terminal support using the python-implemented drawille library.
It could be done as well for emacs using the elisp implementation?
When sublimity-mode is enabled if I set the mark as soon as I scroll the mark is disabled. If I disable sublimity I can set mark, scroll a few lines and copy the marked lines. With sublimity-mode enabled I set the mark and as soon as I start scrolling the mark is reset.
To reproduce:
use this configuration:
(use-package sublimity
:config (progn
(use-package sublimity-scroll)
(use-package sublimity-map
:config (progn (sublimity-map-set-delay nil))
)
:init (sublimity-mode 1))
set mark then scroll down a line. In my case the mark is no longer set. If I turn off sublimity it works fine.
-LeoD
BTW) This is really cool! Nice job.
I would like to say that Sublimity is great work! Thanks for the effort.
But alas, I noticed I have an issue. I was wondering if this is by default of sublimitiy? When I'm scrolling, the Sublimity is not visibile when scrolling (he pops out). But if you're not scrolling anymore, he popped up back.
Is this an issue, of is this by design?
Please, how do I disable sublimity smooth scroll when there’s a trackpad scroll? It’s really great when paging up/down, but it’s blocking scroll altogether when it happens with siblimity-mode one.
Is it possible to implement a way to stop the scrolling inertia without delay?
I would like to have the same behavior as nautilus in gnome for example. For example with the xev
command on my touchpad when I scroll quickly and release my fingers events keept logging until the "end of the inertia", but when the inertia is going I can stop it directly (without any latency, unlike in sublimity) when i touch the touchpad again
I'm not sure if it's well explain enough.
I get the following error when I enable (require 'sublimity-attractive)
. I'm using Emacs snapshot from here. You can find my config file here. My config uses Emacs Prelude.
Debugger entered--Lisp error: (wrong-type-argument wholenump -14)
set-window-margins(#<window 3 on *scratch*> -14 -14)
sublimity-attractive-window-change()
run-hooks(hook)
sublimity--run-hooks((sublimity-attractive-window-change))
sublimity--window-change()
Basically, using relative-line-numbers moves the text to the left of the screen instead of centering it. The max width is still applied, though.
I myself had this sort of problem when I tried to center the text by creating left and right regions some time ago. I couldn't do it because relative-line-numbers creates a region (not sure what's the right word for this) to put the numbers.
I haven't studied the code so I don't know how, but centered-window-mode implements this feature without breaking when relative line is active; if that helps. I tried to migrate to Sublimity because centered-window-mode is slowing down my Emacs.
Thanks for the great package.
I was debugging intermittent slowness on native copy/pastes on my MacBook and discovered that the slowness is proportional to the current line position of a file when sublimity is activated. Pasting text from the native clipboard will visibly paste one character at a time when you're at the bottom of a large file. Yanking is unaffected.
Here is the sublimity config I used (my full emacs config):
(require 'sublimity)
(require 'sublimity-scroll)
(sublimity-mode nil)
I thought this config would make sublimity totally deactivated but removing the sublimity-scroll
require line makes native copy/pastes responsive again.
osx-clipboard
package didn't helpHi, @zk-phi I am literally in awe of this package for emacs but when I installed it in Spacemacs, and setting it on at startup inside user-config, I don't see anything at all.
Please let me know if I'm missing a crucial piece or perhaps it's a bug?
I love this extension. Sublime's minimap was the one thing I liked about it and wished Emacs had. Thank you!
My problem is that the minimap isn't syntax-highlighted throughout. Most of it is just white text.
I've noticed that the region that isn't syntax-highlighted is usually about 10 lines after the cursor and about 50-60 lines before it. The rest of the minimap has proper syntax highlighting. In small buffers, none of the text is highlighted.
My theme is manoj-dark, if that's important. I've checked this so far in buffers containing Python, Javascript, JSX, HTML, CSS, and Elisp.
Sublimity works nicely (thank you!) and I already like it, but there is one usability problem:
It happens even when „problematic” lines are not visible at all (but are above currently displayed part).
Could it be avoided? It would suffice if minimap did not return it's area to buffer while scrolling (it can keep showing old content, or show some empty background with specific color to signal „in progress state”, or just stay empty - does not matter, as long as it keeps those pixels inavailable to buffer)
If I enable the minimap, bits of modeline formatting are obscured or changed for the width of the minimap. See screenshot below, and note how the modeline on the right is darker and missing its border. This happens even if I apply those changes after the package is loaded. Below is a snippet of code (that requires use-package
to be installed) that should be a minimal example of what I'm seeing:
(progn
(package-initialize)
(require 'use-package)
(use-package base16-theme
:config (load-theme 'base16-default-dark t)
)
(use-package sublimity
:ensure t
:config (
progn
(require 'sublimity)
(require 'sublimity-map)
(require 'sublimity-attractive)
(sublimity-mode 1)
(sublimity-map-set-delay nil)
(sublimity-attractive-hide-bars)
(sublimity-attractive-hide-vertical-border)
(sublimity-attractive-hide-fringes)
(set-face-attribute 'mode-line nil
:box nil
:overline "dark grey"
:underline "dark grey"
)
)
)
)
I'm using Mitsuharu Yamamoto's Emacs for Mac, which supports pixel-level (as opposed to line-by-line) scrolling. I've noticed that when the page is resting on a non-line boundary (i.e. a line is only partially visible with part of it off screen), moving the cursor onto that last (or first) line causes the page to skip the way it does by default without sublimity. If on the other hand the cursor is on a line that is fully on screen, sublimity smooth scrolling kicks in and it doesn't skip.
It ought to smooth-scroll in either case.
I liked the effort to bring sublime features of smooth scrolling and minimap into emacs. But I had a bad experience with this.
The scrolling was really annoying, it gets stuck on each and every scroll. Its a bit better when the minimap is kept off, but never same as the sublime (that is buttery-smooth). Looking at the scroll getting stuck, I feel like it is screwing the hell out of my emacs. I tried both the settings in the readme but same in both cases. I am using emacs24.
Please fix this soon, I would really love to see a better scrolling experience with this mode.
Can we open minimap only when needed ?
e.g bind something like mini-map-show to some keybinding.
So it does not distract us when we don't need it. and call it only when we need it.
When editing source code I'd like to see in the minimap some errors highlighted in the whole buffer. Is it possible to show the flycheck overlay in the map?
cheers!
Is there a way to force the mini-map to stay at the far right of the screen, even when the user (re)defines margins? Currently, the mini-map respects the margins, and when it appears, it clashes with the text in my buffer, realigning it in a strange way (e.g., breaking lines where it shouldn't, etc.). Can you have the mini-map ignore the margins, or be fixed at a position in the screen?
I got the package from ELPA, version: sublimity-20150220.634:
I've tried with success in Elisp, shell scripting, C, C++, Python, JS, Ruby, Processing...
But the sublimity map does not appear with Lua, HTML, XML & Markdown files.
There might be more, but those are the ones I tested.
Is there a way to make it work with them?
Even with the basic sublimity configuration:
(require 'sublimity)
(require 'sublimity-scroll)
(sublimity-global-mode)
sublimity will make window auto-jumping after completion completion list popup in company-mode
Detail refers to this page
Or it is relatively troublesome to disable sublimity's hook functions
I am really loving this plugin! Thank you for your work on it.
I was wondering if you could lead me in the right direction when customizing it. I'm not so much asking for a patch, as I am advice, as I am sure you are quite busy!
I get these little arrows on the edge of the map where text is longer than the map is wide. Is this configurable? (perhaps linewrap-mode can be enabled inside the sublimity map buffer via a hook?)
It there a way to prevent the map from disappearing when I give input (such as typing or clicking?
Also, I noticed the cursor is visible in the minimap. Another minimap implementation (which I'm not sure which I like more yours or his) has this problem. They solved it with 'cursor-type'. (reference http://www.emacswiki.org/emacs/MiniMap) Though, I am fairly new to eLisp, so I don't know how to fix it yet for you, that you might be able to pull... sorry :-(
I use the code to do this:
(add-hook 'sublimity-map-setup-hook
(lambda ()
(setq mode-line-format nil)))
I'd like to have the minimap to show no colors/overlays, I just want a minimap view of the buffer.
Is it possible to make the minimap use, let say, the fundamental-mode?
I installed sublimity and enabled sublimity-mode, but the font size of the minimap is too large.
See the right side of this screenshot:
Is it possible to use the minimap in terminal emacs? If so, how can I make the text smaller?
I tried modifying the Sublimity Map Text Scale
to -12
but it had no effect.
# emacs --version
GNU Emacs 24.3.1
Why when I disable sublimity-mode
the linum-mode
also get disabled. And this only happens when cursor is in GNU Emacs buffer.
M-x sublimity-mode
I saw that this package set auto-hscroll-mode
to nil, hence the hscroll no longer working. Is there a reason to do this?
Good evening,
Tonight I am writing to humbly put in a request for you to tag this project.
The reason is that a lot of users want to rely on a "numbered" release, by
the most broad definition of the term. For me, it is really simple, I am setting
up a "kind of stable" Emacs configuration of my system here https://github.com/grettke/home/blob/master/.emacs.el
and I would like to rely 100% just one tag. Whenever a "kind of stable" version
is ready, another tag would be super, too.
You might already have the most stable version in the mainline; and tagging it
would make it crystal clear to new users. Perhaps you have already released such
a version elsewhere, and if so, my apologies, and where does it live?
Stable is not the best word here. It just means that the project lives on GitHub
and that it has a tag. It doesn't mean that the software is perfect, it just
means that it is tagged. That tag gives users a version to settle on and go on
with their life is all.
I've used your package for a long time, love it, and so do many, many others.
This is a way to get that project out to the other thousands and thousands of
users who also rely upon MELPA stable.
All it takes is for you to create a tag, and within hours, it will show up on
MELPA stable.
Can't wait to hear about what you think and whether or not a tag is in this
project's future!
Kind regards,
Grant Rettke
Sublimity is great!
But the mini map causes lagging when delay set to nil
Could showing the active region only when desired (some shotcut) add performance?
Comparing to the vs-code minimap I miss the mini map as a quick scroll overview tool
I default turn off truncate-lines.
When I scroll in a buffer with lots long lines. Especially scroll up from a little low to beginning of buffer. I can't scroll to the beginning. Because the wrap lines affect the view.
I think the solution is use 'sublimity-map-setup-hook to detect and set truncate-lines to t; and set back to original value.
I have no time to write related codes so I have to do this in my init.el:
(set-default 'truncate-lines t)
Instead I get this error:
mouse-minibuffer-check: Wrong type argument: window-valid-p, #<window 339> [2 times]
This is on commit 54e982f
When I open a file and work with sublimity-attractive-centering, lines in the buffer are centralized. But when I scroll the buffer, lines aligns to left again. After scrolled, lines are centralized again. It causes a flash of the screen.
Is it a bug? or any else?
Hi,
I'm quite new to Emacs and I've been looking at various different plugins lately. I tried using Sublimity's Map. However, I'm using Guide Key and Helm as well and they don't seem to play nice with Sublimity.
Guide Key shows which keys are available (e.g. if I press C-c). This window is normally closed after pressing a key. This is not the case with Sublimity which hijacks that window and starts displaying another map...
Best regards!
First, I would thank you for the effort to bring the Sublime Text features to Emacs!
But sure, it could be always better. Frankly, I found the smooth scroll option not so smooth as this: https://github.com/terryma/vim-smooth-scroll/blob/master/autoload/smooth_scroll.vim
I come from Vim, and although the script I linked, is very short, I found it much much more smooth/prettier than the weird quirks of Sublimity smooth scroll, even when I changed the scroll drift/length in all imaginable numbers. Any chance to look to the script, and notice how much they difference in the feeling of scroll, especially with the setup :call smooth_scroll#up(&scroll, 11, 4)
You notice the difference in the scroll? How can Sublimity reach such behaviour?
Love this mode! Thanks!
An optional variable would turn off the green arrows in the map buffer would be great.
mentioned here : http://www.reddit.com/r/emacs/comments/266hqk/smoothscrolling_and_minimap_like_sublime_editor/chocx6q
Sublimity should not animate scrollbar scrolling.
This is a nice plugin but is there a way to keep sublimity from working on the helm buffer when it opens?
Other scroll commands work with sublimity-scroll
, but I have issues with C-n
at the bottom of a window. C-p
at the top operates as expected.
This was a head-scratcher, but after digging into it a bit, I believe the criteria for scrolling doesn't work as expected for partial lines of text at the bottom of the window, which is never an issue at the top as it starts with a completely visible line. Sublimity doesn't expect to scroll yet when C-n
moves point to that partially visible line, but emacs scrolls it to visible anyway edit to clarify: without smooth scrolling behavior. Per the documentation of window-end
used in the criteria:
Note that the position it returns might be only partially visible.
Other motion that ends on a partially visible line would result in the same problem (eg, forward-paragraph
) but one doesn't run into that condition as often.
I have a fix for this particular problem and will submit a pull request. It's not perfect as the method I used doesn't take into account scroll-margin
—if that's non-zero then motion into those margins at the window boundaries will not give smooth scrolling.
The preview pane should be disabled, as the pane just looks like a mirror of the actual buffer content.
If going a very long distance (such as skipping from top to the bottom of a long buffer), or if the user queues more scrolling while the previous scroll is still ongoing (such as by keeping M-v or PgDn pressed for a longer time), it starts building up a backlog and will continue scrolling for a very long long time. Especially the latter case can easily cause it to scroll for several seconds.
Scrolls should be done in such a way that they always take a constant time to finish. That is, it should be aggressive about ramping up the speed for long distances, and if new requests come in while it's not done with the previous scroll, it should stop the final slow down phase of the previous one immediately and go back to full speed. Essentially, no matter what navigation keys I press and how often, the time between me releasing the last key and scrolling stopping should be constant.
When i jump between windows configurations in wasamasa/eyebrowse, sublimity-scroll stop working with error "Error in post-command-hook (sublimity--post-command): (error "‘recenter’ing a window that does not display current-buffer.")" This error appears only when after configuration change i jump to another buffer. If buffer remains same, all works as expected.
Hi,
like the plugin very much!
One issue I'm having, though, is that when I open some command that focuses on the command bar (I guess it's this minibuffer) - e.g. using C-x d and waiting for a couple of seconds, I get an error that covers the whole area saying:
Error running timer `sublimity-map--idle: (Error "Attempt to split minibuffer window")`
Is there a way to disable this timer function when focused on the minibuffer?
Sulimity-map hides the cursor near the right border, vertical scrolling does not happen.
How to reproduce:
In Emacs set: (sublimity-map-set-delay nil)
and then have a long line in your emacs buffer. The line must not fit on screen.
‘M-x toggle-truncate-lines’ enabled helps reproducing the bug more clearly, but does not matter.
Then when you move the cursor to the right, sublimity-map will hide the cursor eventually.
I think this behaviour is not wanted, you should always see the cursor.
I'm using most recent Debian jessie and Emacs-lucid, sublimity v20161214.2032:
GNU Emacs 24.5.1 (i586-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2016-03-23 on babin, modified by Debian
Whenever you scroll, the point jumps back to the first visible position in the buffer temporarily before going back to the right position.
Hopefully this isn't necessary?
I don't know how best to troubleshoot this, but when working in ESS[S]
mode, sublimity does not function (also discussed at ESS, emacs-ess/ESS#346). When enabled, non-ESS buffers seem to work alright.
Minor modes enabled:
Enabled minor modes: Async-Bytecomp-Package Auto-Composition
Auto-Compression Auto-Encryption Auto-Revert Blink-Cursor
Column-Number Diff-Auto-Refine Eldoc Electric-Indent Ess-Roxy
File-Name-Shadow Font-Lock Git-Gutter Global-Font-Lock
Global-Git-Commit Global-Git-Gutter Global-Subword Line-Number
Magit-Auto-Revert Mouse-Wheel Shell-Dirtrack Show-Paren Smartscan
Subword Tooltip Transient-Mark Which-Function Window-Numbering
(When testing previously, the majority of these minor modes were not in play. I don't know what minor modes @vspinu had in play when he found the same problem. Because of this, I'm not certain it's just the major mode impacting sublimity's performance.)
What can I do (hooks, etc) to figure out what is disabling the map when in ESS mode?
When sublimity-auto-hscroll-mode
is active I cannot scroll the buffer with the mouse. Thus I'd like to disable it. I've tried setting sublimity-auto-hscroll-mode
but it seems to have no effect.
It doesn't work by default (I'm using the package.el package).
Besides that, setting it in init.el doesn't work either, but setting it afterwards does work.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.