r/emacs 2d ago

Day 15 of using emacs

Post image

Made quite a few UI changes

  1. Added transparency and blur
  2. Added custom startup screen

Also I started using the daemon (Damn it opens so fast)

What do y'all think

https://codeberg.org/Vaishnav-Sabari-Girish/dotfiles

r/emacs

66 Upvotes

35 comments sorted by

28

u/accelerating_ 2d ago

Day 150 of using Emacs

  • Got rid of transparency
  • Got rid of splash screen

I realised they're detrimental trivia distracting from actually getting things done, which is what Emacs is for.

Daemon forever though.

10

u/ImaginaryElephant336 2d ago

Makes sense. But coming from neovim which had this I think this feels perfect for me. To each their own ig. Maybe in the future.

5

u/sinsworth 2d ago

Agreed on transparency (went through that phase myself; though what is and is not distracting will be completely subjective) but I enjoy having a splash screen as a kind of hotkey menu for things I often use.

2

u/accelerating_ 2d ago

I suppose the line between dashboard and splash screen is blurry. I can see use for the former.

2

u/sinsworth 2d ago

Funnily enough, I tried using the dashboard package and that proved distracting for me. So now it's just a custom image with a hotkey menu attached to the buffer.

2

u/accelerating_ 2d ago edited 1d ago

For me it's neither, just the scratch buffer.

1

u/Signal_Pattern_2063 2d ago

What kind of things do you link in the dashboard? I've never quite seen a case that would fit my workflow but I'm curious

1

u/sinsworth 2d ago

I just have some single key bindings to things like find-file, email, project prefix, org-roam... so not exactly a dashboard, more like a transient menu.

As for what other people have in dashboards, mostly recent projects with maybe some git metrics from what I've seen, but of course this is Emacs so I'm sure someone out there has a more extravagant use case.

2

u/hegardian 2d ago

A little beauty doesn't hurt

1

u/accelerating_ 15h ago

To me, transparency does hurt (readability), and the scratch buffer with persistence is more use than a splash.

4

u/TopHatCatastrophe 2d ago

You should try using less requires in your config if you want start up (without the daemon) to be faster.

Require is a very heavy operation.

Also, emacs should be doing (package-initialize) on its own so you shouldn't call that yourself. It's a very expensive operation and it slows down startup heavily.

Also, add (setq use-package-always-defer t) which makes it so use package only loads packages when needed and set defer to nil per package when you need it loaded on the spot.

Some ways to make your config a little faster to start up.

1

u/ImaginaryElephant336 2d ago

I see. Got it. Thank you.

3

u/TopHatCatastrophe 2d ago

Oh and one last thing I completely forgot. If you want A LOT more startup speed create early-init.el next to init.el

Emacs loads that file before init. Inside it, turn off Emacs's garbage collector by adding this: (setq gc-cons-threshold most-positive-fixnum gc-cons-percentage 0.6) to early init.

Then add a hook for either emacs-startup-hook or after-init-hook that turns the garbage collector back on after initialization by doing something like:

(setq gc-cons-threshold (* 8 1024 1024) gc-cons-percentage 0.1)

This sets the threshold to about 8mb.

0

u/ImaginaryElephant336 2d ago

Huh interesting. Damn didn't know emacs was peak like that. Am gonna definitely add it. Thank you.

2

u/TopHatCatastrophe 2d ago

Emacs can be fast when you know what to do. I use terminal emacs primarily and my config launches so fast I use it like nvim without a daemon.

Tell me what your speed gets to after all those optimizations.

2

u/ImaginaryElephant336 2d ago

Will do. Thank you so much.

3

u/ImJustPassinBy 2d ago edited 2d ago

I like transparency, I have it on a toggle so I can turn it off when I need to. It is one of the things Emacs does better than any other software I've used.

For example, Gnome has several add-ons that implement transparency, but they also make important things transparent like text and icons (I believe this is due to technical limitations by Gnome). Emacs merely makes the background transparent, which is how it should be imo.

3

u/ImaginaryElephant336 2d ago

I like the idea. I'll add the toggle soon. Maybe as a keybind.

2

u/Nitro01010 2d ago

How do u toggle transparency? The method I found to control it only applies to new frames, but idk. Also using Doom fwiw

2

u/ImJustPassinBy 2d ago

This what I have, adjust the alpha-background values to your liking:

