Compare commits
53 Commits
4baaaadf02
...
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
|
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@v4
|
||||
with:
|
||||
node-version: 20.x
|
||||
- run: corepack enable
|
||||
- run: npm ci
|
||||
- run: npm run 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
|
||||
@@ -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,35 +59,36 @@ export default defineUserConfig({
|
||||
'/git',
|
||||
'/hyprland',
|
||||
'/mpd',
|
||||
'/neofetch',
|
||||
'/picom',
|
||||
{
|
||||
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,9 +1,9 @@
|
||||
interface SimplifiedHeader {
|
||||
tag: string;
|
||||
content: [any];
|
||||
content: any[];
|
||||
}
|
||||
|
||||
const simplifiedHead = [
|
||||
const simplifiedHead:SimplifiedHeader[] = [
|
||||
{
|
||||
tag: 'script',
|
||||
content: [
|
||||
@@ -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);
|
||||
// }
|
||||
|
||||
@@ -156,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
|
||||
@@ -350,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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -90,7 +90,6 @@ block.
|
||||
| =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]] |
|
||||
@@ -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()>>))
|
||||
|
||||
@@ -90,38 +90,88 @@ Undefining some stuff to make keybind prefixes work correctly.
|
||||
** Apps
|
||||
Here are my apps keybindings. Each one of them is prefixed by ~a~.
|
||||
#+name: keybindings-apps
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------------+-------------+------------|
|
||||
| | | apps | |
|
||||
| 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 |
|
||||
| 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: keybindings-apps-shell
|
||||
| Key | Function | Description | Package |
|
||||
|-----+-------------+-------------+-------------|
|
||||
| | | shells | |
|
||||
| e | eshell-new | | |
|
||||
| v | vterm | | vterm |
|
||||
| V | multi-vterm | | multi-vterm |
|
||||
| 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
|
||||
@@ -181,7 +231,7 @@ My buffer-related keybindings are all prefixed by ~b~.
|
||||
| c | clone-indirect-buffer | | |
|
||||
| C | clone-indirect-buffer-other-window | | |
|
||||
| l | bufler | | bufler |
|
||||
| d | kill-this-buffer | | |
|
||||
| d | kill-current-buffer | | |
|
||||
| D | kill-buffer | | |
|
||||
| h | dashboard-refresh-buffer | | dashboard |
|
||||
| m | switch-to-messages-buffer | | |
|
||||
@@ -361,10 +411,10 @@ My keybindings for jumping around are prefixed by ~j~.
|
||||
| Key | Function | Description | Package |
|
||||
|-----+----------------------------------+-------------+----------|
|
||||
| | | language | |
|
||||
| . | langtool-correct-at-point | | langtool |
|
||||
| B | langtool-correct-buffer | | langtool |
|
||||
| b | langtool-check-buffer | | langtool |
|
||||
| c | langtool-check | | langtool |
|
||||
| C | langtool-correct-at-point | | langtool |
|
||||
| d | langtool-check-done | | langtool |
|
||||
| l | langtool-switch-default-language | | langtool |
|
||||
| p | langtool-show-message-at-point | | langtool |
|
||||
@@ -420,7 +470,13 @@ My keybindings for my projects are prefixed by ~p~.
|
||||
| Key | Function | Description | Package |
|
||||
|-----+--------------------------------+-------------+----------|
|
||||
| | | org | |
|
||||
| c | org-capture | | 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 |
|
||||
@@ -516,7 +572,7 @@ much to say. The prefix here is ~w~.
|
||||
| 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-delete-window | | |
|
||||
| b | kill-buffer-and-window | | |
|
||||
| d | delete-window | | |
|
||||
| o | other-window | | |
|
||||
| D | delete-other-windows | | |
|
||||
|
||||
@@ -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>>
|
||||
@@ -499,21 +529,6 @@ 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:/scripts.md#emacsmail][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
|
||||
|
||||
**** 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
|
||||
@@ -1252,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
|
||||
@@ -1331,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
|
||||
@@ -1349,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
|
||||
@@ -1365,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)
|
||||
@@ -1413,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
|
||||
@@ -1561,7 +1639,8 @@ excluded files.
|
||||
eol)
|
||||
,(rx "/"
|
||||
(or "rsync" "ssh" "tmp" "yadm" "sudoedit" "sudo")
|
||||
(* any)))))
|
||||
(* any))
|
||||
"/nix/.*")))
|
||||
#+end_src
|
||||
|
||||
** Screenshot
|
||||
@@ -1579,6 +1658,27 @@ look nice.
|
||||
#+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.
|
||||
@@ -1588,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")
|
||||
@@ -1597,72 +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
|
||||
(use-package wakatime-mode
|
||||
:defer t
|
||||
:straight (:build t)
|
||||
:config
|
||||
(setq vterm-shell "/usr/bin/fish"
|
||||
vterm-always-compile-module t))
|
||||
#+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
|
||||
: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
|
||||
|
||||
Another really neat package is =eshell-vterm= which allows to use vterm
|
||||
to run visual commands when in Eshell.
|
||||
#+begin_src emacs-lisp
|
||||
(use-package eshell-vterm
|
||||
:after eshell
|
||||
:straight (:build t)
|
||||
:config
|
||||
(eshell-vterm-mode)
|
||||
(defalias 'eshell/v 'eshell-exec-visual))
|
||||
#+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
|
||||
|
||||
@@ -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
|
||||
@@ -460,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
|
||||
|
||||
@@ -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)
|
||||
@@ -67,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
|
||||
|
||||
@@ -18,34 +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-font-lock-level 4
|
||||
treesit-language-source-alist
|
||||
'((astro "https://github.com/virchau13/tree-sitter-astro")
|
||||
(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
|
||||
@@ -60,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
|
||||
@@ -209,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)
|
||||
@@ -220,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)
|
||||
@@ -324,42 +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/*")
|
||||
":")))
|
||||
#+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
|
||||
|
||||
**** TODO Auto detection of langtool java classpath :noexport:
|
||||
** DSLs
|
||||
DSLs, or /Domain Specific Languages/, are languages dedicated to some
|
||||
very tasks, such as configuration languages or non-general programming
|
||||
@@ -668,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
|
||||
@@ -738,6 +693,29 @@ 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
|
||||
@@ -911,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.
|
||||
@@ -1297,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
|
||||
@@ -1311,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
|
||||
@@ -1417,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
|
||||
@@ -1464,8 +1433,7 @@ Auto-completion for ~emmet-mode~, ~html-mode~, and ~web-mode~.
|
||||
(use-package astro-ts-mode
|
||||
:straight (:build t)
|
||||
:defer t
|
||||
:init
|
||||
(mapc #'treesit-install-language-grammar '(astro css tsx)))
|
||||
:mode "\\.astro\\'")
|
||||
#+end_src
|
||||
|
||||
**** CSS
|
||||
@@ -1479,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
|
||||
@@ -1534,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
|
||||
@@ -1590,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.
|
||||
@@ -1612,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
|
||||
@@ -1680,7 +1671,12 @@ simplest fix is to run the following command:
|
||||
#+begin_src sh
|
||||
npm install --save-dev vue-tsc typescript
|
||||
#+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.
|
||||
|
||||
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
|
||||
|
||||
@@ -111,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
|
||||
|
||||
@@ -133,14 +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.
|
||||
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
|
||||
}
|
||||
#+end_src
|
||||
|
||||
@@ -362,7 +362,7 @@ 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 | =vesktop= | reset |
|
||||
| | e | exec | =emacsclient -c -n= | reset |
|
||||
|
||||
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 |
@@ -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
|
||||
|
||||
1283
docs/scripts.org
1283
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,10 +1,17 @@
|
||||
#+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
|
||||
|
||||
4471
package-lock.json
generated
4471
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -11,14 +11,14 @@
|
||||
"license": "AGPL-3.0",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@vuepress/bundler-vite": "2.0.0-rc.14",
|
||||
"@vuepress/plugin-umami-analytics": "2.0.0-rc.41",
|
||||
"@vuepress/theme-default": "2.0.0-rc.41",
|
||||
"vuepress": "2.0.0-rc.14",
|
||||
"vuepress-plugin-search-pro": "2.0.0-rc.52"
|
||||
"@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"
|
||||
},
|
||||
"dependencies": {
|
||||
"less": "^4.2.0",
|
||||
"less": "^4.4.2",
|
||||
"nord": "^0.2.1"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user