Compare commits
92 Commits
80b61bfbc7
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
f4ae8b2e21
|
|||
|
21c570a440
|
|||
|
9b266c444d
|
|||
|
3fe9b05623
|
|||
|
c29895d019
|
|||
|
003d5d12cf
|
|||
|
764be96265
|
|||
|
4b070dbe4f
|
|||
|
e432aa5f20
|
|||
|
419d291d21
|
|||
|
43e54218a9
|
|||
|
bbfd7414f4
|
|||
|
06a787d3c9
|
|||
|
0adfe045a8
|
|||
|
79fbbd45e5
|
|||
|
df99684d3c
|
|||
|
4adcfc8f6f
|
|||
|
9d58977c68
|
|||
|
5c28ff6d39
|
|||
|
880d9a0a4a
|
|||
|
11aba117de
|
|||
|
7a7700855f
|
|||
|
b330e1c7e0
|
|||
|
5c5ec6f668
|
|||
|
aaf7edeba6
|
|||
|
d37bfce977
|
|||
|
b3a4f3cbd8
|
|||
|
f720e6a57e
|
|||
|
e87c0a9217
|
|||
|
8748b30895
|
|||
|
295ed85fd5
|
|||
|
4a31230d16
|
|||
|
20ac94c9fb
|
|||
|
57a5be3183
|
|||
|
1ad9328960
|
|||
|
78029eefc8
|
|||
|
6e601839aa
|
|||
|
3c5e0db760
|
|||
|
5bc174dd9d
|
|||
|
3ad2ae4074
|
|||
|
c2ebc0db51
|
|||
|
316aabe413
|
|||
|
6b379bfaf8
|
|||
|
ec0fe5c43c
|
|||
|
d4ec04f975
|
|||
|
358464f10a
|
|||
|
6fe4ff5f8e
|
|||
| 8cd8b3e342 | |||
| bb720581fb | |||
|
be955e6673
|
|||
|
bd851e73a6
|
|||
|
98e6a409b4
|
|||
|
d9a7e58f1e
|
|||
|
4baaaadf02
|
|||
|
03bde6015f
|
|||
|
5631935f8f
|
|||
|
edaef817b5
|
|||
|
697edb0cdb
|
|||
|
39f8a4510b
|
|||
|
664aa185dd
|
|||
|
39d9900022
|
|||
|
bbb77f27c8
|
|||
|
c02d6690ed
|
|||
|
420bd45c34
|
|||
|
bdbe74c5e7
|
|||
|
f61b58f9c7
|
|||
|
30892f9ca0
|
|||
|
ba39302238
|
|||
|
25e3b3db92
|
|||
|
58fc99cf8c
|
|||
|
9d8c985588
|
|||
|
4759bf48d0
|
|||
|
4567b9aa02
|
|||
|
bec66b58a7
|
|||
|
d97531a1d1
|
|||
|
7848ed1168
|
|||
|
4f50b88488
|
|||
|
63133d312e
|
|||
|
d7c2eadcec
|
|||
|
bcaeb2ac30
|
|||
|
|
d1d8fa9f0d | ||
|
b6449d2836
|
|||
|
7b76d45eb5
|
|||
|
90813e5ecf
|
|||
|
184510f1af
|
|||
|
b11b2982c6
|
|||
|
788ecefbe5
|
|||
|
b4e585457b
|
|||
|
f7b6ef1a4c
|
|||
|
8ec4e4ad43
|
|||
|
f78c81b21f
|
|||
|
7497a07278
|
7
.envrc
Normal file
7
.envrc
Normal file
@@ -0,0 +1,7 @@
|
||||
export DIRENV_WARN_TIMEOUT=20s
|
||||
|
||||
eval "$(devenv direnvrc)"
|
||||
|
||||
# The use_devenv function supports passing flags to the devenv command
|
||||
# For example: use devenv --impure --option services.postgres.enable:bool true
|
||||
use devenv
|
||||
@@ -1,32 +0,0 @@
|
||||
name: deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: purcell/setup-emacs@master
|
||||
with:
|
||||
version: 29.1
|
||||
- name: "Export org to md"
|
||||
run: emacs -Q --script export.el
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18.x
|
||||
- run: corepack enable
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn build
|
||||
- name: "Deploy to remote server"
|
||||
uses: appleboy/scp-action@v0.1.4
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
key: ${{ secrets.KEY }}
|
||||
port: ${{ secrets.PORT }}
|
||||
source: docs/.vuepress/dist/*
|
||||
target: ${{ secrets.DESTPATH }}
|
||||
strip_components: 3
|
||||
40
.github/workflows/deploy.yaml
vendored
Normal file
40
.github/workflows/deploy.yaml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: deploy
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: purcell/setup-emacs@master
|
||||
with:
|
||||
version: 29.1
|
||||
- name: "Export org to md"
|
||||
run: emacs -Q --script export.el
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
- run: corepack enable
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- name: "Deploy to Cloudflare Pages"
|
||||
uses: cloudflare/pages-action@v1
|
||||
with:
|
||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
accountId: ${{ secrets.ACCOUNT_ID }}
|
||||
projectName: config-phundrak-com
|
||||
directory: docs/.vuepress/dist/
|
||||
githubToken: ${{ secrets.TOKEN }}
|
||||
# - name: "Deploy to remote server"
|
||||
# uses: appleboy/scp-action@v0.1.4
|
||||
# with:
|
||||
# host: ${{ secrets.HOST }}
|
||||
# username: ${{ secrets.USERNAME }}
|
||||
# key: ${{ secrets.KEY }}
|
||||
# port: ${{ secrets.PORT }}
|
||||
# source: docs/.vuepress/dist/*
|
||||
# target: ${{ secrets.DESTPATH }}
|
||||
# strip_components: 3
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -4,3 +4,13 @@ node_modules
|
||||
/docs/**/*.md
|
||||
/docs/.vuepress/dist/
|
||||
/.yarn/
|
||||
|
||||
# Devenv
|
||||
.devenv*
|
||||
devenv.local.nix
|
||||
|
||||
# direnv
|
||||
.direnv
|
||||
|
||||
# pre-commit
|
||||
.pre-commit-config.yaml
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
enableMessageNames: false
|
||||
|
||||
nodeLinker: node-modules
|
||||
10
README.org
10
README.org
@@ -3,7 +3,7 @@
|
||||
#+html: <a href="https://www.gnu.org/software/emacs/"><img src="https://img.shields.io/badge/Emacs-29.1-blueviolet.svg?style=flat-square&logo=GNU%20Emacs&logoColor=white" /></a>
|
||||
#+html: <a href="https://orgmode.org/"><img src="https://img.shields.io/badge/Written%20with-Org%20mode-success?logo=Org&logoColor=white&style=flat-square"/></a>
|
||||
#+html: <a href="https://v2.vuepress.vuejs.org/"><img src="https://img.shields.io/badge/Framework-Vuepress-42D392?logo=Vue.js&logoColor=white&style=flat-square"/></a>
|
||||
#+html: <a href="https://config.phundrak.com"><img src="https://img.shields.io/badge/dynamic/json?label=Website&query=%24%5B%3A1%5D.status&url=https%3A%2F%2Fdrone.phundrak.com%2Fapi%2Frepos%2Fphundrak%2beta.config.phundrak.com%2Fbuilds&style=flat-square&logo=buffer" /></a>
|
||||
#+html: <a href="https://config.phundrak.com/"><img src="https://img.shields.io/badge/Website-online-success?logo=buffer&logoColor=white&style=flat-square"/></a>
|
||||
|
||||
|
||||
* About the Project
|
||||
@@ -14,6 +14,14 @@ through [[https://www.gnu.org/software/emacs/][Emacs]].
|
||||
These Markdown files are then compiled by [[https://v2.vuepress.vuejs.org/][Vuepress]] into a beautiful
|
||||
website available at [[https://beta.config.phundrak.com][config.phundrak.com]].
|
||||
|
||||
Note that a few configs here are no longer up to date. I am in the
|
||||
process of switching over to [[https://nixos.org/][NixOS]]. You can find my current NixOS
|
||||
configuration [[https://labs.phundrak.com/phundrak/nix-config][in this repository]]. It will eventually circle back to
|
||||
being a litterary configuration. Not every piece of software will be
|
||||
configured by Nix exclusively though, Emacs for instance will stay
|
||||
relatively free of Nix configurations aside from its basic
|
||||
installation.
|
||||
|
||||
* Running the project
|
||||
In order to run the project, you need to export all =.org= files in the
|
||||
Markdown format. To do that easily, you can use an org project setup
|
||||
|
||||
103
devenv.lock
Normal file
103
devenv.lock
Normal file
@@ -0,0 +1,103 @@
|
||||
{
|
||||
"nodes": {
|
||||
"devenv": {
|
||||
"locked": {
|
||||
"dir": "src/modules",
|
||||
"lastModified": 1747717470,
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"rev": "c7f2256ee4a4a4ee9cbf1e82a6e49b253c374995",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "src/modules",
|
||||
"owner": "cachix",
|
||||
"repo": "devenv",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1747046372,
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1747372754,
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"git-hooks",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1709087332,
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1746807397,
|
||||
"owner": "cachix",
|
||||
"repo": "devenv-nixpkgs",
|
||||
"rev": "c5208b594838ea8e6cca5997fbf784b7cca1ca90",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"ref": "rolling",
|
||||
"repo": "devenv-nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"devenv": "devenv",
|
||||
"git-hooks": "git-hooks",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"pre-commit-hooks": [
|
||||
"git-hooks"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
9
devenv.nix
Normal file
9
devenv.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
languages.typescript.enable = true;
|
||||
packages = [ pkgs.nodejs_20 ];
|
||||
scripts.export.exec = ''
|
||||
${pkgs.emacs}/bin/emacs -Q --script export.el
|
||||
'';
|
||||
}
|
||||
15
devenv.yaml
Normal file
15
devenv.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
|
||||
inputs:
|
||||
nixpkgs:
|
||||
url: github:cachix/devenv-nixpkgs/rolling
|
||||
|
||||
# If you're using non-OSS software, you can set allowUnfree to true.
|
||||
# allowUnfree: true
|
||||
|
||||
# If you're willing to use a package that's vulnerable
|
||||
# permittedInsecurePackages:
|
||||
# - "openssl-1.1.1w"
|
||||
|
||||
# If you have more than one devenv you can merge them
|
||||
#imports:
|
||||
# - ./backend
|
||||
@@ -1,19 +1,14 @@
|
||||
import { defaultTheme } from '@vuepress/theme-default';
|
||||
import { viteBundler } from '@vuepress/bundler-vite';
|
||||
import { defineUserConfig } from 'vuepress';
|
||||
import { searchProPlugin } from 'vuepress-plugin-search-pro';
|
||||
import { slimsearchPlugin } from '@vuepress/plugin-slimsearch';
|
||||
|
||||
import head from './head';
|
||||
|
||||
interface ChildPage {
|
||||
text: string;
|
||||
link: string;
|
||||
}
|
||||
|
||||
export default defineUserConfig({
|
||||
lang: 'en-US',
|
||||
title: "Phundrak's Dotfiles",
|
||||
head: head,
|
||||
head: head as any,
|
||||
description: "Documentation of the GNU/Linux configuration of P'undrak",
|
||||
bundler: viteBundler({}),
|
||||
markdown: {
|
||||
@@ -25,9 +20,9 @@ export default defineUserConfig({
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
searchProPlugin({
|
||||
indexContent: true,
|
||||
}),
|
||||
slimsearchPlugin({
|
||||
indexContent: true
|
||||
})
|
||||
],
|
||||
theme: defaultTheme({
|
||||
sidebarDepth: 5,
|
||||
@@ -64,36 +59,36 @@ export default defineUserConfig({
|
||||
'/git',
|
||||
'/hyprland',
|
||||
'/mpd',
|
||||
'/neofetch',
|
||||
'/picom',
|
||||
'/rustfmt',
|
||||
{
|
||||
text: 'StumpWM',
|
||||
link: '/stumpwm/',
|
||||
collapsible: true,
|
||||
children: [
|
||||
'/stumpwm/init',
|
||||
'/stumpwm/colours',
|
||||
'/stumpwm/mode-line',
|
||||
'/stumpwm/groups',
|
||||
'/stumpwm/theme',
|
||||
'/stumpwm/commands',
|
||||
'/stumpwm/keybindings',
|
||||
'/stumpwm/utilities',
|
||||
],
|
||||
},
|
||||
'/tmux',
|
||||
'/bootstrap',
|
||||
{
|
||||
text: 'Deprecated Configs',
|
||||
link: '/deprecated/',
|
||||
collapsible: true,
|
||||
children: [
|
||||
'/deprecated/awesome',
|
||||
'/deprecated/bootstrap',
|
||||
'/emacs/packages/exwm',
|
||||
'/deprecated/i3',
|
||||
'/deprecated/nano',
|
||||
'/neofetch',
|
||||
'/picom',
|
||||
'/deprecated/polybar',
|
||||
'/deprecated/spacemacs',
|
||||
{
|
||||
text: 'StumpWM',
|
||||
link: '/stumpwm/',
|
||||
collapsible: true,
|
||||
children: [
|
||||
'/stumpwm/init',
|
||||
'/stumpwm/colours',
|
||||
'/stumpwm/mode-line',
|
||||
'/stumpwm/groups',
|
||||
'/stumpwm/theme',
|
||||
'/stumpwm/commands',
|
||||
'/stumpwm/keybindings',
|
||||
'/stumpwm/utilities',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
interface SimplifiedHeader {
|
||||
tag: string;
|
||||
content: [any];
|
||||
content: any[];
|
||||
}
|
||||
|
||||
const simplifiedHead = [
|
||||
const simplifiedHead:SimplifiedHeader[] = [
|
||||
{
|
||||
tag: 'script',
|
||||
content: [
|
||||
{
|
||||
async: true,
|
||||
src: 'https://umami.phundrak.com/script.js',
|
||||
'data-website-id': '67166941-8c83-4a19-bc8c-139e44b7f7aa',
|
||||
'data-website-id': '9574ed51-3939-4d4e-979f-6b2908fbe1af',
|
||||
'data-do-not-track': 'true',
|
||||
},
|
||||
],
|
||||
@@ -128,7 +128,7 @@ const simplifiedHead = [
|
||||
},
|
||||
];
|
||||
|
||||
let head = [];
|
||||
let head:[string, any, string?][] = [];
|
||||
simplifiedHead.forEach((tag: SimplifiedHeader) => {
|
||||
let tagName = tag.tag;
|
||||
tag.content.forEach((element) => {
|
||||
|
||||
@@ -4,171 +4,171 @@
|
||||
* - Copyright (c) 2016-present Sven Greb <development@svengreb.de>
|
||||
*/
|
||||
|
||||
:root {
|
||||
--nord0: #2e3440;
|
||||
--nord1: #3b4252;
|
||||
--nord2: #434c5e;
|
||||
--nord3: #4c566a;
|
||||
--nord4: #d8dee9;
|
||||
--nord5: #e5e9f0;
|
||||
--nord6: #eceff4;
|
||||
--nord7: #8fbcbb;
|
||||
--nord8: #88c0d0;
|
||||
--nord9: #81a1c1;
|
||||
--nord10: #5e81ac;
|
||||
--nord11: #bf616a;
|
||||
--nord12: #d08770;
|
||||
--nord13: #ebcb8b;
|
||||
--nord14: #a3be8c;
|
||||
--nord15: #b48ead;
|
||||
// :root {
|
||||
// --nord0: #2e3440;
|
||||
// --nord1: #3b4252;
|
||||
// --nord2: #434c5e;
|
||||
// --nord3: #4c566a;
|
||||
// --nord4: #d8dee9;
|
||||
// --nord5: #e5e9f0;
|
||||
// --nord6: #eceff4;
|
||||
// --nord7: #8fbcbb;
|
||||
// --nord8: #88c0d0;
|
||||
// --nord9: #81a1c1;
|
||||
// --nord10: #5e81ac;
|
||||
// --nord11: #bf616a;
|
||||
// --nord12: #d08770;
|
||||
// --nord13: #ebcb8b;
|
||||
// --nord14: #a3be8c;
|
||||
// --nord15: #b48ead;
|
||||
|
||||
scroll-behavior: smooth;
|
||||
// scroll-behavior: smooth;
|
||||
|
||||
// brand colors
|
||||
--c-brand: var(--nord9);
|
||||
--c-brand-light: var(--nord14);
|
||||
// // brand colors
|
||||
// --c-brand: var(--nord9);
|
||||
// --c-brand-light: var(--nord14);
|
||||
|
||||
// background colors
|
||||
--c-bg: var(--nord6);
|
||||
--c-bg-light: var(--nord6);
|
||||
--c-bg-lighter: var(--nord5);
|
||||
--c-bg-dark: var(--nord5);
|
||||
--c-bg-darker: var(--nord4);
|
||||
--c-bg-navbar: var(--c-bg);
|
||||
--c-bg-sidebar: var(--c-bg);
|
||||
--c-bg-arrow: var(--nord4);
|
||||
// // background colors
|
||||
// --c-bg: var(--nord6);
|
||||
// --c-bg-light: var(--nord6);
|
||||
// --c-bg-lighter: var(--nord5);
|
||||
// --c-bg-dark: var(--nord5);
|
||||
// --c-bg-darker: var(--nord4);
|
||||
// --c-bg-navbar: var(--c-bg);
|
||||
// --c-bg-sidebar: var(--c-bg);
|
||||
// --c-bg-arrow: var(--nord4);
|
||||
|
||||
// text colors
|
||||
--c-text: var(--nord1);
|
||||
--c-text-accent: var(--c-brand);
|
||||
--c-text-light: var(--nord2);
|
||||
--c-text-lighter: var(--nord3);
|
||||
--c-text-lightest: var(--nord4);
|
||||
--c-text-quote: var(--nord2);
|
||||
// // text colors
|
||||
// --c-text: var(--nord1);
|
||||
// --c-text-accent: var(--c-brand);
|
||||
// --c-text-light: var(--nord2);
|
||||
// --c-text-lighter: var(--nord3);
|
||||
// --c-text-lightest: var(--nord4);
|
||||
// --c-text-quote: var(--nord2);
|
||||
|
||||
// border colors
|
||||
--c-border: var(--nord4);
|
||||
--c-border-dark: var(--nord4);
|
||||
// // border colors
|
||||
// --c-border: var(--nord4);
|
||||
// --c-border-dark: var(--nord4);
|
||||
|
||||
// custom container colors
|
||||
--c-tip: var(--nord14);
|
||||
--c-tip-bg: rgba(163, 190, 140, 0.2);
|
||||
--c-tip-title: var(--c-text);
|
||||
--c-tip-text: var(--c-text);
|
||||
--c-tip-text-accent: var(--c-text-accent);
|
||||
--c-warning: var(--nord13);
|
||||
--c-warning-bg: rgba(235, 203, 139, 0.3);
|
||||
--c-warning-bg-light: rgba(235, 203, 139, 0.2);
|
||||
--c-warning-bg-lighter: rgba(235, 203, 139, 0.1);
|
||||
--c-warning-border-dark: var(--nord3);
|
||||
--c-warning-details-bg: var(--c-bg);
|
||||
--c-warning-title: var(--nord12);
|
||||
--c-warning-text: var(--nord12);
|
||||
--c-warning-text-accent: var(--nord12);
|
||||
--c-warning-text-light: var(--nord12);
|
||||
--c-warning-text-quote: var(--nord12);
|
||||
// // custom container colors
|
||||
// --c-tip: var(--nord14);
|
||||
// --c-tip-bg: rgba(163, 190, 140, 0.2);
|
||||
// --c-tip-title: var(--c-text);
|
||||
// --c-tip-text: var(--c-text);
|
||||
// --c-tip-text-accent: var(--c-text-accent);
|
||||
// --c-warning: var(--nord13);
|
||||
// --c-warning-bg: rgba(235, 203, 139, 0.3);
|
||||
// --c-warning-bg-light: rgba(235, 203, 139, 0.2);
|
||||
// --c-warning-bg-lighter: rgba(235, 203, 139, 0.1);
|
||||
// --c-warning-border-dark: var(--nord3);
|
||||
// --c-warning-details-bg: var(--c-bg);
|
||||
// --c-warning-title: var(--nord12);
|
||||
// --c-warning-text: var(--nord12);
|
||||
// --c-warning-text-accent: var(--nord12);
|
||||
// --c-warning-text-light: var(--nord12);
|
||||
// --c-warning-text-quote: var(--nord12);
|
||||
|
||||
--c-danger: var(--nord11);
|
||||
--c-danger-bg: rgba(191, 97, 106, 0.2);
|
||||
--c-danger-bg-light: rgba(191, 97, 106, 0.2);
|
||||
--c-danger-bg-lighter: rgba(191, 97, 106, 0.1);
|
||||
--c-danger-border-dark: var(--nord11);
|
||||
--c-danger-details-bg: var(--nord2);
|
||||
--c-danger-title: var(--nord11);
|
||||
--c-danger-text: var(--nord11);
|
||||
--c-danger-text-accent: var(--nord11);
|
||||
--c-danger-text-light: var(--nord11);
|
||||
--c-danger-text-quote: var(--nord11);
|
||||
// --c-danger: var(--nord11);
|
||||
// --c-danger-bg: rgba(191, 97, 106, 0.2);
|
||||
// --c-danger-bg-light: rgba(191, 97, 106, 0.2);
|
||||
// --c-danger-bg-lighter: rgba(191, 97, 106, 0.1);
|
||||
// --c-danger-border-dark: var(--nord11);
|
||||
// --c-danger-details-bg: var(--nord2);
|
||||
// --c-danger-title: var(--nord11);
|
||||
// --c-danger-text: var(--nord11);
|
||||
// --c-danger-text-accent: var(--nord11);
|
||||
// --c-danger-text-light: var(--nord11);
|
||||
// --c-danger-text-quote: var(--nord11);
|
||||
|
||||
--c-details-bg: var(--c-bg-lighter);
|
||||
// --c-details-bg: var(--c-bg-lighter);
|
||||
|
||||
// badge component colors
|
||||
--c-badge-tip: var(--c-tip);
|
||||
--c-badge-warning: var(--c-warning);
|
||||
--c-badge-warning-text: var(--c-bg);
|
||||
--c-badge-danger: var(--c-danger);
|
||||
--c-badge-danger-text: var(--c-bg);
|
||||
// // badge component colors
|
||||
// --c-badge-tip: var(--c-tip);
|
||||
// --c-badge-warning: var(--c-warning);
|
||||
// --c-badge-warning-text: var(--c-bg);
|
||||
// --c-badge-danger: var(--c-danger);
|
||||
// --c-badge-danger-text: var(--c-bg);
|
||||
|
||||
// transition vars
|
||||
--t-color: 0.3s ease;
|
||||
--t-transform: 0.3s ease;
|
||||
// // transition vars
|
||||
// --t-color: 0.3s ease;
|
||||
// --t-transform: 0.3s ease;
|
||||
|
||||
// code blocks vars
|
||||
--code-bg-color: var(--nord0);
|
||||
--code-hl-bg-color: var(--nord1);
|
||||
--code-ln-color: #9e9e9e;
|
||||
--code-ln-wrapper-width: 3.5rem;
|
||||
// // code blocks vars
|
||||
// --code-bg-color: var(--nord0);
|
||||
// --code-hl-bg-color: var(--nord1);
|
||||
// --code-ln-color: #9e9e9e;
|
||||
// --code-ln-wrapper-width: 3.5rem;
|
||||
|
||||
// font vars
|
||||
--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
|
||||
Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||
--font-family-code: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
// // font vars
|
||||
// --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
|
||||
// Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
||||
// --font-family-code: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
|
||||
// layout vars
|
||||
--navbar-height: 3.6rem;
|
||||
--navbar-padding-v: 0.7rem;
|
||||
--navbar-padding-h: 1.5rem;
|
||||
--sidebar-width: 20rem;
|
||||
--sidebar-width-mobile: calc(var(--sidebar-width) * 0.82);
|
||||
--content-width: 740px;
|
||||
--homepage-width: 960px;
|
||||
}
|
||||
// // layout vars
|
||||
// --navbar-height: 3.6rem;
|
||||
// --navbar-padding-v: 0.7rem;
|
||||
// --navbar-padding-h: 1.5rem;
|
||||
// --sidebar-width: 20rem;
|
||||
// --sidebar-width-mobile: calc(var(--sidebar-width) * 0.82);
|
||||
// --content-width: 740px;
|
||||
// --homepage-width: 960px;
|
||||
// }
|
||||
|
||||
html.dark {
|
||||
// brand colors
|
||||
--c-brand: var(--nord14);
|
||||
--c-brand-light: var(--nord14);
|
||||
// html.dark {
|
||||
// // brand colors
|
||||
// --c-brand: var(--nord14);
|
||||
// --c-brand-light: var(--nord14);
|
||||
|
||||
// background colors
|
||||
--c-bg: var(--nord1);
|
||||
--c-bg-light: var(--nord2);
|
||||
--c-bg-lighter: var(--nord2);
|
||||
--c-bg-dark: var(--nord3);
|
||||
--c-bg-darker: var(--nord3);
|
||||
// // background colors
|
||||
// --c-bg: var(--nord1);
|
||||
// --c-bg-light: var(--nord2);
|
||||
// --c-bg-lighter: var(--nord2);
|
||||
// --c-bg-dark: var(--nord3);
|
||||
// --c-bg-darker: var(--nord3);
|
||||
|
||||
// text colors
|
||||
--c-text: var(--nord4);
|
||||
--c-text-light: var(--nord5);
|
||||
--c-text-lighter: var(--nord5);
|
||||
--c-text-lightest: var(--nord6);
|
||||
--c-text-quote: var(--c-text);
|
||||
// // text colors
|
||||
// --c-text: var(--nord4);
|
||||
// --c-text-light: var(--nord5);
|
||||
// --c-text-lighter: var(--nord5);
|
||||
// --c-text-lightest: var(--nord6);
|
||||
// --c-text-quote: var(--c-text);
|
||||
|
||||
// border colors
|
||||
--c-border: var(--nord3);
|
||||
--c-border-dark: var(--nord3);
|
||||
// // border colors
|
||||
// --c-border: var(--nord3);
|
||||
// --c-border-dark: var(--nord3);
|
||||
|
||||
// custom container colors
|
||||
--c-tip: var(--nord14);
|
||||
--c-warning: var(--nord13);
|
||||
--c-warning-bg: rgba(235, 203, 139, 0.2);
|
||||
--c-warning-bg-light: rgba(235, 203, 139, 0.2);
|
||||
--c-warning-bg-lighter: rgba(235, 203, 139, 0.1);
|
||||
--c-warning-border-dark: var(--nord3);
|
||||
--c-warning-details-bg: var(--c-bg);
|
||||
--c-warning-title: var(--nord13);
|
||||
--c-warning-text: var(--nord13);
|
||||
--c-warning-text-accent: var(--nord13);
|
||||
--c-warning-text-light: var(--nord13);
|
||||
--c-warning-text-quote: var(--nord13);
|
||||
// // custom container colors
|
||||
// --c-tip: var(--nord14);
|
||||
// --c-warning: var(--nord13);
|
||||
// --c-warning-bg: rgba(235, 203, 139, 0.2);
|
||||
// --c-warning-bg-light: rgba(235, 203, 139, 0.2);
|
||||
// --c-warning-bg-lighter: rgba(235, 203, 139, 0.1);
|
||||
// --c-warning-border-dark: var(--nord3);
|
||||
// --c-warning-details-bg: var(--c-bg);
|
||||
// --c-warning-title: var(--nord13);
|
||||
// --c-warning-text: var(--nord13);
|
||||
// --c-warning-text-accent: var(--nord13);
|
||||
// --c-warning-text-light: var(--nord13);
|
||||
// --c-warning-text-quote: var(--nord13);
|
||||
|
||||
--c-danger: var(--nord11);
|
||||
--c-danger-bg: rgba(191, 97, 106, 0.2);
|
||||
--c-danger-bg-light: rgba(191, 97, 106, 0.2);
|
||||
--c-danger-bg-lighter: rgba(191, 97, 106, 0.1);
|
||||
--c-danger-border-dark: var(--nord11);
|
||||
--c-danger-details-bg: var(--nord2);
|
||||
--c-danger-title: hsl(354 43% 75.7%);
|
||||
--c-danger-text: hsl(354 43% 80.7%);
|
||||
--c-danger-text-accent: var(--nord11);
|
||||
--c-danger-text-light: var(--nord11);
|
||||
--c-danger-text-quote: var(--nord11);
|
||||
// --c-danger: var(--nord11);
|
||||
// --c-danger-bg: rgba(191, 97, 106, 0.2);
|
||||
// --c-danger-bg-light: rgba(191, 97, 106, 0.2);
|
||||
// --c-danger-bg-lighter: rgba(191, 97, 106, 0.1);
|
||||
// --c-danger-border-dark: var(--nord11);
|
||||
// --c-danger-details-bg: var(--nord2);
|
||||
// --c-danger-title: hsl(354 43% 75.7%);
|
||||
// --c-danger-text: hsl(354 43% 80.7%);
|
||||
// --c-danger-text-accent: var(--nord11);
|
||||
// --c-danger-text-light: var(--nord11);
|
||||
// --c-danger-text-quote: var(--nord11);
|
||||
|
||||
--c-details-bg: var(--c-bg-light);
|
||||
// --c-details-bg: var(--c-bg-light);
|
||||
|
||||
// badge component colors
|
||||
--c-badge-warning-text: var(--nord0);
|
||||
--c-badge-danger-text: var(--nord0);
|
||||
// // badge component colors
|
||||
// --c-badge-warning-text: var(--nord0);
|
||||
// --c-badge-danger-text: var(--nord0);
|
||||
|
||||
// code blocks vars
|
||||
--code-hl-bg-color: var(--nord2);
|
||||
}
|
||||
// // code blocks vars
|
||||
// --code-hl-bg-color: var(--nord2);
|
||||
// }
|
||||
|
||||
@@ -18,13 +18,5 @@ keys or whose remap feature is kind of buggy with some keys, such as
|
||||
the «é» placed where the «w» is on a Qwerty layout (I’m looking at
|
||||
you, HoloCure).
|
||||
|
||||
** Installation
|
||||
If you wish to install my dotfiles and you are on ArchLinux, you can
|
||||
follow the [[file:bootstrap.org][bootstrap]] page where you can find a walkthrough of how I
|
||||
configure my environment and what I install. If you have [[https://github.com/TheLocehiliosan/yadm][YADM]]
|
||||
installed, you can even execute =yadm bootstrap= to execute it after
|
||||
cloning my repo with =yadm clone
|
||||
https://labs.phundrak.com/phundrak/dotfiles.git=.
|
||||
|
||||
** License
|
||||
See [[https://labs.phundrak.com/phundrak/dotfiles/src/branch/master/LICENSE.org][the repository’s license file]].
|
||||
|
||||
@@ -1031,7 +1031,7 @@ displayed as ~0~). Here is what the possible actions are:
|
||||
In this category you will find other keybindings that do not fit in other
|
||||
categories. For now, the only keybinding that is in this category is for
|
||||
toggling the touchpad’s tapping ability. This is linked to a special script I
|
||||
wrote [[file:bin.org::#Toggle_touchpad_tapping-23348b00][here]].
|
||||
wrote [[file:/scripts.md#toggle-touchpad-tapping][here]].
|
||||
#+NAME: sc-misc
|
||||
| Key | Modifiers | Lambda? | Action | What it does | Group |
|
||||
|--------------------+-----------+---------+-----------+-------------------------+-------|
|
||||
|
||||
@@ -334,7 +334,7 @@ Some visual packages:
|
||||
| nordic-theme-git | Nord theme for GTK |
|
||||
| noto-fonts-emoji | Font with emojis |
|
||||
| otf-ipafont | Japanese font |
|
||||
| picom | See [[file:picom.org]] |
|
||||
| picom | See [[file:/picom.org][my Picom config]] |
|
||||
| powerline-fonts | Powerline fonts |
|
||||
| siji-git | Siji font |
|
||||
| ttf-arphic-uming | CJK font Ming style |
|
||||
@@ -568,7 +568,6 @@ files that are to be tangled:
|
||||
| mpd.org |
|
||||
| neofetch.org |
|
||||
| picom.org |
|
||||
| rustfmt.org |
|
||||
| stumpwm.org |
|
||||
| tmux.org |
|
||||
|
||||
@@ -583,7 +582,7 @@ files that are to be tangled:
|
||||
"\n")
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS[127dafd79461dab55296163e57fadb7b355a205a]: generate-tangle
|
||||
#+RESULTS[8b74ad716447b62ace4eeddbd3dae7a1b1bdcdd7]: generate-tangle
|
||||
#+begin_example
|
||||
printf '\n\n==== Tangling bin.org\n\n' && \
|
||||
emacs -q --batch --eval '(require \'ob-tangle)' \
|
||||
@@ -620,11 +619,6 @@ emacs -q --batch --eval '(require \'ob-tangle)' \
|
||||
--eval '(setq org-confirm-babel-evaluate nil)' \
|
||||
--eval '(org-babel-tangle-file "~/org/config/picom.org")'
|
||||
|
||||
printf '\n\n==== Tangling rustfmt.org\n\n' && \
|
||||
emacs -q --batch --eval '(require \'ob-tangle)' \
|
||||
--eval '(setq org-confirm-babel-evaluate nil)' \
|
||||
--eval '(org-babel-tangle-file "~/org/config/rustfmt.org")'
|
||||
|
||||
printf '\n\n==== Tangling stumpwm.org\n\n' && \
|
||||
emacs -q --batch --eval '(require \'ob-tangle)' \
|
||||
--eval '(setq org-confirm-babel-evaluate nil)' \
|
||||
@@ -830,7 +824,7 @@ end
|
||||
#+END_SRC
|
||||
|
||||
*** Symlink some system config files
|
||||
Let’s symlink the ~plock~ script ([[file:bin.org::#Lock-635fcb38][source here]]) to ~/usr/bin~ so ~xss-lock~
|
||||
Let’s symlink the ~plock~ script ([[file:../scripts.md#plock][source here]]) to ~/usr/bin~ so ~xss-lock~
|
||||
can find it.
|
||||
#+BEGIN_SRC fish
|
||||
sudo ln -s ~/.local/bin/plock /usr/bin/plock
|
||||
@@ -844,7 +838,7 @@ mkdir -p ~/fromGIT
|
||||
|
||||
**** Reveal.JS
|
||||
I sometimes use Reveal.JS to make presentations, and I set its
|
||||
location in my [[file:emacs.org][Emacs config]] to be in =~/fromGIT=, so let’s clone it
|
||||
location in my [[file:../emacs/index.md][Emacs config]] to be in =~/fromGIT=, so let’s clone it
|
||||
there.
|
||||
#+BEGIN_SRC fish
|
||||
printf "\n# Install Reveal.JS ###########################################################\n\n"
|
||||
@@ -235,7 +235,7 @@ Keywords=Text;Editor;
|
||||
#+end_src
|
||||
|
||||
I also have ~mu4e.desktop~ which is used to set my default email client.
|
||||
It relies on ~emacsmail~ defined in [[file:bin.org::#Emacsmail-afffb7cd][this document]].
|
||||
It relies on ~emacsmail~ defined in [[file:./scripts.md#emacsmail][this document]].
|
||||
#+begin_src conf-desktop :tangle ~/.local/share/applications/mu4e.desktop
|
||||
[Desktop Entry]
|
||||
Name=Mu4e
|
||||
@@ -344,7 +344,7 @@ Type=Application
|
||||
|
||||
*** YouTube ~.desktop~ files
|
||||
The first ~.desktop~ file related to YouTube is ~ytdl.desktop~ which runs
|
||||
~ytdl~ defined in [[file:bin.org::#ytdl-a-youtube-dl-wrapper-03bd63e0][this document]].
|
||||
~ytdl~ defined in [[file:scripts.md#ytdl][this document]].
|
||||
#+begin_src conf-desktop :tangle ~/.local/share/applications/ytdl.desktop
|
||||
[Desktop Entry]
|
||||
Version=0.3
|
||||
@@ -357,7 +357,7 @@ Type=Application
|
||||
Categories=Network;Video
|
||||
#+end_src
|
||||
|
||||
There is also ~ytplay.desktop~ for ~ytplay~ defined in [[file:bin.org::#Media-youtube-dl-wrappers-ytplay-z6ka39h0m9j0][this document]].
|
||||
There is also ~ytplay.desktop~ for ~ytplay~ defined in [[file:scripts.md#ytplay][this document]].
|
||||
#+begin_src conf-desktop
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
|
||||
@@ -27,53 +27,6 @@ loaded, speeding Emacs up a bit.
|
||||
(blink-cursor-mode 0) ; disable blinking cursor
|
||||
#+end_src
|
||||
|
||||
*** Better garbage collection
|
||||
Emacs sometimes freezes up a bit when doing some garbage collection,
|
||||
which is not super. So, in order to fix that, I do two things:
|
||||
1. Set up a really high threshold (I have a lot of RAM to spare, so I
|
||||
don’t really care),
|
||||
2. Hook garbage collection thirty seconds after Emacs loses focus and
|
||||
every thirty seconds after that,
|
||||
3. Cancel garbage collection if Emacs gains focus back within this
|
||||
thirty seconds window.
|
||||
|
||||
With a garbage collection threshold, Emacs should never garbage
|
||||
collect on its own, and Emacs is free to freeze up for a few seconds
|
||||
when it loses focus since I’m looking away.
|
||||
#+begin_src emacs-lisp
|
||||
(setq garbage-collection-messages t ;; tell me when garbage collecting
|
||||
gc-cons-threshold (* 16 1024 1024 1024)) ;; 16GiB of RAM
|
||||
|
||||
(defmacro my/time (&rest body)
|
||||
`(let ((time (current-time)))
|
||||
,@body
|
||||
(float-time (time-since time))))
|
||||
|
||||
(defun my/garbage-collect ()
|
||||
"Garbage collect and tell the user how much time it took."
|
||||
(message "Garbage collector ran for %.06fs"
|
||||
(my/time (garbage-collect))))
|
||||
|
||||
(defvar my/gc-timer nil
|
||||
"Timer for garbage collection. See
|
||||
`my/garbage-collect-on-focus-lost'.")
|
||||
|
||||
(defun my/garbage-collect-on-focus-lost ()
|
||||
"Garbage collect when Emacs loses focus.
|
||||
|
||||
Garbage collection is only triggered thirty seconds after losing
|
||||
focus, and only once."
|
||||
(if (frame-focus-state)
|
||||
(when (timerp my/gc-timer)
|
||||
(cancel-timer my/gc-timer))
|
||||
(setq my/gc-timer (run-with-idle-timer 30 nil #'my/garbage-collect))))
|
||||
|
||||
(add-function :after after-focus-change-function #'my/garbage-collect-on-focus-lost)
|
||||
#+end_src
|
||||
|
||||
To write this, I mostly based myself on [[https://news.ycombinator.com/item?id=39190110][this HackerNews thread]] and [[https://akrl.sdf.org/#orgc15a10d][its
|
||||
related article]].
|
||||
|
||||
** Emacs Behavior
|
||||
*** Editing Text in Emacs
|
||||
I *never* want to keep trailing spaces in my files, which is why I’m
|
||||
@@ -203,7 +156,9 @@ it looks really uncomfortable! This is why I prefer to tell Emacs to
|
||||
keep its backup files to itself in a directory it only will access.
|
||||
#+begin_src emacs-lisp
|
||||
(setq backup-directory-alist `(("." . ,(expand-file-name ".tmp/backups/"
|
||||
user-emacs-directory))))
|
||||
user-emacs-directory)))
|
||||
tramp-backup-directory-alist `(("." . ,(expand-file-name ".tmp/tramp-backups/"
|
||||
user-emacs-directory))))
|
||||
#+end_src
|
||||
|
||||
When using LSP with Typescript projects, my =tsconfig.json= or its
|
||||
@@ -397,47 +352,3 @@ on the matter.
|
||||
(unless (string= "-" project-name)
|
||||
(format (if (buffer-modified-p) " ◉ %s" " ● %s - Emacs") project-name))))))
|
||||
#+end_src
|
||||
|
||||
** A better custom variable setter
|
||||
Something people often forget about custom variables in Elisp is they
|
||||
can have a custom setter that will run some code if we set the
|
||||
variable properly with ~customize-set-variable~, so ~setq~ shouldn’t be
|
||||
the user’s choice by default. But repeatedly writing
|
||||
~customize-set-variable~ can get tiring and boring. So why not take the
|
||||
best of both world and create ~csetq~, a ~setq~ that uses
|
||||
~customize-set-variable~ under the hood while it keeps a syntax similar
|
||||
to the one ~setq~ uses?
|
||||
#+begin_src emacs-lisp
|
||||
(defmacro csetq (&rest forms)
|
||||
"Bind each custom variable FORM to the value of its VAL.
|
||||
|
||||
FORMS is a list of pairs of values [FORM VAL].
|
||||
`customize-set-variable' is called sequentially on each pair
|
||||
contained in FORMS. This means `csetq' has a similar behaviour as
|
||||
`setq': each VAL expression is evaluated sequentially, i.e. the
|
||||
first VAL is evaluated before the second, and so on. This means
|
||||
the value of the first FORM can be used to set the second FORM.
|
||||
|
||||
The return value of `csetq' is the value of the last VAL.
|
||||
|
||||
\(fn [FORM VAL]...)"
|
||||
(declare (debug (&rest sexp form))
|
||||
(indent 1))
|
||||
;; Check if we have an even number of arguments
|
||||
(when (= (mod (length forms) 2) 1)
|
||||
(signal 'wrong-number-of-arguments (list 'csetq (1+ (length forms)))))
|
||||
;; Transform FORMS into a list of pairs (FORM . VALUE)
|
||||
(let (sexps)
|
||||
(while forms
|
||||
(let ((form (pop forms))
|
||||
(value (pop forms)))
|
||||
(push `(customize-set-variable ',form ,value)
|
||||
sexps)))
|
||||
`(progn ,@(nreverse sexps))))
|
||||
#+end_src
|
||||
|
||||
I first got inspired by [[https://oremacs.com/2015/01/17/setting-up-ediff/][this blog article]] (archived article, just in
|
||||
case) but it seems the code snippet no longer works properly, so not
|
||||
only did I have to modify it to make it work with an arbitrary amount
|
||||
of arguments (as long as it’s pairs of variables and their value), but
|
||||
I also had to make the code simply work.
|
||||
|
||||
@@ -40,7 +40,7 @@ APPEND and COMPARE-FN, see `add-to-list'."
|
||||
#+end_src
|
||||
|
||||
** Generate and insert random passwords
|
||||
These functions got replaced by my custom package, see [[file:./misc.md#password-generator][Password
|
||||
These functions got replaced by my custom package, see [[file:packages/misc.md#password-generator][Password
|
||||
generator]].
|
||||
|
||||
** Handle new windows
|
||||
@@ -59,13 +59,6 @@ focus the new window immediately.
|
||||
(interactive)
|
||||
(split-window-below)
|
||||
(windmove-down))
|
||||
|
||||
(defun kill-buffer-and-delete-window ()
|
||||
"Kill the current buffer and delete its window."
|
||||
(interactive)
|
||||
(progn
|
||||
(kill-this-buffer)
|
||||
(delete-window)))
|
||||
#+end_src
|
||||
|
||||
** Resize windows
|
||||
@@ -73,9 +66,9 @@ focus the new window immediately.
|
||||
(with-eval-after-load 'hydra
|
||||
(defhydra windows-adjust-size ()
|
||||
"
|
||||
_s_: enlarge
|
||||
_c_: enlarge _r_: right
|
||||
_t_: shrink
|
||||
_c_: enlarge _r_: right
|
||||
_s_: enlarge
|
||||
"
|
||||
("c" enlarge-window-horizontally)
|
||||
("t" shrink-window)
|
||||
@@ -138,3 +131,21 @@ b s~, which bring the user directly to the ~*Messages*~ buffer and the
|
||||
(interactive)
|
||||
(switch-to-buffer "*scratch*"))
|
||||
#+end_src
|
||||
|
||||
** Tangle all Emacs config files
|
||||
#+begin_src emacs-lisp :results none
|
||||
(defvar my/emacs-org-config-directory
|
||||
(expand-file-name "org/config/docs/emacs" (getenv "HOME"))
|
||||
"Location of my config as org files.")
|
||||
|
||||
(defun my/tangle-emacs-config ()
|
||||
"Tangle all my Emacs config files from org files."
|
||||
(interactive)
|
||||
(let ((files (f-files my/emacs-org-config-directory
|
||||
(lambda (file) (f-ext-p file "org"))
|
||||
t))
|
||||
(org-confirm-babel-evaluate nil))
|
||||
(dolist (file files)
|
||||
(message "Tangling %s" file)
|
||||
(org-babel-tangle-file file))))
|
||||
#+end_src
|
||||
|
||||
@@ -80,24 +80,23 @@ block.
|
||||
** Loading All Configuration Modules
|
||||
|
||||
#+name: emacs-modules
|
||||
| Module Name | Config Page |
|
||||
|--------------------------+----------------------------------|
|
||||
| =basic-config.el= | [[file:./basic-config.org][Basic Configuration]] |
|
||||
| =custom-elisp.el= | [[file:./custom-elisp.org][Custom Elisp]] |
|
||||
| =package-manager.el= | [[file:./package-manager.org][Package Manager]] |
|
||||
| =keybinding-managemers.el= | [[file:./keybinding-managemers.org][Keybinding Managers]] |
|
||||
| =applications.el= | [[file:./packages/applications.org][Packages — Applications]] |
|
||||
| =autocompletion.el= | [[file:./packages/autocompletion.org][Packages — Autocompletion]] |
|
||||
| =editing.el= | [[file:./packages/editing.org][Packages — Editing]] |
|
||||
| =emacs-builtin.el= | [[file:./packages/emacs-builtin.org][Packages — Emacs Built-ins]] |
|
||||
| =exwm.el= | [[file:./packages/exwm.org][Packages — EXWM]] |
|
||||
| =helpful.el= | [[file:./packages/helpful.org][Packages — Making My Life Easier]] |
|
||||
| =latex.el= | [[file:./packages/latex.org][Packages — LaTeX]] |
|
||||
| =misc.el= | [[file:./packages/misc.org][Packages — Misc]] |
|
||||
| =org.el= | [[file:./packages/org.org][Packages — Org Mode]] |
|
||||
| =programming.el= | [[file:./packages/programming.org][Packages — Programming]] |
|
||||
| =visual-config.el= | [[file:./packages/visual-config.org][Packages — Visual Configuration]] |
|
||||
| =keybindings.el= | [[file:./keybindings.org][Keybindings]] |
|
||||
| Module Name | Config Page |
|
||||
|------------------------+----------------------------------|
|
||||
| =basic-config.el= | [[file:./basic-config.org][Basic Configuration]] |
|
||||
| =custom-elisp.el= | [[file:./custom-elisp.org][Custom Elisp]] |
|
||||
| =package-manager.el= | [[file:./package-manager.org][Package Manager]] |
|
||||
| =keybinding-managers.el= | [[file:keybinding-managers.org][Keybinding Managers]] |
|
||||
| =applications.el= | [[file:./packages/applications.org][Packages — Applications]] |
|
||||
| =autocompletion.el= | [[file:./packages/autocompletion.org][Packages — Autocompletion]] |
|
||||
| =editing.el= | [[file:./packages/editing.org][Packages — Editing]] |
|
||||
| =emacs-builtin.el= | [[file:./packages/emacs-builtin.org][Packages — Emacs Built-ins]] |
|
||||
| =helpful.el= | [[file:./packages/helpful.org][Packages — Making My Life Easier]] |
|
||||
| =latex.el= | [[file:./packages/latex.org][Packages — LaTeX]] |
|
||||
| =misc.el= | [[file:./packages/misc.org][Packages — Misc]] |
|
||||
| =org.el= | [[file:./packages/org.org][Packages — Org Mode]] |
|
||||
| =programming.el= | [[file:./packages/programming.org][Packages — Programming]] |
|
||||
| =visual-config.el= | [[file:./packages/visual-config.org][Packages — Visual Configuration]] |
|
||||
| =keybindings.el= | [[file:./keybindings.org][Keybindings]] |
|
||||
|
||||
#+name: generate-modules
|
||||
#+begin_src emacs-lisp :tangle no :cache yes :var modules=emacs-modules :exports none
|
||||
@@ -107,8 +106,8 @@ block.
|
||||
" ")
|
||||
#+end_src
|
||||
|
||||
#+RESULTS[f76449860408293997e174ff94c743d46951835b]: generate-modules
|
||||
: "basic-config.el" "custom-elisp.el" "package-manager.el" "keybinding-managemers.el" "applications.el" "autocompletion.el" "editing.el" "emacs-builtin.el" "exwm.el" "helpful.el" "latex.el" "misc.el" "org.el" "programming.el" "visual-config.el" "keybindings.el"
|
||||
#+RESULTS[05f9bb535bec2ba84390cc118600323683f51e7c]: generate-modules
|
||||
: "basic-config.el" "custom-elisp.el" "package-manager.el" "keybinding-managers.el" "applications.el" "autocompletion.el" "editing.el" "emacs-builtin.el" "helpful.el" "latex.el" "misc.el" "org.el" "programming.el" "visual-config.el" "keybindings.el"
|
||||
|
||||
#+begin_src emacs-lisp :noweb yes
|
||||
(dolist (module '(<<generate-modules()>>))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#+title: Emacs — Keybinding Managers
|
||||
#+setupfile: ../headers
|
||||
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
|
||||
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/keybinding-managemers.el
|
||||
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/keybinding-managers.el
|
||||
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
|
||||
|
||||
* Keybinding Managers
|
||||
@@ -68,7 +68,6 @@ they are much more comfortable than Emacs’.
|
||||
evil-want-C-u-scroll t
|
||||
evil-want-C-i-jump nil)
|
||||
(require 'evil-vars)
|
||||
(evil-set-undo-system 'undo-tree)
|
||||
:config
|
||||
<<evil-undefine-keys>>
|
||||
<<evil-bepo>>
|
||||
@@ -156,52 +155,6 @@ additional code compared to most people due to the bépo layout.
|
||||
(evil-collection-init))
|
||||
#+end_src
|
||||
|
||||
~undo-tree~ is my preferred way of undoing and redoing stuff. The main
|
||||
reason is it doesn’t create a linear undo/redo history, but rather a
|
||||
complete tree you can navigate to see your complete editing history.
|
||||
One of the two obvious things to do are to tell Emacs to save all its
|
||||
undo history files in a dedicated directory, otherwise we’d risk
|
||||
littering all of our directories. The second thing is to simply
|
||||
globally enable its mode.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package undo-tree
|
||||
:defer t
|
||||
:straight (:build t)
|
||||
:custom
|
||||
(undo-tree-history-directory-alist
|
||||
`(("." . ,(expand-file-name (file-name-as-directory "undo-tree-hist")
|
||||
user-emacs-directory))))
|
||||
:init
|
||||
(global-undo-tree-mode)
|
||||
:config
|
||||
<<undo-tree-ignore-text-properties>>
|
||||
<<undo-tree-compress-files>>
|
||||
(setq undo-tree-visualizer-diff t
|
||||
undo-tree-visualizer-timestamps t
|
||||
undo-tree-auto-save-history t
|
||||
undo-tree-enable-undo-in-region t
|
||||
undo-limit (* 800 1024)
|
||||
undo-strong-limit (* 12 1024 1024)
|
||||
undo-outer-limit (* 128 1024 1024)))
|
||||
#+end_src
|
||||
|
||||
An interesting behaviour from DoomEmacs is to compress the history
|
||||
files with ~zstd~ when it is present on the system. Not only do we enjoy
|
||||
much smaller files (according to DoomEmacs, we get something like 80%
|
||||
file savings), Emacs can load them much faster than the regular files.
|
||||
Sure, it uses more CPU time uncompressing these files, but it’s
|
||||
insignificant, and it’s still faster than loading a heavier file.
|
||||
#+name: undo-tree-compress-files
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(when (executable-find "zstd")
|
||||
(defun my/undo-tree-append-zst-to-filename (filename)
|
||||
"Append .zst to the FILENAME in order to compress it."
|
||||
(concat filename ".zst"))
|
||||
(advice-add 'undo-tree-make-history-save-file-name
|
||||
:filter-return
|
||||
#'my/undo-tree-append-zst-to-filename))
|
||||
#+end_src
|
||||
|
||||
** Hydra
|
||||
[[https://github.com/abo-abo/hydra][Hydra]] is a simple menu creator for keybindings.
|
||||
#+begin_src emacs-lisp
|
||||
|
||||
@@ -9,23 +9,32 @@ Undefining some stuff to make keybind prefixes work correctly.
|
||||
|
||||
#+name: general-keybindings-gen
|
||||
#+header: :tangle no :exports none :results value :cache yes
|
||||
#+begin_src emacs-lisp :var table=keybinds-windows prefix=""
|
||||
(mapconcat (lambda (line)
|
||||
(let* ((key (nth 0 line))
|
||||
(function (nth 1 line))
|
||||
(comment (or (nth 2 line) ""))
|
||||
(package (or (nth 3 line) "")))
|
||||
(format "\"%s%s\" %s"
|
||||
prefix
|
||||
key
|
||||
(if (string= "" comment)
|
||||
(if (member function '("" "nil")) "nil" (concat "#'" function))
|
||||
(format "'(%s :wk %s%s)"
|
||||
(if (member function '("" "nil")) ":ignore t" function)
|
||||
(if (member function '("none" "nil")) "t" (concat "\"" comment "\""))
|
||||
(if (string-blank-p package) "" (concat ":package " package)))))))
|
||||
table
|
||||
"\n")
|
||||
#+begin_src emacs-lisp :var table=keybindings-apps prefix="a"
|
||||
(mapconcat
|
||||
(lambda (line)
|
||||
(let* ((key (format "%s" (nth 0 line)))
|
||||
(function (nth 1 line))
|
||||
(fn-nil-p (member function '("" "nil")))
|
||||
(comment (or (nth 2 line) ""))
|
||||
(comment-p (not (string= "" comment)))
|
||||
(comment (cond ((nth 2 line) (concat " :wk \"" (nth 2 line) "\""))
|
||||
(fn-nil-p " :wk t")
|
||||
(t "")))
|
||||
(package (or (nth 3 line) ""))
|
||||
(package-p (not (string= "" (nth 3 line))))
|
||||
(package (if package-p (concat " :package " (nth 3 line)) "")))
|
||||
(format "\"%s\" %s"
|
||||
(concat prefix key)
|
||||
(if (or comment-p package-p)
|
||||
(format "'(%s%s%s)"
|
||||
(if (member function '("" "nil"))
|
||||
":ignore t"
|
||||
function)
|
||||
(if comment-p comment "")
|
||||
(if package-p package ""))
|
||||
(concat "#'" function)))))
|
||||
table
|
||||
"\n")
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
@@ -36,110 +45,210 @@ Undefining some stuff to make keybind prefixes work correctly.
|
||||
|
||||
(phundrak/evil
|
||||
:packages '(counsel)
|
||||
"U" #'evil-redo
|
||||
"U" '(evil-redo :package evil)
|
||||
"C-a" #'beginning-of-line
|
||||
"C-e" #'end-of-line
|
||||
"C-y" #'yank
|
||||
"M-y" #'counsel-yank-pop)
|
||||
"M-y" '(counsel-yank-pop :package counsel))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
#+begin_src emacs-lisp :results none
|
||||
(general-define-key
|
||||
"<f5>" #'compile
|
||||
"<f6>" #'recompile)
|
||||
|
||||
(phundrak/leader-key
|
||||
"SPC" '(counsel-M-x :wk "M-x")
|
||||
"'" #'shell-pop
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-tabs, prefix="TAB ")>>
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-apps, prefix="a")>>
|
||||
<<general-keybindings-gen(table=keybinds-apps-shell, prefix="as")>>
|
||||
<<general-keybindings-gen(table=treemacs-keybinds, prefix="at")>>
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-buffers, prefix="b")>>
|
||||
|
||||
"c" '(:ignore t :wk "code")
|
||||
"cl" #'evilnc-comment-or-uncomment-lines
|
||||
|
||||
<<keybindings-flycheck>>
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-files, prefix="f")>>
|
||||
<<keybinds-specific-files>>
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-help, prefix="h")>>
|
||||
|
||||
"i" '(:ignore t :wk "insert")
|
||||
"iu" #'counsel-unicode-char
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-jump, prefix="j")>>
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-toggle, prefix="t ")>>
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-text, prefix="T")>>
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-windows, prefix="w")>>
|
||||
|
||||
<<general-keybindings-gen(table=keybinds-quit, prefix="q")>>
|
||||
|
||||
"'" '(shell-pop :package shell-pop)
|
||||
"R" #'recompile
|
||||
"u" #'universal-argument
|
||||
"U" #'undo-tree-visualize)
|
||||
|
||||
<<general-keybindings-gen(table=keybindings-tabs, prefix="TAB ")>>
|
||||
<<general-keybindings-gen(table=keybindings-apps, prefix="a")>>
|
||||
<<general-keybindings-gen(table=keybindings-apps-shell, prefix="as")>>
|
||||
<<general-keybindings-gen(table=keybindings-treemacs, prefix="at")>>
|
||||
<<general-keybindings-gen(table=keybindings-buffers, prefix="b")>>
|
||||
<<general-keybindings-gen(table=keybindings-code, prefix="c")>>
|
||||
<<general-keybindings-gen(table=keybindings-errors, prefix="e")>>
|
||||
<<keybindings-errors-extra>>
|
||||
<<general-keybindings-gen(table=keybindings-files, prefix="f")>>
|
||||
<<keybindings-files-extras>>
|
||||
<<general-keybindings-gen(table=keybindings-git, prefix="g")>>
|
||||
<<general-keybindings-gen(table=keybindings-help, prefix="h")>>
|
||||
<<general-keybindings-gen(table=keybindings-insert, prefix="i")>>
|
||||
<<general-keybindings-gen(table=keybindings-jump, prefix="j")>>
|
||||
<<general-keybindings-gen(table=keybindings-language, prefix="l")>>
|
||||
<<general-keybindings-gen(table=keybindings-media, prefix="m")>>
|
||||
<<general-keybindings-gen(table=keybindings-org, prefix="o")>>
|
||||
<<general-keybindings-gen(table=keybindings-refactor, prefix="r")>>
|
||||
<<general-keybindings-gen(table=keybindings-toggle, prefix="t ")>>
|
||||
<<general-keybindings-gen(table=keybindings-text, prefix="T")>>
|
||||
<<general-keybindings-gen(table=keybindings-windows, prefix="w")>>
|
||||
<<general-keybindings-gen(table=keybindings-quit, prefix="q")>>)
|
||||
#+end_src
|
||||
|
||||
** Apps
|
||||
Here are my apps keybinds. Each one of them is prefixed by ~a~.
|
||||
#+name: keybinds-apps
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------------+-------------+------------|
|
||||
| | | apps | |
|
||||
| c | calc | | |
|
||||
| C | | calendar | |
|
||||
| CC | calendar | | |
|
||||
| Co | org-agenda | | org |
|
||||
| Cs | org-caldav-sync | | org-caldav |
|
||||
| d | docker | | |
|
||||
| E | elfeed | | |
|
||||
| e | | email | |
|
||||
| ec | mu4e-compose-new | | |
|
||||
| em | mu4e | | |
|
||||
| k | keycast-mode | | |
|
||||
| K | keycast-log-mode | | |
|
||||
| m | | mastodon | |
|
||||
| mm | mastodon | | mastodon |
|
||||
| mn | mastodon-notifications-get | | mastodon |
|
||||
| mt | mastodon-toot | | mastodon |
|
||||
| T | tetris | | |
|
||||
| w | wttrin | | wttrin |
|
||||
Here are my apps keybindings. Each one of them is prefixed by ~a~.
|
||||
#+name: keybindings-apps
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------------+-------------+-----------------|
|
||||
| | | apps | |
|
||||
| a | | AI | |
|
||||
| ae | eca | | eca |
|
||||
| aC | claude-code-ide | | claude-code-ide |
|
||||
| ac | claude-code-ide-menu | | claude-code-ide |
|
||||
| c | calc | | |
|
||||
| C | | calendar | |
|
||||
| CC | calendar | | |
|
||||
| Co | org-agenda | | org |
|
||||
| Cs | org-caldav-sync | | org-caldav |
|
||||
| d | docker | | docker |
|
||||
| E | elfeed | | elfeed |
|
||||
| e | | email | |
|
||||
| ec | mu4e-compose-new | | mu4e |
|
||||
| em | mu4e | | mu4e |
|
||||
| k | keycast-mode | | keycast |
|
||||
| K | keycast-log-mode | | keycast |
|
||||
| m | | mastodon | |
|
||||
| mm | mastodon | | mastodon |
|
||||
| mn | mastodon-notifications-get | | mastodon |
|
||||
| mt | mastodon-toot | | mastodon |
|
||||
| T | tetris | | |
|
||||
| S | screenshot | | screenshot |
|
||||
| w | wttrin | | wttrin |
|
||||
|
||||
*** Shell apps
|
||||
I also have two main shell-related functions, prefixed with ~as~.
|
||||
#+name: keybinds-apps-shell
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-------------+-------------+-------------|
|
||||
| | | shells | |
|
||||
| e | eshell-new | | |
|
||||
| v | vterm | | vterm |
|
||||
| V | multi-vterm | | multi-vterm |
|
||||
#+name: keybindings-apps-shell
|
||||
| Key | Function | Description | Package |
|
||||
|-----+------------+-------------+---------|
|
||||
| | | shells | |
|
||||
| e | eshell-new | | |
|
||||
| t | eat | | eat |
|
||||
|
||||
*** Treemacs
|
||||
#+name: keybindings-treemacs
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------------------------+-------------+----------|
|
||||
| | | treemacs | |
|
||||
| c | | create | |
|
||||
| cd | treemacs-create-dir | | treemacs |
|
||||
| cf | treemacs-create-file | | treemacs |
|
||||
| ci | treemacs-create-icon | | treemacs |
|
||||
| ct | treemacs-create-theme | | treemacs |
|
||||
| cw | treemacs-create-workspace | | treemacs |
|
||||
| d | treemacs-delete-file | | treemacs |
|
||||
| f | | files | |
|
||||
| ff | treemacs-find-file | | treemacs |
|
||||
| ft | treemacs-find-tag | | treemacs |
|
||||
| l | | lsp | |
|
||||
| ls | treemacs-expand-lsp-symbol | | treemacs |
|
||||
| ld | treemacs-expand-lsp-treemacs-deps | | treemacs |
|
||||
| lD | treemacs-collapse-lsp-treemacs-deps | | treemacs |
|
||||
| lS | treemacs-collapse-lsp-symbol | | treemacs |
|
||||
| p | | projects | |
|
||||
| pa | treemacs-add-project-to-workspace | | treemacs |
|
||||
| pf | treemacs-project-follow-mode | | treemacs |
|
||||
| pn | treemacs-project-of-node | | treemacs |
|
||||
| pp | treemacs-project-at-point | | treemacs |
|
||||
| pr | treemacs-remove-project-from-workspace | | treemacs |
|
||||
| pt | treemacs-move-project-down | | treemacs |
|
||||
| ps | treemacs-move-project-up | | treemacs |
|
||||
| r | | rename | |
|
||||
| rf | treemacs-rename-file | | treemacs |
|
||||
| rp | treemacs-rename-project | | treemacs |
|
||||
| rr | treemacs-rename | | treemacs |
|
||||
| rw | treemacs-rename-workspace | | treemacs |
|
||||
| t | treemacs | | treemacs |
|
||||
| T | | toggles | |
|
||||
| Td | treemacs-toggle-show-dotfiles | | treemacs |
|
||||
| Tn | treemacs-toggle-node | | treemacs |
|
||||
| v | | visit node | |
|
||||
| va | treemacs-visit-node-ace | | treemacs |
|
||||
| vc | treemacs-visit-node-close-treemacs | | treemacs |
|
||||
| vn | treemacs-visit-node-default | | treemacs |
|
||||
| y | | yank | |
|
||||
| ya | treemacs-copy-absolute-path-at-point | | treemacs |
|
||||
| yp | treemacs-copy-project-path-at-point | | treemacs |
|
||||
| yr | treemacs-copy-relative-path-at-point | | treemacs |
|
||||
| yf | treemacs-copy-file | | treemacs |
|
||||
|
||||
*** Treemacs
|
||||
#+name: keybindings-treemacs
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------------------------+-------------+----------|
|
||||
| | | treemacs | |
|
||||
| c | | create | |
|
||||
| cd | treemacs-create-dir | | treemacs |
|
||||
| cf | treemacs-create-file | | treemacs |
|
||||
| ci | treemacs-create-icon | | treemacs |
|
||||
| ct | treemacs-create-theme | | treemacs |
|
||||
| cw | treemacs-create-workspace | | treemacs |
|
||||
| d | treemacs-delete-file | | treemacs |
|
||||
| f | | files | |
|
||||
| ff | treemacs-find-file | | treemacs |
|
||||
| ft | treemacs-find-tag | | treemacs |
|
||||
| l | | lsp | |
|
||||
| ls | treemacs-expand-lsp-symbol | | treemacs |
|
||||
| ld | treemacs-expand-lsp-treemacs-deps | | treemacs |
|
||||
| lD | treemacs-collapse-lsp-treemacs-deps | | treemacs |
|
||||
| lS | treemacs-collapse-lsp-symbol | | treemacs |
|
||||
| p | | projects | |
|
||||
| pa | treemacs-add-project-to-workspace | | treemacs |
|
||||
| pf | treemacs-project-follow-mode | | treemacs |
|
||||
| pn | treemacs-project-of-node | | treemacs |
|
||||
| pp | treemacs-project-at-point | | treemacs |
|
||||
| pr | treemacs-remove-project-from-workspace | | treemacs |
|
||||
| pt | treemacs-move-project-down | | treemacs |
|
||||
| ps | treemacs-move-project-up | | treemacs |
|
||||
| r | | rename | |
|
||||
| rf | treemacs-rename-file | | treemacs |
|
||||
| rp | treemacs-rename-project | | treemacs |
|
||||
| rr | treemacs-rename | | treemacs |
|
||||
| rw | treemacs-rename-workspace | | treemacs |
|
||||
| t | treemacs | | treemacs |
|
||||
| T | | toggles | |
|
||||
| Td | treemacs-toggle-show-dotfiles | | treemacs |
|
||||
| Tn | treemacs-toggle-node | | treemacs |
|
||||
| v | | visit node | |
|
||||
| va | treemacs-visit-node-ace | | treemacs |
|
||||
| vc | treemacs-visit-node-close-treemacs | | treemacs |
|
||||
| vn | treemacs-visit-node-default | | treemacs |
|
||||
| y | | yank | |
|
||||
| ya | treemacs-copy-absolute-path-at-point | | treemacs |
|
||||
| yp | treemacs-copy-project-path-at-point | | treemacs |
|
||||
| yr | treemacs-copy-relative-path-at-point | | treemacs |
|
||||
| yf | treemacs-copy-file | | treemacs |
|
||||
|
||||
** Buffers
|
||||
My buffer-related keybinds are all prefixed by ~b~.
|
||||
#+name: keybinds-buffers
|
||||
| Key | Function | Description |
|
||||
|-----+------------------------------------+-------------|
|
||||
| | | buffers |
|
||||
| b | bufler-switch-buffer | |
|
||||
| B | bury-buffer | |
|
||||
| c | clone-indirect-buffer | |
|
||||
| C | clone-indirect-buffer-other-window | |
|
||||
| l | bufler | |
|
||||
| d | kill-this-buffer | |
|
||||
| D | kill-buffer | |
|
||||
| h | dashboard-refresh-buffer | |
|
||||
| m | switch-to-messages-buffer | |
|
||||
| n | next-buffer | |
|
||||
| p | previous-buffer | |
|
||||
| r | counsel-buffer-or-recentf | |
|
||||
| s | switch-to-scratch-buffer | |
|
||||
My buffer-related keybindings are all prefixed by ~b~.
|
||||
#+name: keybindings-buffers
|
||||
| Key | Function | Description | Package |
|
||||
|-----+------------------------------------+-------------+-----------|
|
||||
| | | buffers | |
|
||||
| b | bufler-switch-buffer | | bufler |
|
||||
| B | bury-buffer | | |
|
||||
| c | clone-indirect-buffer | | |
|
||||
| C | clone-indirect-buffer-other-window | | |
|
||||
| l | bufler | | bufler |
|
||||
| d | kill-current-buffer | | |
|
||||
| D | kill-buffer | | |
|
||||
| h | dashboard-refresh-buffer | | dashboard |
|
||||
| m | switch-to-messages-buffer | | |
|
||||
| n | next-buffer | | |
|
||||
| p | previous-buffer | | |
|
||||
| r | counsel-buffer-or-recentf | | counsel |
|
||||
| R | rename-uniquely | | |
|
||||
| s | switch-to-scratch-buffer | | |
|
||||
|
||||
** Code
|
||||
#+name: keybindings-code
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-----------------------------------+-------------+---------------------|
|
||||
| | | code | |
|
||||
| l | evilnc-comment-or-uncomment-lines | | evil-nerd-commenter |
|
||||
| n | hl-todo-next | | hl-todo |
|
||||
| p | hl-todo-previous | | hl-todo |
|
||||
|
||||
** Errors
|
||||
#+begin_src emacs-lisp
|
||||
@@ -155,39 +264,45 @@ My buffer-related keybinds are all prefixed by ~b~.
|
||||
("q" nil))
|
||||
#+end_src
|
||||
|
||||
#+name: keybindings-flycheck
|
||||
#+name: keybindings-errors
|
||||
| Key | Function | Description | Package |
|
||||
|-----+---------------------+----------------+---------|
|
||||
| | | errors | |
|
||||
| . | hydra-flycheck/body | hydra-flycheck | |
|
||||
| l | counsel-flycheck | | counsel |
|
||||
| F | flyspell-hydra/body | flyspell-hydra | |
|
||||
|
||||
#+name: keybindings-errors-extra
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
"e" '(:ignore t :which-key "errors")
|
||||
"e." '(hydra-flycheck/body :wk "hydra")
|
||||
"el" #'counsel-flycheck
|
||||
"ee" '(:keymap flycheck-command-map :package 'flycheck :wk "flycheck")
|
||||
"ef" '(:keymap flyspell-mode-map :package 'flyspell :wk "flyspell")
|
||||
"eF" #'flyspell-hydra/body
|
||||
#+end_src
|
||||
|
||||
** Files
|
||||
My keybinds for file manipulation are prefixed by ~f~.
|
||||
#+name: keybinds-files
|
||||
| Key | Function | Description |
|
||||
|-----+-------------------+-------------|
|
||||
| | | files |
|
||||
| f | counsel-find-file | |
|
||||
| F | quick-find-files | |
|
||||
| h | hexl-find-file | |
|
||||
| r | counsel-recentf | |
|
||||
| s | save-buffer | |
|
||||
My keybindings for file manipulation are prefixed by ~f~.
|
||||
#+name: keybindings-files
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-------------------+-------------+------------------|
|
||||
| | | files | |
|
||||
| f | counsel-find-file | | counsel |
|
||||
| F | quick-find-files | | quick-find-files |
|
||||
| h | hexl-find-file | | |
|
||||
| r | counsel-recentf | | counsel |
|
||||
| s | save-buffer | | |
|
||||
|
||||
I also have some keybinds dedicated to opening specific files.
|
||||
#+name: keybinds-specific-files
|
||||
I also have some keybindings dedicated to opening specific files.
|
||||
#+name: keybindings-files-extras
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
"fc" '((lambda ()
|
||||
(interactive)
|
||||
(quick-find-files nil "~/org/config/docs/emacs" "org"))
|
||||
:wk "emacs config")
|
||||
:wk "emacs config"
|
||||
:package quick-find-files)
|
||||
"fC" '((lambda ()
|
||||
(interactive)
|
||||
(quick-find-files nil "~/org/config/docs" "org"))
|
||||
:wk "general config")
|
||||
:wk "general config"
|
||||
:package quick-find-files)
|
||||
"fi" '((lambda ()
|
||||
(interactive)
|
||||
(find-file (concat user-emacs-directory "init.el")))
|
||||
@@ -197,27 +312,49 @@ I also have some keybinds dedicated to opening specific files.
|
||||
(quick-find-files nil
|
||||
(expand-file-name "lisp" user-emacs-directory)
|
||||
"el"))
|
||||
:which-key "elisp config")
|
||||
:which-key "elisp config"
|
||||
:package quick-find-files)
|
||||
"fR" '((lambda ()
|
||||
(interactive)
|
||||
(counsel-find-file ""
|
||||
(concat user-emacs-directory
|
||||
(file-name-as-directory "straight")
|
||||
(file-name-as-directory "repos"))))
|
||||
:which-key "straight package")
|
||||
:which-key "straight package"
|
||||
:package counsel)
|
||||
"fS" '((lambda ()
|
||||
(interactive)
|
||||
(find-file "~/org/config/stumpwm.org"))
|
||||
:which-key "stumpwm.org")
|
||||
#+end_src
|
||||
|
||||
** Git
|
||||
#+name: keybindings-git
|
||||
| Key | Function | Description | Package |
|
||||
|-----+---------------------+-------------+---------|
|
||||
| | | git | |
|
||||
| b | magit-blame | | magit |
|
||||
| c | magit-clone | | magit |
|
||||
| d | magit-dispatch | | magit |
|
||||
| i | magit-init | | magit |
|
||||
| s | magit-status | | magit |
|
||||
| l | magit-log | | magit |
|
||||
| y | my/yadm | | magit |
|
||||
| S | magit-stage-file | | magit |
|
||||
| U | magit-unstage-file | | magit |
|
||||
| f | | file | |
|
||||
| fd | magit-diff | | magit |
|
||||
| fc | magit-file-checkout | | magit |
|
||||
| fl | magit-file-dispatch | | magit |
|
||||
| fF | magit-find-file | | magit |
|
||||
|
||||
** Help
|
||||
My keybinds for help are prefixed by ~h~.
|
||||
#+name: keybinds-help
|
||||
My keybindings for help are prefixed by ~h~.
|
||||
#+name: keybindings-help
|
||||
| Key | Function | Description |
|
||||
|-----+--------------------------+-------------|
|
||||
| | | help |
|
||||
| k | which-key-show-top-level | |
|
||||
| k | which-key-show-top-level | which-key |
|
||||
| i | info | |
|
||||
| I | info-display-manual | |
|
||||
| d | | describe |
|
||||
@@ -232,82 +369,131 @@ My keybinds for help are prefixed by ~h~.
|
||||
| ds | helpful-symbol | |
|
||||
| dv | helpful-variable | |
|
||||
|
||||
** Insert
|
||||
#+name: keybindings-insert
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------+-------------+-----------|
|
||||
| | | insert | |
|
||||
| u | counsel-unicode-char | | counsel |
|
||||
| y | ivy-yasnippet | | yasnippet |
|
||||
|
||||
** Jump
|
||||
My keybinds for jumping around are prefixed by ~j~.
|
||||
#+name: keybinds-jump
|
||||
| Key | Function | Description |
|
||||
|-----+-------------------------+-------------|
|
||||
| | | jump |
|
||||
| f | counsel-file-jump | |
|
||||
| d | dirvish-dwim | |
|
||||
| D | dired-jump-other-window | |
|
||||
My keybindings for jumping around are prefixed by ~j~.
|
||||
#+name: keybindings-jump
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-------------------------------+-------------+---------|
|
||||
| | | jump | |
|
||||
| C | | avy copy | |
|
||||
| Cl | avy-copy-line | | avy |
|
||||
| Cr | avy-copy-region | | avy |
|
||||
| D | dired-jump-other-window | | |
|
||||
| U | my/avy-open-url | open-url | avy |
|
||||
| b | avy-pop-mark | | avy |
|
||||
| c | evil-avy-goto-char-timer | | avy |
|
||||
| d | dirvish-dwim | | dirvish |
|
||||
| f | counsel-file-jump | | counsel |
|
||||
| k | | avy kill | |
|
||||
| kL | avy-kill-ring-save-whole-line | | avy |
|
||||
| kR | avy-kill-ring-save-region | | avy |
|
||||
| kl | avy-kill-whole-line | | avy |
|
||||
| kr | avy-kill-region | | avy |
|
||||
| l | avy-goto-line | | avy |
|
||||
| m | | move | |
|
||||
| ml | avy-move-line | | avy |
|
||||
| mr | avy-move-region | | avy |
|
||||
| mt | avy-transpose-lines-in-region | | avy |
|
||||
| n | avy-next | | avy |
|
||||
| p | avy-prev | | avy |
|
||||
| u | my/avy-goto-url | goto-url | avy |
|
||||
|
||||
** Language
|
||||
#+name: keybindings-language
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------------------+-------------+----------|
|
||||
| | | language | |
|
||||
| . | langtool-correct-at-point | | langtool |
|
||||
| B | langtool-correct-buffer | | langtool |
|
||||
| b | langtool-check-buffer | | langtool |
|
||||
| c | langtool-check | | langtool |
|
||||
| d | langtool-check-done | | langtool |
|
||||
| l | langtool-switch-default-language | | langtool |
|
||||
| p | langtool-show-message-at-point | | langtool |
|
||||
| r | langtool-correct-region | | langtool |
|
||||
|
||||
** Media
|
||||
#+name: keybindings-media
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-----------------------------+----------------+---------|
|
||||
| | | media | |
|
||||
| . | hydra-media/body | hydra-media | emms |
|
||||
| « | emms-player-mpd-previous | | emms |
|
||||
| » | emms-player-mpd-next | | emms |
|
||||
| c | emms-player-mpd-clear | | emms |
|
||||
| e | | emms | |
|
||||
| eb | emms-browser | | emms |
|
||||
| ep | emms-playlist-mode-go | | emms |
|
||||
| es | emms-player-mpd-show | | emms |
|
||||
| p | my/mpc-toggle | mpd-play-pause | |
|
||||
| s | emms-stop | | emms |
|
||||
| u | | update | |
|
||||
| um | emms-player-mpd-update-all | | emms |
|
||||
| uc | emms-cache-set-from-mpd-all | | emm s |
|
||||
|
||||
** Project
|
||||
My keybinds for my projects are prefixed by ~p~.
|
||||
#+name: keybinds-project
|
||||
| Key | Function | Description |
|
||||
|-----+--------------------------------------------+-------------|
|
||||
| | | project |
|
||||
| ! | projectile-run-shell-command-in-root | |
|
||||
| & | projectile-run-async-shell-command-in-root | |
|
||||
| b | counsel-projectile-switch-to-buffer | |
|
||||
| c | counsel-projectile | |
|
||||
| d | counsel-projectile-find-dir | |
|
||||
| e | projectile-edit-dir-locals | |
|
||||
| f | counsel-projectile-find-file | |
|
||||
| g | projectile-find-tag | |
|
||||
| k | project-kill-buffers | |
|
||||
| p | counsel-projectile-switch-project | |
|
||||
| t | ivy-magit-todos | |
|
||||
| v | projectile-vc | |
|
||||
My keybindings for my projects are prefixed by ~p~.
|
||||
#+name: keybindings-project
|
||||
| Key | Function | Description | Package |
|
||||
|-----+--------------------------------------------+-------------+------------|
|
||||
| | | project | |
|
||||
| ! | projectile-run-shell-command-in-root | | projectile |
|
||||
| & | projectile-run-async-shell-command-in-root | | projectile |
|
||||
| b | counsel-projectile-switch-to-buffer | | counsel |
|
||||
| c | counsel-projectile | | counsel |
|
||||
| d | counsel-projectile-find-dir | | counsel |
|
||||
| e | projectile-edit-dir-locals | | projectile |
|
||||
| f | counsel-projectile-find-file | | counsel |
|
||||
| g | projectile-find-tag | | projectile |
|
||||
| k | project-kill-buffers | | |
|
||||
| p | counsel-projectile-switch-project | | cousel |
|
||||
| v | projectile-vc | | projectile |
|
||||
|
||||
*** Treemacs
|
||||
** Refactor
|
||||
#+name: keybindings-refactor
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------------------+-----------------+------------------|
|
||||
| | | refactor | |
|
||||
| i | evil-iedit-state/iedit-mode | iedit-mode | evil-iedit-state |
|
||||
| q | evil-iedit-state/quit-iedit-mode | quit-iedit-mode | evil-iedit-state |
|
||||
|
||||
#+name: treemacs-keybinds
|
||||
| Key | Function | Description |
|
||||
|-----+----------------------------------------+-------------|
|
||||
| | | treemacs |
|
||||
| c | | create |
|
||||
| cd | treemacs-create-dir | |
|
||||
| cf | treemacs-create-file | |
|
||||
| ci | treemacs-create-icon | |
|
||||
| ct | treemacs-create-theme | |
|
||||
| cw | treemacs-create-workspace | |
|
||||
| d | treemacs-delete-file | |
|
||||
| f | | files |
|
||||
| ff | treemacs-find-file | |
|
||||
| ft | treemacs-find-tag | |
|
||||
| l | | lsp |
|
||||
| ls | treemacs-expand-lsp-symbol | |
|
||||
| ld | treemacs-expand-lsp-treemacs-deps | |
|
||||
| lD | treemacs-collapse-lsp-treemacs-deps | |
|
||||
| lS | treemacs-collapse-lsp-symbol | |
|
||||
| p | | projects |
|
||||
| pa | treemacs-add-project-to-workspace | |
|
||||
| pf | treemacs-project-follow-mode | |
|
||||
| pn | treemacs-project-of-node | |
|
||||
| pp | treemacs-project-at-point | |
|
||||
| pr | treemacs-remove-project-from-workspace | |
|
||||
| pt | treemacs-move-project-down | |
|
||||
| ps | treemacs-move-project-up | |
|
||||
| r | | rename |
|
||||
| rf | treemacs-rename-file | |
|
||||
| rp | treemacs-rename-project | |
|
||||
| rr | treemacs-rename | |
|
||||
| rw | treemacs-rename-workspace | |
|
||||
| t | treemacs | |
|
||||
| T | | toggles |
|
||||
| Td | treemacs-toggle-show-dotfiles | |
|
||||
| Tn | treemacs-toggle-node | |
|
||||
| v | | visit node |
|
||||
| va | treemacs-visit-node-ace | |
|
||||
| vc | treemacs-visit-node-close-treemacs | |
|
||||
| vn | treemacs-visit-node-default | |
|
||||
| y | | yank |
|
||||
| ya | treemacs-copy-absolute-path-at-point | |
|
||||
| yp | treemacs-copy-project-path-at-point | |
|
||||
| yr | treemacs-copy-relative-path-at-point | |
|
||||
| yf | treemacs-copy-file | |
|
||||
** Org
|
||||
#+name: keybindings-org
|
||||
| Key | Function | Description | Package |
|
||||
|-----+--------------------------------+-------------+----------|
|
||||
| | | org | |
|
||||
| c | | clock | |
|
||||
| cc | org-clock-cancel | | org |
|
||||
| cd | org-clock-display | | org |
|
||||
| cg | org-clock-goto | | org |
|
||||
| ci | org-clock-in | | org |
|
||||
| co | org-clock-out | | org |
|
||||
| C | org-capture | | org |
|
||||
| r | | roam | |
|
||||
| rb | org-mark-ring-goto | back | org-roam |
|
||||
| rB | org-roam-buffer-toggle | | org-roam |
|
||||
| rn | | nodes | |
|
||||
| rnf | org-roam-node-find | | org-roam |
|
||||
| rni | org-roam-node-insert | | org-roam |
|
||||
| rno | org-roam-node-open | | org-roam |
|
||||
| rnr | org-roam-node-random | | org-roam |
|
||||
| rnv | org-roam-node-visit | | org-roam |
|
||||
| rs | | sync | |
|
||||
| rsa | org-roam-db-autosync-mode | | org-roam |
|
||||
| rsc | org-roam-db-clear-all | | org-roam |
|
||||
| rsd | org-roam-db-diagnose-node | | org-roam |
|
||||
| rss | org-roam-db-sync | | org-roam |
|
||||
| ru | | ui | |
|
||||
| rua | org-roam-ui-add-to-local-graph | | org-roam |
|
||||
| ruo | org-roam-ui-open | | org-roam |
|
||||
|
||||
** Tabs
|
||||
Emacs has native tabs available, which can be interesting when working
|
||||
@@ -315,8 +501,8 @@ on multiple projects at once between which we may want to switch. Tabs
|
||||
allow the user not to have multiple frames while keeping the
|
||||
advantages of having multiple frames.
|
||||
|
||||
My keybinds are prefixed by ~SPC TAB~.
|
||||
#+name: keybinds-tabs
|
||||
My keybindings are prefixed by ~SPC TAB~.
|
||||
#+name: keybindings-tabs
|
||||
| Key | Function | Description |
|
||||
|-----+--------------+-------------|
|
||||
| | | tabs |
|
||||
@@ -332,18 +518,20 @@ My keybinds are prefixed by ~SPC TAB~.
|
||||
|
||||
** Text
|
||||
The prefix here is ~T~.
|
||||
#+name: keybinds-text
|
||||
| Key | Function | Description |
|
||||
|-----+----------------------+-------------|
|
||||
| | | text |
|
||||
| e | string-edit-at-point | |
|
||||
| u | downcase-region | |
|
||||
| U | upcase-region | |
|
||||
| z | hydra-zoom/body | |
|
||||
#+name: keybindings-text
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------+-------------+----------------------|
|
||||
| | | text | |
|
||||
| e | string-edit-at-point | | string-edit-at-point |
|
||||
| u | downcase-region | | |
|
||||
| U | upcase-region | | |
|
||||
| z | hydra-zoom/body | | |
|
||||
|
||||
*** TODO Rewrite hydra-zoom :noexport:
|
||||
|
||||
** Toggles
|
||||
My toggle keybinds are prefixed by ~t~.
|
||||
#+name: keybinds-toggle
|
||||
My toggle keybindings are prefixed by ~t~.
|
||||
#+name: keybindings-toggle
|
||||
| Key | Function | Description |
|
||||
|-----+---------------------------------------+--------------|
|
||||
| | | toggles |
|
||||
@@ -357,42 +545,44 @@ My toggle keybinds are prefixed by ~t~.
|
||||
| it | toggle-input-method | |
|
||||
| is | set-input-method | |
|
||||
|
||||
*** TODO Rewrite =my/modify-frame-alpha-background/body= :noexport:
|
||||
|
||||
** Windows
|
||||
A couple of keybinds are hidden from which-key, otherwise there’s not
|
||||
A couple of keybindings are hidden from which-key, otherwise there’s not
|
||||
much to say. The prefix here is ~w~.
|
||||
#+name: keybinds-windows
|
||||
| Key | Function | Description |
|
||||
|-----+-------------------------------+-------------|
|
||||
| | | windows |
|
||||
| c | evil-window-left | |
|
||||
| t | evil-window-down | |
|
||||
| s | evil-window-up | |
|
||||
| r | evil-window-right | |
|
||||
| . | windows-adjust-size/body | |
|
||||
| - | split-window-below-and-focus | |
|
||||
| / | split-window-right-and-focus | |
|
||||
| $ | winum-select-window-by-number | |
|
||||
| 0 | winum-select-window-0-or-10 | none |
|
||||
| 1 | winum-select-window-1 | none |
|
||||
| 2 | winum-select-window-2 | none |
|
||||
| 3 | winum-select-window-3 | none |
|
||||
| 4 | winum-select-window-4 | none |
|
||||
| 5 | winum-select-window-5 | none |
|
||||
| 6 | winum-select-window-6 | none |
|
||||
| 7 | winum-select-window-7 | none |
|
||||
| 8 | winum-select-window-8 | none |
|
||||
| 9 | winum-select-window-9 | none |
|
||||
| b | kill-buffer-and-delete-window | |
|
||||
| d | delete-window | |
|
||||
| o | other-window | |
|
||||
| D | delete-other-windows | |
|
||||
| w | | writeroom |
|
||||
| w. | writeroom-buffer-width/body | |
|
||||
| ww | writeroom-mode | |
|
||||
#+name: keybindings-windows
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-------------------------------+-------------+----------------|
|
||||
| | | windows | |
|
||||
| c | evil-window-left | | evil |
|
||||
| t | evil-window-down | | evil |
|
||||
| s | evil-window-up | | evil |
|
||||
| r | evil-window-right | | evil |
|
||||
| . | windows-adjust-size/body | | |
|
||||
| - | split-window-below-and-focus | | |
|
||||
| / | split-window-right-and-focus | | |
|
||||
| $ | winum-select-window-by-number | | winum |
|
||||
| 0 | winum-select-window-0-or-10 | none | winum |
|
||||
| 1 | winum-select-window-1 | none | winum |
|
||||
| 2 | winum-select-window-2 | none | winum |
|
||||
| 3 | winum-select-window-3 | none | winum |
|
||||
| 4 | winum-select-window-4 | none | winum |
|
||||
| 5 | winum-select-window-5 | none | winum |
|
||||
| 6 | winum-select-window-6 | none | winum |
|
||||
| 7 | winum-select-window-7 | none | winum |
|
||||
| 8 | winum-select-window-8 | none | winum |
|
||||
| 9 | winum-select-window-9 | none | winum |
|
||||
| b | kill-buffer-and-window | | |
|
||||
| d | delete-window | | |
|
||||
| o | other-window | | |
|
||||
| D | delete-other-windows | | |
|
||||
| w | | writeroom | |
|
||||
| w. | writeroom-buffer-width/body | | writeroom-mode |
|
||||
| ww | writeroom-mode | | writeroom-mode |
|
||||
|
||||
** Quit
|
||||
Why would I ever use any of these keybinds? They are prefixed with ~q~.
|
||||
#+name: keybinds-quit
|
||||
Why would I ever use any of these keybindings? They are prefixed with ~q~.
|
||||
#+name: keybindings-quit
|
||||
| Key | Function | Description |
|
||||
|-----+----------------------------+-------------|
|
||||
| | | quit |
|
||||
|
||||
@@ -50,7 +50,6 @@ stuff.
|
||||
(package-initialize)
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
|
||||
#+end_src
|
||||
|
||||
From time to time, I fork some packages either because I’m trying to
|
||||
|
||||
@@ -33,6 +33,35 @@
|
||||
:defer t)
|
||||
#+end_src
|
||||
|
||||
** AI
|
||||
*** Claude Code Emacs
|
||||
#+begin_src emacs-lisp
|
||||
(use-package claude-code-ide
|
||||
:defer t
|
||||
:straight (:build t :type git :host github :repo "manzaltu/claude-code-ide.el")
|
||||
:custom
|
||||
((claude-code-ide-terminal-backend 'eat)
|
||||
(claude-code-ide-enable-mcp-server t))
|
||||
:config
|
||||
(claude-code-ide-emacs-tools-setup))
|
||||
#+end_src
|
||||
|
||||
*** Editor Code Assistant
|
||||
The Editor Code Assistant, or ECA, is a nice package that allows the
|
||||
user to use an AI agent right in Emacs. AI is certainly not something
|
||||
that will replace programmers any time soon, but it’s still a nice
|
||||
tool to have when you know what you’re doing.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package eca
|
||||
:defer t
|
||||
:init (setopt eca-extra-args '("--verbose" "--log-level debug"))
|
||||
:straight (:build t
|
||||
:host github
|
||||
:repo "editor-code-assistant/eca-emacs"
|
||||
:files ("*.el")))
|
||||
#+end_src
|
||||
|
||||
** Bitwarden
|
||||
This package is still a very much work in progress one I’m developing
|
||||
in order to interact with Bitwarden in Emacs with the help of the
|
||||
@@ -295,6 +324,7 @@ know about it since I don’t want it to include it a second time after
|
||||
(setq message-signature nil
|
||||
mail-signature nil)
|
||||
#+end_src
|
||||
|
||||
*** Gnus
|
||||
#+begin_src emacs-lisp
|
||||
(use-package gnus
|
||||
@@ -395,7 +425,7 @@ configuration for the ~mu4e~ package itself.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package mu4e
|
||||
:after all-the-icons
|
||||
:straight (:build t)
|
||||
:straight (:build nil)
|
||||
:commands mu4e mu4e-compose-new
|
||||
:init
|
||||
(defun mu4e--main-action-str (name func)
|
||||
@@ -406,16 +436,16 @@ configuration for the ~mu4e~ package itself.
|
||||
(require 'mu4e)
|
||||
(remove-hook 'mu4e-main-mode-hook 'evil-collection-mu4e-update-main-view)
|
||||
|
||||
<<mu4e-ical-setup>>
|
||||
<<mu4e-ical-init-config>>
|
||||
;; <<mu4e-ical-setup>>
|
||||
;; <<mu4e-ical-init-config>>
|
||||
|
||||
(csetq mu4e-completing-read-function 'completing-read
|
||||
mu4e-use-fancy-chars t
|
||||
message-kill-buffer-on-exit t
|
||||
mu4e-org-support nil)
|
||||
(setopt mu4e-completing-read-function 'completing-read
|
||||
mu4e-use-fancy-chars t
|
||||
message-kill-buffer-on-exit t
|
||||
mu4e-org-support nil)
|
||||
(let ((dir (concat (getenv "HOME") "/Downloads/mu4e")))
|
||||
(when (file-directory-p dir)
|
||||
(csetq mu4e-attachment-dir dir)))
|
||||
(setopt mu4e-attachment-dir dir)))
|
||||
(defmacro mu4e-view-mode--prepare ()
|
||||
`(lambda () (visual-line-mode 1)))
|
||||
:gfhook ('mu4e-view-mode-hook (mu4e-view-mode--prepare))
|
||||
@@ -433,7 +463,7 @@ configuration for the ~mu4e~ package itself.
|
||||
(add-hook 'mu4e-view-mode-hook (lambda () (setq truncate-lines nil)))
|
||||
(add-hook 'mu4e-headers-mode-hook (lambda () (setq truncate-lines t)))
|
||||
|
||||
<<mu4e-ical-config>>
|
||||
;; <<mu4e-ical-config>>
|
||||
<<mu4e-keybindings-undef>>
|
||||
<<mu4e-keybindings-view>>
|
||||
<<mu4e-keybindings-view-no-prefix>>
|
||||
@@ -498,22 +528,7 @@ configuration for the ~mu4e~ package itself.
|
||||
Quick sidenote: on Arch Linux, you’ll need to install either ~mu~ or
|
||||
~mu-git~ from the AUR in order to use mu4e. I also have a ~.desktop~ file
|
||||
to make it possible to open mu4e directly from my program picker. It
|
||||
uses the shell script ~emacsmail~ I’ve written [[file:bin.org::#Emacsmail-afffb7cd][here]].
|
||||
#+header: :mkdirp yes
|
||||
#+begin_src conf-desktop :tangle ~/.local/share/applications/mu4e.desktop
|
||||
[Desktop Entry]
|
||||
Name=Mu4e
|
||||
GenericName=Mu4e
|
||||
Comment=Maildir Utils for Emacs
|
||||
MimeType=x-scheme-handler/mailto;
|
||||
Exec=/home/phundrak/.local/bin/emacsmail %U
|
||||
Icon=emacs
|
||||
Type=Application
|
||||
Terminal=false
|
||||
Categories=Network;Email;TextEditor
|
||||
StartupWMClass=Gnus
|
||||
Keywords=Text;Editor;
|
||||
#+end_src
|
||||
uses the shell script ~emacsmail~ I’ve written [[file:/scripts.md#emacsmail][here]].
|
||||
|
||||
**** Interact with iCalendar events
|
||||
Something that has always bugged me was how to properly with iCalendar
|
||||
@@ -521,8 +536,8 @@ events shared with me on my personal mailbox. The answer is actually
|
||||
[[https://www.djcbsoftware.nl/code/mu/mu4e/iCalendar.html][dead simple]].
|
||||
#+name: mu4e-ical-setup
|
||||
#+begin_src emacs-lisp
|
||||
(require 'mu4e-icalendar)
|
||||
(mu4e-icalendar-setup)
|
||||
;; (require 'mu4e-icalendar)
|
||||
;; (mu4e-icalendar-setup)
|
||||
#+end_src
|
||||
|
||||
I’ll just configure a couple of things regarding these events, namely
|
||||
@@ -530,14 +545,14 @@ converting them to org-mode and add them to my =~/org/notes.org= file,
|
||||
and delete the email once I answered to the event.
|
||||
#+name: mu4e-ical-config
|
||||
#+begin_src emacs-lisp
|
||||
(setq mu4e-icalendar-trash-after-reply t)
|
||||
;; (setq mu4e-icalendar-trash-after-reply t)
|
||||
#+end_src
|
||||
|
||||
#+name: mu4e-ical-init-config
|
||||
#+begin_src emacs-lisp
|
||||
(setq gnus-icalendar-org-capture-file "~/org/notes.org"
|
||||
gnus-icalendar-org-capture-headline '("Calendar"))
|
||||
(gnus-icalendar-org-setup)
|
||||
;; (setq gnus-icalendar-org-capture-file "~/org/notes.org"
|
||||
;; gnus-icalendar-org-capture-headline '("Calendar"))
|
||||
;; (gnus-icalendar-org-setup)
|
||||
#+end_src
|
||||
|
||||
**** Basic configuration
|
||||
@@ -556,7 +571,7 @@ and how to retrieve them.
|
||||
#+name: mu4e-mail-on-machine
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(setq mu4e-get-mail-command "mbsync -a"
|
||||
mu4e-root-maildir "~/Mail"
|
||||
mu4e-root-maildir (concat (getenv "HOME") "/Mail/lucien@phundrak.com/")
|
||||
mu4e-trash-folder "/Trash"
|
||||
mu4e-refile-folder "/Archive"
|
||||
mu4e-sent-folder "/Sent"
|
||||
@@ -791,29 +806,6 @@ With this piece of code, I can simply jump to my inbox maildir with
|
||||
(:maildir "/Trash" :key ?t)))
|
||||
#+end_src
|
||||
|
||||
**** Dealing with spammers
|
||||
I’m sure you have received at least one email recently from a sketchy
|
||||
email address asking you something that might be completely unrelated
|
||||
to what you do, or at least somewhat related. Fortunately, [[https://twitter.com/Boris/status/1360208504544444417][we have a
|
||||
hero]]! Now, let me write a function that will insert their
|
||||
pre-written text at point to avoid me going back to their Twitter
|
||||
thread each time I want to shut spammers up.
|
||||
#+begin_src emacs-lisp
|
||||
(defun reply-to-bill ()
|
||||
(interactive)
|
||||
(insert "Please forward this email to bill@noprocurement.com,
|
||||
and delete my email, as I’ll be changing jobs soon, and this
|
||||
email address will no longer be active.
|
||||
|
||||
Bill Whiskoney is a senior partner at Nordic Procurement
|
||||
Services, and he handles our budget and will help you further or
|
||||
introduce you to someone who can."))
|
||||
#+end_src
|
||||
|
||||
If you want the full story, make sure to read the whole thread, I
|
||||
guarantee it, it’s worth your time! And in case the Twitter thread
|
||||
disappear in the future, [[https://threader.app/thread/1360208504544444417][here is a backup]].
|
||||
|
||||
**** Getting Fancy
|
||||
I’m not a huge fan of mu4e’s default icons marking my emails, so I’ll
|
||||
redefine them as follows. Be aware the name of these icons are from
|
||||
@@ -1049,8 +1041,6 @@ skipping the export part and write your emails directly in org-mode?
|
||||
org-msg-signature (format "\n--\n#+begin_signature\n%s\n#+end_signature"
|
||||
(with-temp-buffer
|
||||
(insert-file-contents mail-signature-file)
|
||||
(while (re-search-forward "\n" nil t)
|
||||
(replace-match "\n\n"))
|
||||
(buffer-string))))
|
||||
:general
|
||||
(phundrak/major-leader-key
|
||||
@@ -1092,7 +1082,7 @@ notification system, and I’ll activate the modeline notification.
|
||||
EMMS, also known as the /Emacs MultiMedia System/, allows the user to
|
||||
interact through Emacs with multimedia elements such as music and
|
||||
videos. My main use for it will be for music with MPD (see its
|
||||
configuration [[file:mpd.org][here]]).
|
||||
configuration [[file:/mpd.md][here]]).
|
||||
#+begin_src emacs-lisp
|
||||
(use-package emms
|
||||
:defer t
|
||||
@@ -1112,6 +1102,9 @@ configuration [[file:mpd.org][here]]).
|
||||
<<emms-search-set-variable>>
|
||||
|
||||
<<emms-media-hydra>>
|
||||
(defun my/mpc-toggle ()
|
||||
(interactive)
|
||||
(shell-command-and-echo "mpc toggle"))
|
||||
(defun emms-player-toggle-pause ()
|
||||
(interactive)
|
||||
(shell-command-and-echo "mpc toggle"))
|
||||
@@ -1153,27 +1146,7 @@ configuration [[file:mpd.org][here]]).
|
||||
:packages 'emms
|
||||
"d" #'emms-playlist-mode-kill-track
|
||||
"p" #'emms-playlist-mode-play-smart
|
||||
"q" #'kill-this-buffer)
|
||||
(phundrak/leader-key
|
||||
:infix "m"
|
||||
:packages 'emms
|
||||
"" '(:ignore t :which-key "media")
|
||||
"." #'hydra-media/body
|
||||
"«" #'emms-player-mpd-previous
|
||||
"»" #'emms-player-mpd-next
|
||||
"c" #'emms-player-mpd-clear
|
||||
"e" '(:ignore t :which-key "emms")
|
||||
"eb" #'emms-browser
|
||||
"ep" #'emms-playlist-mode-go
|
||||
"es" #'emms-player-mpd-show
|
||||
"p" '((lambda ()
|
||||
(interactive)
|
||||
(shell-command-and-echo "mpc toggle"))
|
||||
:which-key "mpc toggle")
|
||||
"s" #'emms-stop
|
||||
"u" '(:ignore t :which-key "update")
|
||||
"um" #'emms-player-mpd-update-all
|
||||
"uc" #'emms-cache-set-from-mpd-all))
|
||||
"q" #'kill-this-buffer))
|
||||
#+end_src
|
||||
|
||||
*** Finding files from EMMS
|
||||
@@ -1269,6 +1242,40 @@ minibuffer, both separated by a single space."
|
||||
("q" nil :exit t))
|
||||
#+end_src
|
||||
|
||||
** Langtool
|
||||
LanguageTool is a great tool for catching typos and grammatical errors
|
||||
in quite a few languages.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package langtool
|
||||
:defer t
|
||||
:straight (:build t)
|
||||
:commands (langtool-check
|
||||
langtool-check-done
|
||||
langtool-show-message-at-point
|
||||
langtool-correct-buffer)
|
||||
:custom
|
||||
(langtool-default-language "en-US")
|
||||
(langtool-mother-tongue "fr")
|
||||
:config
|
||||
(setq langtool-http-server-host "localhost"
|
||||
langtool-http-server-port 8081))
|
||||
#+end_src
|
||||
|
||||
Finally, =writegood-mode= detects some simple general rules when writing
|
||||
in English and can also calculate the Flesh-Kincaid levels of a
|
||||
document.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package writegood-mode
|
||||
:defer t
|
||||
:straight (:build t)
|
||||
:hook org-mode latex-mode
|
||||
:general
|
||||
(phundrak/major-leader-key
|
||||
:keymaps 'writegood-mode-map
|
||||
"g" #'writegood-grade-level
|
||||
"r" #'writegood-reading-ease))
|
||||
#+end_src
|
||||
|
||||
** Nov
|
||||
Nov is a major-mode for reading EPUB files within Emacs. Since I have
|
||||
it, I don’t need any other Epub reader on my computer! Plus this one
|
||||
@@ -1348,7 +1355,7 @@ dark mode for PDFs.
|
||||
"m" 'pdf-view-midnight-minor-mode)
|
||||
:config
|
||||
(with-eval-after-load 'pdf-view
|
||||
(csetq pdf-view-midnight-colors '("#d8dee9" . "#2e3440"))))
|
||||
(setopt pdf-view-midnight-colors '("#d8dee9" . "#2e3440"))))
|
||||
#+end_src
|
||||
|
||||
One thing ~pdf-tools~ doesn’t handle is restoring the PDF to the last
|
||||
@@ -1366,6 +1373,60 @@ left it.
|
||||
#+end_src
|
||||
|
||||
** Project Management
|
||||
*** Jujutsu
|
||||
Let’s face it: [[https://git-scm.com/][git]] is awesome. There’s a reason it took over the world
|
||||
of software development, replacing pretty much all competitors such as
|
||||
subversion. And I will forever love it. But, it has a lot of
|
||||
drawbacks, especially its interface that is... not great, to put it
|
||||
mildly. I absolutely respect its commitment to staying backward
|
||||
compatible, but it’s not great.
|
||||
|
||||
[[https://jj-vcs.github.io/][Jujutsu]] on the other hand, is awesome! It’s interface is really clean,
|
||||
really intuitive, especially for someone like me who rebases a LOT!
|
||||
And, for now, it still uses git as its backend, so it’s entirely
|
||||
compatible with git repositories. In fact, I pretty much don’t use git
|
||||
anymore, jj (abbreviation of Jujutsu) has almost completely replaced
|
||||
git for me.
|
||||
|
||||
It comes to no surprise then that I will use [[https://elpa.gnu.org/packages/vc-jj.html][=vc-jj=]], a Jujutsu
|
||||
backend for =vc.el= and =project.el=.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package vc-jj
|
||||
:straight (:build t)
|
||||
:defer nil)
|
||||
#+end_src
|
||||
|
||||
As mentioned in the package’s README, I do need to set these lines in
|
||||
my jj config:
|
||||
#+begin_src toml :tangle no
|
||||
[ui]
|
||||
diff-formatter = ":git"
|
||||
conflict-marker-style = "git"
|
||||
#+end_src
|
||||
|
||||
I also like Magit’s interface, as you can see in my [[file:./applications.md#magit][Magit]] config.
|
||||
Therefore, let’s install =jujutsu-mode= which attempts to recreate a
|
||||
Magit-style interface for Jujutsu.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package jj-mode
|
||||
:straight (:build t :host github :repo "bolivier/jj-mode.el")
|
||||
:defer t)
|
||||
#+end_src
|
||||
|
||||
Though, I’ll be honest, I generally prefer to use Jujutsu in the
|
||||
terminal, unlike git. Something I do use Emacs for, however, is
|
||||
writing my commit messages.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package jjdescription
|
||||
:defer nil
|
||||
:straight (:build t)
|
||||
:commands jjdescription-mode
|
||||
:init (add-to-list 'auto-mode-alist '("\\.jjdescription\\'" . jjdescription-mode)))
|
||||
#+end_src
|
||||
|
||||
*** Magit
|
||||
Magit is an awesome wrapper around Git for Emacs! Very often, I go
|
||||
from disliking to really hating Git GUI clients because they often
|
||||
@@ -1382,8 +1443,8 @@ doing and what Git is doing! In short, I absolutely love it!
|
||||
:config
|
||||
(add-hook 'magit-process-find-password-functions 'magit-process-password-auth-source)
|
||||
<<magit-angular-keywords-highlight>>
|
||||
(csetq magit-clone-default-directory "~/fromGIT/"
|
||||
magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
|
||||
(setopt magit-clone-default-directory "~/fromGIT/"
|
||||
magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1)
|
||||
(with-eval-after-load 'evil-collection
|
||||
(phundrak/evil
|
||||
:packages '(evil-collection magit)
|
||||
@@ -1401,25 +1462,7 @@ doing and what Git is doing! In short, I absolutely love it!
|
||||
:packages 'magit
|
||||
"," #'with-editor-finish
|
||||
"k" #'with-editor-cancel
|
||||
"a" #'with-editor-cancel)
|
||||
(phundrak/leader-key
|
||||
:infix "g"
|
||||
:packages 'magit
|
||||
"" '(:ignore t :wk "git")
|
||||
"b" #'magit-blame
|
||||
"c" #'magit-clone
|
||||
"d" #'magit-dispatch
|
||||
"i" #'magit-init
|
||||
"s" #'magit-status
|
||||
"l" #'magit-log
|
||||
"y" #'my/yadm
|
||||
"S" #'magit-stage-file
|
||||
"U" #'magit-unstage-file
|
||||
"f" '(:ignore t :wk "file")
|
||||
"fd" #'magit-diff
|
||||
"fc" #'magit-file-checkout
|
||||
"fl" #'magit-file-dispatch
|
||||
"fF" #'magit-find-file))
|
||||
"a" #'with-editor-cancel))
|
||||
#+end_src
|
||||
|
||||
There is currently a bug in Emacs TRAMP as described in issue [[https://github.com/magit/magit/issues/4720][#4720]] of
|
||||
@@ -1448,7 +1491,7 @@ I also want to highlight these angular-style keywords in commit messages.
|
||||
"Highlight angular-style keywords in commit messages."
|
||||
(let ((boundary 0))
|
||||
(when (string-match (rx (seq (or "feat" "fix" "docs" "style" "refactor"
|
||||
"perf" "test" "chore")
|
||||
"perf" "test" "ci" "chore")
|
||||
(* "(" (* (not ")")) ")")
|
||||
":"))
|
||||
msg
|
||||
@@ -1475,14 +1518,7 @@ keywords in a buffer. Let’s enable this mode globally.
|
||||
(use-package hl-todo
|
||||
:defer t
|
||||
:straight (:build t)
|
||||
:init (global-hl-todo-mode 1)
|
||||
:general
|
||||
(phundrak/leader-key
|
||||
:packages '(hl-todo)
|
||||
:infix "c"
|
||||
"" '(:ignore t :which-key "todos")
|
||||
"n" #'hl-todo-next
|
||||
"p" #'hl-todo-previous))
|
||||
:init (global-hl-todo-mode 1))
|
||||
#+end_src
|
||||
|
||||
We can now configure properly =magit-todos=. Notice my custom function
|
||||
@@ -1603,7 +1639,8 @@ excluded files.
|
||||
eol)
|
||||
,(rx "/"
|
||||
(or "rsync" "ssh" "tmp" "yadm" "sudoedit" "sudo")
|
||||
(* any)))))
|
||||
(* any))
|
||||
"/nix/.*")))
|
||||
#+end_src
|
||||
|
||||
** Screenshot
|
||||
@@ -1617,15 +1654,31 @@ look nice.
|
||||
:type git
|
||||
:host github
|
||||
:repo "tecosaur/screenshot")
|
||||
:config (load-file (locate-library "screenshot.el"))
|
||||
:general
|
||||
(phundrak/leader-key
|
||||
:infix "a"
|
||||
:packages '(screenshot)
|
||||
"S" #'screenshot))
|
||||
:config (load-file (locate-library "screenshot.el")))
|
||||
#+end_src
|
||||
|
||||
** Shells
|
||||
*** Eat
|
||||
Eat is a modern shell emulator for Emacs. I use it as a replacement
|
||||
for VTerm as I never got VTerm to actually work on NixOS.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package eat
|
||||
:defer t
|
||||
:straight (eat :type git
|
||||
:host codeberg
|
||||
:repo "akib/emacs-eat"
|
||||
:files ("*.el" ("term" "term/*.el") "*.texi"
|
||||
"*.ti" ("terminfo/e" "terminfo/e/*")
|
||||
("terminfo/65" "terminfo/65/*")
|
||||
("integration" "integration/*")
|
||||
(:exclude ".dir-locals.el" "*-tests.el")))
|
||||
:init
|
||||
(add-hook 'eshell-load-hook #'eat-eshell-mode)
|
||||
(eat-eshell-mode 1)
|
||||
:config
|
||||
(add-hook 'eat-exit-hook #'kill-this-buffer))
|
||||
#+end_src
|
||||
|
||||
*** Shell-pop
|
||||
Shell-pop allows the user to easily call for a new shell in a pop-up
|
||||
buffer.
|
||||
@@ -1635,7 +1688,7 @@ buffer.
|
||||
:straight (:build t)
|
||||
:custom
|
||||
(shell-pop-default-directory "/home/phundrak")
|
||||
(shell-pop-shell-type (quote ("eshell" "*eshell*" (lambda () (eshell shell-pop-term-shell)))))
|
||||
(shell-pop-shell-type (quote ("eat" "*eat-pop*" (lambda () (eat)))))
|
||||
(shell-pop-window-size 30)
|
||||
(shell-pop-full-span nil)
|
||||
(shell-pop-window-position "bottom")
|
||||
@@ -1644,60 +1697,12 @@ buffer.
|
||||
(shell-pop-cleanup-buffer-at-process-exit t))
|
||||
#+end_src
|
||||
|
||||
*** VTerm
|
||||
VTerm gives Emacs access to regular shells with an almost regular
|
||||
emulator. Be aware you will most likely need to hit ~C-c~ twice to send
|
||||
an interrupt signal.
|
||||
** Wakatime
|
||||
#+begin_src emacs-lisp
|
||||
(use-package vterm
|
||||
:defer t
|
||||
:straight t
|
||||
:config
|
||||
(setq vterm-shell "/usr/bin/fish"))
|
||||
#+end_src
|
||||
|
||||
One annoying think with vterm is it only can create one buffer, you
|
||||
can’t have multiple vterm buffers by default. ~multi-vterm~ fixes this
|
||||
issue.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package multi-vterm
|
||||
:after vterm
|
||||
(use-package wakatime-mode
|
||||
:defer t
|
||||
:straight (:build t)
|
||||
:general
|
||||
(phundrak/major-leader-key
|
||||
:packages '(vterm multi-vterm)
|
||||
:keymap 'vterm-mode-map
|
||||
"c" #'multi-vterm
|
||||
"n" #'multi-vterm-next
|
||||
"p" #'multi-vterm-prev))
|
||||
#+end_src
|
||||
|
||||
** XWidgets Webkit Browser
|
||||
I used to use the xwidgets webkit browser in order to view or preview
|
||||
HTML files from Emacs, but it seems the Cairo background transparency
|
||||
patch breaks it. So while this isn’t patched, I will disable Xwidgets
|
||||
in my Emacs build, and these keybinds *will not* be tangled.
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(phundrak/evil
|
||||
:keymaps 'xwidget-webkit-mode-map
|
||||
"<mouse-4>" #'xwidget-webkit-scroll-down-line
|
||||
"<mouse-5>" #'xwidget-webkit-scroll-up-line
|
||||
"c" #'xwidget-webkit-scroll-backward
|
||||
"t" #'xwidget-webkit-scroll-up-line
|
||||
"s" #'xwidget-webkit-scroll-down-line
|
||||
"r" #'xwidget-webkit-scroll-forward
|
||||
"h" #'xwidget-webkit-goto-history
|
||||
"C" #'xwidget-webkit-back
|
||||
"R" #'xwidget-webkit-forward
|
||||
"C-r" #'xwidget-webkit-reload
|
||||
"j" nil
|
||||
"k" nil
|
||||
"l" nil
|
||||
"H" nil
|
||||
"L" nil
|
||||
"C-d" #'xwidget-webkit-scroll-up
|
||||
"C-u" #'xwidget-webkit-scroll-down)
|
||||
:init (global-wakatime-mode))
|
||||
#+end_src
|
||||
|
||||
** Wttr.in
|
||||
|
||||
@@ -301,10 +301,5 @@ you’re not sure or if you don’t remember what your snippet is.
|
||||
(use-package ivy-yasnippet
|
||||
:defer t
|
||||
:after (ivy yasnippet)
|
||||
:straight (:build t)
|
||||
:general
|
||||
(phundrak/leader-key
|
||||
:infix "i"
|
||||
:packages 'ivy-yasnippet
|
||||
"y" #'ivy-yasnippet))
|
||||
:straight (:build t))
|
||||
#+end_src
|
||||
|
||||
@@ -75,11 +75,6 @@ compatibility package that adds states for iedit.
|
||||
iedit-only-at-symbol-boundaries t
|
||||
iedit-toggle-key-default nil)
|
||||
:general
|
||||
(phundrak/leader-key
|
||||
:infix "r"
|
||||
:packages '(iedit evil-iedit-state)
|
||||
"" '(:ignore t :which-key "refactor")
|
||||
"i" #'evil-iedit-state/iedit-mode)
|
||||
(general-define-key
|
||||
:keymaps 'evil-iedit-state-map
|
||||
"c" nil
|
||||
|
||||
@@ -81,20 +81,20 @@ Since Emacs 29, it is possible to enable drag-and-drop between Emacs
|
||||
and other applications.
|
||||
#+name: dired-drag-and-drop
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(csetq dired-mouse-drag-files t
|
||||
mouse-drag-and-drop-region-cross-program t)
|
||||
(setopt dired-mouse-drag-files t
|
||||
mouse-drag-and-drop-region-cross-program t)
|
||||
#+end_src
|
||||
|
||||
In Dirvish, it’s best to use the long name of flags whenever possible,
|
||||
otherwise some commands won’t work.
|
||||
#+name: dired-listing-flags
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(csetq dired-listing-switches (string-join '("--all"
|
||||
"--human-readable"
|
||||
"--time-style=long-iso"
|
||||
"--group-directories-first"
|
||||
"-lv1")
|
||||
" "))
|
||||
(setopt dired-listing-switches (string-join '("--all"
|
||||
"--human-readable"
|
||||
"--time-style=long-iso"
|
||||
"--group-directories-first"
|
||||
"-lv1")
|
||||
" "))
|
||||
#+end_src
|
||||
|
||||
However, it is possible to instead use =eza= when it is available (it’s
|
||||
@@ -121,12 +121,12 @@ files and images.
|
||||
(my/dir (lambda (path &optional dir)
|
||||
(expand-file-name (file-name-as-directory path)
|
||||
(or dir user-emacs-directory)))))
|
||||
(csetq image-dired-thumb-size 150
|
||||
image-dired-dir (funcall my/dir "dired-img")
|
||||
image-dired-db-file (funcall my/file "dired-db.el")
|
||||
image-dired-gallery-dir (funcall my/dir "gallery")
|
||||
image-dired-temp-image-file (funcall my/file "temp-image" image-dired-dir)
|
||||
image-dired-temp-rotate-image-file (funcall my/file "temp-rotate-image" image-dired-dir)))
|
||||
(setopt image-dired-thumb-size 150
|
||||
image-dired-dir (funcall my/dir "dired-img")
|
||||
image-dired-db-file (funcall my/file "dired-db.el")
|
||||
image-dired-gallery-dir (funcall my/dir "gallery")
|
||||
image-dired-temp-image-file (funcall my/file "temp-image" image-dired-dir)
|
||||
image-dired-temp-rotate-image-file (funcall my/file "temp-rotate-image" image-dired-dir)))
|
||||
#+end_src
|
||||
|
||||
Copying files with Dired is a blocking process. It’s usually fine when
|
||||
@@ -170,8 +170,6 @@ compilation buffer, as well as enable some syntax highlighting.
|
||||
"r" nil
|
||||
"R" #'recompile
|
||||
"h" nil)
|
||||
(phundrak/leader-key
|
||||
"R" #'recompile)
|
||||
:config
|
||||
(setq compilation-scroll-output t))
|
||||
#+end_src
|
||||
@@ -462,15 +460,29 @@ supported natively. I will describe them here.
|
||||
(use-package tramp
|
||||
:straight (tramp :type built-in :build t)
|
||||
:config
|
||||
<<tramp-nixos>>
|
||||
<<tramp-add-yadm>>
|
||||
(csetq tramp-ssh-controlmaster-options nil
|
||||
tramp-verbose 0
|
||||
tramp-auto-save-directory (locate-user-emacs-file "tramp/")
|
||||
tramp-chunksize 2000)
|
||||
(setopt tramp-ssh-controlmaster-options nil
|
||||
tramp-verbose 0
|
||||
tramp-auto-save-directory (locate-user-emacs-file "tramp/")
|
||||
tramp-chunksize 2000)
|
||||
(add-to-list 'backup-directory-alist ; deactivate auto-save with TRAMP
|
||||
(cons tramp-file-name-regexp nil)))
|
||||
#+end_src
|
||||
|
||||
*** SSHing into NixOS remotes
|
||||
When using TRAMP to SSH into remote NixOS hosts, the true =$PATH= gets
|
||||
truncated, rendering some binaries unavailable, such as =git= or =nil= (an
|
||||
LSP server for the Nix language). To fix that, we simply need to write
|
||||
the following code.
|
||||
#+name: tramp-nixos
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(require 'tramp-sh)
|
||||
(setq tramp-remote-path (append tramp-remote-path
|
||||
'(tramp-own-remote-path)))
|
||||
|
||||
#+end_src
|
||||
|
||||
*** Yadm
|
||||
[[https://yadm.io/][~yadm~]] is a git wrapper made to easily manage your dotfiles. It has
|
||||
loads of features I don’t use (the main one I like but don’t use is
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#+title: Emacs — Packages — EXWM
|
||||
#+title: Emacs — Packages — EXWM (Deprecated)
|
||||
#+setupfile: ../../headers
|
||||
#+property: header-args:emacs-lisp :mkdirp yes :lexical t :exports code
|
||||
#+property: header-args:emacs-lisp+ :tangle ~/.config/emacs/lisp/exwm.el
|
||||
#+property: header-args:emacs-lisp+ :mkdirp yes :noweb no-export
|
||||
|
||||
* EXWM
|
||||
* EXWM (Deprecated)
|
||||
#+html: ::: warning
|
||||
This configuration of EXWM is no longer maintained and was deprecated
|
||||
on May 24th, 2025. Therefore, it may not be up to date with the latest
|
||||
versions of EXWM.
|
||||
#+html: :::
|
||||
|
||||
So, I’m finally slowly getting back to EXWM. I tried it a couple of
|
||||
years ago, but that was with the SpacemacsOS layer on Spacemacs, on a
|
||||
laptop which got accidentally formatted before I could save my config
|
||||
@@ -224,7 +230,7 @@ mode), except for ~s-RET~ which opens an eshell terminal.
|
||||
#+end_src
|
||||
|
||||
A couple of commands are also automatically executed through my
|
||||
~autostart~ script written [[file:bin.org::#Autostart-a99e99e7][here]].
|
||||
~autostart~ script written [[file:/scripts.md#autostart][here]].
|
||||
#+name: exwm-autostart
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(exwm/run-in-background "autostart")
|
||||
|
||||
@@ -25,16 +25,7 @@ it bépo-compatible.
|
||||
:defer t
|
||||
:straight t
|
||||
:config
|
||||
(csetq avy-keys '(?a ?u ?i ?e ?c ?t ?s ?r ?n)
|
||||
avy-dispatch-alist '((?x . avy-action-kill-move)
|
||||
(?X . avy-action-kill-stay)
|
||||
(?T . avy-action-teleport)
|
||||
(?m . avy-action-mark)
|
||||
(?C . avy-action-copy)
|
||||
(?y . avy-action-yank)
|
||||
(?Y . avy-action-yank-line)
|
||||
(?I . avy-action-ispell)
|
||||
(?z . avy-action-zap-to-char)))
|
||||
(setopt avy-keys '(?a ?u ?i ?e ?c ?t ?s ?r ?n))
|
||||
(defun my/avy-goto-url ()
|
||||
"Jump to url with avy."
|
||||
(interactive)
|
||||
@@ -49,31 +40,6 @@ it bépo-compatible.
|
||||
:pakages 'avy
|
||||
"gc" #'evil-avy-goto-char-timer
|
||||
"gl" #'evil-avy-goto-line)
|
||||
(phundrak/leader-key
|
||||
:packages 'avy
|
||||
:infix "j"
|
||||
"b" #'avy-pop-mark
|
||||
"c" #'evil-avy-goto-char-timer
|
||||
"l" #'avy-goto-line)
|
||||
(phundrak/leader-key
|
||||
:packages 'avy
|
||||
:infix "A"
|
||||
"c" '(:ignore t :which-key "copy")
|
||||
"cl" #'avy-copy-line
|
||||
"cr" #'avy-copy-region
|
||||
"k" '(:ignore t :which-key "kill")
|
||||
"kl" #'avy-kill-whole-line
|
||||
"kL" #'avy-kill-ring-save-whole-line
|
||||
"kr" #'avy-kill-region
|
||||
"kR" #'avy-kill-ring-save-region
|
||||
"m" '(:ignore t :which-key "move")
|
||||
"ml" #'avy-move-line
|
||||
"mr" #'avy-move-region
|
||||
"mt" #'avy-transpose-lines-in-region
|
||||
"n" #'avy-next
|
||||
"p" #'avy-prev
|
||||
"u" #'my/avy-goto-url
|
||||
"U" #'my/avy-open-url)
|
||||
(phundrak/major-leader-key
|
||||
:packages '(avy org)
|
||||
:keymaps 'org-mode-map
|
||||
@@ -92,16 +58,24 @@ Let’s give ~calc-mode~ some better defaults.
|
||||
** Elcord
|
||||
What’s the point of using Emacs if you can’t tell everyone?
|
||||
#+begin_src emacs-lisp
|
||||
(defun my/elcord-buffer-details-format ()
|
||||
"Return the buffer details string shown on Discord."
|
||||
(format "Editing %s"
|
||||
(if (projectile-project-p default-directory)
|
||||
(f-relative (buffer-file-name) (projectile-project-root))
|
||||
(buffer-name))))
|
||||
|
||||
(use-package elcord
|
||||
:straight (:built t)
|
||||
:defer t
|
||||
:config
|
||||
(csetq elcord-use-major-mode-as-main-icon t
|
||||
elcord-refresh-rate 5
|
||||
elcord-boring-buffers-regexp-list `("^ "
|
||||
,(rx "*" (+ any) "*")
|
||||
,(rx bol (or "Re: "
|
||||
"Fwd: ")))))
|
||||
(setopt elcord-use-major-mode-as-main-icon t
|
||||
elcord-refresh-rate 5
|
||||
elcord-boring-buffers-regexp-list `("^ "
|
||||
,(rx "*" (+ any) "*")
|
||||
,(rx bol (or "Re: "
|
||||
"Fwd: ")))
|
||||
elcord-buffer-details-format-function #'my/elcord-buffer-details-format))
|
||||
#+end_src
|
||||
|
||||
** Elpher
|
||||
|
||||
@@ -327,17 +327,6 @@ specified org files which are described below.
|
||||
(defvar org-worldbuilding-file "~/org/worldbuilding.org")
|
||||
#+end_src
|
||||
|
||||
Let me describe a keybind to invoke org-capture from anywhere within
|
||||
Emacs.
|
||||
#+name: org-capture-keybinds
|
||||
#+begin_src emacs-lisp :tangle no
|
||||
(phundrak/leader-key
|
||||
:packages 'org
|
||||
:infix "o"
|
||||
"" '(:ignore t :which-key "org")
|
||||
"c" #'org-capture)
|
||||
#+end_src
|
||||
|
||||
When ~org-capture~ is invoked, it will ask which template we wish to
|
||||
use. In the table [[org-capture-shortcuts-table]], the /key/ column
|
||||
represents which keychord we need to hit, titled with /name/, we need to
|
||||
@@ -843,28 +832,34 @@ can schedule a todo header for some dates, or set a deadline.
|
||||
|
||||
Let’s now define some keybinds for inserting stuff in our org buffer:
|
||||
#+name: org-keybinds-insert
|
||||
| Key chord | Function | Description |
|
||||
|-----------+-------------------------------+-------------|
|
||||
| i | nil | insert |
|
||||
| ib | org-insert-structure-template | |
|
||||
| id | org-insert-drawer | |
|
||||
| ie | nil | emphasis |
|
||||
| ieb | org-emphasize-bold | |
|
||||
| iec | org-emphasize-code | |
|
||||
| iei | org-emphasize-italic | |
|
||||
| ies | org-emphasize-strike-through | |
|
||||
| ieu | org-emphasize-underline | |
|
||||
| iev | org-emphasize-verbatim | |
|
||||
| iE | org-set-effort | |
|
||||
| if | org-footnote-new | |
|
||||
| ih | org-insert-heading | |
|
||||
| iH | counsel-org-link | |
|
||||
| ii | org-insert-item | |
|
||||
| il | org-insert-link | |
|
||||
| in | org-add-note | |
|
||||
| ip | org-set-property | |
|
||||
| is | org-insert-subheading | |
|
||||
| it | org-set-tags-command | |
|
||||
| Key chord | Function | Description | Package |
|
||||
|-----------+---------------------------------------------------+---------------------+------------|
|
||||
| i | nil | insert | |
|
||||
| ib | org-insert-structure-template | | |
|
||||
| ic | | conlanging | |
|
||||
| ica | conlanging-eittlandic-insert-adjective-declension | adjective | conlanging |
|
||||
| icn | conlanging-eittlandic-insert-noun-declensions | noun | conlanging |
|
||||
| icv | conlanging-eittlandic-insert-verb-declension | verb | conlanging |
|
||||
| id | org-insert-drawer | | |
|
||||
| ie | nil | emphasis | |
|
||||
| ieb | org-emphasize-bold | | |
|
||||
| iec | org-emphasize-code | | |
|
||||
| iei | org-emphasize-italic | | |
|
||||
| ies | org-emphasize-strike-through | | |
|
||||
| ieu | org-emphasize-underline | | |
|
||||
| iev | org-emphasize-verbatim | | |
|
||||
| iE | org-set-effort | | |
|
||||
| if | org-footnote-new | | |
|
||||
| ih | org-insert-heading | | |
|
||||
| iH | counsel-org-link | | |
|
||||
| ii | org-insert-item | | |
|
||||
| il | org-insert-link | | |
|
||||
| in | org-add-note | | |
|
||||
| ip | org-set-property | | |
|
||||
| is | org-insert-subheading | | |
|
||||
| it | org-set-tags-command | | |
|
||||
| iV | conlang-store-heading-vuepress | store Vuepress link | conlanging |
|
||||
| iv | conlanging-insert-heading-vuepress | vuepress link | conlanging |
|
||||
|
||||
There isn’t a lot of stuff I can jump to yet, but there’s still some:
|
||||
#+name: org-keybinds-jump
|
||||
@@ -1060,26 +1055,6 @@ management system based on org-mode.
|
||||
:config
|
||||
(org-roam-db-autosync-mode 1)
|
||||
:general
|
||||
(phundrak/leader-key
|
||||
:packages '(org org-roam)
|
||||
:infix "o"
|
||||
"r" '(:ignore t :which-key "roam")
|
||||
"rb" '(org-mark-ring-goto :which-key "back")
|
||||
"rB" #'org-roam-buffer-toggle
|
||||
"rn" '(:ignore t :which-key "nodes")
|
||||
"rnf" #'org-roam-node-find
|
||||
"rni" #'org-roam-node-insert
|
||||
"rno" #'org-roam-node-open
|
||||
"rnr" #'org-roam-node-random
|
||||
"rnv" #'org-roam-node-visit
|
||||
"rs" '(:ignore t :which-key "sync")
|
||||
"rsa" #'org-roam-db-autosync-mode
|
||||
"rsc" #'org-roam-db-clear-all
|
||||
"rsd" #'org-roam-db-diagnose-node
|
||||
"rss" #'org-roam-db-sync
|
||||
"ru" '(:ignore t :which-key "ui")
|
||||
"rua" #'org-roam-ui-add-to-local-graph
|
||||
"ruo" #'org-roam-ui-open)
|
||||
(phundrak/major-leader-key
|
||||
:keymaps 'org-mode-map
|
||||
:packages '(org org-roam)
|
||||
@@ -1165,7 +1140,7 @@ management system based on org-mode.
|
||||
(phundrak/major-leader-key
|
||||
:keymaps 'org-mode-map
|
||||
:pakages 'org-ref
|
||||
"ic" #'org-ref-insert-link
|
||||
"iC" #'org-ref-insert-link
|
||||
"iL" #'org-ref-insert-ref-link
|
||||
"ir" #'org-ref-insert-link-hydra/body
|
||||
"iB" #'org-ref-bibtex-hydra/body))
|
||||
|
||||
@@ -18,32 +18,27 @@ variables to install grammars for different languages.
|
||||
:hook ((bash-ts-mode c-ts-mode c++-ts-mode
|
||||
html-ts-mode js-ts-mode typescript-ts-mode
|
||||
json-ts-mode rust-ts-mode tsx-ts-mode python-ts-mode
|
||||
css-ts-mode yaml-ts-mode) . lsp-deferred)
|
||||
css-ts-mode yaml-ts-mode) . lsp-deferred))
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package tree-sitter-langs
|
||||
:after tree-sitter
|
||||
:straight t
|
||||
:custom (global-tree-sitter-mode t)
|
||||
:init
|
||||
(setq treesit-language-source-alist
|
||||
'((bash "https://github.com/tree-sitter/tree-sitter-bash")
|
||||
(c "https://github.com/tree-sitter/tree-sitter-c")
|
||||
(cmake "https://github.com/uyha/tree-sitter-cmake")
|
||||
(common-lisp "https://github.com/theHamsta/tree-sitter-commonlisp")
|
||||
(cpp "https://github.com/tree-sitter/tree-sitter-cpp")
|
||||
(css "https://github.com/tree-sitter/tree-sitter-css")
|
||||
(csharp "https://github.com/tree-sitter/tree-sitter-c-sharp")
|
||||
(elisp "https://github.com/Wilfred/tree-sitter-elisp")
|
||||
(go "https://github.com/tree-sitter/tree-sitter-go")
|
||||
(go-mod "https://github.com/camdencheek/tree-sitter-go-mod")
|
||||
(html "https://github.com/tree-sitter/tree-sitter-html")
|
||||
(js . ("https://github.com/tree-sitter/tree-sitter-javascript" "master" "src"))
|
||||
(json "https://github.com/tree-sitter/tree-sitter-json")
|
||||
(lua "https://github.com/Azganoth/tree-sitter-lua")
|
||||
(make "https://github.com/alemuller/tree-sitter-make")
|
||||
(markdown "https://github.com/ikatyang/tree-sitter-markdown")
|
||||
(python "https://github.com/tree-sitter/tree-sitter-python")
|
||||
(r "https://github.com/r-lib/tree-sitter-r")
|
||||
(rust "https://github.com/tree-sitter/tree-sitter-rust")
|
||||
(toml "https://github.com/tree-sitter/tree-sitter-toml")
|
||||
(tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src"))
|
||||
(typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src"))
|
||||
(yaml "https://github.com/ikatyang/tree-sitter-yaml"))))
|
||||
(add-to-list 'treesit-extra-load-path
|
||||
(expand-file-name "bin" tree-sitter-langs-grammar-dir)))
|
||||
|
||||
(use-package treesit-auto
|
||||
:after tree-sitter
|
||||
:straight t
|
||||
:config (global-treesit-auto-mode))
|
||||
|
||||
(use-package treesit-fold
|
||||
:after tree-sitter
|
||||
:straight (:build t :host github :repo "emacs-tree-sitter/treesit-fold")
|
||||
:config (treesit-fold-mode))
|
||||
#+end_src
|
||||
|
||||
*** Appwrite
|
||||
@@ -58,27 +53,8 @@ it is.
|
||||
:host github
|
||||
:repo "Phundrak/appwrite.el")
|
||||
:config
|
||||
(csetq appwrite-endpoint "https://appwrite.phundrak.com"
|
||||
appwrite-devel t))
|
||||
#+end_src
|
||||
|
||||
*** Databases
|
||||
A really cool tool in Emacs for manipulating databases is ~emacsql~.
|
||||
It’s able to manipulate SQLite databases by default, but it’s also
|
||||
possible to manipulate MariaDB and PostgreSQL databases by installing
|
||||
additional packages. For now, I just need SQLite and PostgreSQL
|
||||
interfaces, so let’s install the relevant packages.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package emacsql-psql
|
||||
:defer t
|
||||
:after (emacsql)
|
||||
:straight (:build t))
|
||||
|
||||
(with-eval-after-load 'emacsql
|
||||
(phundrak/major-leader-key
|
||||
:keymaps 'emacs-lisp-mode-map
|
||||
:packages '(emacsql)
|
||||
"E" #'emacsql-fix-vector-indentation))
|
||||
(setopt appwrite-endpoint "https://appwrite.phundrak.com"
|
||||
appwrite-devel t))
|
||||
#+end_src
|
||||
|
||||
*** Flycheck
|
||||
@@ -207,6 +183,7 @@ awesome!
|
||||
:init
|
||||
(setq lsp-keymap-prefix "C-c l"
|
||||
read-process-output-max (* 3 1024 1024))
|
||||
(setenv "LSP_USE_PLISTS" "true")
|
||||
:hook ((c-mode . lsp-deferred)
|
||||
(c++-mode . lsp-deferred)
|
||||
(html-mode . lsp-deferred)
|
||||
@@ -218,9 +195,18 @@ awesome!
|
||||
(lsp-rust-analyzer-cargo-watch-command "clippy")
|
||||
(lsp-eldoc-render-all t)
|
||||
(lsp-idle-delay 0.6)
|
||||
(lsp-rust-analyzer-server-display-inlay-hints t)
|
||||
(lsp-use-plist t)
|
||||
(lsp-enable-indentation nil)
|
||||
;; Bash
|
||||
(lsp-bash-highlight-parsing-errors t)
|
||||
;; Nix
|
||||
;; Rust
|
||||
(lsp-rust-analyzer-server-display-inlay-hints t)
|
||||
;; ;; Vue configuration
|
||||
(lsp-vetur-emmet "always")
|
||||
(lsp-vetur-format-default-formatter-html "prettier")
|
||||
:config
|
||||
(add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]coverage\\'")
|
||||
(lsp-register-client
|
||||
(make-lsp-client :new-connection (lsp-tramp-connection "shellcheck")
|
||||
:major-modes '(sh-mode)
|
||||
@@ -287,6 +273,7 @@ You can find the keybinds of Treemacs here.
|
||||
[remap xref-find-apropos] #'consult-lsp-symbols))
|
||||
#+end_src
|
||||
|
||||
*** dap-mode
|
||||
~dap-mode~ is an advanced debugging mode that works through LSP. Note
|
||||
that currently, ~dap-firefox~ and ~dap-chrome~ don’t work correctly due to
|
||||
[[https://github.com/emacs-lsp/dap-mode/issues/547][this issue]]. A workaround can be found in [[https://github.com/emacs-lsp/dap-mode/issues/554#issuecomment-1171256089][this comment]] though.
|
||||
@@ -321,54 +308,6 @@ that currently, ~dap-firefox~ and ~dap-chrome~ don’t work correctly due to
|
||||
:cwd nil))))
|
||||
#+end_src
|
||||
|
||||
*** Langtool
|
||||
LanguageTool is a great tool for catching typos and grammatical errors
|
||||
in quite a few languages.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package langtool
|
||||
:defer t
|
||||
:straight (:build t)
|
||||
:commands (langtool-check
|
||||
langtool-check-done
|
||||
langtool-show-message-at-point
|
||||
langtool-correct-buffer)
|
||||
:custom
|
||||
(langtool-default-language "en-US")
|
||||
(langtool-mother-tongue "fr")
|
||||
:config
|
||||
(setq langtool-java-classpath (string-join '("/usr/share/languagetool"
|
||||
"/usr/share/java/languagetool/*")
|
||||
":"))
|
||||
:general
|
||||
(phundrak/leader-key
|
||||
:packages 'langtool
|
||||
:infix "l"
|
||||
"" '(:ignore t :which-key "LangTool")
|
||||
"B" #'langtool-correct-buffer
|
||||
"b" #'langtool-check-buffer
|
||||
"c" #'langtool-check
|
||||
"C" #'langtool-correct-at-point
|
||||
"d" #'langtool-check-done
|
||||
"l" #'langtool-switch-default-language
|
||||
"p" #'langtool-show-message-at-point
|
||||
"r" #'langtool-correct-region))
|
||||
#+end_src
|
||||
|
||||
Finally, =writegood-mode= detects some simple general rules when writing
|
||||
in English and can also calculate the Flesh-Kincaid levels of a
|
||||
document.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package writegood-mode
|
||||
:defer t
|
||||
:straight (:build t)
|
||||
:hook org-mode latex-mode
|
||||
:general
|
||||
(phundrak/major-leader-key
|
||||
:keymaps 'writegood-mode-map
|
||||
"g" #'writegood-grade-level
|
||||
"r" #'writegood-reading-ease))
|
||||
#+end_src
|
||||
|
||||
** DSLs
|
||||
DSLs, or /Domain Specific Languages/, are languages dedicated to some
|
||||
very tasks, such as configuration languages or non-general programming
|
||||
@@ -677,6 +616,13 @@ Markdown.
|
||||
:defer t)
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package nix-ts-mode
|
||||
:mode "\\.nix\\'"
|
||||
:straight (:build t)
|
||||
:config (add-to-list 'major-mode-remap-alist '((nix-mode . nix-ts-mode))))
|
||||
#+end_src
|
||||
|
||||
*** Nginx
|
||||
Nginx is another webserver, older and more mature than Caddy. A couple
|
||||
of packages are required in order to be able to properly work with
|
||||
@@ -747,8 +693,41 @@ or some I write myself.
|
||||
org-plantuml-jar-path "~/.local/bin/plantuml.jar"))
|
||||
#+end_src
|
||||
|
||||
*** QML
|
||||
I’m currently working on a [[https://quickshell.org/][Quickshell]] configuration to replace my
|
||||
[[https://github.com/Alexays/Waybar][Waybar]] one. Quickshell is configured with [[https://doc.qt.io/qt-6/qmlapplications.html][QML]], which requires its
|
||||
major mode.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package qml-ts-mode
|
||||
:after lsp-mode
|
||||
:straight (qml-ts-mode :build t
|
||||
:type git
|
||||
:host github
|
||||
:repo "xhcoding/qml-ts-mode")
|
||||
:config
|
||||
(add-to-list 'lsp-language-id-configuration '(qml-ts-mode . "qml-ts"))
|
||||
(lsp-register-client
|
||||
(make-lsp-client :new-connection (lsp-stdio-connection '("qmlls" "-E"))
|
||||
:activation-fn (lsp-activate-on "qml-ts")
|
||||
:server-id 'qmlls))
|
||||
(add-hook 'qml-ts-mode-hook (lambda ()
|
||||
(setq-local electric-indent-chars '(?\n ?\( ?\) ?{ ?} ?\[ ?\] ?\; ?,))
|
||||
(lsp-deferred))))
|
||||
#+end_src
|
||||
|
||||
*** Ron files
|
||||
Rusty Object Notation, or RON for short, is to Rust what Json is to
|
||||
Javascript. Sometimes, I have to work with such files, which is why I
|
||||
installed this major mode.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package ron-mode
|
||||
:defer t
|
||||
:straight (:build t))
|
||||
#+end_src
|
||||
|
||||
*** Shells
|
||||
Aside from Eshell, my main shell on my machine is fish (see my [[file:fish.org][fish
|
||||
Aside from Eshell, my main shell on my machine is fish (see my [[file:/fish.md][fish
|
||||
config]]), therefore I need a mode for it.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package fish-mode
|
||||
@@ -808,6 +787,17 @@ When editing some scripts though, I need to use the built-in ~shell-mode~.
|
||||
:mode "\\.yaml\\'")
|
||||
#+end_src
|
||||
|
||||
*** yuck
|
||||
This is one of the two file formats used by [[https://github.com/elkowar/eww/][eww]]’s configuration, a
|
||||
Lisp-like language. Therefore, it will also use [[file:./editing.md#parinfer][parinfer]] to manage its
|
||||
parenthesis.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package yuck-mode
|
||||
:straight (:build t)
|
||||
:defer t
|
||||
:hook ((yuck-mode . parinfer-rust-mode)))
|
||||
#+end_src
|
||||
|
||||
** General Programming Languages
|
||||
*** C/C++
|
||||
I know, I know, C and C++ no longer are closely related languages,
|
||||
@@ -891,7 +881,7 @@ when entering ~lisp-mode~.
|
||||
#+end_src
|
||||
|
||||
Sly enables some deep interactivity between Emacs and a CommonLisp
|
||||
application running the Slynk backend. For an example, see [[file:stumpwm.org::#Utilities-Sly-kkok6oi0yaj0][my Sly
|
||||
application running the Slynk backend. For an example, see [[file:/stumpwm/utilities.md#sly][my Sly
|
||||
configuration for StumpWM]].
|
||||
#+begin_src emacs-lisp
|
||||
(use-package sly
|
||||
@@ -899,26 +889,6 @@ configuration for StumpWM]].
|
||||
:straight (:build t))
|
||||
#+end_src
|
||||
|
||||
*** Dart
|
||||
#+begin_src emacs-lisp
|
||||
(use-package dart-mode
|
||||
:straight (:build t)
|
||||
:defer t
|
||||
:hook (dart-mode . lsp-deferred)
|
||||
:mode "\\.dart\\'")
|
||||
#+end_src
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package lsp-dart
|
||||
:straight (:build t)
|
||||
:defer t
|
||||
:general
|
||||
(phundrak/major-leader-key
|
||||
:keymaps 'dart-mode-map
|
||||
:packages '(lsp-mode lsp-dart)
|
||||
"l" '(:keymap lsp-command-map :which-key "lsp")))
|
||||
#+end_src
|
||||
|
||||
*** EmacsLisp
|
||||
This package displays the function’s arglist or variable’s docstring
|
||||
in the echo area at the bottom of the frame. Quite useful indeed.
|
||||
@@ -1285,8 +1255,19 @@ Finally, I’m using [[https://github.com/microsoft/pyright][Pyright]] as my LSP
|
||||
*** Rust
|
||||
Rust is a general programming language, akin to C++ in some ways, but
|
||||
much more oriented towards safe code, and much better suited for web
|
||||
development. First, let’s install the most important package,
|
||||
~rustic~.
|
||||
development.
|
||||
|
||||
First, I’m using =rust-mode= to tell it to use [[https://tree-sitter.github.io/tree-sitter/][tree sitter]].
|
||||
#+begin_src emacs-lisp
|
||||
(use-package rust-mode
|
||||
:straight t
|
||||
:defer t
|
||||
:init
|
||||
(setq rust-mode-treesitter-derive t))
|
||||
#+end_src
|
||||
|
||||
Then, let’s install the most important package, =rustic=, which provides
|
||||
several improvements on top of =rust-mode=.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package rustic
|
||||
:defer t
|
||||
@@ -1299,7 +1280,6 @@ development. First, let’s install the most important package,
|
||||
(defalias 'org-babel-execute:rust #'org-babel-execute:rustic)
|
||||
(add-to-list 'org-src-lang-modes '("rust" . rustic)))
|
||||
(setq rustic-lsp-client 'lsp-mode)
|
||||
(add-hook 'rustic-mode-hook #'tree-sitter-hl-mode)
|
||||
:general
|
||||
(general-define-key
|
||||
:keymaps 'rustic-mode-map
|
||||
@@ -1405,13 +1385,14 @@ languages in the same buffer, mainly HTML, CSS, and JavaScript.
|
||||
("\\.svelte\\'" . web-mode)
|
||||
("\\.ctp\\'" . web-mode)
|
||||
("\\.djhtml\\'" . web-mode)
|
||||
("\\.ftl\\'" . web-mode)
|
||||
("\\.vue\\'" . web-mode))
|
||||
:config
|
||||
(csetq web-mode-markup-indent-offset 2
|
||||
web-mode-code-indent-offset 2
|
||||
web-mode-css-indent-offset 2
|
||||
web-mode-style-padding 0
|
||||
web-mode-script-padding 0)
|
||||
(setopt web-mode-markup-indent-offset 2
|
||||
web-mode-code-indent-offset 2
|
||||
web-mode-css-indent-offset 2
|
||||
web-mode-style-padding 0
|
||||
web-mode-script-padding 0)
|
||||
:general
|
||||
(phundrak/major-leader-key
|
||||
:keymaps 'web-mode-map
|
||||
@@ -1447,6 +1428,14 @@ Auto-completion for ~emmet-mode~, ~html-mode~, and ~web-mode~.
|
||||
:after (emmet-mode web-mode))
|
||||
#+end_src
|
||||
|
||||
**** Astro
|
||||
#+begin_src emacs-lisp
|
||||
(use-package astro-ts-mode
|
||||
:straight (:build t)
|
||||
:defer t
|
||||
:mode "\\.astro\\'")
|
||||
#+end_src
|
||||
|
||||
**** CSS
|
||||
Let’s customize a bit the built-in CSS mode.
|
||||
#+begin_src emacs-lisp
|
||||
@@ -1458,6 +1447,7 @@ Let’s customize a bit the built-in CSS mode.
|
||||
:hook (scss-mode . prettier-js-mode)
|
||||
:init
|
||||
(put 'css-indent-offset 'safe-local-variable #'integerp)
|
||||
:config (setopt css-indent-offset 2)
|
||||
:general
|
||||
(phundrak/major-leader-key
|
||||
:keymaps 'css-mode-map
|
||||
@@ -1513,6 +1503,16 @@ activate when I open ~.less~ files by default. Let’s fix that.
|
||||
"l" '(:keymap lsp-command-map :which-key "lsp")))
|
||||
#+end_src
|
||||
|
||||
I also use from time to time TailwindCSS. Let’s add its LSP
|
||||
configuration.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package lsp-tailwindcss
|
||||
:defer t
|
||||
:after lsp
|
||||
:init (setq lsp-tailwindcss-add-on-mode t)
|
||||
:straight (:type git :host github :repo "merrickluo/lsp-tailwindcss"))
|
||||
#+end_src
|
||||
|
||||
**** Javascript
|
||||
~javascript-mode~ is meh at best, while ~rjsx-mode~ (Real JSX) is much
|
||||
better: it supports both JavaScript and ~.jsx~ files for React and
|
||||
@@ -1569,15 +1569,14 @@ don’t. Let’s interact with NPM through Emacs then.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package npm-transient
|
||||
:defer t
|
||||
:straight (npm-transient :build t
|
||||
:type git
|
||||
:host github
|
||||
:repo "Phundrak/npm-transient"))
|
||||
;; :general
|
||||
;; (phundrak/major-leader-key
|
||||
;; :packages '(npm-transient rjsx-mode web-mode)
|
||||
;; :keymaps '(rjsx-mode-map web-mode-map)
|
||||
;; "n" #'npm-transient))
|
||||
:straight (:build t
|
||||
:type git
|
||||
:repo "labs.phundrak.com/phundrak/npm-transient.el")
|
||||
:general
|
||||
(phundrak/major-leader-key
|
||||
:packages '(npm-transient typescript-ts-mode web-mode)
|
||||
:keymaps '(web-mode-map)
|
||||
"n" #'npm-transient))
|
||||
#+end_src
|
||||
|
||||
And finally, here is a formatter for JavaScript.
|
||||
@@ -1591,8 +1590,21 @@ And finally, here is a formatter for JavaScript.
|
||||
(setq prettier-js-args '("--single-quote" "--jsx-single-quote")))
|
||||
#+end_src
|
||||
|
||||
**** Typescript
|
||||
Typescript is a safer alternative to JavaScript. Let’s install its major mode then.
|
||||
**** Json
|
||||
My configuration for Json is quite short, I’m just defaulting to
|
||||
Emacs’ built-in tree-sitter mode for any =.json= file and reducing the
|
||||
indentation to 2 spaces for any file using a mode from the built-in
|
||||
package =js=.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(use-package js
|
||||
:straight (:type built-in)
|
||||
:mode ("\\.json\\'" . json-ts-mode)
|
||||
:config (setopt js-indent-level 2))
|
||||
#+end_src
|
||||
|
||||
**** TypeScript
|
||||
TypeScript is a safer alternative to JavaScript. Let’s install its major mode then.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package typescript-mode
|
||||
:defer t
|
||||
@@ -1650,43 +1662,21 @@ Tide enabled interactivity with Typescript.
|
||||
"roi" #'tide-organize-imports))
|
||||
#+end_src
|
||||
|
||||
*** Zig
|
||||
[[https://ziglang.org/][Zig]] is to C kind of what Rust is to C++: a modern replacement without
|
||||
sacrificing performance. It is much safer than C while providing
|
||||
interop with it. Plus, its [[https://ziglang.org/documentation/master/std/][standard library]] is pretty complete.
|
||||
|
||||
First, here is its major mode.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package zig-mode
|
||||
:defer t
|
||||
:straight (:build t)
|
||||
:after flycheck
|
||||
:hook (zig-mode . lsp-deferred)
|
||||
:config
|
||||
;; This is from DoomEmacs
|
||||
(flycheck-define-checker zig
|
||||
"A zig syntax checker using the zig-fmt interpreter."
|
||||
:command ("zig" "fmt" (eval (buffer-file-name)))
|
||||
:error-patterns
|
||||
((error line-start (file-name) ":" line ":" column ": error: " (message) line-end))
|
||||
:modes zig-mode)
|
||||
(add-to-list 'flycheck-checkers 'zig)
|
||||
:general
|
||||
(phundrak/major-leader-key
|
||||
:keymaps 'zip-mode-map
|
||||
:packages 'lsp-mode
|
||||
"l" '(:keymap lsp-command-map :which-key "lsp"))
|
||||
(phundrak/major-leader-key
|
||||
:packages 'zig-mode
|
||||
:keymaps 'zig-mode-map
|
||||
"c" #'zig-compile
|
||||
"f" #'zig-format-buffer
|
||||
"r" #'zig-run
|
||||
"t" #'zig-test-buffer))
|
||||
**** Vue
|
||||
There isn’t really any configuration in this heading, but an important
|
||||
note concerning the usage of LSP with Vue. If the packages =typescript=
|
||||
and =vue-tsc= are not in the =package.json= of a project, =volar= (or
|
||||
=vue-semantic-server= according to =lsp-mode=) won’t start properly. The
|
||||
simplest fix is to run the following command:
|
||||
#+begin_src sh
|
||||
npm install --save-dev vue-tsc typescript
|
||||
#+end_src
|
||||
|
||||
For LSP to work, we need ~zls~ to be installed. In my case, as I am on
|
||||
Arch Linux, I can install it from the AUR, and my AUR helper is ~paru~.
|
||||
#+begin_src fish :results raw :wrap "src text" :exports code
|
||||
paru --skipreview --noconfirm -S zls-bin 2>&1
|
||||
#+end_src
|
||||
Or replace =npm= with whichever package manager you prefer.
|
||||
|
||||
If you want to work with Vue in Emacs, =web-mode= is more than enough
|
||||
when paired with an LSP server.
|
||||
|
||||
With the Nix package manager, the Vue 3 LSP server is
|
||||
=nodePackages."@vue/language-server"= and not =vue-language-server=. The
|
||||
latter is for Vue 2.
|
||||
|
||||
@@ -40,6 +40,17 @@ for fish.
|
||||
direnv hook fish | source
|
||||
#+end_src
|
||||
|
||||
I also use [[https://github.com/elkowar/eww/][eww]] for some widgets, let’s load its shell completions.
|
||||
#+begin_src fish
|
||||
eww shell-completions --shell fish | source
|
||||
#+end_src
|
||||
|
||||
The [[https://crates.io/crates/sqlx][sqlx]] CLI is a requirement for my Rust projects using this crate.
|
||||
The code below integrates its completions in Fish.
|
||||
#+begin_src fish
|
||||
sqlx completions fish | source
|
||||
#+end_src
|
||||
|
||||
Since I don’t really have a better place on this website to put it,
|
||||
here is my direnv configuration located at
|
||||
=$HOME/.config/direnv/direnv.toml=.
|
||||
@@ -77,13 +88,19 @@ Now, there is only one function I modify when it comes to the
|
||||
appearance of fish when I’m the one using it: the ~fish_greeting~
|
||||
function. I just want it empty.
|
||||
#+BEGIN_SRC fish
|
||||
function fish_greeting; end
|
||||
function fish_greeting
|
||||
pumo-system-info
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
For my fish prompt, I use [[https://starship.rs][starship]], a shell-agnostic prompt. Let’s
|
||||
load it:
|
||||
#+begin_src fish
|
||||
function starship_transient_prompt_func
|
||||
starship module character
|
||||
end
|
||||
starship init fish | source
|
||||
enable_transience
|
||||
#+end_src
|
||||
|
||||
** Setting up external tools
|
||||
@@ -125,6 +142,8 @@ $rlang\
|
||||
$rust\
|
||||
$scala\
|
||||
$zig\
|
||||
$nix_shell\
|
||||
$direnv\
|
||||
$memory_usage\
|
||||
$env_var\
|
||||
$custom\
|
||||
@@ -148,6 +167,23 @@ symbol = "λ "
|
||||
style = "bold green"
|
||||
#+end_src
|
||||
|
||||
Some module configurations don’t exactly sit right with me, so let’s
|
||||
tweak them a bit.
|
||||
#+begin_src toml
|
||||
[nix_shell]
|
||||
format = '[$symbol$state( \($name\))]($style)'
|
||||
symbol = '❄️ '
|
||||
|
||||
[shlvl]
|
||||
disabled = false
|
||||
threshold = 3
|
||||
|
||||
[direnv]
|
||||
disabled = false
|
||||
detect_files = ['.envrc', '.env']
|
||||
symbol = ' '
|
||||
#+end_src
|
||||
|
||||
Finally, let’s disable all modules I don’t need.
|
||||
#+begin_src toml
|
||||
[cobol]
|
||||
@@ -194,8 +230,6 @@ disable = true
|
||||
disable = true
|
||||
[vagrant]
|
||||
disable = true
|
||||
[nix_shell]
|
||||
disable = true
|
||||
[conda]
|
||||
disable = true
|
||||
[aws]
|
||||
@@ -504,7 +538,7 @@ abbr webcam 'devour mpv --demuxer-lavf-format=video4linux2 --demuxer-lavf-o-set=
|
||||
|
||||
**** Sudo
|
||||
First, I make it so that ~sudo~ comes with the ~-A~ switch in order to call my
|
||||
custom graphical script for getting my password (see [[file:bin.org::#Askpass-d0d7a8c0][askpass]]). I also made it so
|
||||
custom graphical script for getting my password (see [[file:./scripts.md#askpass][askpass]]). I also made it so
|
||||
~please~ is an equivalent to ~sudo -A~ as a joke.
|
||||
#+BEGIN_SRC fish
|
||||
abbr please 'sudo -A'
|
||||
|
||||
287
docs/git.org
287
docs/git.org
@@ -6,42 +6,203 @@
|
||||
|
||||
* Git
|
||||
** Basic configuration
|
||||
Just to make Emacs follow the convention in terms of indentation, I’m
|
||||
forcing it to use tabs.
|
||||
#+begin_src conf-unix
|
||||
# -*- indent-tabs-mode: t; -*-
|
||||
#+end_src
|
||||
|
||||
*** Setting Up Personal Information and Preferences
|
||||
Let’s set some of my personal information, namely my name, my email,
|
||||
and which GPG key I sign my commits with.
|
||||
#+begin_src conf-unix
|
||||
[user]
|
||||
email = lucien@phundrak.com
|
||||
name = Lucien Cartier-Tilet
|
||||
signingkey = BD7789E705CB8DCA
|
||||
signingkey = ~/.ssh/id_ed25519.pub
|
||||
#+end_src
|
||||
|
||||
In terms of core configuration, I simply set Emacs as my default Git
|
||||
editor. I also have my global gitignore file, described below in
|
||||
[[file:./git.md#global-gitignore-file][Global gitignore file]].
|
||||
#+begin_src conf-unix
|
||||
[core]
|
||||
editor = emacsclient -c -a emacs
|
||||
whitespace = fix,-indent-with-non-tab,trailing-space
|
||||
excludesfile = /home/phundrak/.gitignore_global
|
||||
#+end_src
|
||||
|
||||
#+begin_src conf-unix
|
||||
[pull]
|
||||
rebase = true
|
||||
excludesfile = ~/.config/git/global-ignore
|
||||
#+end_src
|
||||
|
||||
Let’s not forget to tell Git to use the =main= branch by default.
|
||||
#+begin_src conf-unix
|
||||
[init]
|
||||
defaultBranch = main
|
||||
#+end_src
|
||||
|
||||
This is entirely a matter of personal preferences, but I like to use
|
||||
[[https://zen-browser.app/][Zen]], a Firefox fork with really nice features.
|
||||
#+begin_src conf-unix
|
||||
[web]
|
||||
browser = zen-browser
|
||||
#+end_src
|
||||
|
||||
*** Better Diffing
|
||||
Git’s diffing algorithm evolved and improved over time, but its
|
||||
default algorithm did not. Take this example, from [[https://blog.gitbutler.com/how-git-core-devs-configure-git/][this Gitbutler
|
||||
article]]:
|
||||
|
||||
[[file:./img/git/diff-default.png]]
|
||||
|
||||
Not really readable, I think you’ll agree. I mean, you can sort of see
|
||||
what happens, but really, we just moved the =h2= styling below the
|
||||
=.event= styling. Git seems to think otherwise. However, let’s turn on
|
||||
the =histogram= algorithm on:
|
||||
|
||||
[[file:./img/git/diff-histogram.png]]
|
||||
|
||||
Immediately, we have a much clearer picture of what happened! But I’ll
|
||||
let you on another secret: you can make it even clearer by using the
|
||||
=colorMoved= option to color differently lines that were moved from
|
||||
lines that were actually modified!
|
||||
|
||||
[[file:./img/git/diff-moved.png]]
|
||||
|
||||
I’ll also add a configuration to make it easier to see what is being
|
||||
compared using =mnemonicPrefix=. As per =man git-config=:
|
||||
#+begin_src text
|
||||
git diff
|
||||
compares the (i)ndex and the (w)ork tree;
|
||||
|
||||
git diff HEAD
|
||||
compares a (c)ommit and the (w)ork tree;
|
||||
|
||||
git diff --cached
|
||||
compares a (c)ommit and the (i)ndex;
|
||||
|
||||
git diff HEAD:<file1> <file2>
|
||||
compares an (o)bject and a (w)ork tree entity;
|
||||
|
||||
git diff --no-index <a> <b>
|
||||
compares two non-git things <a> and <b>.
|
||||
#+end_src
|
||||
|
||||
That means you can see I was comparing to objects not tracked by git
|
||||
in my screenshot above.
|
||||
|
||||
Finally, =renames= set to =copies= not only better detects file renames,
|
||||
but also file copies.
|
||||
|
||||
#+begin_src conf-unix
|
||||
[diff]
|
||||
algorithm = histogram
|
||||
colorMoved = plain
|
||||
mnemonicPrefix = true
|
||||
renames = copy
|
||||
#+end_src
|
||||
|
||||
*** Better Fetching, Pulling, Rebasing, and Pushing
|
||||
By default, when I pull new commits, I do not want to create a merge
|
||||
commit, but rather to rebase my commits on what’s new upstream.
|
||||
#+begin_src conf-unix
|
||||
[pull]
|
||||
rebase = true
|
||||
#+end_src
|
||||
|
||||
However, there is a problem with git’s default behaviour: it wont
|
||||
allow me to pull changes or perform a rebase as long as my worktree is
|
||||
dirty. I either have to commit or stash my changes before I can do
|
||||
something. And you know what? Git can auto stash your changes for you
|
||||
before performing a rebase. In fact, while we’re at it, let’s also
|
||||
automatically squash commits that need to be squashed, and update all
|
||||
refs.
|
||||
#+begin_src conf-unix
|
||||
[rebase]
|
||||
autoSquash = true
|
||||
autoStash = true
|
||||
updateRefs = true
|
||||
#+end_src
|
||||
|
||||
And oh, buggers, you have a merge conflict! I’m used to it, but since
|
||||
git 2.3, there is a new feature that adds some context to git
|
||||
conflicts: =zdiff3= (which stands for /zealous diff3/). Not only will it
|
||||
show you the conflicting incoming and HEAD changes, but it will also
|
||||
show you what the code was before either modified the conflicting
|
||||
area. Not a must-have feature, but a nice one to have. Compare this:
|
||||
|
||||
[[file:./img/git/merge-default.png]]
|
||||
|
||||
To this:
|
||||
|
||||
[[file:./img/git/merge-zdiff3.png]]
|
||||
|
||||
We have a new line beginning with =|||||||= with the original line
|
||||
below. Also, it’s nice to see Emacs supports this syntax out of the
|
||||
box!
|
||||
|
||||
#+begin_src conf-unix
|
||||
[merge]
|
||||
conflictstyle = zdiff3
|
||||
#+end_src
|
||||
|
||||
Finally, once we’re good to go, we may want to push our changes to the
|
||||
remote repository. Sometimes, git is confused and isn’t sure where it
|
||||
should push your branch. Let’s tell it to simply push your current
|
||||
branch to the branch with the same name on the remote with
|
||||
=push.default=. If the upstream branch is not set yet, you can
|
||||
automatically set it up with =push.autoSetupRemote=. Finally, I don’t
|
||||
want to push separately my tags, so let’s push them with any other
|
||||
push.
|
||||
#+begin_src conf-unix
|
||||
[push]
|
||||
default = simple
|
||||
autoSetupRemote = true
|
||||
followTags = true
|
||||
#+end_src
|
||||
|
||||
*** Making Git Look Better
|
||||
First, let’s activate colors in git by default when we are in a terminal.
|
||||
#+begin_src conf-unix
|
||||
[color]
|
||||
ui = auto
|
||||
#+end_src
|
||||
|
||||
Getting a raw list of things –branches, tags, …– is *not nice*. So,
|
||||
let’s make it a bit nicer and split these lists in columns.
|
||||
#+begin_src conf-unix
|
||||
[web]
|
||||
browser = firefox
|
||||
[column]
|
||||
ui = auto
|
||||
#+end_src
|
||||
|
||||
Simply using the =column.ui= option sets everything to use columns when
|
||||
using a terminal. If you want more granularity, you can instead use
|
||||
=column.branch=, =column.status=, etc... Look up =man git-config= for more
|
||||
info.
|
||||
|
||||
*** Better Sorting Branches and Tags
|
||||
By default, branches are sorted alphabetically. This may be fine for
|
||||
most people, but I prefer something else: sorting them by how recently
|
||||
they were comitted to. This is actually quite easy to configure:
|
||||
#+begin_src conf-unix
|
||||
[branch]
|
||||
sort = -committerdate
|
||||
#+end_src
|
||||
|
||||
Sorting tags is not nice by default. For instance, git will show you
|
||||
version 11 before version 2, because 11 is technically before 2
|
||||
alphabetically speaking. Let’s fix that.
|
||||
#+begin_src conf-unix
|
||||
[tag]
|
||||
sort = version:refname
|
||||
#+end_src
|
||||
|
||||
*** Did You Mean "Commit"?
|
||||
Sometimes, I fat finger my git commands and white a subcommand that
|
||||
does not exist, like =git pul= or =git comitt=. By default, git will
|
||||
simply tell you that, no, that subcommand does not exist, but will be
|
||||
kind enough to suggest a few commands that may be what you are looking
|
||||
for. Let’s make git not only suggest these, but also ask you if you
|
||||
want to run the one you most likely wanted to run.
|
||||
#+begin_src conf-unix
|
||||
[help]
|
||||
autocorrect = prompt
|
||||
#+end_src
|
||||
|
||||
** Aliases
|
||||
@@ -178,7 +339,6 @@
|
||||
| =l= | =log --oneline --graph --decorate= |
|
||||
| =s= | =status= |
|
||||
| =staged= | =diff --cached= |
|
||||
| =upstream= | =!git push -u origin HEAD= |
|
||||
|
||||
#+RESULTS:
|
||||
: a = add --all
|
||||
@@ -205,6 +365,9 @@
|
||||
|
||||
** Tools
|
||||
*** Sendemail
|
||||
With git, it is possible to directly send commits as patches to a
|
||||
mailing list by email. However, it needs to know how. I’ll just
|
||||
configure my mail server here.
|
||||
#+begin_src conf-unix
|
||||
[sendemail]
|
||||
smtpserver = mail.phundrak.com
|
||||
@@ -213,12 +376,24 @@
|
||||
smtpserverport = 587
|
||||
#+end_src
|
||||
|
||||
Git also needs to know my password for my email address. Obviously, I
|
||||
won’t share it here, but I am using a helper which will itself return
|
||||
my password to git.
|
||||
#+begin_src conf-unix
|
||||
[credentials "smtp://lucien@phundrak.com@mail.phundrak.com:587"]
|
||||
helper = "secret-tool lookup password email_lucien-phundrak-com"
|
||||
#+end_src
|
||||
|
||||
*** Magit
|
||||
This configuration is specific for what I consider to be the best git
|
||||
client out there, [[https://magit.vc/][Magit]]. Not just because it is an Emacs git client,
|
||||
but also because it is quite transparent in terms of what happens with
|
||||
the command line, but it also lets you see so much more easily what
|
||||
happens with so many niceties. Rebases, including interactive rebases,
|
||||
are a breeze with Magit.
|
||||
|
||||
I also can interact with some Git forges, including GitHub. Here are
|
||||
some configurations recommended by Magit for Git.
|
||||
#+begin_src conf-unix
|
||||
[magithub]
|
||||
online = true
|
||||
@@ -231,12 +406,17 @@
|
||||
*** GPG
|
||||
#+begin_src conf-unix
|
||||
[gpg]
|
||||
program = gpg2
|
||||
format = ssh
|
||||
[gpg "ssh"]
|
||||
allowedSignersFile = "~/.ssh/allowed_signers"
|
||||
[commit]
|
||||
gpgsign = true
|
||||
#+end_src
|
||||
|
||||
*** Merge
|
||||
I like to use Emacs for everything (is it surprising?). Let’s declare
|
||||
the merge tool =ediff= and use it in my git configuration.
|
||||
|
||||
#+begin_src conf-unix
|
||||
[merge]
|
||||
tool = ediff
|
||||
@@ -247,30 +427,6 @@
|
||||
cmd = emacs --eval \" (progn (defun ediff-write-merge-buffer () (let ((file ediff-merge-store-file)) (set-buffer ediff-buffer-C) (write-region (point-min) (point-max) file) (message \\\"Merge buffer saved in: %s\\\" file) (set-buffer-modified-p nil) (sit-for 1))) (setq ediff-quit-hook 'kill-emacs ediff-quit-merge-hook 'ediff-write-merge-buffer) (ediff-merge-files-with-ancestor \\\"$LOCAL\\\" \\\"$REMOTE\\\" \\\"$BASE\\\" nil \\\"$MERGED\\\"))\"
|
||||
#+end_src
|
||||
|
||||
*** Pager
|
||||
#+begin_src conf-unix
|
||||
[pager]
|
||||
diff = delta
|
||||
log = delta
|
||||
reflog = delta
|
||||
show = delta
|
||||
#+end_src
|
||||
|
||||
*** Delta
|
||||
#+begin_src conf-unix
|
||||
[delta]
|
||||
features = side-by-side line-numbers decorations
|
||||
whitespace-error-style = 22 reverse
|
||||
|
||||
[delta "decorations"]
|
||||
commit-decoration-style = bold yellow box ul
|
||||
file-style = bold yellow ul
|
||||
file-decoration-style = none
|
||||
|
||||
[interactive]
|
||||
diffFilter = delta --color-only
|
||||
#+end_src
|
||||
|
||||
*** Git forges
|
||||
#+begin_src conf-unix
|
||||
[github]
|
||||
@@ -283,6 +439,9 @@
|
||||
|
||||
[url "https://phundrak@labs.phundrak.com"]
|
||||
insteadOf = https://labs.phundrak.com
|
||||
|
||||
[url "https://github.com/RustSec/advisory-db"]
|
||||
insteadOf = https://github.com/RustSec/advisory-db
|
||||
#+end_src
|
||||
|
||||
*** LFS
|
||||
@@ -293,3 +452,59 @@
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
#+end_src
|
||||
|
||||
** Global gitignore file
|
||||
:PROPERTIES:
|
||||
:HEADER-ARGS: :mkdirp yes :tangle ~/.config/git/global-ignore
|
||||
:END:
|
||||
This is my global gitignore file, specifying files that will always be
|
||||
ignored by Git, as described in [[file:./git.md#basic-configuration][Basic configuration]].
|
||||
|
||||
You may see some lines beginning with =,*=. Just read it as a simple =*=,
|
||||
this is done in order to avoid org-mode being confused by a
|
||||
line-initial =*= usually marking headings.
|
||||
|
||||
First, let’s just ignore dotenv files and direnv’s directories.
|
||||
#+begin_src gitignore
|
||||
.env
|
||||
.direnv/
|
||||
#+end_src
|
||||
|
||||
Now, let’s ignore files generated by Emacs.
|
||||
#+begin_src gitignore
|
||||
,*~
|
||||
\#*\#
|
||||
,*.elc
|
||||
auto-save-list
|
||||
.\#*
|
||||
,*_flymake.*
|
||||
/auto/
|
||||
.projectile
|
||||
.dir-locals.el
|
||||
|
||||
# Org mode files
|
||||
.org-id-locations
|
||||
,*_archive
|
||||
#+end_src
|
||||
|
||||
Finally, let’s ignore some files we generally do not want.
|
||||
#+begin_src text
|
||||
,*.out
|
||||
,*.o
|
||||
,*.so
|
||||
|
||||
# Archives
|
||||
,*.7zz
|
||||
,*.dmg
|
||||
,*.gz
|
||||
,*.iso
|
||||
,*.jar
|
||||
,*.rar
|
||||
,*.tar
|
||||
,*.zip
|
||||
|
||||
,*.log
|
||||
,*.sqlite
|
||||
|
||||
dist/
|
||||
#+end_src
|
||||
|
||||
@@ -26,6 +26,7 @@ input {
|
||||
kb_model =
|
||||
kb_options = caps:ctrl_modifier
|
||||
kb_rules =
|
||||
numlock_by_default = true
|
||||
|
||||
follow_mouse = 1
|
||||
|
||||
@@ -40,9 +41,43 @@ input {
|
||||
We can then set the monitors used. If =HDMI-A-1= is not found when
|
||||
Hyprland launches, it will simply ignore it. And at worst, I can use
|
||||
[[https://github.com/artizirk/wdisplays][wdisplays]] to manually set the position of my screens.
|
||||
#+name: monitors-table
|
||||
| Monitor name | Resolution | Refresh rate (Hz) | Position |
|
||||
|--------------+------------+-------------------+----------|
|
||||
| HDMI-A-1 | 2560x1080 | | 0x0 |
|
||||
| eDP-1 | 1920x1080 | 120 | 2560x0 |
|
||||
|
||||
#+name: gen-monitors
|
||||
#+begin_src emacs-lisp :var table=monitors-table :exports results :tangle no :wrap "src conf" :cache yes
|
||||
(let ((normalize-value (lambda (value)
|
||||
(or (if (numberp value)
|
||||
(number-to-string value)
|
||||
value)
|
||||
""))))
|
||||
(mapconcat (lambda (line)
|
||||
(let* ((monitor (funcall normalize-value (nth 0 line)))
|
||||
(resolution (funcall normalize-value (nth 1 line)))
|
||||
(refresh-rate (funcall normalize-value (nth 2 line)))
|
||||
(refresh-rate (if (string= "" refresh-rate) "" (concat "@" refresh-rate)))
|
||||
(position (funcall normalize-value (nth 3 line)))
|
||||
(scale (funcall normalize-value (nth 4 line)))
|
||||
(scale (if (string= "" scale) "1" scale)))
|
||||
(format "monitor = %s, %s%s, %s, %s"
|
||||
monitor
|
||||
resolution
|
||||
refresh-rate
|
||||
position
|
||||
scale)))
|
||||
table
|
||||
"\n"))
|
||||
#+end_src
|
||||
|
||||
This translates into the following configuration:
|
||||
|
||||
#+RESULTS[7a1e8ae4a77d335ec873de9ef0536bb45c84f2a0]: gen-monitors
|
||||
#+begin_src conf
|
||||
monitor = HDMI-A-1, 2560x1080, 0x0, 1
|
||||
monitor = eDP-1, 1920x1080, 2560x0, 1
|
||||
monitor = HDMI-A-1, 2560x1080, 0x0, 1
|
||||
monitor = eDP-1, 1920x1080@120, 2560x0, 1
|
||||
#+end_src
|
||||
|
||||
** Visual configuration
|
||||
@@ -66,16 +101,6 @@ general {
|
||||
I may one day use the [[https://github.com/hyprland-community/pyprland][=layout_center=]] layout from [[https://github.com/hyprland-community/pyprland][pyprland]], but I
|
||||
haven’t got around to do that yet.
|
||||
|
||||
This section is specific to touchpads, but I like to use it to switch
|
||||
between workspaces quickly. Note that I only want to swipe between
|
||||
existing workspaces, not to create new ones.
|
||||
#+begin_src conf
|
||||
gestures {
|
||||
workspace_swipe = true
|
||||
workspace_swipe_numbered = true
|
||||
}
|
||||
#+end_src
|
||||
|
||||
Decorations are just a nice thing to make things look pretty. I like
|
||||
some slight rounding on my windows with a nice though light shadow.
|
||||
Again, the colour comes from the Nord palette with nord0.
|
||||
@@ -87,10 +112,12 @@ decoration {
|
||||
size = 9
|
||||
passes = 1
|
||||
}
|
||||
drop_shadow = true
|
||||
shadow_range = 4
|
||||
shadow_render_power = 3
|
||||
col.shadow = rgba(2e3440aa)
|
||||
shadow {
|
||||
enabled = true
|
||||
color = rgba(2e3440aa)
|
||||
range = 4
|
||||
render_power = 3
|
||||
}
|
||||
}
|
||||
#+end_src
|
||||
|
||||
@@ -109,19 +136,11 @@ animations {
|
||||
}
|
||||
#+end_src
|
||||
|
||||
Now, we can take care of the configuration of the layouts. The only
|
||||
notable thing here is that I prefer to have no gaps when there is only
|
||||
one window in the dwindle layout. Not much is done with the master
|
||||
layout, as I don’t use it.
|
||||
Now, we can take care of the configuration of the layouts.
|
||||
#+begin_src conf
|
||||
dwindle {
|
||||
pseudotile = true
|
||||
preserve_split = true
|
||||
no_gaps_when_only = 1
|
||||
}
|
||||
|
||||
master {
|
||||
new_is_master = true
|
||||
}
|
||||
#+end_src
|
||||
|
||||
@@ -156,9 +175,15 @@ Having a working policy kit is generally a good idea.
|
||||
exec-once = xfce-polkit
|
||||
#+end_src
|
||||
|
||||
Now, let’s launch the notification daemon [[https://dunst-project.org/][dunst]].
|
||||
Now, let’s launch the notification daemon [[https://github.com/ErikReider/SwayNotificationCenter][swaync]].
|
||||
#+begin_src conf
|
||||
exec-once = dunst
|
||||
exec-once = swaync
|
||||
#+end_src
|
||||
|
||||
Let’s also launch [[https://sr.ht/~kennylevinsen/wlsunset/][wlsunset]]. I’ll very vagely aim at Paris with the
|
||||
longitude and latitude.
|
||||
#+begin_src conf
|
||||
exec-once = wlsunset -l 48.5 -L 2.2 -d 1500
|
||||
#+end_src
|
||||
|
||||
Let’s launch some apps and their applet. Here, we’re launching the
|
||||
@@ -230,6 +255,7 @@ map.
|
||||
submap = reset
|
||||
<<gen-submap(table=top-media, submap="", reset-submap="no")>>
|
||||
<<gen-submap(table=top-windows-movements, submap="", reset-submap="no")>>
|
||||
<<gen-mouse(table=top-windows-actions)>>
|
||||
<<gen-submap(table=top-workspace-movements, submap="", reset-submap="no")>>
|
||||
#+end_src
|
||||
|
||||
@@ -336,9 +362,9 @@ It is sort of the general menu for my keybindings.
|
||||
#+name: apps-submap
|
||||
| Modifiers | Key | Action | Argument | Submap |
|
||||
|-----------+-----+--------+-------------------+--------|
|
||||
| | b | exec | =firefox= | reset |
|
||||
| | b | exec | =zen-browser= | reset |
|
||||
| SHIFT | b | exec | =qutebrowser= | reset |
|
||||
| | d | exec | =discord= | reset |
|
||||
| | d | exec | =vesktop= | reset |
|
||||
| | e | exec | =emacsclient -c -n= | reset |
|
||||
| | g | exec | =gimp= | reset |
|
||||
| | n | exec | =nemo= | reset |
|
||||
@@ -385,14 +411,14 @@ what most of these do.
|
||||
*** Screenshots
|
||||
Here are the keybinding for the screenshot submap
|
||||
#+name: screenshot-submap
|
||||
| Modifiers | Key | Action | Argument | Submap |
|
||||
|-----------+-------+--------+-----------------+--------|
|
||||
| | Print | exec | =screenshot= | reset |
|
||||
| | c | exec | =screenshot -c= | reset |
|
||||
| | s | exec | =screenshot -s= | reset |
|
||||
| | g | exec | =screenshot -g= | reset |
|
||||
| | d | exec | =screenshot -d 3= | reset |
|
||||
| Shift | s | exec | =screenshot -sc= | reset |
|
||||
| Modifiers | Key | Action | Argument | Submap |
|
||||
|-----------+-------+--------+--------------------+--------|
|
||||
| | Print | exec | =screenshot= | reset |
|
||||
| | d | exec | =screenshot -d 3= | reset |
|
||||
| Shift | d | exec | =screenshot -sced 3= | reset |
|
||||
| | e | exec | =screenshot -sec= | reset |
|
||||
| | s | exec | =screenshot -s= | reset |
|
||||
| Shift | s | exec | =screenshot -sc= | reset |
|
||||
|
||||
*** Windows
|
||||
#+name: windows-submap
|
||||
@@ -476,3 +502,18 @@ bind = , w, submap, windows
|
||||
bind = , escape, submap, reset
|
||||
bind = CTRL, g, submap, reset
|
||||
#+end_src
|
||||
|
||||
#+name: gen-mouse
|
||||
#+begin_src emacs-lisp :var table=top-windows-actions
|
||||
(mapconcat (lambda (line)
|
||||
(let ((modifiers (or (nth 0 line) ""))
|
||||
(mouse-btn (nth 1 line))
|
||||
(command (or (nth 2 line) "")))
|
||||
(format "bindm = %s, %s, %s" modifiers mouse-btn command)))
|
||||
table
|
||||
"\n")
|
||||
#+end_src
|
||||
|
||||
#+RESULTS[bab4997f43c513c6557a8f039ae1e20cc96e7794]: gen-mouse
|
||||
: bindm = SUPER, mouse:272, movewindow
|
||||
: bindm = SUPER, mouse:273, resizewindow
|
||||
|
||||
BIN
docs/img/git/diff-default.png
Normal file
BIN
docs/img/git/diff-default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
docs/img/git/diff-histogram.png
Normal file
BIN
docs/img/git/diff-histogram.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
docs/img/git/diff-moved.png
Normal file
BIN
docs/img/git/diff-moved.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
docs/img/git/merge-default.png
Normal file
BIN
docs/img/git/merge-default.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
docs/img/git/merge-zdiff3.png
Normal file
BIN
docs/img/git/merge-zdiff3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
@@ -11,8 +11,7 @@ It can be manipulated by various front-end applications, such as the
|
||||
command-line utility ~mpc~, TUI ~ncmpcpp~, or GUI ~cantata~. In my case, I
|
||||
use mainly ~ncmpcpp~ and Emacs’ EMMS.
|
||||
|
||||
On my computer, MPD runs as a user daemon, as seen in [[file:bootstrap.org::#Execute_bootstrap-Enable_some_services-Mpd-f0f5b9b7][my bootstrap
|
||||
file here]].
|
||||
On my computer, MPD runs as a user daemon.
|
||||
|
||||
** Required Parameters
|
||||
MPD requires a few compulsory parameters that we will see below.
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
#+title: Neofetch
|
||||
#+title: Neofetch (Deprecated)
|
||||
#+setupfile: headers
|
||||
#+PROPERTY: header-args :noweb yes :exports code :tangle no :exports none
|
||||
#+PROPERTY: header-args:sh :tangle ~/.config/neofetch/config.conf :exports code
|
||||
#+PROPERTY: header-args:sh+ :noweb yes :padline no :mkdirp yes
|
||||
|
||||
* Neofetch
|
||||
* Neofetch (Deprecated)
|
||||
|
||||
#+html: ::: warning
|
||||
This configuration of Neofetch is no longer maintained and was
|
||||
deprecated on May 24th, 2025. Therefore, it may not be up to date with
|
||||
the latest versions of Neofetch.
|
||||
#+html: :::
|
||||
|
||||
[[https://github.com/dylanaraps/neofetch][Neofetch]] is a CLI utility used to display system information. It was
|
||||
written in Bash, and thus its configuration file is written as a Bash
|
||||
script too. This document was written with org-mode, and my
|
||||
|
||||
@@ -2,7 +2,14 @@
|
||||
#+setupfile: headers
|
||||
#+PROPERTY: header-args:conf :exports code :mkdirp yes :tangle ~/.config/picom/picom.conf
|
||||
|
||||
* Picom
|
||||
* Picom (deprecated)
|
||||
|
||||
#+html: ::: warning
|
||||
This configuration of Picom is no longer maintained and was deprecated
|
||||
on May 24th, 2025. Therefore, it may not be up to date with the latest
|
||||
versions of Picom.
|
||||
#+html: :::
|
||||
|
||||
Picom is the successor to Compton, a standalone compositor for Xorg. It provides
|
||||
compositing for WM that do not provide any, such as i3. I am currently using
|
||||
[[https://github.com/ibhagwan/picom][ibhagwan’s fork of compton]] which provides the ~dual-kawase~ blur from [[https://github.com/tryone144/compton][tryone’s
|
||||
|
||||
105
docs/rustfmt.org
105
docs/rustfmt.org
@@ -1,105 +0,0 @@
|
||||
#+TITLE: Rust Formatter
|
||||
#+setupfile: headers
|
||||
#+PROPERTY: header-args:toml :mkdirp yes :tangle ~/.rustfmt.toml
|
||||
|
||||
* Rust Formatter
|
||||
The ~.rustfmt.toml~ file located in the ~$HOME~ directory is a global
|
||||
configuration file for Rust’s code formatters, such as ~rustfmt~. In this file,
|
||||
you can find how my Rust code is always formatted.
|
||||
|
||||
** General settings
|
||||
First, we are using the 2018 edition of Rust.
|
||||
#+BEGIN_SRC toml
|
||||
edition = "2018"
|
||||
#+END_SRC
|
||||
|
||||
Put single-expression functions on a single line.
|
||||
#+BEGIN_SRC toml
|
||||
fn_single_line = true
|
||||
#+END_SRC
|
||||
|
||||
Format string literals where necessary.
|
||||
#+BEGIN_SRC toml
|
||||
format_strings = true
|
||||
#+END_SRC
|
||||
|
||||
Maximum width of each line
|
||||
#+BEGIN_SRC toml
|
||||
max_width = 80
|
||||
#+END_SRC
|
||||
|
||||
Merge multiple imports into a single nested import.
|
||||
#+BEGIN_SRC toml
|
||||
merge_imports = true
|
||||
#+END_SRC
|
||||
|
||||
** Structs and Enums
|
||||
The maximum length of enum variant having discriminant, that gets
|
||||
vertically aligned with others. Variants without discriminants would
|
||||
be ignored for the purpose of alignment.
|
||||
|
||||
Note that this is not how much whitespace is inserted, but instead the
|
||||
longest variant name that doesn't get ignored when aligning.
|
||||
#+BEGIN_SRC toml
|
||||
enum_discrim_align_threshold = 20
|
||||
#+END_SRC
|
||||
|
||||
The maximum diff of width between struct fields to be aligned with
|
||||
each other.
|
||||
#+BEGIN_SRC toml
|
||||
struct_field_align_threshold = 20
|
||||
#+END_SRC
|
||||
|
||||
Reorder =impl= items. =type= and =const= are put first, then macros and
|
||||
methods.
|
||||
#+BEGIN_SRC toml
|
||||
reorder_impl_items = true
|
||||
#+END_SRC
|
||||
|
||||
** Comments
|
||||
Convert ~/* */~ comments to ~//~ comments where possible.
|
||||
#+BEGIN_SRC toml
|
||||
normalize_comments = true
|
||||
#+END_SRC
|
||||
|
||||
Break comments to fit on the line.
|
||||
#+BEGIN_SRC toml
|
||||
wrap_comments = true
|
||||
#+END_SRC
|
||||
|
||||
Report ~FIXME~ items in comments.
|
||||
#+BEGIN_SRC toml
|
||||
report_fixme = "Always"
|
||||
#+END_SRC
|
||||
|
||||
Report ~TODO~ items in comments.
|
||||
#+BEGIN_SRC toml
|
||||
todo = "Always"
|
||||
#+END_SRC
|
||||
|
||||
** Documentation
|
||||
Format code snippet included in doc comments.
|
||||
#+BEGIN_SRC toml
|
||||
format_code_in_doc_comments = true
|
||||
#+END_SRC
|
||||
|
||||
Convert ~#![doc]~ and ~#[doc]~ attributes to ~//!~ and ~///~ doc comments.
|
||||
#+BEGIN_SRC toml
|
||||
normalize_doc_attributes = true
|
||||
#+END_SRC
|
||||
|
||||
** Whitespace
|
||||
Use tab characters for indentation, spaces for alignment.
|
||||
#+BEGIN_SRC toml
|
||||
hard_tabs = false
|
||||
#+END_SRC
|
||||
|
||||
Number of spaces per tab.
|
||||
#+BEGIN_SRC toml
|
||||
tab_spaces = 4
|
||||
#+END_SRC
|
||||
|
||||
I want newlines to always be Unix style.
|
||||
#+BEGIN_SRC toml
|
||||
newline_style = "Unix"
|
||||
#+END_SRC
|
||||
1314
docs/scripts.org
1314
docs/scripts.org
File diff suppressed because it is too large
Load Diff
@@ -119,9 +119,9 @@ It’s always nice to have the =BROWSER= variable available in case you
|
||||
want to do stuff with scripts and your default browser.
|
||||
|
||||
#+name: browser
|
||||
| Variable | Value |
|
||||
|----------+---------|
|
||||
| =BROWSER= | =firefox= |
|
||||
| Variable | Value |
|
||||
|----------+-------------|
|
||||
| =BROWSER= | =zen-browser= |
|
||||
|
||||
#+begin_src sh
|
||||
<<export-variables(browser)>>
|
||||
|
||||
@@ -1,19 +1,26 @@
|
||||
#+title: StumpWM
|
||||
#+title: StumpWM (Deprecated)
|
||||
#+setupfile: ../headers
|
||||
#+property: header-args:emacs-lisp :tangle no :exports results :cache yes :noweb yes
|
||||
|
||||
[[file:../img/stumpwm.png]]
|
||||
|
||||
* StumpWM
|
||||
* StumpWM (deprecated)
|
||||
|
||||
#+html: ::: warning
|
||||
This configuration of StumpWM is no longer maintained and was
|
||||
deprecated on May 24th, 2025. Therefore, it may not be up to date with
|
||||
the latest versions of StumpWM.
|
||||
#+html: :::
|
||||
|
||||
** Introduction
|
||||
*** What is StumpWM?
|
||||
[[https://stumpwm.github.io/][StumpWM]] is a tiling window manager inheriting from [[http://www.nongnu.org/ratpoison/][RatPoison]], written
|
||||
entirely in [[https://common-lisp.net/][Common Lisp]] and compiled with [[http://www.sbcl.org/][SBCL]]. While it is not a
|
||||
dynamic tiling window manager like [[file:Deprecated/awesome.org][Awesome]] is, its ability of managing
|
||||
dynamic tiling window manager like [[file:/deprecated/awesome.md][Awesome]] is, its ability of managing
|
||||
windows in frames and using keychords with keymaps like Emacs does is
|
||||
a huge plus for me, not to mention the fact its configuration file is
|
||||
written in Common Lisp, a general programming language, a bit like
|
||||
Awesome. This makes it an [[file:Deprecated/i3.org][i3]] on steroids, sort of. It also uses a lot
|
||||
Awesome. This makes it an [[file:/deprecated/i3.md][i3]] on steroids, sort of. It also uses a lot
|
||||
of Emacs’ concepts, which is great for an Emacs user such as myself.
|
||||
|
||||
*** Why not EXWM then?
|
||||
|
||||
@@ -525,7 +525,7 @@ with Emacs’ buffers.
|
||||
My music is managed through MPD, and I often use ~playerctl~ commands in
|
||||
order to interact with it without any GUI application. So, we’ll see a
|
||||
lot of its usage here, and numerous commands used here come from the
|
||||
~mpd~ minor mode loaded [[file:./stumpwm.md#init-file][above]].
|
||||
~mpd~ minor mode loaded [[file:init.md][in the init file]].
|
||||
|
||||
First, let’s declare an interactive keymap in order to easily change
|
||||
several times in a row either the current song playing or the volume
|
||||
|
||||
@@ -97,7 +97,7 @@ formatter is U+E082, which symbolizes the CPU.
|
||||
*** Generating the Mode-Line
|
||||
We can indicate what to display in our modeline. Each formatter will
|
||||
be separated by a Powerline separator with the code point ~0xE0B0~ in
|
||||
the font I am using (see [[file:./stumpwm.md#fonts][Fonts]]).
|
||||
the font I am using (see [[file:theme.md#fonts][Theme » Fonts]]).
|
||||
|
||||
#+name: modeline-format
|
||||
#+caption: Formatters for the modeline
|
||||
|
||||
4052
package-lock.json
generated
Normal file
4052
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
23
package.json
23
package.json
@@ -3,21 +3,26 @@
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"dev": "vuepress dev docs",
|
||||
"build": "vuepress build docs"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://labs.phundrak.com/phundrak/conlang.phundrak.com"
|
||||
},
|
||||
"author": "Lucien Cartier-Tilet <lucien@phundrak.com>",
|
||||
"license": "AGPL-3.0",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@vuepress/bundler-vite": "^2.0.0-rc.2",
|
||||
"@vuepress/theme-default": "^2.0.0-rc.2",
|
||||
"vuepress": "2.0.0-rc.2",
|
||||
"vuepress-plugin-search-pro": "^2.0.0-rc.16"
|
||||
"@vuepress/bundler-vite": "2.0.0-rc.26",
|
||||
"@vuepress/plugin-slimsearch": "^2.0.0-rc.118",
|
||||
"@vuepress/plugin-umami-analytics": "2.0.0-rc.118",
|
||||
"@vuepress/theme-default": "2.0.0-rc.118",
|
||||
"vuepress": "2.0.0-rc.26"
|
||||
},
|
||||
"packageManager": "yarn@4.1.1"
|
||||
"dependencies": {
|
||||
"less": "^4.4.2",
|
||||
"nord": "^0.2.1"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vuepress dev docs",
|
||||
"build": "vuepress build docs"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
pkgs.mkShell {
|
||||
nativeBuildInputs = with pkgs.buildPackages; [
|
||||
corepack
|
||||
];
|
||||
shellHook = ''
|
||||
yarn set version stable
|
||||
'';
|
||||
}
|
||||
Reference in New Issue
Block a user