New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to use dot instead of face for indentation guides ? #16
Comments
If possible I am in :) |
+1 |
Hi, here is a quick way how to do that. #define vline_width 7 There are some problems with pixel width of chars (you have to have same pixel width of xbm image and character or it gets messy). In my case it's 7 pixels. You can check yours with (frame-char-width (selected-frame)) and adjust the image accordingly. Here is some elisp for adjusting faces
and here is a preview. |
looks amazing @vlcek thanks |
@vlcek can you please create a patch? |
+1 |
I would be very happy if you could specify both a mark character and a face (kind of like how whitespace-mode does it). Then you could e.g. have a faint '|' character. No worrying about pixel widths since it's a regular character. |
Fill-Column-Indicator is able to draw a dashed line. Maybe something can be borrowed from there? |
Awesome work, @vlcek ! However, I couldn't figure out how I could create a bitmap image in Paint, with the settings that you deliverd.
Any suggestion? |
indent-guide can specify indent line symbol. you can use similar unicode symbols to archive this effect. |
@ReneFroger This is what I use in my .emacs which seems to work pretty well for a decent range of font widths (up to char width of 16 pixels). It sets the stipple when enabling highlight-indentation mode on a buffer and looks at the current frame parameters to work out which stipple to set. It can probably be improved to handle an even wider range of widths. (require 'highlight-indentation)
(defun my-set-highlight-stipple ()
;; Define custom stipple for highlight-indentation
;; See https://github.com/antonj/Highlight-Indentation-for-Emacs/issues/16
(let* ((char-width (frame-char-width (selected-frame)))
(hl-stipple (if (> char-width 8)
(list char-width 4 (string 16 0 0 0 0 0 0 0))
(list char-width 4 (string 16 0 0 0)))))
(set-face-attribute 'highlight-indentation-face nil
:stipple hl-stipple
:inherit nil)
(set-face-attribute 'highlight-indentation-current-column-face nil
:stipple hl-stipple
:inherit nil
:foreground "yellow"))
)
;; Patch highlight-indentation-mode to set/update a stipple attribute
(defadvice highlight-indentation-mode (before set-highlight-indentation-stipple activate)
"Sets the stipple used by indentation highlighting"
(my-set-highlight-stipple)) (edit: included char-width directly in the stipple list). |
Sorry for my belated response, thanks for your reply, I really appreciate it. I tried your setup, with Any suggestion in order to debug this? Thanks in advance. |
@Lenbok any chance that your setup is working with Consolas? |
@ReneFroger Yep, I just installed consolas (nice font!) and: |
This is what I get, any ideas? @Lenbok |
Hey folks, is it possible to use a unicode glyph rather than bitmap, for example |
@geraldus Probably not. But see |
@bassu you've made my day! Many thanks! |
I would also like to see the ability to use a Unicode glyph as I typically run emacs in terminal mode. |
@Lenbok your snippet looks promising, but when i paste it into my Does this still work (Emacs version 27.0.50) |
It looks like the |
It would be super nice if we could use glyphs for terminal emacs :) |
By slightly modifying the above snippet one can get thin vertical guide lines: (set-face-attribute 'highlight-indentation-face nil
:stipple (list (frame-char-width (selected-frame)) 4 (string 16 16 16 16))
:inherit nil
:foreground "peru") Information on how |
Is it possible to use dot instead of face for indentation guides ? or a character like middle dot ? for example something like this:
The text was updated successfully, but these errors were encountered: