More use-package

This commit is contained in:
Joe Frikker
2026-10-07 14:39:26 -04:00
parent 55c2311bd7
commit cb6228b8dd
+47 -23
View File
@@ -1046,7 +1046,6 @@ These are just some general settings that apply everywhere. First, a few package
{ {
programs.emacs = { programs.emacs = {
extraPackages = epkgs: with epkgs; [ extraPackages = epkgs: with epkgs; [
doom-modeline
free-keys free-keys
]; ];
}; };
@@ -1098,25 +1097,33 @@ don't need a poor man's local history.
Also, why do I have to set so many variables just to get emacs to stop putting extra files Also, why do I have to set so many variables just to get emacs to stop putting extra files
everywhere? everywhere?
#+begin_src elisp #+begin_src nix
(setopt make-backup-files nil) {
(setopt create-lockfiles nil) programs.emacs.init.usePackage.emacs.custom = {
(setopt auto-save-default nil) make-backup-files = false;
create-lockfiles = false;
auto-save-default = false;
};
}
#+end_src #+end_src
Turn on ~view-mode~ automatically when the buffer is read-only. This just helps out with navigation Turn on ~view-mode~ automatically when the buffer is read-only. This just helps out with navigation
a bit. I almost want to open files read-only by default, just so I can use ~view-mode~ (maybe with a bit. I almost want to open files read-only by default, just so I can use ~view-mode~ (maybe with
some other keybindings) all the time. But, I think one more invisible flag to manage is a bit much. some other keybindings) all the time. But, I think one more invisible flag to manage is a bit much.
#+begin_src elisp #+begin_src nix
(setopt view-read-only t) {
programs.emacs.init.usePackage.emacs.custom.view-read-only = true;
}
#+end_src #+end_src
I don't really do anything with sentences. But, I also never put two spaces after a period. So, at I don't really do anything with sentences. But, I also never put two spaces after a period. So, at
least this setting is correct. least this setting is correct.
#+begin_src elisp #+begin_src nix
(setopt sentence-end-double-space nil) {
programs.emacs.init.usePackage.emacs.custom.sentence-end-double-space = false;
}
#+end_src #+end_src
I kill whole lines *way* more than partial lines. If the cursor is at the front of a line, this will I kill whole lines *way* more than partial lines. If the cursor is at the front of a line, this will
@@ -1124,35 +1131,54 @@ just kill the whole line instead of requiring two ~C-k C-k~ presses to make it h
when I'd ever want it to kill the line *without* the trailing newline, but I guess the one time ever when I'd ever want it to kill the line *without* the trailing newline, but I guess the one time ever
that I do, I'll have to press two more keys :( that I do, I'll have to press two more keys :(
#+begin_src elisp #+begin_src nix
(setopt kill-whole-line t) {
programs.emacs.init.usePackage.emacs.custom.kill-whole-line = true;
}
#+end_src #+end_src
Show column numbers in the modeline. Now that I think about it, I'm not sure why I want this. I Show column numbers in the modeline. Now that I think about it, I'm not sure why I want this. I
guess I could try turning it off someday? guess I could try turning it off someday?
#+begin_src elisp #+begin_src nix
(column-number-mode t) {
programs.emacs.init.usePackage.emacs.custom.column-number-mode = true;
}
#+end_src #+end_src
Make sure which-key mode is always on. The on-the-fly keymap help it gives is indespensable. Make sure which-key mode is always on. The on-the-fly keymap help it gives is indespensable.
#+BEGIN_SRC elisp #+BEGIN_SRC nix
(which-key-mode) {
programs.emacs.init.usePackage.which-key = {
enable = true;
hook = ["after-init"];
};
}
#+END_SRC #+END_SRC
Automatically refresh ~dired~ buffers when switching to them, instead of requiring an explicit Automatically refresh ~dired~ buffers when switching to them, instead of requiring an explicit
refresh. refresh.
#+BEGIN_SRC elisp #+BEGIN_SRC nix
(setopt dired-auto-revert-buffer t) {
programs.emacs.init.usePackage.dired = {
enable = true;
custom.dired-auto-revert-buffer = true;
};
}
#+END_SRC #+END_SRC
Similarly, highlighting the line the cursor is on is really useful for figuring out where you are, Similarly, highlighting the line the cursor is on is really useful for figuring out where you are,
especially on monitors with a lot of vertical space. especially on monitors with a lot of vertical space.
#+BEGIN_SRC elisp #+BEGIN_SRC nix
(add-hook 'after-init-hook 'global-hl-line-mode) {
programs.emacs.init.usePackage.hl-line = {
enable = true;
hook = ["(after-init . global-hl-line-mode)"];
};
}
#+END_SRC #+END_SRC
From the docs: "If ‘complete’, TAB first tries to indent the current line, and if the line was From the docs: "If ‘complete’, TAB first tries to indent the current line, and if the line was
@@ -1739,8 +1765,7 @@ Some auto-formatting stuff
hook = [ "after-init" ]; hook = [ "after-init" ];
}; };
simple = { emacs = {
enable = true;
config = '' config = ''
(setq-default indent-tabs-mode nil) (setq-default indent-tabs-mode nil)
(setq-default tab-width 4) (setq-default tab-width 4)
@@ -2403,8 +2428,7 @@ xs
''; '';
}; };
simple = { emacs = {
enable = true;
hook = ["(org-mode . visual-line-mode)"]; hook = ["(org-mode . visual-line-mode)"];
}; };