Commit graph

237 commits

Author SHA1 Message Date
William Carroll
78172233f8 Add build, lint Emacs steps to post-receive pipeline
TL;DR:
- Define runEmacsScript to emacs/default.nix for ci/pipelines/post-receive
- Write script.el to call (load init.el) and catch any errors
- Lint Elisp with gonewest818/elisp-lint

Also nice how Buildkite supports :gnu: emojis!
2020-08-27 18:29:48 +01:00
William Carroll
d67dbec7e8 Clean up emacs/default.nix
- Prefer prepending wpcDir, vendorDir to EMACSLOADPATH instead of using the
  --directory flag
- Remove --load ${wpcPackageEl} because init.el calls (require 'wpc-package)
- Surround $@ in 2x-quotes
2020-08-27 18:25:14 +01:00
William Carroll
a1a2f0bbbd Remove exported DEPOT env var from wpcarros-emacs
wpcarros-emacs no longer depends on this being set.
2020-08-27 17:31:25 +01:00
William Carroll
eb0e1d8c5d Prefer builtins.path
Following the advice of Domen's nix.dev anti-patterns, I'm preferring something
like...

```nix
builtins.path { path = /path/to/some.where; name = "some.where"; }
```

...to

```nix
/path/to/some/where
```

While the former is more verbose, it will fail to build when the path doesn't
exist, which I prefer.
2020-08-27 17:31:15 +01:00
William Carroll
ea0788fd62 Delete unused parts of bookmark.el
Trimming more fat.
2020-08-26 18:30:10 +01:00
William Carroll
8fef6c0408 Remove bookmark for <depot>
Since depot now support cs.tvl.fyi, I don't need this, and that is a *massive*
upgrade.
2020-08-25 14:20:46 +01:00
William Carroll
8eed16dc67 Replace calls to (getenv "BRIEFCASE") with constants/briefcase
I would prefer to define constants/briefcase in terms of `(getenv "BRIEFCASE")`
and assert that `(f-exists? (getenv "BRIEFCASE"))`, in one location:
constants.el
2020-08-25 14:19:19 +01:00
William Carroll
21ce27b0ca Prefer <leader>jb to <leader>jd for searching all of briefcase
Feels more natural...
2020-08-25 14:16:41 +01:00
William Carroll
504cf0daab Delete org-helpers
I'm trying to tidy things up, so I'm trying to apply some of the principles from
"Essentialism" to my Emacs configuration.
2020-08-25 14:15:58 +01:00
William Carroll
23a41528bb Remove unnecessary TODO
The Nix expression that builds `wpcarros-emacs` sets BRIEFCASE, so the .envrc
isn't relied on.
2020-08-25 14:02:32 +01:00
William Carroll
64afb11d60 Remove unnecessary code from wpc-nix.el
TL;DR:
- Prefer `(getenv "BRIEFCASE")` to `(f-expand "~/briefcase")`. I should audit my
  Emacs for references to ~/briefcase and replace those calls with `getenv`.
- Remove calls setting <nixpkgs> and <depot> and rely exclusively on <briefcase>
- Prefer ~/nixpkgs-channels to ~/nixpkgs.

Notes:
- I need a better way of calling `home-manager switch` that resides within my
  briefcase
2020-08-25 13:55:14 +01:00
William Carroll
7a1e56e7d1 Prefer simpler, more idiomatic project-find-function
This version avoids installed all of the custom `cl-defmethods` for a
`'monorepo` type and instead uses the existing `'transient`.
2020-08-24 11:19:47 +01:00
William Carroll
5b6862ea39 Call git secret hide whenever //secrets.json is saved
Having `git secret hide` as a pre-commit hook doesn't make much sense to me. I
will detail why when/if I write a blog post on briefcase's secret mgt setup.

The problem is, if I change secrets.json and then run `git status`, I won't see
any pending changes. This is because secrets.json is gitignore'd. If I run `git
secret hide` everytime I save secrets.json, I can rest assured that my `git
status` will be consistent with any updates to secrets.json.
2020-08-20 18:41:39 +01:00
William Carroll
4d8ce34a7e Simplify EXWM init hook
Anytime something before or during window-manager.el fails to evaluate,
I lose the ability to type, but I *can* still click.

@tazjin recommended that I use the mouse to cycle to the *Warnings*
buffer, which led me to another bug in a series of bugs that I'm
uncovering: ~/briefcase/org didn't exist.

A simple mistake like this should break my WM startup, so I decided to
remove most of my init hook logic.
2020-08-20 11:26:32 +01:00
William Carroll
c9da7c5214 Add XMODIFIERS=emacs
This fixes the latest segfault I encountered after
/usr/bin/{google-emacs,emacs} was updated...
2020-08-20 11:26:32 +01:00
William Carroll
9d7331d63b Debug evil-want-keybindings issue
Problem: dependency loading order

I originally assumed that keybindings.el was the first module to `require
'evil` because init.el shows:

```elisp
(require 'keybindings)
(require 'window-manager)
```

The problem is that keybindings.el calls `require 'window-manager` and
window-manager.el requires evil! I admit, I've created a bit of a birds nest for
myself.

A few thoughts:
- keybindings.el doesn't need to `require 'window-manager`. Fixed!
- window-manager.el shouldn't need to `require 'evil`. TODO...
2020-08-20 11:26:32 +01:00
William Carroll
53be40b1a6 Drop use-package in keybindings.el
I'm attempting to kill that zombie bug about evil-want-keybinding...
2020-08-20 11:26:32 +01:00
William Carroll
39622607ff Add missing dependencies to emacs/default.nix
While debugging some broken Emacs config, I ran Emacs in X, where for some
reason my PATH doesn't have my nix-env dependencies... because of this, when I
call `~/.nix-profile/bin/wpcarros-emacs` to start my Emacs, I saw warnings about
missing packages that I hadn't seen before. Nice!
2020-08-20 11:26:32 +01:00
William Carroll
3dc7f7758b Drop support for wpc-keybindings
In favor of keybindings.el!

Now I have:
- kbd.el: There are no keybindings in this file. It's just a library for working
  with keybindings in Emacs.
- keybindings.el: (hopefully) all of my keybindings for EXWM, evil, etc.
2020-08-20 11:26:32 +01:00
William Carroll
4ae6eff607 Remove unused kbd/install-kbds?
In another refactor, I'd like to move all ad-hoc keybindings out of individual
modules and into keybindings.el.
2020-08-20 11:26:32 +01:00
William Carroll
23cf5d43d8 Centralize <SPC> in normal mode KBDs
Merging keybinding and wpc-keybindings step-by-step...
2020-08-20 11:26:32 +01:00
William Carroll
108da34dd9 Delete unused KBDs
Now that everything is in my monorepo, it's easy for me to use <SPC>jd to search
for these files.
2020-08-20 11:26:32 +01:00
William Carroll
0c71fc9d1d Drop support for dir-locals.nix, <nixpkgs>, etc.
In the spirit of Marie Kondo, I'm tidying up!

TL;DR:
- Prefer .envrc `use_nix` and delete all dir-locals.nix files
- Remove ~all references to <nixpkgs>, <unstable>, <depot> and prefer
  referencing each with briefcase.third_party.{pkgs,unstable,depot}
- Delete nixBufferFromShell function since I was only using that in
  dir-locals.nix files
2020-08-20 11:26:32 +01:00
William Carroll
f032eee79d List directories first in dired view
Ideally I'd use exa insted of ls, but I cannot seem to support that yet.
2020-08-20 11:26:31 +01:00
William Carroll
7e2dcc97cc Drop support for wpc/find-file
Cleaning things up...
2020-08-20 11:26:31 +01:00
William Carroll
de723c142b Prefer project.el to projectile
Today @tazjin told me about Emacs's built-in project.el library, which he
recommended that I extend to support monorepo-specific tooling. It worked like a
charm!

Now when I press "<leader>f", it will resolve to either the nearest file named
default.nix or directory name .git.
2020-08-13 18:05:45 +01:00
William Carroll
994a632ac3 Set Emacs current-project to ~/briefcase
I don't rely on this often, so it's best to leave it as the top-level directory
for briefcase.
2020-08-13 18:04:54 +01:00
William Carroll
ca06888a56 Remove week / 52 indicator
This is taking up too much space.
2020-07-17 15:39:37 +01:00
William Carroll
5e81144622 Misc Emacs improvements
I stole these bad-boys from @tazjin's config.
2020-07-06 20:45:33 +01:00
William Carroll
7d9cfdbc41 Prefer telephone-line to doom-modeline
After growing frustrated with doom-modeline's compatibility with my EXWM setup,
I decided to borrow @tazjin's setup, which I find to be much more appealing.
2020-07-06 11:11:08 +01:00
William Carroll
183b306159 Use ivy-helpers/list-external-commands
Without the ivy-helpers/ namespace, I believe this code is buggy.
2020-06-16 11:49:56 +01:00
William Carroll
f4fa363c19 Prefer Solarized Light theme
I've said it once, and I'll say it again: my preferences often change.
2020-06-16 11:49:33 +01:00
William Carroll
ef3cba1b39 Support additional KBDs for Clojure
Define KBDs in clojure-mode-map that resemble my common-lisp and elisp KBDs.
2020-06-16 11:48:44 +01:00
William Carroll
b1e358f247 Use dot-time format for modeline timestamp
My current understanding of how computers deal with time:
- Modelling time is easy: use the number of seconds that have elapsed since the
  Unix epoch.
- Display time is complicated. Which timezone should we use? Which format
  string?
2020-06-16 11:46:17 +01:00
William Carroll
675b8084c7 Prefer smaller default font size for laptop
I'll be working without an external monitor for the next few months, so I prefer
this smaller size.
2020-06-16 11:37:24 +01:00
William Carroll
e864074600 Support elm-mode for Emacs
Instead of (ab)using haskell-mode, support elm-mode.

TODO: Support elm-format on buffer save
2020-04-11 17:45:59 +01:00
William Carroll
3dac2f10ff Drop support for Haskell glyphs
I think that glyphs look nice, but they subtley confuse Emacs's UI. In the case
of a two-character glyph condensing into one character's width, the fill-width
indicator -- correctly -- highlights the 81st character as red, but it looks
like it's erroneously highlighting the 80th.

Also when I want to create an anonymous function I type (), which condenses into
the unit character, and it's difficult to delete either the opening or the
closing parenthesis.

Overall I think glyphs are cute, but they're not worth the trouble.
2020-04-11 10:41:49 +01:00
William Carroll
ca67b4256d Debug unresponsive keyboard
After binary searching through my git history to restore my keyboard
functionality, I discovered the issue: I deleted the "Terminal" workspace, but I
did not remove the call to `(exwm/switch "Terminal")`, which silently prevented
EXWM from initializing.

I wish errors like this were noisier.
2020-04-06 11:30:09 +01:00
William Carroll
a180a51620 Don't depend on google-stuff.el
I created a google-stuff.el module months ago, but I have not needed to
use it much. Removing the google-stuff.el module and all of my
dependencies on it.
2020-04-05 17:01:52 +01:00
William Carroll
81b59e9ddd Drop support for ynab.el
YNAB is short for YouNeedABudget.com. I wrote this code before I started
the //monzo_ynab project.
2020-04-05 16:11:42 +01:00
William Carroll
fb6dabfb8d Drop support for wpc-terminal
As I mentioned in the previous commit, I now use vterm.el as my primary
terminal. I wrote most of this Elisp when I first started using Emacs. I
know longer need it.
2020-04-05 16:10:32 +01:00
William Carroll
431f68298d Drop support for terminator.el
Before I switched to vterm.el, I used alacritty as my primary terminal.
I could not install alacritty on gLinux, so I switched to terminator.
When I was ricing my machine, I wanted my Emacs theme to change my
terminator theme. I never finished that project, and it is quite dusty
now.
2020-04-05 16:08:10 +01:00
William Carroll
695ab28a6c Remove wpc-docker.el
I have not needed this configuration in over a year.
2020-04-05 16:07:33 +01:00
William Carroll
408a25415c Remove dotfiles.el
This module is a bit stale.
2020-04-05 15:58:57 +01:00
William Carroll
946ccfb247 Tidy //emacs
TL;DR:
- Add README.md that includes instructions on how to install my Emacs
- Delete unused Makefile
2020-04-05 15:50:58 +01:00
William Carroll
46d817665f Move Emacs documents to //emacs
These documents outline some of my Elisp conventions and ideas. As such,
I think //emacs should host them.
2020-04-04 14:30:27 +01:00
William Carroll
f23e1be416 Drop support for Terminal workspace
I created the Terminal workspace before I wrote a function for finding/creating
vterm instances. I now use the latter almost exclusively.
2020-04-03 10:08:41 +01:00
William Carroll
d8f0f3daf3 Remove :index field from exwm/named-workspace struct
I can compute the index use dash.el's -elem-index. I'm also removing some unused
EXWM workspaces.
2020-04-02 18:36:51 +01:00
William Carroll
099d88739b Tidy window-manager.el
Remove stale code and stale comments.
2020-04-02 18:36:21 +01:00
William Carroll
691583ed5c Refactor opening X applications from Emacs
I borrowed heavily from Vincent's depot.
2020-04-02 18:34:49 +01:00
William Carroll
d12b8b3dcb Build either emacs.{glinux,nixos} depending on my current device
`M-x nix/rebuild-emacs` will build either emacs.glinux or emacs.nixos depending
on whether I'm using a work device or a personal device.
2020-04-02 14:50:53 +01:00
William Carroll
86da482fbf Define device/corporate?
Write a predicate function for checking whether or not I'm on a corporate
device.
2020-04-02 14:50:18 +01:00
William Carroll
401ec6a7a1 Tidy up emacs/default.nix
When I run `nix-env -f '<briefcase>' -iA emacs`, Nix builds a derivation of
wpcarros-emacs using the path to the Emacs derivation. This doesn't work well on
glinux and causes strange behavior. For instance, Chrome crashes when it tries
to browse for files. Building with `nix-env -iA emacs.glinux` fixes this and
other problems.

Miscellaneous other changes:
- Remove unnecessary fix-point recursion
- Drop support for unused dottime.el
- Remove unused overrideEmacs
- Remove unused withLocalConfig
- Support emacs.glinux and emacs.nixos alternative derivations
2020-04-02 14:37:47 +01:00
William Carroll
8c3bf2debf Set Gruvbox theme as my default Emacs theme
I want to use a dark theme for awhile.
2020-04-02 14:37:09 +01:00
William Carroll
be13644f1c Tidy up themes.el
TL;DR:
- Prune unused themes
- Prefer "JetBrainsMono" font for all themes
- Remove TODOs that I've either supported or that I'm uninterested in supporting
2020-04-02 14:36:12 +01:00
William Carroll
8fa3140253 Increase default font size for laptop
I'm working off of my laptop but I'm using my 4k monitor. The expression that
sets `fonts/size` could be more sophisticated and detect this, but for now, I'm
just bumping up the size.
2020-04-02 14:34:31 +01:00
William Carroll
d88a4d5792 Drop support for org-capture
I don't use org-capture, and I am not currently interested in developing that
habit.
2020-04-01 21:02:30 +01:00
William Carroll
90154fd2dd Prefer briefcase/org to Dropbox/org
I would like to version-control most but not all of my org files.
2020-04-01 21:01:17 +01:00
William Carroll
7dbf7b025a Delete dusty Elisp code
When I first switched to EXWM, I wrote a lot of Elisp. I think I was mostly
excited about having a monorepo and, as I had a backlog of ideas that I wanted
to implement, I ended up writing many halfly baked ideas in Elisp. These are
mostly sketches.
2020-04-01 20:58:10 +01:00
William Carroll
f2ba5aca31 Ensure Emacs prettier hook activates
Problem:
prettier-js waits for rjsx-mode. rjsx-mode only runs on .js files. As such,
the hook that installs prettier-js-mode for *all* of my frontend hooks, which
includes more than just js files, does not install until a javascript file is
opened.

Solution:
Do not conditionally load prettier-js.

Bonus:
Remove the .js mode from rjsx.
2020-03-27 10:59:57 +00:00
William Carroll
47a0b45f5f Change theme to doom-one
TL;DR
- Prefer doom-one theme to solarized light
- Prefer colorscheme/set to themes/set
2020-03-26 23:34:40 +00:00
William Carroll
1cc1ce5ccf Change the value of constants/current-project
Yesterday evening, I moved the blog directory to website/blog; I forgot to
update this value.
2020-03-20 16:56:46 +00:00
William Carroll
117f0be7c2 Unbind <SPC> in evil's motion map
By default this just advances the point one character, which I don't use nor
want especially because my leader key is the space key.
2020-03-20 12:12:42 +00:00
William Carroll
d0d77baafb Support KBD for toggling linum-mode
I would like to restore the good practice of jumping precisely to line numbers
within buffers.
2020-03-20 12:12:09 +00:00
William Carroll
fbf66c423b Remove setting for enabling both laptop and external monitor
Currently I prefer working with one screen at a time, so I'm preferring to
toggle between external monitor and laptop monitor.
2020-03-16 13:58:18 +00:00
William Carroll
8c0a56a03e Restore Emacs server
I think I removed the `(server-start)` call when I was debugging some EXWM
issues. I have stabilized my configuration considerably since then, and I'd like
to use the Emacs server.
2020-03-10 23:07:30 +00:00
William Carroll
5d656b646f Include notmuch as an Emacs dependency
`(require 'notmuch)` in `email.el` broke my Emacs initialization. This should
fix that.
2020-03-06 18:45:55 +00:00
William Carroll
28af585f3d Include NIX_PATH settings in nix/rebuild-emacs function
I'm currently setting NIX_PATH in ~/briefcase/shell.nix. This means when I call
`nix/rebuild-emacs` from a buffer that is inside the briefcase directory, the
command succeeds because NIX_PATH is properly defined. When I call
`nix/rebuild-emacs` from any other location it fails.

I'm hard-coding the NIX_PATH in this command so that I can call
`nix/rebuild-emacs` from any buffer that is currently active.
2020-03-06 18:45:55 +00:00
William Carroll
96ff26e5ca Support nix/home-manager-switch
As a part of my plan to reduce my dependence on the shell, I defined an Elisp
function to call `home-manager switch` from `M-x`.
2020-03-06 18:45:55 +00:00
William Carroll
19742e7790 Add programs to home-manager
Support commonly used programs like fd, exa, bat, etc.

For now, I'm unsure how to manage the programs in my emacs/default.nix with my
home.nix. I'll wait until I have a stronger opinion to handle this.
2020-03-06 10:15:29 +00:00
William Carroll
dec005ea34 Consume top-level emacs attribute
Refactor `nix/rebuild-emacs` to consume newly defined top-level emacs
attribute.
2020-03-04 19:49:45 +00:00
William Carroll
3abee3373c Use doom-modeline
Cleaning up my modeline by using the beautiful doom-modeline package.
2020-03-01 22:32:25 +00:00
William Carroll
9e0fdd3973 Remove default values for Nix expression parameters
I'm not sure if this commit breaks everything in my monorepo. I think it
will.

Why am I doing this? Perhaps it's a bad idea. I don't fully understand how
readTree works. My ignorance is costing me hours of time spent debugging. In an
effort to better understand readTree, I'm removing the default values for my Nix
expression parameters, which I believe have preventing errors from surfacing.
2020-03-01 22:32:24 +00:00
William Carroll
527b472469 Converge naming of Acer laptop to "socrates"
Prefer "socrates" to "flattop".
2020-02-22 19:04:12 +00:00
William Carroll
1fbc80359b Support ssh/{sudo-buffer,cd-home}
- Support command to open a dired buffer with wpcarro's $HOME directory for any
  host defined in ssh/hosts.
- Support opening the current buffer with sudo privileges.
2020-02-20 23:18:59 +00:00
William Carroll
9fc29831e0 Configure ssh preferences
Every Tuesday I work from Google's 6PS office instead of BEL. I work from my
laptop, which often requires that I ssh into the desktop work station in BEL. I
have settled on a locally optimal workflow that I'd like to improve. To help
seek higher ground, I'm planning on using ssh.el to configure tramp and define
utility functions to lower my cost of exploring new workflows.

- Defines a function, `ssh/desktop-cd-home` that helps me quickly open a dired
  buffer for my work station's home directory.
- Documents some variables that I set weeks ago.
- Requires ssh.el in init.el.
2020-02-18 11:18:02 +00:00
William Carroll
993f7c9389 Further configure notmuch
Until now my notmuch is usable but not almost always pleasurably so. For
example, when I reply to messages, notmuch warns that "Insert failed:"; when I
check Gmail, the reply sent... strange. After consulting with a fellow notmuch
user and Emacs disciple, tazjin@, I borrowed some of his notmuch configuration.

- notmuch is no longer warning about replies
- Replies do not include noisy email signatures
- I have an Emacs User-Agent header in my outgoing mail
- All of this and more...
2020-02-18 11:09:03 +00:00
William Carroll
6f179afd49 Define KBD for find-file-at-point (i.e. ffap)
I'm attempting to incorporate the beloved find-file-at-point function into my
workflow.
2020-02-18 11:09:03 +00:00
William Carroll
159301da50 Further specify saved searches for tags
Add tag:unread to:
- direct
- broadcast
- systems

Additionally: I added "and not tag:sent" for direct because oftentimes I send
myself mail. Without that condition, my sent mail shows up in direct.
2020-02-18 11:09:03 +00:00
William Carroll
2e63a4e2e1 Require keybindings.el after wpc-keybindings.el
keybindings.el calls (require 'evil-ex), which I introduced in this commit...
0456a1c4b4
...calling (require 'evil-ex) loads evil. When evil is loaded before
evil-want-integration is set to nil, evil-collection writes to *Warnings* when
Emacs initializes, which I find noisy. This commit ensures the
evil-want-integration is set to nil before evil is loaded, which appeases
evil-collection and thus removes the warning message.

Bonus:
If you git checkout the previous commit, and attempt to run the KBDs...
- `SPC g s`: magit-status
- `s h`: evil-window-vsplit
...from a buffer whose major-mode is dired-mode, you should notice that the
above functions won't execute.

Strangely though, if you look at this commit...
37f8ca04f2
...I fixed these issues. Well I introduced a regression when I added 0456a1c.

My current guess is that when evil-collection complains about
evil-want-integration, it is breaking the evaluation sequence of my init.el
file. wpc-dired.el is downstream from wpc-keybindings.el, which requires
evil-collection. Perhaps no modules required after wpc-keybindings.el are
evaluated after evil-collection warns about evil-want-integration. Even if that
assumption is wrong, what I do know is that this commit fixes the
evil-collection warning and restores the KBDs for dired-mode-map.

Here's to feeding two birds with one scone!
2020-02-17 22:40:41 +00:00
William Carroll
e61965cafd Drop support for compton
I'm finding myself running `pkill compton` offer. In the spirit of slimming down
my configuration, I'm dropping support for compton.
2020-02-17 21:18:03 +00:00
William Carroll
6051654527 Support additional notmuch saved queries
Today I setup declarative gmail filters using some Google internal tooling. I'm
now adding labels to messages from Critique, Sphinx, Ganpati, "The Daily
Insider", messages sent directly to me, and more. These labels are applied
server-side.

On the notmuch, client-side, I'm support saved queries for these newly created
gmail labels.
2020-02-16 17:16:05 +00:00
William Carroll
08c3f6dd69 Support KBDs for labelling emails
I can already tag emails with `+` and `-`. Here I'm defining KBDs for moving
messages from my inbox into: action, review, and waiting. I'm also mutually
excluding messages in action, review, and waiting from inbox and vice versa.

I'm also supporting a "muted" tag for now; I'm still learning how to use notmuch
with email threads, but I'm hoping the "muted" tag will prevent future messages
in a thread from arriving in my inbox.
2020-02-16 17:13:21 +00:00
William Carroll
1ed7f2ed73 Prefer newest-to-oldest sorting
The default sorting order of results from notmuch.el are in
oldest-to-newest. This prefers the opposite.
2020-02-14 18:01:38 +00:00
William Carroll
0456a1c4b4 Define notmuch KBDs
Until I have more opinions about my workflow with notmuch, I will redefine the
KBDs from Gmail that I'm comfortable with. While not many KBDs are defined here,
evil-collection defines dozens, many of which I find reasonable; those that I
disagree with, I've unbound in this commit.

Composing emails in notmuch feels similar to writing a commit message with
magit. I want to be able to type :x or :wq, but these commands don't DWIM. For
magit, I'd like that behavior to be the same as `C-c C-c`; not surprisingly, for
notmuch, I'd like the same.

I've bound :x to do this for notmuch. I'd like to define a macro that can easily
define buffer-local evil-ex commands for particular modes. This should lower the
cost of defining evil-ex commands and hopefully convince me to support some of
this desired behavior.
2020-02-14 15:38:28 +00:00
William Carroll
8105af7b8d Configure saved searches for notmuch
Mimmicking the "action", "review", and "waiting" labels that I had in Gmail
using the equivalent labels as tags in notmuch.
2020-02-14 15:38:05 +00:00
William Carroll
fa779ab7bf Support list/xs-distinct-by?
Supporting a predicate to check that all elements in a list are distinct after
applying a transformation function to them.
2020-02-14 15:34:56 +00:00
William Carroll
1a484b4b91 Disable auto pairing parens, brackets, quotes
I don't see much value in this tool for my workflow.
2020-02-12 18:07:31 +00:00
William Carroll
d81f31107d Support cycling through display configurations
Today when I opened my laptop, I wasn't sure if it was powered off or on because
the display was blank. Thankfully the volume was muted and the LED indicator was
on, which informed me that the laptop was powered on. This saved me from
unnecessarily rebooting.

What happened was that last night I was working from home and using my external
monitor. Usually I enable my external display and disable my laptop display. But
when I left for work this morning, I unplugged the HDMI cable from my laptop
without disabling the external display or enabling the laptop display.

I noticed a XF86 button on my laptop entitled XF86Display. I figured that this
could be a nice place to bind a key to toggle my laptop display on or off. At
the last minute, I had the idea to just cycle through all possible display
configurations that I use; there are only three anyways. When dealing with more
than two states, I realized I should use a cycle to model the configuration
states. Now I'm thinking that I should be using cycles to model toggles as well
- instead of just using a top-level variable that I `setq` over. I haven't
refactored existing toggles to be cycles, but I am excited about this new
keybinding.

This commit additionally:
- Moves keybindings out of display.el and into keybindings.el
- Conditionally sets KBDs if using work laptop
2020-02-11 13:56:10 +00:00
William Carroll
3fa8276816 Support C-k for upward movement in ivy-switch-buffer-map
Without these KBDs, C-k kills buffers. As an evil-mode user, I expect C-k to
move upwards. As such, adding the `ivy-switch-buffer-map` to my existing ivy
KBDs that handle a similar use-case.

Note: I'm unsure why the KBDs in evil-collection didn't cover this.
2020-02-10 11:36:09 +00:00
William Carroll
52831c7136 Disable ido-mode
For awhile I had a mixture of ivy and ido. Disabling ido and preferring ivy for
everything.
2020-02-10 11:35:27 +00:00
William Carroll
9dd9bce494 Add ts.el to emacs/default.nix
I ran `M-x package-autoremove` that deleted `ts.el`, which wasn't listed in my
default.nix. Adding it...
2020-02-10 11:34:19 +00:00
William Carroll
2af05f698c Support vterm-mgt.el
I enjoyed using term-switcher so much that I ended up adopting vterm as my
primary terminal. After reaching for vterm as often as I did, I realized that I
would enjoy supporting cycling through instances, creating new instances,
deleting existing instances, renaming instances. Thus spawned vterm-mgt.el.

I'm particularly excited about the KBD to toggle between vterm instances and
source code buffers.
2020-02-10 10:06:40 +00:00
William Carroll
8584059e7c Support cycle/{append,remove}
Supporting these functions was a little tricky. For example, how should we
handle calling cycle/remove on the item that is currently focused? After
attempting to be clever, I decided to just set the value to nil and let the
consumer decide what is best for them. I can always support a more opinionated
version that fallsback to previous-index if previous-index is set. But until I
have a better idea of how I'm going to consume this, I think nil is the best
option.
2020-02-10 10:06:33 +00:00
William Carroll
f145bc9eb6 Support cycle/focus-item
I oftentimes call `cycle/focus` and pass `(lambda (a) (equal a b))`. This
function should tighten up my code.
2020-02-08 15:55:59 +00:00
William Carroll
3f54dd8601 Support cycle/empty?
Add predicate for determining if a cycle contains items.

Updated cycle/{new,from-list} to support setting current-index to nil when a
consumer calls it with an empty list.
2020-02-08 15:55:53 +00:00
William Carroll
048b7867bf Add bin dependencies to wpcarros-emacs
I removed most of the packages that I install with `nix-env`. You can view these
with `nix-env --query`. This is one small step in a grander project to migrate
entirely to a declarative config managed by Nix.
2020-02-07 11:01:24 +00:00
William Carroll
52d284f59d Remove assertions that prelude/executable-exists?
I'm in the midst of transitioning onto a few new tools.

My previous workflow just used `nix-env` to install *some* packages. I didn't
have a prescribed methodology for which packages I would install using `nix-env`
and which ones I would install using `sudo apt-get install`. Sometimes if a
package would be available in my aptitude repositories, I'd use that; other
times when it wasn't available I'd use `nix-env`. One complication about being
on gLinux intead of NixOS is that some packages (e.g. nixpkgs.terminator) is
available via `nix-env -iA nixpkgs.terminator`, but the installation won't
actually run on my gLinux. In these instances, I would install terminator from
the aptitude repositories.

Then @tazjin introduced me to his Emacs configuration that he builds using
Nix. What appealed to me about his built Emacs is that it worked as expected on
either a NixOS machine and on gLinux (and presumably on other non-NixOS machines
as well).

A setup towards which I'm working is to own one or a few NixOS machines whose
configurations are entirely managed with Nix. On devices like my work machines,
which cannot run NixOS, I can build as much of the software that I need using
Nix and attempt to minimize the ad hoc configuration either with shell scripts,
python, golang, or more Nix code... it's clear that I still don't have a clear
idea of how that part will work.

For now, I'm adopting nix, nix-env, lorri, direnv, and weening off of aptitude
as much as I can. Things are a bit messy, but my general trend feels
positive. Stay tuned for more updates.
2020-02-07 11:01:24 +00:00
William Carroll
b4dd290745 Temporarily disable initialization code
My Emacs initialization fails for a few reasons, which I haven't prioritized
time to investigate yet:

- Some OCaml deps are absent
- godoc is absent
2020-02-05 23:33:29 +00:00
William Carroll
05135ef875 Further configure Go tooling
- Prefer goimports to gofmt. goimports calls gofmt; it also adds and removes
  dependencies.
- Assert the presence of goimports, godoc, godef
- KBD godef to M-.
- Support the M-x compile command for calling `go build -v`
2020-02-05 17:58:15 +00:00
William Carroll
cce926d60f Remove KBDs supporting undesired Ergodox configuration
I mistakenly mapped one of my dual-function keys on my Ergodox to send Shift+CMD
instead of CMD. When some of my Emacs keybindings weren't firing, I noticed that
the key event they received was some like `C-S-s-<char>` instead of say
`C-s-<char>`. As a quick fix, I duplicated each of my keybindings that relied on
the CMD key to support Shift+CMD as well until I remapped the key on my
Ergodox. This morning, I remapped the Shift+CMD key to CMD, so I'm bidding adieu
to this code.
2020-02-03 10:54:15 +00:00
William Carroll
4de3e5c392 Add KBDs to vterm
Support pasting and scrolling.
2020-02-02 18:31:39 +00:00
William Carroll
ffbe5c9757 Support emacs fn for rebuilding wpcarros-emacs
Call `M-x` `nix/rebuild-emacs` to build and link `wpcarros-emacs`.
2020-02-02 18:31:33 +00:00
William Carroll
2cfcb1c34d Support focusing EXWM X-application buffers
Press `<M-escape.` to display a list of buffers hosting X applications. Use
`completing-read` to select and focus one of these.

See the function docs and TODOs for more information.
2020-02-02 18:31:33 +00:00
William Carroll
2e76601f70 Blacklist additional non-source-code modes
I don't want vterm buffers or magit buffers showing up when I cycle throw
buffers.
2020-02-02 18:31:33 +00:00
William Carroll
5521db80b1 Attempt to debug xrandr behavior in display.el
Currently, after I connect my monitor to my laptop, I run `display/enable-4k`,
which will use `xrandr` to enable the display. The scaling of the enabled
display is not what I expect. So I've habituated re-running the same function,
`display/enable-4k`, which scales the display and meets my expectations.

What's strange is that if instead of running `display/enable-4k` the first time
from Emacs, I call `xrandr ...` from a terminal, this enables the display and
scales it properly on the first invocation.

I'm unsure how to explain this behavior. It's possible that a environment
variable is set properly in the terminal that isn't set in my Emacs, but this is
just a guess.

I'm going to using a different invocation in display.el that explicitly passes
the monitors dimensions. Let's see if that works.
2020-02-02 18:31:32 +00:00
William Carroll
2ec436b2b5 Support KBDs for term-switcher package
To facilitate transitioning from using `terminator` to using `vterm`, I'm
defining some KBDs that I hope will help me habituate my usage of `vterm`.
2020-02-02 18:31:32 +00:00
William Carroll
851aba8201 Support timestring.el
Quickly access strings that encode time is various formats. See the module docs
in timestring.el for more information.
2020-02-02 18:31:32 +00:00
William Carroll
e8b47d5030 Support golang
I decided to start writing go code for scripts instead of python. I think this
will be a learning opportunity for me and should increase the integrity of my
scripts by adding some static type checking.
2020-01-31 23:18:59 +00:00
William Carroll
837cfe07c7 Rename dotfiles -> briefcase
Renaming my mono-repo briefcase.

I first introduced this commit in master, but it introduced a bug where one of
two things would happen:

1. Emacs wouldn't start and would crash X.
2. Emacs would start but my keyboard wouldn't work.

I learned some valuable debugging skills in the process. Here are some of them:

When my keyboard was broken, I wanted to control my computer using my
laptop. Thankfully this is possible by using `x2x`, which forward X events from
the SSH client to the SSH host.

```shell
> # I'm unsure if this is the *exact* command
> ssh -X desktop x2x -west :0.0
```

Git commit-local bisecting. I didn't need to do a `git bisect` because I knew
which commit introduced the bug; it was HEAD, master. But -- as you can see from
the size of this commit -- there are many changes involved. I wanted to binary
search through the changes, so I did the following workflow using `magit`:

- git reset --soft HEAD^
- git stash 1/2 of the files changed
- re-run `nix-env -f ~/briefcase/emacs -i`
- restart X session
- If the problem persists, the bug exists in the non-stashed files. Repeat the
  process until you find the bug.

In my case, the bug was pretty benign. Calling `(exwm/switch "Dotfiles")` at the
bottom of `window-manager.el` was failing because "Dotfiles" is the name of a
non-existent workspace; it should've been `(exwm/switch "Briefcase")`.

There may have been more problems. I changed a few other things along the way,
including exposing the env vars BRIEFCASE to `wpcarros-emacs` inside of
`emacs/default.nix`.

The important part is that this was a valuable learning opportunity, and I'm
glad that I'm walking away from the two days of "lost productivity" feeling
actually productive.
2020-01-31 15:27:48 +00:00
William Carroll
edea127e07 Support building wpcarros-emacs
I'm using a Makefile until I can remember the command:

```shell
> nix-env -f . -i
```

This will install (i.e. `-i`) any derivations instantiated from the Nix
expression resolvable by `-f`. Ideally the incantation will look something like
this:

```shell
> nix-env -f '<universe>' -iA emacs
```

Informing `nix-env` to install all of the derivations created by the expression
at attribute `emacs` in my `<universe>` repository. For now two things are
preventing this:

1. `emacs` isn't an attribute in my top-level expression defined in the
   `default.nix`.
2. If I do add `emacs` as an attribute and call the above command, my usage of
   `readTree` results in `pkgs` missing `.lib` and a few other stdlib commands
   that are available in `(import <nixpkgs> {})`.

A fix for both of these should be forthcoming.
2020-01-31 13:20:18 +00:00
William Carroll
578ed1ba98 Move move .emacs.d out of configs/shared
Moving all of my Emacs-related files into their own directory at the root of
this repository.
2020-01-30 16:00:29 +00:00
William Carroll
56a7b9fa41 Removes obsolete emacs deps
No longer using these emacs deps. Preparing this repo to house a more
up-to-date, robust config.
2018-04-25 12:15:00 -04:00
William Carroll
863b29323c pc_settings -> dotfiles
My younger self didn't know that creating repos to house your
configuration was a known pattern! Hence the unweildy name, pc_settings.

This change was a long time coming.
2018-04-23 15:25:35 -04:00
William Carroll
c466358048 Update Emacs / Bash monkey-patched functions 2018-01-08 15:42:25 -05:00
William Carroll
cc96fd9618 Removes dead helper fn 2017-07-29 21:45:59 -04:00
William Carroll
84789f0c33 Defines fn to conditionally activate emacs tabbar 2017-07-29 21:45:35 -04:00
William Carroll
abb61dade2 Updates symlinking script for custom emacs funcs 2017-07-01 16:46:46 -04:00
William Carroll
296fe1b8f6 Stylizes tabbar; extends emacs config 2017-07-01 16:21:44 -04:00
William Carroll
e52c4330c7 Disables QuickEdit prototype 2017-06-26 10:30:17 -04:00
William Carroll
257246aed5 Updates ZSH_THEME and trims fat from config 2017-06-25 15:44:18 -04:00
William Carroll
f344f2e370 Adds os detection for bootstrapping configs 2017-06-23 13:01:16 -04:00
William Carroll
689e887354 Blacklists additional modes from MRU buffer candidates 2017-06-21 23:51:59 -04:00
William Carroll
8fbafc3a5c Conditionally enables Evil; adds Dired+; conditionally applies linum 2017-06-20 07:48:03 -04:00
William Carroll
1ccaee9fa9 Adds finer-grain control over Linum Mode 2017-06-18 13:23:21 -04:00
William Carroll
4375cecfd1 Adds script for symlinking emacs functions 2017-06-17 21:32:05 -04:00
William Carroll
2867dfb9f2 Fixes EDITOR env variable configuration 2017-06-17 21:31:28 -04:00
William Carroll
857bb85e66 Adds custom dired functions 2017-06-17 21:30:33 -04:00
William Carroll
f40a345766 Moves helm helper functions to a separate file 2017-06-15 17:21:22 -04:00
William Carroll
d9a05b322e Adds QuickEdit mode for git commit messages within ansi-term 2017-06-15 17:20:45 -04:00
William Carroll
708670590f Adds vim monkey-patch to edit files within Emacs 2017-06-15 17:18:58 -04:00
William Carroll
8fff1ba890 Better integrates CLI and Emacsclient 2017-06-13 11:33:16 -04:00
William Carroll
6b3d011491 Adds CTRL_T fuzzy find helm source for files 2017-06-06 11:14:30 -04:00
William Carroll
981f86bf7d Removes unnecessary kbds; enhances config 2017-06-06 10:35:37 -04:00
William Carroll
cf13a3b182 Adds custom helm sources and kbds 2017-06-02 19:52:13 -04:00
William Carroll
7cf411fe0f Remaps slate kbds 2017-06-02 10:35:24 -04:00
William Carroll
23f4e84ada Moves helper functions to separate file 2017-06-01 00:00:03 -04:00