- Emacs Lisp 88.8%
- Common Lisp 8.1%
- TeX 0.8%
- Tree-sitter Query 0.7%
- Shell 0.6%
- Other 0.7%
| bashrc.d | ||
| bin | ||
| dot | ||
| emacs.d | ||
| install-emacs | ||
| rs | ||
| template | ||
| vscode.d | ||
| .gitignore | ||
| .gitmodules | ||
| install.sh | ||
| notes.md | ||
| README.md | ||
home-env
This repository configures my "home environment" on all machines (personal and work). It configures dotfiles (ex .bashrc) as well as manages packages for editors (ex gptel for emacs). It also sets up useful shell functions and aliases.
This repository was inspired by (and copy/pasted from) biviosoftware home-env.
I don't reccomend installing on your machine. At times my configuration is broken in ways I find acceptable. You may not. I also don't think about backwards compatability or anything along those lines when I work on it. But, look around and hopefully something inspires you:)
Install:
curl -s -L https://git.sr.ht/~e-carlin/home-env/blob/master/install.sh | bash
TODO tracker
Available here.
OS
I work on macOS, Ubuntu, Fedora, CentOS, and AlmaLinux. My configuration should mostly work on those systems when using Bash.
macOS
- On MacOS Ventura and later you can swap ctrl and option in system preferences > keyboard > keyboard shortcuts > modifier keys (make sure to select each keyboard in the dropdown menu)
- In earlier versions I used karabiner. Specifically I do: left_alt (equal to `left_option`) to left_control and left_control to left_option
- In iTerm2 I swap right alt with esc+ (search for "esc+").
- In the past I used the gui version of emacs because it comes with
image support https://emacsformacosx.com/ .
- You need to give it full disk access in system settings > privacy security
- if you can't
ls ~/Downloadsthen you need to give fully disk access to system ruby (system prefs -> privacy and security -> full disk acces -> CMD + shft + G -> /usr/bin/ruby) - I now build emacs from source on Macos because I needed tree-sitter support which is behind a build flag.
- Fix quote characters
- Set default shell to bash
# install homebrew https://brew.sh/
radia_run homebrew
brew install bash
echo '/opt/homebrew/bin/bash' >> /etc/shells
chsh -s /opt/homebrew/bin/bash
brew install coreutils # Things like gnu ls which supports the --hide flag
- You can start the emacs app from the command line on Mac with
/Applications/Emacs.app/Contents/MacOS/Emacs --debug-init
Brew (multiuser)
- System preferences > users and groups > + icon > new group (named brew)
- add user(s) to this group
- install brew
chgrp -R brew $(brew --prefix)/*# make brew owned by brew groupchmod -R g+w $(brew --prefix)/*# Allow members read and write privs- **
sudo chown -R ${USER}:brew $(brew --prefix)/*** # Brew is messed up, may have to run this as the user before running any brew commands
Ubuntu
- Remove terminal transparency
sudo kbdrate -r 30 -d 250# Make keys go brrr # TODO(e-carlin): This should be in bashrc.dWindows + p# Cycle through display settings to get to mirror displaysudo apt update && sudo apt upgrade -y# Update machine- Install keyd to remap C- and M- keys. This is needed on wayland which doesn't respond to ~/.Xmodmap.
TODO(e-carlin): this should be done in install.sh
sudo install -m 644 /dev/stdin /etc/keyd/default.conf <<EOF
[ids]
*
[main]
leftcontrol = leftalt
leftalt = leftcontrol
EOF
sudo systemctl restart keyd
# journalctl -u keyd will show config errors
Firefox
- I prefer to cycle through tabs in order not most recently used. To
do so enter
about:configin the address bar, type ctrl in the search box, double clickbrowser.ctrlTab.previewsso it's value becomesfalse.
Editor
Emacs is my main editor. I update whenever I have a need. See install-emacs.sh for the specific version and how to install
Useful emacs commands during install/setup:
M-x eval-expression RET (functionp 'json-serialize) RET ;(should be t)- rm dirs in emacs.d/melpa then eval-buffer e-carlin-pack-install-helper.el (make sure that file has up to date packages found in dot/emacs)
M-x toggle-debug-on-error
Debugging emacs
M-x toggle-debug-on-error ;; or on-quitd ;; steps through in the debuggerc ;; continues execution in the debugger- If you find the function in question and want to monkey around with
it you can copy and paste it into a scratch buffer and the run
M-x eval-buffer. Emacs has a global namespace so the function will override the default one.
Running elisp
- M-x eval-buffer
- M-x byte-compile-file
Updating emacs packages
M-x package-refresh-contents
M-x list-packages
U
x
M-x package-autoremove
Emacs lsp (eglot)
A special install of editable pip installs is required
# https://github.com/microsoft/pyright/blob/main/docs/import-resolution.md#editable-installs
pip install -e . --config-settings editable_mode=compat
If that doesn't work you may want to try creating a pyrightconfig.json
cat > pyrightconfig.json <<'EOF'
{
"venvPath":"/home/vagrant/.pyenv/versions",
"venv":"py3"
}
EOF
Emacs gptel
I'm trying to integrate AI tools into more of my workflow. I use the ChatGPT desktop app on MacOS. I'm also trying to use gptel from within Emacs.
You'll need to set an API key for the models you want to use. This is for openai.
api_key=<your_api_key>
echo -e "machine api.openai.com login apikey password $api_key" > ~/.authinfo
chmod 600 ~/.authinfo
EIN (emacs ipython notebook)
- For runninging jupyter notebooks with emacs https://realpython.com/emacs-the-best-python-editor/#integration-with-jupyter-and-ipython
Other editor options
At times I also use vi (vim). I have configuration here for it.
Previously I used neovim and vscode so if you search the git history you can see how I had them setup.
Keyboard
Kinesis Freestyl Pro
- Sometimes on Ubuntu alt and windows key seem to get swapped in that case press the "Layout" 2x (once 2 layout lights will show up, press once more one layout light will be lit)
GPG
- Creation instructions:
https://www.liquidweb.com/kb/how-do-i-use-gpg/
gpg --full-generate-key # rsa/rsa; 4096gpg --output public.asc --armor --export <email>gpg --output private.asc --armor --export-secret-keys --export-options export-backup <email>gpg —-import /path/to/private.asc
Assymetric encryption
gpg --output test.gpg --encrypt --sign --armor --recipient <email> test.txt gpg --output test.txt --decrypt test.gpg
Symmetric encryption
gpg --symmetric test.txt gpg --decrypt test.txt.gpg > test.out
Managing usb on macos
diskutil list diskutil eraseDisk FAT32 KINGSTON MBRFormat /dev/disk2
nvm
I use nvm to manage node versions
# Use curl install https://github.com/nvm-sh/nvm
nvm install node # installs latest
pyenv
I use pyenvto manage python versions
# Use curl installer (I use linux curl|bash install on mac too) https://github.com/pyenv/pyenv?tab=readme-ov-file#1-automatic-installer-recommended
pyenv install 3
pyenv global 3.xxx
pyenv virtualenv 3.13.3 ecpy
pyenv global ecpy