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 = {
extraPackages = epkgs: with epkgs; [
doom-modeline
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
everywhere?
#+begin_src elisp
(setopt make-backup-files nil)
(setopt create-lockfiles nil)
(setopt auto-save-default nil)
#+begin_src nix
{
programs.emacs.init.usePackage.emacs.custom = {
make-backup-files = false;
create-lockfiles = false;
auto-save-default = false;
};
}
#+end_src
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
some other keybindings) all the time. But, I think one more invisible flag to manage is a bit much.
#+begin_src elisp
(setopt view-read-only t)
#+begin_src nix
{
programs.emacs.init.usePackage.emacs.custom.view-read-only = true;
}
#+end_src
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.
#+begin_src elisp
(setopt sentence-end-double-space nil)
#+begin_src nix
{
programs.emacs.init.usePackage.emacs.custom.sentence-end-double-space = false;
}
#+end_src
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
that I do, I'll have to press two more keys :(
#+begin_src elisp
(setopt kill-whole-line t)
#+begin_src nix
{
programs.emacs.init.usePackage.emacs.custom.kill-whole-line = true;
}
#+end_src
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?
#+begin_src elisp
(column-number-mode t)
#+begin_src nix
{
programs.emacs.init.usePackage.emacs.custom.column-number-mode = true;
}
#+end_src
Make sure which-key mode is always on. The on-the-fly keymap help it gives is indespensable.
#+BEGIN_SRC elisp
(which-key-mode)
#+BEGIN_SRC nix
{
programs.emacs.init.usePackage.which-key = {
enable = true;
hook = ["after-init"];
};
}
#+END_SRC
Automatically refresh ~dired~ buffers when switching to them, instead of requiring an explicit
refresh.
#+BEGIN_SRC elisp
(setopt dired-auto-revert-buffer t)
#+BEGIN_SRC nix
{
programs.emacs.init.usePackage.dired = {
enable = true;
custom.dired-auto-revert-buffer = true;
};
}
#+END_SRC
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.
#+BEGIN_SRC elisp
(add-hook 'after-init-hook 'global-hl-line-mode)
#+BEGIN_SRC nix
{
programs.emacs.init.usePackage.hl-line = {
enable = true;
hook = ["(after-init . global-hl-line-mode)"];
};
}
#+END_SRC
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" ];
};
simple = {
enable = true;
emacs = {
config = ''
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
@@ -2403,8 +2428,7 @@ xs
'';
};
simple = {
enable = true;
emacs = {
hook = ["(org-mode . visual-line-mode)"];
};