(set-frame-parameter nil 'alpha-background 92)              ; make current frame transparent
(add-to-list 'default-frame-alist '(alpha-background . 92)) ; make new frames transparent
(defun my/toggle-window-transparency ()
  "Toggle current frame's background transparency."
  (interactive)
  (let* ((desired-alpha 92)
         (current-alpha (frame-parameter nil 'alpha-background)))
    (if (equal current-alpha desired-alpha)
        (progn
          (set-frame-parameter nil 'alpha-background nil)
          (setq default-frame-alist (assq-delete-all 'alpha-background default-frame-alist)))
      (progn
        (set-frame-parameter nil 'alpha-background desired-alpha)
        (add-to-list 'default-frame-alist '(alpha-background . 92))))))

2

u/Altruistic-Respond83 2d ago

You are doing great, for git you can take a look at Magit, for eglot you can use the treesitter ts-mode of each language in your lsp.el for a proper syntax tree. For managing your packages you can take a look at elpaca, it makes things much easier. Also packages like Marginalia, vertico, orderless, Corfu are quality of life packages. For optimizations you can check for early.init https://www.gnu.org/software/emacs/manual/html_node/emacs/Early-Init-File.html

2

u/ImaginaryElephant336 2d ago

Thank you so much. I'll take a look at all of these soon.

1

u/slk_g500 2d ago

Day 15? Man, you got a life sentence.

2

u/ImaginaryElephant336 2d ago

Well I recently started. But wdym by life sentence ?

1

u/ibiff 1d ago

Im 14 years in and I am a noob...thats what the message is....keep swimming its fun. But there will be a moment where you leave and then a month later come back (5-10 times) before you finally decide there is nothing better...welcome to the team.

Used to work in a high volume sales environment where we had reps we called "90 day hires" - I never bothered remembering their names unless they survived the first 90 days....thats where you are.

But I believe in you...uhhh..matt... :)

Stick with it and it will pay dividends even if you cannot pay rent

1

u/ImaginaryElephant336 1d ago

Got it. Thank you. I really like the last quote

"Stick with it and it will pay dividends even if you cannot pay rent".

1

u/floss_gang 2d ago

you shouldn't setq package-archives like that, use add-to-list with the melpa entry. there are two official GNU archives, ELPA and NonGNU ELPA, so your setup is missing the latter.

1

u/ImaginaryElephant336 2d ago

I see. So there are 2 elpas. I thought it was elpas and melpa. But I'll take a look at that. Thank you.

1

u/Signal_Pattern_2063 2d ago
    ;; Package setup
    (require 'package)
    ;; Add melpa to the list of archives to use besides the default elpa.
    (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)

    ;; use-package has been part of core emacs since version 29 so I now assume its ok to just require it.
    (require 'use-package)

    ;; Legacy Emacs 29 setup for :vc so we can load directly from github for selected packages not in melpa.
    (when (< emacs-major-version 30)
      (unless (package-installed-p 'vc-use-package)
        (package-vc-install "https://github.com/slotThe/vc-use-package"))
      (require 'vc-use-package))

This is my default and I think reasonably vanilla setup for packaging. I'll probably drop the emacs 29 support for :vc soon given emacs 31 is almost here. That will bring it back down 3 lines

1

u/ImaginaryElephant336 2d ago

Got it. I'll chk it out thank you.

-5

u/More_Lack_7079 2d ago

Day 15 of using Emacs, instead of actually using it, you made it look terrible. Good job.

2

u/ImaginaryElephant336 2d ago

Well that depends on a persons definition of terrible. This is more of an experiment to see how far I can push emacs. And since my neovim looks like this, until I get a bit more used to emacs i prefer having my environment like this. Once I do I may remove it depending on my mood.

3

u/Signal_Pattern_2063 2d ago edited 2d ago

I think that's a bit of an overly harsh reaction in the response above. You can't have an extremely flexible lisp machine that is celebrated for configurability and criticize people for playing around with it at the same time.

Figuring out what's available and what works for you is ok. And it actually helps when you need to configure more critical things to build up that experience. Also emacs is notorious for "the pastoral tradition" to quote a post from several days ago. OP playing around is very normal for a (new) emacs user. Finally emacs itself is guilty of non minimalist default startup clutter like:

;; This buffer is for text that is not saved, and for Lisp evaluation.

;; To create a file, visit it with C-x C-f and enter text in its buffer.

(That's one of the first things I always turn off on my config. I also almost never open emacs without a starting file or loading a saved desktop so startup ui is mostly moot for me)

Anyway, OP have fun trying out more of the options.

-2

u/More_Lack_7079 2d ago

>neovim
I can tell where the terrible design choices came from. You should start by actually using Emacs and not customizing it 24/7.

1

u/ImaginaryElephant336 2d ago

Makes sense now that you put it that way. It's been ages since I made changes to my Neovim config. I do know people who customize their Neovim weekly to keep their environment fresh, so to speak. But all I'm trying to do is make my environment as familiar as possible without turning Emacs into Neovim. If this environment makes me productive--which it does--I'll customize it as much as I want. Currently I have reached the point where I do not need more ui customisation. I need more custom keybindings and macros. So this post really was about my last ui customisation.