Comments (11)
Good news! We have symbol-overlay-mode
now.
Check the new feature after Melpa finish this build. Wish you enjoy it.
@borgnix @dakra
from symbol-overlay.
@borgnix jFYI, until this get's implemented here I have the following in my config:
;; Make highlight symbol use overlay-put instead of font-lock
;; https://github.com/nschum/highlight-symbol.el/issues/26#issuecomment-233168193
(defun highlight-symbol-add-symbol-with-face (symbol face)
(save-excursion
(goto-char (point-min))
(while (re-search-forward symbol nil t)
(let ((ov (make-overlay (match-beginning 0)
(match-end 0))))
(overlay-put ov 'highlight-symbol t)
(overlay-put ov 'face face)))))
(defun highlight-symbol-remove-symbol (_symbol)
(dolist (ov (overlays-in (point-min) (point-max)))
(when (overlay-get ov 'highlight-symbol)
(delete-overlay ov))))
from symbol-overlay.
Very nice :)
I see the mode does not have a keymap and if I call
symbol-overlay-jump-next
it says 'Symbol is not highlighted'.
I would like to bind M-n
and M-p
in a symbol-overlay-mode-map
so
I can easily jump between the highlighted symbols.
Also is there a setting for the toggle-scope? I would like to
only show current scope by default.
Thanks :)
from symbol-overlay.
I use "o/u" as the common next-and-prev-like bindings when searching or moving over texts because they are at the most natural positions on the keyboard. It's comfortable for my fingers: "u/o" to move around while "i" for confirming/toggling and "k" for killing/deleting.
However, It's just a matter of personal taste. You can customize the keymap as you like.
highlight-symbol-mode
is indeed a nice feature though I had hardly used it. Maybe it will be added to symbol-overlay
in the future versions.
Thanks.
from symbol-overlay.
please add this feature :)
from symbol-overlay.
@dakra Thank you!
from symbol-overlay.
You can easily define a symbol-overlay-mode-map
in your own init.el. And it will automatically linked to the minor-mode. Or why not just simply global-set the key?
The user-error
of 'Symbol is not highlighted' is deleted, now you can start a jump from any position even inside a not-highlighted symbol. Same to all the other symbol-overlay commands.
For some reasons, scope is not supported in symbol-overlay-mode
. If you wanna toggle the scope, use symbol-overlay-put
to highlight it first.
from symbol-overlay.
Alright, you can set symbol-overlay-temp-in-scope
to be non-nil to make symbol-overlay-mode
highlighting in scope by default, and toggle its value anywhere outside the package.
from symbol-overlay.
Awesome.
I tried to set the minor-mode-map in use-package but that
didn't really work.
Anyway, using a global key is probably a good idea anyway.
One more thing, I saw you added symbol-overlay-switch-forward/backward
which I like very much and would rather use those
than symbol-overlay-jump-next
.. but those functions
are not yet supported in the minor-mode ("No more forward symbols").
Good job 👍
from symbol-overlay.
switch-forward/backward
is for jumping from one symbol to another one. It doesn't make sense to support it in the minor mode, since the symbol at point is already highlighted.
The best philosophy about symbol-overlay is to use jump
for jumping between occurrences of a specific symbol, and switch
for finding and switching to a new one. As for the minor-mode, just treat it as a sort of quick preview.
:)
from symbol-overlay.
The thing is that I want one single keybinding.
So I guess I want a symbol-overlay-jump-next-dwim
then,
that, if symbol-overlay-minor-mode
is active AND a symbol is
under (point)
I want to call jump-next
else do switch-forward
.
Does this make sense?
Anyway, this is obviously only a very minor thing.
Closing the issue already since it works pretty much like I want now :)
from symbol-overlay.
Related Issues (20)
- Is it possible to use more than 8 colors? HOT 7
- Overlay on selection HOT 4
- symbol-overlay-rename not works in wgrep buffer
- Activating overlays in a transient manner HOT 3
- args-out-of-range error HOT 15
- A symbol-overlay-jump-avy function for the symbol-overlay-map HOT 7
- Tag a new release HOT 1
- Support not putting boundaries on match HOT 2
- Support other search tools, like `swiper-isearch-thing-at-point` HOT 3
- void-variable clojure-font-lock-extra-keywords HOT 7
- Symbol-overlay conflicts with haskell-mode HOT 4
- Request: Add case insensitive
- `symbol-overlay-list-all`
- Overlay conflicts with eglot HOT 4
- Adding package to NonGNU ELPA HOT 2
- Evil implementation? HOT 1
- 11749c3 breaks things HOT 6
- Cannot be used with yasnippet
- SO didn't recognize sharp quote(function quote), is this made by design or a bug?
- Jumping to next symbol (switch-forward) skips to last on screen HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symbol-overlay.