├── .config ├── Code │ └── User │ │ ├── install-extensions.sh │ │ ├── keybindings.json │ │ └── settings.json ├── GIMP │ └── 2.10 │ │ └── palettes │ │ └── dracula.gpl ├── XCompose ├── atuin │ └── config.toml ├── bat │ ├── config │ └── themes │ │ └── Delacula.tmTheme ├── bottom │ └── bottom.toml ├── broot │ └── conf.toml ├── containers │ └── registries.conf ├── doom │ ├── config.el │ ├── date.el │ ├── describe.el │ ├── doom-modeline.el │ ├── fetcher.el │ ├── init.el │ ├── marginalia.el │ ├── org-agenda.el │ ├── org-link.el │ ├── org-property-drawer-dates.el │ ├── org-property-drawer.el │ ├── org-roam-ql.el │ ├── org-roam.el │ ├── org.el │ ├── packages.el │ └── theme.el ├── fish │ ├── completions │ │ ├── az.fish │ │ └── tldr.fish │ ├── config.fish │ ├── functions │ │ ├── azcopy.fish │ │ ├── browser-search.fish │ │ ├── browser.fish │ │ ├── cal.fish │ │ ├── cdr.fish │ │ ├── cert.fish │ │ ├── date.fish │ │ ├── docker.fish │ │ ├── dot-versions.fish │ │ ├── dot.fish │ │ ├── fz.fish │ │ ├── glow.fish │ │ ├── ici.fish │ │ ├── ip.fish │ │ ├── jqz.fish │ │ ├── jwt.fish │ │ ├── kb.fish │ │ ├── le.fish │ │ ├── lh.fish │ │ ├── ll.fish │ │ ├── lld.fish │ │ ├── llh.fish │ │ ├── ln.fish │ │ ├── lt.fish │ │ ├── man.fish │ │ ├── me.fish │ │ ├── mkcd.fish │ │ ├── mpc.fish │ │ ├── npm.fish │ │ ├── pandock.fish │ │ ├── podman.fish │ │ ├── radix.fish │ │ ├── rg.fish │ │ ├── ssh.fish │ │ ├── starship.fish │ │ ├── startx.fish │ │ ├── utc.fish │ │ ├── vagrant.fish │ │ ├── xclip.fish │ │ └── xclipx.fish │ └── themes │ │ └── Delacula.theme ├── git │ ├── config │ ├── hooks │ │ └── prepare-commit-msg │ └── ignore ├── i3 │ ├── config │ └── i3status.conf ├── kak │ ├── colors │ │ └── dracula.kak │ └── kakrc ├── kitty │ ├── kitty.conf │ └── themes │ │ ├── dracula.conf │ │ ├── espresso-libre.conf │ │ ├── grass.conf │ │ ├── ocean.conf │ │ └── red-alert.conf ├── lf │ ├── lfrc │ └── previewer.sh ├── ncmpcpp │ ├── bindings │ └── config ├── nvim │ └── init.vim ├── pacman.conf ├── procs │ └── config.toml ├── starship.toml ├── tig │ └── config └── xkb │ └── keymap │ └── delafayette ├── .local └── share │ └── eslint │ └── rules.json ├── .xinitrc └── README.md /.config/Code/User/install-extensions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Output of : 3 | # code --list-extensions | xargs -L 1 echo code --install-extension 4 | 5 | code --install-extension alefragnani.project-manager 6 | code --install-extension amazonwebservices.aws-toolkit-vscode 7 | code --install-extension Angular.ng-template 8 | code --install-extension Arjun.swagger-viewer 9 | code --install-extension atlassian.atlascode 10 | code --install-extension Azurite.azurite 11 | code --install-extension CoenraadS.bracket-pair-colorizer-2 12 | code --install-extension dbaeumer.vscode-eslint 13 | code --install-extension denoland.vscode-deno 14 | code --install-extension DotJoshJohnson.xml 15 | code --install-extension dracula-theme.theme-dracula 16 | code --install-extension eamodio.gitlens 17 | code --install-extension eg2.vscode-npm-script 18 | code --install-extension esbenp.prettier-vscode 19 | code --install-extension foxundermoon.shell-format 20 | code --install-extension GitLab.gitlab-workflow 21 | code --install-extension golang.go 22 | code --install-extension gregoire.dance 23 | code --install-extension Gruntfuggly.todo-tree 24 | code --install-extension hashicorp.terraform 25 | code --install-extension influxdata.flux 26 | code --install-extension ms-azuretools.vscode-azureappservice 27 | code --install-extension ms-azuretools.vscode-azurefunctions 28 | code --install-extension ms-azuretools.vscode-azureresourcegroups 29 | code --install-extension ms-azuretools.vscode-azurestorage 30 | code --install-extension ms-azuretools.vscode-azureterraform 31 | code --install-extension ms-azuretools.vscode-azurevirtualmachines 32 | code --install-extension ms-azuretools.vscode-docker 33 | code --install-extension ms-dotnettools.csharp 34 | code --install-extension ms-kubernetes-tools.vscode-kubernetes-tools 35 | code --install-extension ms-ossdata.vscode-postgresql 36 | code --install-extension ms-python.python 37 | code --install-extension ms-python.vscode-pylance 38 | code --install-extension ms-toolsai.jupyter 39 | code --install-extension ms-toolsai.jupyter-keymap 40 | code --install-extension ms-toolsai.jupyter-renderers 41 | code --install-extension ms-vscode-remote.remote-containers 42 | code --install-extension ms-vscode-remote.remote-ssh 43 | code --install-extension ms-vscode-remote.remote-ssh-edit 44 | code --install-extension ms-vscode-remote.remote-wsl 45 | code --install-extension ms-vscode-remote.vscode-remote-extensionpack 46 | code --install-extension ms-vscode.azure-account 47 | code --install-extension ms-vscode.cmake-tools 48 | code --install-extension ms-vscode.cpptools 49 | code --install-extension myxvisual.vscode-ts-uml 50 | code --install-extension NicolasVuillamy.vscode-groovy-lint 51 | code --install-extension nrwl.angular-console 52 | code --install-extension octref.vetur 53 | code --install-extension Orta.vscode-jest 54 | code --install-extension redhat.java 55 | code --install-extension redhat.vscode-commons 56 | code --install-extension redhat.vscode-xml 57 | code --install-extension redhat.vscode-yaml 58 | code --install-extension ryu1kn.partial-diff 59 | code --install-extension silvenon.mdx 60 | code --install-extension skyapps.fish-vscode 61 | code --install-extension SonarSource.sonarlint-vscode 62 | code --install-extension streetsidesoftware.code-spell-checker 63 | code --install-extension streetsidesoftware.code-spell-checker-french 64 | code --install-extension sumneko.lua 65 | code --install-extension tfsec.tfsec 66 | code --install-extension timonwong.shellcheck 67 | code --install-extension twxs.cmake 68 | code --install-extension VisualStudioExptTeam.vscodeintellicode 69 | code --install-extension vsciot-vscode.azure-iot-edge 70 | code --install-extension vsciot-vscode.azure-iot-toolkit 71 | code --install-extension vsciot-vscode.azure-iot-tools 72 | code --install-extension vsciot-vscode.vscode-iot-device-cube 73 | code --install-extension vsciot-vscode.vscode-iot-workbench 74 | code --install-extension vscjava.vscode-java-debug 75 | code --install-extension vscjava.vscode-java-dependency 76 | code --install-extension vscjava.vscode-java-pack 77 | code --install-extension vscjava.vscode-java-test 78 | code --install-extension vscjava.vscode-maven 79 | code --install-extension vscodevim.vim 80 | code --install-extension wix.vscode-import-cost 81 | code --install-extension zxh404.vscode-proto3 82 | -------------------------------------------------------------------------------- /.config/Code/User/keybindings.json: -------------------------------------------------------------------------------- 1 | [ 2 | // sidebar 3 | { 4 | "key": "Ctrl+e", 5 | "command": "workbench.view.explorer", 6 | "when": "vim.mode != 'Insert'" 7 | }, 8 | { 9 | "key": "Ctrl+f", 10 | "command": "workbench.action.findInFiles", 11 | "when": "editorTextFocus && vim.mode != 'Insert'" 12 | }, 13 | // palette 14 | { 15 | "key": "Ctrl+0", 16 | "command": "workbench.action.showCommands", 17 | "when": "vim.mode != 'Insert'" 18 | }, 19 | // layout 20 | { 21 | "key": "Ctrl+h", 22 | "command": "workbench.action.navigateLeft", 23 | "when": "vim.mode != 'Insert'" 24 | }, 25 | { 26 | "key": "Ctrl+j", 27 | "command": "workbench.action.navigateDown", 28 | "when": "vim.mode != 'Insert'" 29 | }, 30 | { 31 | "key": "Ctrl+k", 32 | "command": "workbench.action.navigateUp", 33 | "when": "vim.mode != 'Insert'" 34 | }, 35 | { 36 | "key": "Ctrl+l", 37 | "command": "workbench.action.navigateRight", 38 | "when": "vim.mode != 'Insert'" 39 | }, 40 | // dance: move b to q 41 | { 42 | "key": "Q", 43 | "when": "editorTextFocus && dance.mode == 'normal'", 44 | "title": "Select to previous word start", 45 | "command": "dance.seek.word.backward" 46 | }, 47 | { 48 | "key": "Shift+Q", 49 | "when": "editorTextFocus && dance.mode == 'normal'", 50 | "title": "Extend to previous word start", 51 | "command": "dance.seek.word.extend.backward" 52 | }, 53 | { 54 | "key": "Alt+Q", 55 | "when": "editorTextFocus && dance.mode == 'normal'", 56 | "title": "Select to previous non-whitespace word start", 57 | "command": "dance.seek.word.ws.backward" 58 | }, 59 | { 60 | "key": "Shift+Alt+Q", 61 | "when": "editorTextFocus && dance.mode == 'normal'", 62 | "title": "Extend to previous non-whitespace word start", 63 | "command": "dance.seek.word.ws.extend.backward" 64 | }, 65 | { 66 | "key": "B", 67 | "when": "editorTextFocus && dance.mode == 'normal'", 68 | "title": "Show buffer menu", 69 | "command": "dance.openMenu", 70 | "args": { 71 | "input": "buffer" 72 | } 73 | }, 74 | { 75 | "key": "Shift+B", 76 | "when": "editorTextFocus && dance.mode == 'normal'", 77 | "title": "Show buffer menu (locked)", 78 | "command": "dance.openMenu", 79 | "args": { 80 | "input": "buffer", 81 | "locked": true 82 | } 83 | }, 84 | { 85 | "key": "Ctrl+I", 86 | "when": "editorTextFocus && dance.mode == 'normal'", 87 | "title": "Jump forward", 88 | "command": "workbench.action.navigateForward" 89 | }, 90 | { 91 | "key": "Ctrl+O", 92 | "when": "editorTextFocus && dance.mode == 'normal'", 93 | "title": "Jump backward", 94 | "command": "workbench.action.navigateBack" 95 | }, 96 | { 97 | "key": "Alt+Backspace", 98 | "when": "editorTextFocus && dance.mode == 'normal'", 99 | "title": "Clear main selections", 100 | "command": "dance.selections.clear.main" 101 | }, 102 | { 103 | "key": "Backspace", 104 | "when": "editorTextFocus && dance.mode == 'normal'", 105 | "title": "Clear secondary selections", 106 | "command": "dance.selections.clear.secondary" 107 | }, 108 | { 109 | "key": "Shift+3", 110 | "when": "editorTextFocus && dance.mode == 'normal'", 111 | "title": "Comment code", 112 | "command": "editor.action.commentLine" 113 | }, 114 | // text-objects 115 | { 116 | "key": "Alt+O", 117 | "when": "editorTextFocus && dance.mode == 'normal'", 118 | "title": "Select whole object", 119 | "command": "dance.seek.askObject" 120 | }, 121 | { 122 | "key": "Alt+O", 123 | "when": "editorTextFocus && dance.mode == 'insert'", 124 | "title": "Select whole object", 125 | "command": "dance.seek.askObject" 126 | }, 127 | // Spacemacs 128 | { 129 | "key": "Space", 130 | "when": "editorTextFocus && dance.mode == 'normal'", 131 | "title": "Show commands", 132 | "command": "workbench.action.showCommands" 133 | }, 134 | // previous / next 135 | { 136 | "key": "Ctrl+p", 137 | "command": "selectPrevSuggestion", 138 | "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" 139 | }, 140 | { 141 | "key": "Ctrl+n", 142 | "command": "selectNextSuggestion", 143 | "when": "suggestWidgetMultipleSuggestions && suggestWidgetVisible && textInputFocus" 144 | }, 145 | { 146 | "key": "Ctrl+p", 147 | "command": "workbench.action.quickOpenSelectPrevious", 148 | "when": "inQuickOpen" 149 | }, 150 | { 151 | "key": "Ctrl+n", 152 | "command": "workbench.action.quickOpenSelectNext", 153 | "when": "inQuickOpen" 154 | } 155 | ] 156 | -------------------------------------------------------------------------------- /.config/Code/User/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "chat.commandCenter.enabled": false, 3 | "diffEditor.ignoreTrimWhitespace": true, 4 | "editor.bracketPairColorization.enabled": true, 5 | "editor.cursorStyle": "block", 6 | "editor.cursorSurroundingLines": 10, 7 | "editor.fontSize": 10, 8 | "editor.guides.bracketPairs": "active", 9 | "editor.minimap.size": "fill", 10 | "editor.minimap.enabled": false, 11 | "editor.quickSuggestions": { 12 | "other": true, 13 | "comments": true, 14 | "strings": true 15 | }, 16 | "editor.renderLineHighlight": "all", 17 | "editor.renderWhitespace": "all", 18 | "editor.scrollbar.verticalScrollbarSize": 32, 19 | "editor.semanticHighlighting.enabled": true, 20 | "editor.stickyScroll.enabled": true, 21 | "editor.suggestSelection": "first", 22 | "editor.tabSize": 2, 23 | "editor.wordBasedSuggestions": "matchingDocuments", 24 | "editor.wordBasedSuggestionsMode": "allDocuments", 25 | "explorer.confirmDragAndDrop": false, 26 | "explorer.confirmDelete": false, 27 | "explorer.fileNesting.enabled": true, 28 | "explorer.fileNesting.patterns": { 29 | ".env": ".envrc,.env.example,.env.template", 30 | ".eslintrc.json": ".eslintcache", 31 | ".prettierrc": ".prettierignore,.editorconfig", 32 | "flake.nix": "flake.lock", 33 | "jest.config.js": "jest.*.js,jest.*.ts", 34 | "package.json": "package-lock.json,yarn.lock,pnpm-lock.yaml,.yarnrc.yml", 35 | "tsconfig.json": "tsconfig.*.json", 36 | "tsconfig.base.json": "tsconfig.*.json", 37 | "Cargo.toml": "Cargo.lock", 38 | "GemFile": "Gemfile.lock", 39 | "README.md": "CHANGELOG.md,CODEOWNERS,CODE_OF_CONDUCT.md,CONTRIBUTING.md,INSTALL.md,LICENSE,LICENSE.txt,OWNERS,SECURITY.md,TESTING.md", 40 | "*.ts": "${capture}.js,${capture}.spec.ts" 41 | }, 42 | "explorer.sortOrder": "type", 43 | "keyboard.dispatch": "keyCode", 44 | "problems.showCurrentInStatus": true, 45 | "references.preferredLocation": "view", 46 | "files.exclude": { 47 | "**/.classpath": true, 48 | "**/.project": true, 49 | "**/.settings": true, 50 | "**/.factorypath": true 51 | }, 52 | "search.exclude": { 53 | ".yarn": true, 54 | "yarn.lock": true 55 | }, 56 | "search.mode": "reuseEditor", 57 | "terminal.integrated.fontFamily": "iosevka term", 58 | "terminal.integrated.fontSize": 13, 59 | "terminal.integrated.scrollback": 10000, 60 | "terminal.integrated.smoothScrolling": true, 61 | "update.mode": "none", 62 | "window.menuBarVisibility": "toggle", 63 | "workbench.colorTheme": "Dracula", 64 | "workbench.colorCustomizations": { 65 | "tab.activeBorderTop": "#50fa7b", 66 | "tab.activeBackground": "#444754" 67 | }, 68 | "workbench.editor.highlightModifiedTabs": true, 69 | "workbench.startupEditor": "newUntitledFile", 70 | "workbench.statusBar.visible": true, 71 | "workbench.experimental.sidePanel.enabled": true, 72 | // languages 73 | "debug.javascript.autoAttachFilter": "disabled", 74 | /// js 75 | "javascript.referencesCodeLens.enabled": true, 76 | "javascript.referencesCodeLens.showOnAllFunctions": true, 77 | "javascript.updateImportsOnFileMove.enabled": "always", 78 | /// ts 79 | "typescript.implementationsCodeLens.enabled": true, 80 | "typescript.referencesCodeLens.enabled": true, 81 | "typescript.referencesCodeLens.showOnAllFunctions": true, 82 | "typescript.updateImportsOnFileMove.enabled": "always", 83 | /// py 84 | "python.analysis.typeCheckingMode": "strict", 85 | // extensions 86 | "atlascode.bitbucket.enabled": true, 87 | "atlascode.bitbucket.explorer.relatedJiraIssues.enabled": true, 88 | "atlascode.bitbucket.pipelines.explorerEnabled": true, 89 | "atlascode.jira.enabled": true, 90 | "atlascode.jira.explorer.enabled": true, 91 | "atlascode.jira.statusbar.enabled": false, 92 | /// azure 93 | "azureFunctions.showProjectWarning": false, 94 | "azureResourceGroups.groupBy": "resourceType", 95 | "azurite.location": ".azurite", 96 | "cosmosDB.showSavePrompt": false, 97 | "deno.codeLens.implementations": true, 98 | "deno.codeLens.references": true, 99 | "deno.codeLens.referencesAllFunctions": true, 100 | "docker.containers.groupBy": "State", 101 | "docker.containers.description": ["ContainerName", "State", "Status"], 102 | "eslint.alwaysShowStatus": true, 103 | "eslint.debug": true, 104 | "stylelint.validate": ["css", "scss"], 105 | "gitlens.blame.ignoreWhitespace": true, 106 | "gitlens.codeLens.enabled": false, 107 | "gitlens.sortBranchesBy": "date:desc", 108 | "gitlens.views.remotes.branches.layout": "list", 109 | /* 110 | "jest.autoRun": { 111 | "watch": false, 112 | "onSave": "test-src-file" 113 | }, 114 | */ 115 | "terraform.codelens.referenceCount": true, 116 | // format 117 | "prettier.semi": false, 118 | "prettier.trailingComma": "all", 119 | "[css][html][javascript][json][jsonc][markdown][scss][typescript][typescriptreact][yaml]": { 120 | "editor.defaultFormatter": "esbenp.prettier-vscode" 121 | }, 122 | "[terraform][terraform-vars]": { 123 | "editor.defaultFormatter": "hashicorp.terraform" 124 | }, 125 | "ini.format.enable": false, 126 | // schemas 127 | "json.schemas": [ 128 | { 129 | "fileMatch": ["nest-cli.json"], 130 | "url": "https://json.schemastore.org/nest-cli" 131 | }, 132 | { 133 | "fileMatch": ["angular.json"], 134 | "url": "https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular/cli/lib/config/workspace-schema.json" 135 | }, 136 | { 137 | "fileMatch": ["cypress.json", "cypress-config-dev.json"], 138 | "url": "https://raw.githubusercontent.com/cypress-io/cypress/v9.5.3/cli/schema/cypress.schema.json" 139 | }, 140 | { 141 | "fileMatch": ["manifest.json"], 142 | "url": "https://json.schemastore.org/webextension.json" 143 | } 144 | ], 145 | "xml.server.preferBinary": true, 146 | // point to this specific version fixing the "condition" keys 147 | "yaml.schemas": { 148 | "https://bitbucket.org/atlassianlabs/atlascode/raw/f61ec5b742d3df75932b3c65d78e3c7e1cb67854/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml" 149 | }, 150 | // telemetry 151 | "telemetry.telemetryLevel": "off", 152 | "nxConsole.enableTelemetry": false, 153 | "partialDiff.enableTelemetry": false, 154 | "redhat.telemetry.enabled": false, 155 | // kakoune 156 | "dance.modes": { 157 | "normal": { 158 | "cursorStyle": "block", 159 | "lineNumbers": "inherit", 160 | "selectionBehavior": "character", 161 | "decorations": { 162 | "applyTo": "main", 163 | "backgroundColor": "$editor.hoverHighlightBackground", 164 | "isWholeLine": false 165 | }, 166 | "onEnterMode": [ 167 | [ 168 | ".selections.restore", 169 | { 170 | "register": " ^", 171 | "try": true 172 | } 173 | ] 174 | ], 175 | "onLeaveMode": [ 176 | [ 177 | ".selections.save", 178 | { 179 | "register": " ^", 180 | "style": { 181 | "borderColor": "$editor.selectionBackground", 182 | "borderStyle": "solid", 183 | "borderWidth": "2px", 184 | "borderRadius": "1px" 185 | }, 186 | "until": [ 187 | [ 188 | "mode-did-change", 189 | { 190 | "include": "normal" 191 | } 192 | ], 193 | ["selections-did-change"] 194 | ] 195 | } 196 | ] 197 | ] 198 | } 199 | }, 200 | "dance.menus": { 201 | "buffer": { 202 | "items": { 203 | "bf": { 204 | "text": "find", 205 | "command": "workbench.action.quickOpen" 206 | }, 207 | "j": { 208 | "text": "next", 209 | "command": "workbench.action.nextEditorInGroup" 210 | }, 211 | "k": { 212 | "text": "previous", 213 | "command": "workbench.action.previousEditorInGroup" 214 | }, 215 | "d": { 216 | "text": "delete", 217 | "command": "workbench.action.closeActiveEditor" 218 | }, 219 | "o": { 220 | "text": "delete others", 221 | "command": "workbench.action.closeOtherEditors" 222 | }, 223 | "c": { 224 | "text": "config", 225 | "command": "workbench.action.openSettingsJson" 226 | } 227 | } 228 | } 229 | ], 230 | } 231 | -------------------------------------------------------------------------------- /.config/GIMP/2.10/palettes/dracula.gpl: -------------------------------------------------------------------------------- 1 | GIMP Palette 2 | Name: Dracula 3 | # 4 | 40 42 54 #282A36 5 | 68 71 90 #44475A 6 | 98 114 164 #6272A4 7 | 248 248 242 #F8F8F2 8 | 139 233 253 #8BE9FD 9 | 80 250 123 #50FA7B 10 | 255 184 108 #FFB86C 11 | 255 121 198 #FF79C6 12 | 189 147 249 #BD93F9 13 | 255 85 85 #FF5555 14 | 241 250 140 #F1FA8C 15 | -------------------------------------------------------------------------------- /.config/XCompose: -------------------------------------------------------------------------------- 1 | # this file must be symlinked from $HOME or Emacs won't find it 2 | # ln -s .config/XCompose .XCompose 3 | 4 | # /usr/share/X11/locale/en_US.UTF-8/Compose 5 | include "%L" 6 | 7 | : "⁑" U2051 # TWO ASTERISKS ALIGNED VERTICALLY 8 | <2> : "⁑" U2051 # TWO ASTERISKS ALIGNED VERTICALLY 9 | <3> : "⁂" U2042 # ASTERISM 10 | : "∓" U2213 # MINOR-OR-PLUS SIGN 11 | 12 | # is lafayette quote 13 | : "⚑" U2691 # BLACK FLAG 14 | : "⚐" U2690 # WHITE FLAG 15 | : "⧗" U29D7 # BLACK HOURGLASS 16 | : "⧖" U29D6 # WHITE HOURGLASS 17 |

: "🯅" U1FBC5 # STICK FIGURE 18 | : "★" U2605 # BLACK STAR 19 | : "☆" U2606 # WHITE STAR 20 | 21 | # as to avoid overwritting existing like interrobang 22 | : "‼" U203C # DOUBLE EXCLAMATION MARK 23 | : "⁇" U2047 # DOUBLE QUESTION MARK 24 | : "⁈" U2048 # QUESTION EXCLAMATION MARK 25 | # damn emoji 26 | : "⁉" U2049 # EXCLAMATION QUESTION MARK 27 | 28 | -------------------------------------------------------------------------------- /.config/atuin/config.toml: -------------------------------------------------------------------------------- 1 | # https://github.com/atuinsh/atuin/blob/main/crates/atuin-client/config.toml 2 | 3 | ## where to store your database, default is your system data directory 4 | ## linux/mac: ~/.local/share/atuin/history.db 5 | ## windows: %USERPROFILE%/.local/share/atuin/history.db 6 | # db_path = "~/.history.db" 7 | 8 | ## where to store your encryption key, default is your system data directory 9 | ## linux/mac: ~/.local/share/atuin/key 10 | ## windows: %USERPROFILE%/.local/share/atuin/key 11 | # key_path = "~/.key" 12 | 13 | ## where to store your auth session token, default is your system data directory 14 | ## linux/mac: ~/.local/share/atuin/session 15 | ## windows: %USERPROFILE%/.local/share/atuin/session 16 | # session_path = "~/.session" 17 | 18 | ## date format used, either "us" or "uk" 19 | # dialect = "us" 20 | 21 | ## default timezone to use when displaying time 22 | ## either "l", "local" to use the system's current local timezone, or an offset 23 | ## from UTC in the format of "<+|->H[H][:M[M][:S[S]]]" 24 | ## for example: "+9", "-05", "+03:30", "-01:23:45", etc. 25 | # timezone = "local" 26 | 27 | ## enable or disable automatic sync 28 | # auto_sync = true 29 | 30 | ## enable or disable automatic update checks 31 | # update_check = true 32 | 33 | ## address of the sync server 34 | # sync_address = "https://api.atuin.sh" 35 | 36 | ## how often to sync history. note that this is only triggered when a command 37 | ## is ran, so sync intervals may well be longer 38 | ## set it to 0 to sync after every command 39 | # sync_frequency = "10m" 40 | 41 | ## which search mode to use 42 | ## possible values: prefix, fulltext, fuzzy, skim 43 | # search_mode = "fuzzy" 44 | 45 | ## which filter mode to use by default 46 | ## possible values: "global", "host", "session", "directory", "workspace" 47 | ## consider using search.filters to customize the enablement and order of filter modes 48 | # filter_mode = "global" 49 | 50 | ## With workspace filtering enabled, Atuin will filter for commands executed 51 | ## in any directory within a git repository tree (default: false). 52 | ## 53 | ## To use workspace mode by default when available, set this to true and 54 | ## set filter_mode to "workspace" or leave it unspecified and 55 | ## set search.filters to include "workspace" before other filter modes. 56 | # workspaces = false 57 | 58 | ## which filter mode to use when atuin is invoked from a shell up-key binding 59 | ## the accepted values are identical to those of "filter_mode" 60 | ## leave unspecified to use same mode set in "filter_mode" 61 | # filter_mode_shell_up_key_binding = "global" 62 | 63 | ## which search mode to use when atuin is invoked from a shell up-key binding 64 | ## the accepted values are identical to those of "search_mode" 65 | ## leave unspecified to use same mode set in "search_mode" 66 | # search_mode_shell_up_key_binding = "fuzzy" 67 | 68 | ## which style to use 69 | ## possible values: auto, full, compact 70 | # style = "auto" 71 | 72 | ## the maximum number of lines the interface should take up 73 | ## set it to 0 to always go full screen 74 | inline_height = 20 75 | 76 | ## Invert the UI - put the search bar at the top , Default to `false` 77 | invert = true 78 | 79 | ## enable or disable showing a preview of the selected command 80 | ## useful when the command is longer than the terminal width and is cut off 81 | # show_preview = true 82 | 83 | ## what to do when the escape key is pressed when searching 84 | ## possible values: return-original, return-query 85 | # exit_mode = "return-original" 86 | 87 | ## possible values: emacs, subl 88 | # word_jump_mode = "emacs" 89 | 90 | ## characters that count as a part of a word 91 | # word_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" 92 | 93 | ## number of context lines to show when scrolling by pages 94 | # scroll_context_lines = 1 95 | 96 | ## use ctrl instead of alt as the shortcut modifier key for numerical UI shortcuts 97 | ## alt-0 .. alt-9 98 | # ctrl_n_shortcuts = false 99 | 100 | ## default history list format - can also be specified with the --format arg 101 | # history_format = "{time}\t{command}\t{duration}" 102 | 103 | ## prevent commands matching any of these regexes from being written to history. 104 | ## Note that these regular expressions are unanchored, i.e. if they don't start 105 | ## with ^ or end with $, they'll match anywhere in the command. 106 | ## For details on the supported regular expression syntax, see 107 | ## https://docs.rs/regex/latest/regex/#syntax 108 | # history_filter = [ 109 | # "^secret-cmd", 110 | # "^innocuous-cmd .*--secret=.+", 111 | # ] 112 | history_filter = [ 113 | "^cd$", 114 | "^ll$", 115 | ] 116 | 117 | ## prevent commands run with cwd matching any of these regexes from being written 118 | ## to history. Note that these regular expressions are unanchored, i.e. if they don't 119 | ## start with ^ or end with $, they'll match anywhere in CWD. 120 | ## For details on the supported regular expression syntax, see 121 | ## https://docs.rs/regex/latest/regex/#syntax 122 | # cwd_filter = [ 123 | # "^/very/secret/area", 124 | # ] 125 | 126 | ## Configure the maximum height of the preview to show. 127 | ## Useful when you have long scripts in your history that you want to distinguish 128 | ## by more than the first few lines. 129 | # max_preview_height = 4 130 | 131 | ## Configure whether or not to show the help row, which includes the current Atuin 132 | ## version (and whether an update is available), a keymap hint, and the total 133 | ## amount of commands in your history. 134 | # show_help = true 135 | 136 | ## Configure whether or not to show tabs for search and inspect 137 | # show_tabs = true 138 | 139 | ## Configure whether or not the tabs row may be auto-hidden, which includes the current Atuin 140 | ## tab, such as Search or Inspector, and other tabs you may wish to see. This will 141 | ## only be hidden if there are fewer than this count of lines available, and does not affect the use 142 | ## of keyboard shortcuts to switch tab. 0 to never auto-hide, default is 8 (lines). 143 | ## This is ignored except in `compact` mode. 144 | # auto_hide_height = 8 145 | 146 | ## Defaults to true. This matches history against a set of default regex, and will not save it if we get a match. Defaults include 147 | ## 1. AWS key id 148 | ## 2. Github pat (old and new) 149 | ## 3. Slack oauth tokens (bot, user) 150 | ## 4. Slack webhooks 151 | ## 5. Stripe live/test keys 152 | # secrets_filter = true 153 | 154 | ## Defaults to true. If enabled, upon hitting enter Atuin will immediately execute the command. Press tab to return to the shell and edit. 155 | # This applies for new installs. Old installs will keep the old behaviour unless configured otherwise. 156 | enter_accept = true 157 | 158 | ## Defaults to "emacs". This specifies the keymap on the startup of `atuin 159 | ## search`. If this is set to "auto", the startup keymap mode in the Atuin 160 | ## search is automatically selected based on the shell's keymap where the 161 | ## keybinding is defined. If this is set to "emacs", "vim-insert", or 162 | ## "vim-normal", the startup keymap mode in the Atuin search is forced to be 163 | ## the specified one. 164 | # keymap_mode = "auto" 165 | 166 | ## Cursor style in each keymap mode. If specified, the cursor style is changed 167 | ## in entering the cursor shape. Available values are "default" and 168 | ## "{blink,steady}-{block,underline,bar}". 169 | # keymap_cursor = { emacs = "blink-block", vim_insert = "blink-block", vim_normal = "steady-block" } 170 | 171 | # network_connect_timeout = 5 172 | # network_timeout = 5 173 | 174 | ## Timeout (in seconds) for acquiring a local database connection (sqlite) 175 | # local_timeout = 5 176 | 177 | ## Set this to true and Atuin will minimize motion in the UI - timers will not update live, etc. 178 | ## Alternatively, set env NO_MOTION=true 179 | # prefers_reduced_motion = false 180 | 181 | [stats] 182 | ## Set commands where we should consider the subcommand for statistics. Eg, kubectl get vs just kubectl 183 | # common_subcommands = [ 184 | # "apt", 185 | # "cargo", 186 | # "composer", 187 | # "dnf", 188 | # "docker", 189 | # "git", 190 | # "go", 191 | # "ip", 192 | # "kubectl", 193 | # "nix", 194 | # "nmcli", 195 | # "npm", 196 | # "pecl", 197 | # "pnpm", 198 | # "podman", 199 | # "port", 200 | # "systemctl", 201 | # "tmux", 202 | # "yarn", 203 | # ] 204 | 205 | ## Set commands that should be totally stripped and ignored from stats 206 | # common_prefix = ["sudo"] 207 | 208 | ## Set commands that will be completely ignored from stats 209 | # ignored_commands = [ 210 | # "cd", 211 | # "ls", 212 | # "vi" 213 | # ] 214 | 215 | [keys] 216 | # Defaults to true. If disabled, using the up/down key won't exit the TUI when scrolled past the first/last entry. 217 | # scroll_exits = true 218 | 219 | [sync] 220 | # Enable sync v2 by default 221 | # This ensures that sync v2 is enabled for new installs only 222 | # In a later release it will become the default across the board 223 | records = true 224 | 225 | [preview] 226 | ## which preview strategy to use to calculate the preview height (respects max_preview_height). 227 | ## possible values: auto, static 228 | ## auto: length of the selected command. 229 | ## static: length of the longest command stored in the history. 230 | ## fixed: use max_preview_height as fixed height. 231 | # strategy = "auto" 232 | 233 | [daemon] 234 | ## Enables using the daemon to sync. Requires the daemon to be running in the background. Start it with `atuin daemon` 235 | # enabled = false 236 | 237 | ## How often the daemon should sync in seconds 238 | # sync_frequency = 300 239 | 240 | ## The path to the unix socket used by the daemon (on unix systems) 241 | ## linux/mac: ~/.local/share/atuin/atuin.sock 242 | ## windows: Not Supported 243 | # socket_path = "~/.local/share/atuin/atuin.sock" 244 | 245 | ## Use systemd socket activation rather than opening the given path (the path must still be correct for the client) 246 | ## linux: false 247 | ## mac/windows: Not Supported 248 | # systemd_socket = false 249 | 250 | ## The port that should be used for TCP on non unix systems 251 | # tcp_port = 8889 252 | 253 | # [theme] 254 | ## Color theme to use for rendering in the terminal. 255 | ## There are some built-in themes, including the base theme ("default"), 256 | ## "autumn" and "marine". You can add your own themes to the "./themes" subdirectory of your 257 | ## Atuin config (or ATUIN_THEME_DIR, if provided) as TOML files whose keys should be one or 258 | ## more of AlertInfo, AlertWarn, AlertError, Annotation, Base, Guidance, Important, and 259 | ## the string values as lowercase entries from this list: 260 | ## https://ogeon.github.io/docs/palette/master/palette/named/index.html 261 | ## If you provide a custom theme file, it should be called "NAME.toml" and the theme below 262 | ## should be the stem, i.e. `theme = "NAME"` for your chosen NAME. 263 | # name = "autumn" 264 | 265 | ## Whether the theme manager should output normal or extra information to help fix themes. 266 | ## Boolean, true or false. If unset, left up to the theme manager. 267 | # debug = true 268 | 269 | [search] 270 | ## The list of enabled filter modes, in order of priority. 271 | ## The "workspace" mode is skipped when not in a workspace or workspaces = false. 272 | ## Default filter mode can be overridden with the filter_mode setting. 273 | # filters = [ "global", "host", "session", "workspace", "directory" ] 274 | filters = [ "host", "session", "workspace", "directory" ] 275 | -------------------------------------------------------------------------------- /.config/bat/config: -------------------------------------------------------------------------------- 1 | --theme="Delacula" 2 | -------------------------------------------------------------------------------- /.config/bottom/bottom.toml: -------------------------------------------------------------------------------- 1 | # This is a default config file for bottom. All of the settings are commented 2 | # out by default; if you wish to change them uncomment and modify as you see 3 | # fit. 4 | 5 | # This group of options represents a command-line flag/option. Flags explicitly 6 | # added when running (ie: btm -a) will override this config file if an option 7 | # is also set here. 8 | 9 | [flags] 10 | # Whether to hide the average cpu entry. 11 | #hide_avg_cpu = false 12 | # Whether to use dot markers rather than braille. 13 | #dot_marker = false 14 | # The update rate of the application. 15 | #rate = 1000 16 | # Whether to put the CPU legend to the left. 17 | #left_legend = false 18 | # Whether to set CPU% on a process to be based on the total CPU or just current usage. 19 | #current_usage = false 20 | # Whether to set CPU% on a process to be based on the total CPU or per-core CPU% (not divided by the number of cpus). 21 | #unnormalized_cpu = false 22 | # Whether to group processes with the same name together by default. 23 | #group_processes = false 24 | # Whether to make process searching case sensitive by default. 25 | #case_sensitive = false 26 | # Whether to make process searching look for matching the entire word by default. 27 | #whole_word = false 28 | # Whether to make process searching use regex by default. 29 | #regex = false 30 | # Defaults to Celsius. Temperature is one of: 31 | #temperature_type = "k" 32 | #temperature_type = "f" 33 | #temperature_type = "c" 34 | #temperature_type = "kelvin" 35 | #temperature_type = "fahrenheit" 36 | #temperature_type = "celsius" 37 | # The default time interval (in milliseconds). 38 | #default_time_value = 60000 39 | # The time delta on each zoom in/out action (in milliseconds). 40 | #time_delta = 15000 41 | # Hides the time scale. 42 | #hide_time = false 43 | # Override layout default widget 44 | #default_widget_type = "proc" 45 | #default_widget_count = 1 46 | # Expand the default widget upon starting the app. 47 | #expanded_on_startup = true 48 | # Use basic mode 49 | #basic = false 50 | # Use the old network legend style 51 | #use_old_network_legend = false 52 | # Remove space in tables 53 | #hide_table_gap = false 54 | # Show the battery widgets 55 | battery = true 56 | # Disable mouse clicks 57 | #disable_click = false 58 | # Built-in themes. Valid values are "default", "default-light", "gruvbox", "gruvbox-light", "nord", "nord-light" 59 | #color = "default" 60 | # Show memory values in the processes widget as values by default 61 | #mem_as_value = false 62 | # Show tree mode by default in the processes widget. 63 | #tree = false 64 | # Shows an indicator in table widgets tracking where in the list you are. 65 | #show_table_scroll_position = false 66 | # Show processes as their commands by default in the process widget. 67 | #process_command = false 68 | # Displays the network widget with binary prefixes. 69 | #network_use_binary_prefix = false 70 | # Displays the network widget using bytes. 71 | #network_use_bytes = false 72 | # Displays the network widget with a log scale. 73 | #network_use_log = false 74 | # Hides advanced options to stop a process on Unix-like systems. 75 | #disable_advanced_kill = false 76 | # Shows GPU(s) memory 77 | #enable_gpu_memory = false 78 | # How much data is stored at once in terms of time. 79 | #retention = "10m" 80 | 81 | # These are all the components that support custom theming. Note that colour support 82 | # will depend on terminal support. 83 | 84 | #[colors] # Uncomment if you want to use custom colors 85 | # Represents the colour of table headers (processes, CPU, disks, temperature). 86 | #table_header_color="LightBlue" 87 | # Represents the colour of the label each widget has. 88 | #widget_title_color="Gray" 89 | # Represents the average CPU color. 90 | #avg_cpu_color="Red" 91 | # Represents the colour the core will use in the CPU legend and graph. 92 | #cpu_core_colors=["LightMagenta", "LightYellow", "LightCyan", "LightGreen", "LightBlue", "LightRed", "Cyan", "Green", "Blue", "Red"] 93 | # Represents the colour RAM will use in the memory legend and graph. 94 | #ram_color="LightMagenta" 95 | # Represents the colour SWAP will use in the memory legend and graph. 96 | #swap_color="LightYellow" 97 | # Represents the colour ARC will use in the memory legend and graph. 98 | #arc_color="LightCyan" 99 | # Represents the colour the GPU will use in the memory legend and graph. 100 | #gpu_core_colors=["LightGreen", "LightBlue", "LightRed", "Cyan", "Green", "Blue", "Red"] 101 | # Represents the colour rx will use in the network legend and graph. 102 | #rx_color="LightCyan" 103 | # Represents the colour tx will use in the network legend and graph. 104 | #tx_color="LightGreen" 105 | # Represents the colour of the border of unselected widgets. 106 | #border_color="Gray" 107 | # Represents the colour of the border of selected widgets. 108 | #highlighted_border_color="LightBlue" 109 | # Represents the colour of most text. 110 | #text_color="Gray" 111 | # Represents the colour of text that is selected. 112 | #selected_text_color="Black" 113 | # Represents the background colour of text that is selected. 114 | #selected_bg_color="LightBlue" 115 | # Represents the colour of the lines and text of the graph. 116 | #graph_color="Gray" 117 | # Represents the colours of the battery based on charge 118 | #high_battery_color="green" 119 | #medium_battery_color="yellow" 120 | #low_battery_color="red" 121 | 122 | # Layout - layouts follow a pattern like this: 123 | # [[row]] represents a row in the application. 124 | # [[row.child]] represents either a widget or a column. 125 | # [[row.child.child]] represents a widget. 126 | # 127 | # All widgets must have the type value set to one of ["cpu", "mem", "proc", "net", "temp", "disk", "empty"]. 128 | # All layout components have a ratio value - if this is not set, then it defaults to 1. 129 | # The default widget layout: 130 | #[[row]] 131 | # ratio=30 132 | # [[row.child]] 133 | # type="cpu" 134 | #[[row]] 135 | # ratio=40 136 | # [[row.child]] 137 | # ratio=4 138 | # type="mem" 139 | # [[row.child]] 140 | # ratio=3 141 | # [[row.child.child]] 142 | # type="temp" 143 | # [[row.child.child]] 144 | # type="disk" 145 | #[[row]] 146 | # ratio=30 147 | # [[row.child]] 148 | # type="net" 149 | # [[row.child]] 150 | # type="proc" 151 | # default=true 152 | 153 | # Filters - you can hide specific temperature sensors, network interfaces, and disks using filters. This is admittedly 154 | # a bit hard to use as of now, and there is a planned in-app interface for managing this in the future: 155 | #[disk_filter] 156 | #is_list_ignored = true 157 | #list = ["/dev/sda\\d+", "/dev/nvme0n1p2"] 158 | #regex = true 159 | #case_sensitive = false 160 | #whole_word = false 161 | 162 | #[mount_filter] 163 | #is_list_ignored = true 164 | #list = ["/mnt/.*", "/boot"] 165 | #regex = true 166 | #case_sensitive = false 167 | #whole_word = false 168 | 169 | #[temp_filter] 170 | #is_list_ignored = true 171 | #list = ["cpu", "wifi"] 172 | #regex = false 173 | #case_sensitive = false 174 | #whole_word = false 175 | 176 | #[net_filter] 177 | #is_list_ignored = true 178 | #list = ["virbr0.*"] 179 | #regex = true 180 | #case_sensitive = false 181 | #whole_word = false 182 | -------------------------------------------------------------------------------- /.config/broot/conf.toml: -------------------------------------------------------------------------------- 1 | [[verbs]] 2 | name = "view" 3 | invocation = "view" 4 | shortcut = "v" 5 | execution = "bat {file}" 6 | 7 | [[verbs]] 8 | key = "alt-l" 9 | name = "edit" 10 | invocation = "edit" 11 | shortcut = "e" 12 | execution = "kak {file}" 13 | 14 | [[verbs]] 15 | key = "alt-h" 16 | execution = ":back" 17 | 18 | [[verbs]] 19 | key = "alt-j" 20 | execution = ":line_down" 21 | 22 | [[verbs]] 23 | key = "alt-k" 24 | execution = ":line_up" 25 | -------------------------------------------------------------------------------- /.config/containers/registries.conf: -------------------------------------------------------------------------------- 1 | # see /etc/containers/registries.conf 2 | 3 | [registries.search] 4 | registries = [ 5 | 'docker.io', 6 | 'quay.io', 7 | ] 8 | -------------------------------------------------------------------------------- /.config/doom/config.el: -------------------------------------------------------------------------------- 1 | ;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- 2 | ;;; https://github.com/doomemacs/doomemacs/blob/master/templates/config.example.el 3 | 4 | ;; Place your private configuration here! Remember, you do not need to run 'doom 5 | ;; sync' after modifying this file! 6 | 7 | (load! "private.el") 8 | (load! "theme.el") 9 | (load! "date.el") 10 | (load! "describe.el") 11 | (load! "doom-modeline.el") 12 | (load! "org.el") 13 | (load! "org-agenda.el") 14 | (load! "org-roam.el") 15 | (load! "org-roam-ql.el") 16 | (load! "org-property-drawer.el") 17 | (load! "fetcher.el") 18 | (load! "marginalia.el") 19 | 20 | ;; Some functionality uses this to identify you, e.g. GPG configuration, email 21 | ;; clients, file templates and snippets. It is optional. 22 | (setq user-full-name "Delapouite" 23 | user-mail-address "delapouite@gmail.com") 24 | 25 | 26 | ;; If you use `org' and don't want your org files in the default location below, 27 | ;; change `org-directory'. It must be set before org loads! 28 | (setq org-directory "~/Sync/org/") 29 | 30 | ;; This determines the style of line numbers in effect. If set to `nil', line 31 | ;; numbers are disabled. For relative line numbers, set this to `relative'. 32 | (setq display-line-numbers-type nil) 33 | (setq scroll-margin 10) 34 | 35 | ;; Whenever you reconfigure a package, make sure to wrap your config in an 36 | ;; `after!' block, otherwise Doom's defaults may override your settings. E.g. 37 | ;; 38 | ;; (after! PACKAGE 39 | ;; (setq x y)) 40 | ;; 41 | ;; The exceptions to this rule: 42 | ;; 43 | ;; - Setting file/directory variables (like `org-directory') 44 | ;; - Setting variables which explicitly tell you to set them before their 45 | ;; package is loaded (see 'C-h v VARIABLE' to look up their documentation). 46 | ;; - Setting doom variables (which start with 'doom-' or '+'). 47 | ;; 48 | ;; Here are some additional functions/macros that will help you configure Doom. 49 | ;; 50 | ;; - `load!' for loading external *.el files relative to this one 51 | ;; - `use-package!' for configuring packages 52 | ;; - `after!' for running code after a package has loaded 53 | ;; - `add-load-path!' for adding directories to the `load-path', relative to 54 | ;; this file. Emacs searches the `load-path' when you load packages with 55 | ;; `require' or `use-package'. 56 | ;; - `map!' for binding new keys 57 | ;; 58 | ;; To get information about any of these functions/macros, move the cursor over 59 | ;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). 60 | ;; This will open documentation for it, including demos of how they are used. 61 | ;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces, 62 | ;; etc). 63 | ;; 64 | ;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how 65 | ;; they are implemented. 66 | 67 | (map! :n "q" #'evil-backward-word-begin 68 | :n "Q" #'evil-backward-WORD-begin 69 | :n "U" #'evil-redo 70 | :n "b d" #'kill-current-buffer 71 | :n "b n" #'next-buffer 72 | :n "b p" #'previous-buffer 73 | :n "b s" #'save-buffer) 74 | (map! :leader :desc "M-x" "SPC" #'execute-extended-command 75 | :leader :desc "Fetch stats" "j" #'my/fetch-stats 76 | :leader :desc "Clip Link" "k" #'my/org-cliplink 77 | :leader :desc "Toggle org-link-display" "t k" #'org-toggle-link-display) 78 | 79 | (setq company-selection-wrap-around t) 80 | (setq completion-ignore-case t) 81 | 82 | (use-package! org-download 83 | :config 84 | (setq-default org-download-image-dir "~/.cache/org-download") 85 | (org-download-enable)) 86 | 87 | ; org-babel 88 | 89 | (setq org-plantuml-exec-mode 'plantuml) 90 | (add-to-list 'org-src-lang-modes '("plantuml" . plantuml)) 91 | 92 | (org-babel-do-load-languages 93 | 'org-babel-load-languages 94 | '((lilypond . t) 95 | (plantuml . t) 96 | (emacs-lisp . nil))) 97 | 98 | (defun my/search-cwd (prefix) 99 | (defun my/search-cwd-internal () (insert prefix)) 100 | (minibuffer-with-setup-hook #'my/search-cwd-internal (call-interactively #'+default/search-cwd))) 101 | 102 | (require 'ol-man) 103 | 104 | (setq ispell-personal-dictionary "~/Sync/ispell.dictionary") 105 | 106 | (defun my/rename-file-and-buffer (&optional new-name) 107 | "Rename the current buffer and file it is visiting." 108 | (interactive) 109 | (let ((filename (buffer-file-name))) 110 | (if (not (and filename (file-exists-p filename))) 111 | (message "Buffer is not visiting a file!") 112 | (unless new-name (setq new-name (read-file-name "New name: " filename))) 113 | (cond 114 | ((vc-backend filename) (vc-rename-file filename new-name)) 115 | (t 116 | (rename-file filename new-name t) 117 | (set-visited-file-name new-name t t)))))) 118 | 119 | (defun my/rename-file-plus () 120 | (interactive) 121 | (my/rename-file-and-buffer (s-replace "_" "·" (buffer-file-name))) 122 | (setq org-property-format "%-4s %s") 123 | (org-set-property "id" (s-replace " + " "·" (org-id-get))) 124 | (org-roam-set-keyword "title" (s-replace " + " "·" (org-get-title)))) 125 | 126 | (defun my/rename-file-vs () 127 | (interactive) 128 | (my/rename-file-and-buffer (s-replace "_vs_" "·" (buffer-file-name))) 129 | (setq org-property-format "%-4s %s") 130 | (org-set-property "id" (s-replace " vs " "·" (org-id-get))) 131 | (org-roam-set-keyword "title" (s-replace " vs " "·" (org-get-title)))) 132 | 133 | (use-package! olivetti 134 | :config 135 | (setq olivetti-minimum-body-width 120) 136 | :hook (org-mode . olivetti-mode)) 137 | -------------------------------------------------------------------------------- /.config/doom/date.el: -------------------------------------------------------------------------------- 1 | ;;; date.el -*- lexical-binding: t; -*- 2 | 3 | (defun iso8601-format (&optional time) 4 | "Format time string with %FT%T%z TIME" 5 | (format-time-string "%FT%T%z" time)) 6 | 7 | (defun iso8601-to-epoch (&optional iso) 8 | "Parse iso8601 string to unix epoch timestamp" 9 | (string-to-number (format-time-string "%s" (if iso (date-to-time iso))))) 10 | 11 | (defun iso8601-diff-days (iso) 12 | "Return the number of days between today and ISO" 13 | (let ((now (iso8601-to-epoch)) 14 | (past (iso8601-to-epoch iso))) 15 | (/ (- now past) 86400))) 16 | -------------------------------------------------------------------------------- /.config/doom/describe.el: -------------------------------------------------------------------------------- 1 | ;;; describe.el -*- lexical-binding: t; -*- 2 | 3 | ;; Related to help map 4 | 5 | (map! :leader :desc "Describe alias" "d a" #'describe-alias 6 | :leader :desc "Describe abbrev" "d A" #'list-abbrevs 7 | :leader :desc "Describe binding" "d b" #'describe-bindings 8 | :leader :desc "Describe char" "d c" #'describe-char 9 | :leader :desc "Describe face" "d F" #'describe-face 10 | :leader :desc "Describe key" "d k" #'describe-key 11 | :leader :desc "Describe keymap" "d K" #'describe-keymap 12 | :leader :desc "Describe mode" "d m" #'describe-mode 13 | :leader :desc "Describe package" "d p" #'describe-package 14 | :leader :desc "Describe text-properties" "d t" #'describe-text-properties 15 | :leader :desc "Describe theme" "d T" #'describe-theme 16 | :leader :desc "Describe variable" "d v" #'describe-variable 17 | :leader :desc "Describe widget" "d w" #'describe-widget 18 | 19 | :leader :desc "Describe function" "d f f" #'describe-function 20 | :leader :desc "Describe builtin function" "d f b" #'describe-builtin-function 21 | :leader :desc "Describe non-obsolete function" "d f n" #'describe-non-obsolete-function 22 | :leader :desc "Describe obsolete function" "d f o" #'describe-obsolete-function 23 | 24 | :leader :desc "Describe command" "d x x" #'describe-command 25 | :leader :desc "Describe builtin command" "d x b" #'describe-builtin-command 26 | :leader :desc "Describe non-obsolete command" "d x n" #'describe-non-obsolete-command 27 | :leader :desc "Describe obsolete command" "d x o" #'describe-obsolete-command) 28 | 29 | (defun obsolete-p (symbol) 30 | "Return non nil if SYMBOL is obsolete" 31 | (or (plist-member (symbol-plist symbol) 'byte-obsolete-info) 32 | (plist-member (symbol-plist symbol) 'byte-obsolete-variable))) 33 | 34 | (defun my/describe-function-prompt (predicate) 35 | "Prompt for a function from `describe-function' with PREDICATE." 36 | (let* ((fn (function-called-at-point)) 37 | (prompt (format-prompt "Describe function" fn)) 38 | (enable-recursive-minibuffers t) 39 | (val (completing-read prompt 40 | #'help--symbol-completion-table 41 | predicate 42 | t nil nil 43 | (and fn (symbol-name fn))))) 44 | (unless (equal val "") 45 | (setq fn (intern val))) 46 | (unless (and fn (symbolp fn)) 47 | (user-error "You didn't specify a function's symbol")) 48 | (unless (or (fboundp fn) (get fn 'function-documentation)) 49 | (user-error "Symbol's function definition is void: %s" fn)) 50 | (list fn))) 51 | 52 | (defun my/describe-command-prompt (predicate) 53 | "Prompt for a function from `describe-command' with PREDICATE." 54 | (let* ((fn (caar command-history)) 55 | (prompt (format-prompt "Describe command" fn)) 56 | (enable-recursive-minibuffers t) 57 | (val (completing-read prompt 58 | #'help--symbol-completion-table 59 | predicate 60 | t nil nil 61 | (and fn (symbol-name fn))))) 62 | (unless (equal val "") 63 | (setq fn (intern val))) 64 | (unless (and fn (symbolp fn)) 65 | (user-error "You didn't specify a command's symbol")) 66 | (unless (or (fboundp fn) (get fn 'function-documentation)) 67 | (user-error "Symbol is not a command: %s" fn)) 68 | (list fn))) 69 | 70 | (defun describe-alias (fun) 71 | "Display the full documentation of aliased FUNCTION (a symbol). 72 | When called from Lisp, FUNCTION may also be a function object." 73 | (interactive (my/describe-function-prompt 74 | (lambda (f) 75 | (and (function-alias-p f) 76 | (or (fboundp f) (get f 'function-documentation)))))) 77 | (describe-function fun)) 78 | 79 | (defun describe-obsolete-function (fun) 80 | "Display the full documentation of obsolete FUNCTION (a symbol). 81 | When called from Lisp, FUNCTION may also be a function object." 82 | (interactive (my/describe-function-prompt 83 | (lambda (f) 84 | (and (obsolete-p f) 85 | (or (fboundp f) (get f 'function-documentation)))))) 86 | (describe-function fun)) 87 | 88 | (defun describe-non-obsolete-function (fun) 89 | "Display the full documentation of obsolete FUNCTION (a symbol). 90 | When called from Lisp, FUNCTION may also be a function object." 91 | (interactive (my/describe-function-prompt 92 | (lambda (f) 93 | (and (not (obsolete-p f)) 94 | (or (fboundp f) (get f 'function-documentation)))))) 95 | (describe-function fun)) 96 | 97 | (defun describe-obsolete-command (command) 98 | "Display the full documentation of obsolete COMMAND (a symbol). 99 | When called from Lisp, COMMAND may also be a function object." 100 | (interactive (my/describe-command-prompt 101 | (lambda (f) 102 | (and (obsolete-p f) 103 | (commandp f))))) 104 | (describe-command command)) 105 | 106 | (defun describe-non-obsolete-command (command) 107 | "Display the full documentation of obsolete COMMAND (a symbol). 108 | When called from Lisp, COMMAND may also be a function object." 109 | (interactive (my/describe-command-prompt 110 | (lambda (f) 111 | (and (not (obsolete-p f)) 112 | (commandp f))))) 113 | (describe-command command)) 114 | 115 | (defun describe-builtin-function (fun) 116 | "Display the full documentation of builtin FUNCTION (a symbol). 117 | When called from Lisp, FUNCTION may also be a function object." 118 | (interactive (my/describe-function-prompt 119 | (lambda (f) 120 | (and (subrp (symbol-function f)) 121 | (or (fboundp f) (get f 'function-documentation)))))) 122 | (describe-function fun)) 123 | 124 | (defun describe-builtin-command (command) 125 | "Display the full documentation of builtin COMMAND (a symbol). 126 | When called from Lisp, COMMAND may also be a function object." 127 | (interactive (my/describe-command-prompt 128 | (lambda (f) 129 | (and (subrp (symbol-function f)) 130 | (commandp f))))) 131 | (describe-command command)) 132 | -------------------------------------------------------------------------------- /.config/doom/doom-modeline.el: -------------------------------------------------------------------------------- 1 | ;;; doom-modeline.el -*- lexical-binding: t; -*- 2 | ;;; https://github.com/seagle0128/doom-modeline 3 | ;;; https://github.com/doomemacs/doomemacs/tree/master/modules/ui/modeline 4 | 5 | (use-package! doom-modeline 6 | :config 7 | 8 | (setq doom-modeline-total-line-number t) 9 | (setq doom-modeline-enable-word-count t) 10 | 11 | (defun get-buffer-file-mtime () 12 | (let ((mtime (file-attribute-modification-time 13 | (file-attributes (buffer-file-name))))) 14 | (when mtime (iso8601-format mtime)))) 15 | 16 | (defun get-mtime-face (mtime) 17 | "Select a face in a gradient depending on decay" 18 | (let ((days (iso8601-diff-days mtime))) 19 | (cond ((> days 300) 'error) 20 | ((> days 180) 'warning) 21 | ((< days 30) 'success) 22 | (t 'mode-line)))) 23 | 24 | (doom-modeline-def-segment buffer-mtime 25 | "Define buffer-mtime modeline segment" 26 | (let* ((mtime (get-buffer-file-mtime)) 27 | (days (iso8601-diff-days mtime)) 28 | (face (get-mtime-face mtime))) 29 | (concat (doom-modeline-wspc) 30 | (propertize (concat mtime " " (number-to-string days) "d") 'face face)))) 31 | 32 | (doom-modeline-def-segment org-roam-node-segment 33 | "Define org-roam modeline segment using node property accessors" 34 | (letrec ((node (org-roam-node-from-id (org-with-point-at 1 (org-id-get)))) 35 | (links (if node (org-roam-node-links-count node) "")) 36 | (backlinks (if node (org-roam-node-backlinks-count node) "")) 37 | (wikipedia-links (if node (org-roam-node-wikipedia-links-count node) "")) 38 | (social-links (if node (org-roam-node-social-links-count node) "")) 39 | (stage (if node (org-roam-node-stage node) "")) 40 | (interest (if node (org-roam-node-interest node) "")) 41 | (upgraded-at (if node (org-roam-node-upgraded-at node) "")) 42 | (combos (if node (org-roam-node-combos node) "")) 43 | (tags (if node (org-roam-node-template-tags node) ""))) 44 | (concat (doom-modeline-wspc) 45 | (propertize backlinks 'face (if (string-prefix-p "0" backlinks) 'error 'mode-line)) 46 | "→ →" (propertize links 'face (if (string-prefix-p "0" links) 'error 'mode-line)) 47 | " w" (propertize wikipedia-links 'face (if (string-prefix-p "0" wikipedia-links) 'error 'mode-line)) 48 | " s" (propertize social-links 'face (if (string-prefix-p "0" social-links) 'error 'mode-line)) 49 | " ∧" (propertize stage 'face 'mode-line) 50 | " ★" (propertize interest 'face 'mode-line) 51 | " ↑" (propertize upgraded-at 'face 'mode-line) 52 | " " (propertize combos 'face 'mode-line) 53 | " " (propertize tags 'face 'mode-line) 54 | ))) 55 | 56 | ;; look at the 50+ doom-modeline-segment--* functions to discover possible segments 57 | (doom-modeline-def-modeline 'my-modeline 58 | '(bar window-number modals matches buffer-info-simple buffer-mtime buffer-position word-count selection-info) 59 | '(org-roam-node-segment objed-state misc-info debug lsp minor-modes input-method indent-info major-mode process check)) 60 | 61 | (defun doom-modeline-set-my-modeline () 62 | "Enable my modeline" 63 | (interactive) 64 | (doom-modeline-set-modeline 'my-modeline)) 65 | 66 | (add-hook 'org-mode-hook `doom-modeline-set-my-modeline)) 67 | -------------------------------------------------------------------------------- /.config/doom/init.el: -------------------------------------------------------------------------------- 1 | ;;; init.el -*- lexical-binding: t; -*- 2 | ;;; https://github.com/doomemacs/doomemacs/blob/master/templates/init.example.el 3 | 4 | ;; This file controls what Doom modules are enabled and what order they load 5 | ;; in. Remember to run 'doom sync' after modifying it! 6 | 7 | ;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's 8 | ;; documentation. There you'll find a link to Doom's Module Index where all 9 | ;; of our modules are listed, including what flags they support. 10 | 11 | ;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or 12 | ;; 'C-c c k' for non-vim users) to view its documentation. This works on 13 | ;; flags as well (those symbols that start with a plus). 14 | ;; 15 | ;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its 16 | ;; directory (for easy access to its source code). 17 | 18 | (doom! :input 19 | ;;bidi ; (tfel ot) thgir etirw uoy gnipleh 20 | ;;chinese 21 | ;;japanese 22 | ;;layout ; auie,ctsrnm is the superior home row 23 | 24 | :completion 25 | (company +childframe); the ultimate code completion backend 26 | ;;helm ; the *other* search engine for love and life 27 | ;;ido ; the other *other* search engine... 28 | ;;(ivy +prescient) ; a search engine for love and life 29 | vertico ; the search engine of the future 30 | 31 | :ui 32 | ;;deft ; notational velocity for Emacs 33 | doom ; what makes DOOM look the way it does 34 | doom-dashboard ; a nifty splash screen for Emacs 35 | doom-quit ; DOOM quit-message prompts when you quit Emacs 36 | (emoji +unicode) ; 🙂 37 | hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW 38 | ;;hydra 39 | ;;indent-guides ; highlighted indent columns 40 | ;;ligatures ; ligatures and symbols to make your code pretty again 41 | ;;minimap ; show a map of the code on the side 42 | modeline ; snazzy, Atom-inspired modeline, plus API 43 | nav-flash ; blink cursor line after big motions 44 | ;;neotree ; a project drawer, like NERDTree for vim 45 | ophints ; highlight the region an operation acts on 46 | (popup +defaults) ; tame sudden yet inevitable temporary windows 47 | ;;tabs ; a tab bar for Emacs 48 | ;;treemacs ; a project drawer, like neotree but cooler 49 | ;;unicode ; extended unicode support for various languages 50 | (vc-gutter +pretty) ; vcs diff in the fringe 51 | vi-tilde-fringe ; fringe tildes to mark beyond EOB 52 | ;;window-select ; visually switch windows 53 | workspaces ; tab emulation, persistence & separate workspaces 54 | ;;zen ; distraction-free coding or writing 55 | 56 | :editor 57 | (evil +everywhere) ; come to the dark side, we have cookies 58 | file-templates ; auto-snippets for empty files 59 | fold ; (nigh) universal code folding 60 | ;;(format +onsave) ; automated prettiness 61 | ;;god ; run Emacs commands without modifier keys 62 | ;;lispy ; vim for lisp, for people who don't like vim 63 | ;;multiple-cursors ; editing in many places at once 64 | ;;objed ; text object editing for the innocent 65 | ;;parinfer ; turn lisp into python, sort of 66 | ;;rotate-text ; cycle region at point between text candidates 67 | snippets ; my elves. They type so I don't have to 68 | ;;word-wrap ; soft wrapping with language-aware indent 69 | 70 | :emacs 71 | dired ; making dired pretty [functional] 72 | electric ; smarter, keyword-based electric-indent 73 | ;;ibuffer ; interactive buffer management 74 | undo ; persistent, smarter undo for your inevitable mistakes 75 | vc ; version-control and Emacs, sitting in a tree 76 | 77 | :term 78 | ;;eshell ; the elisp shell that works everywhere 79 | ;;shell ; simple shell REPL for Emacs 80 | ;;term ; basic terminal emulator for Emacs 81 | ;;vterm ; the best terminal emulation in Emacs 82 | 83 | :checkers 84 | syntax ; tasing you for every semicolon you forget 85 | (spell +flyspell +hunspell) ; tasing you for misspelling mispelling 86 | ;;grammar ; tasing grammar mistake every you make 87 | 88 | :tools 89 | ;;ansible 90 | ;;biblio ; Writes a PhD for you (citation needed) 91 | ;;debugger ; FIXME stepping through code, to help you add bugs 92 | ;;direnv 93 | docker 94 | ;;editorconfig ; let someone else argue about tabs vs spaces 95 | ;;ein ; tame Jupyter notebooks with emacs 96 | (eval +overlay) ; run code, run (also, repls) 97 | ;;gist ; interacting with github gists 98 | lookup ; navigate your code and its documentation 99 | ;;lsp ; M-x vscode 100 | magit ; a git porcelain for Emacs 101 | ;;make ; run make tasks from Emacs 102 | ;;pass ; password manager for nerds 103 | ;;pdf ; pdf enhancements 104 | ;;prodigy ; FIXME managing external services & code builders 105 | ;;rgb ; creating color strings 106 | ;;taskrunner ; taskrunner for all your projects 107 | terraform ; infrastructure as code 108 | ;;tmux ; an API for interacting with tmux 109 | ;;tree-sitter ; syntax and parsing, sitting in a tree... 110 | ;;upload ; map local to remote projects via ssh/ftp 111 | 112 | :os 113 | (:if IS-MAC macos) ; improve compatibility with macOS 114 | ;;tty ; improve the terminal Emacs experience 115 | 116 | :lang 117 | ;;agda ; types of types of types of types... 118 | ;;beancount ; mind the GAAP 119 | ;;(cc +lsp) ; C > C++ == 1 120 | clojure ; java with a lisp 121 | ;;common-lisp ; if you've seen one lisp, you've seen them all 122 | ;;coq ; proofs-as-programs 123 | ;;crystal ; ruby at the speed of c 124 | ;;csharp ; unity, .NET, and mono shenanigans 125 | ;;data ; config/data formats 126 | ;;(dart +flutter) ; paint ui and not much else 127 | ;;dhall 128 | ;;elixir ; erlang done right 129 | ;;elm ; care for a cup of TEA? 130 | emacs-lisp ; drown in parentheses 131 | ;;erlang ; an elegant language for a more civilized age 132 | ;;ess ; emacs speaks statistics 133 | ;;factor 134 | ;;faust ; dsp, but you get to keep your soul 135 | ;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER) 136 | ;;fsharp ; ML stands for Microsoft's Language 137 | ;;fstar ; (dependent) types and (monadic) effects and Z3 138 | ;;gdscript ; the language you waited for 139 | (go +lsp) ; the hipster dialect 140 | ;;(graphql +lsp) ; Give queries a REST 141 | ;;(haskell +lsp) ; a language that's lazier than I am 142 | ;;hy ; readability of scheme w/ speed of python 143 | ;;idris ; a language you can depend on 144 | json ; At least it ain't XML 145 | ;;(java +lsp) ; the poster child for carpal tunnel syndrome 146 | javascript ; all(hope(abandon(ye(who(enter(here)))))) 147 | ;;julia ; a better, faster MATLAB 148 | ;;kotlin ; a better, slicker Java(Script) 149 | ;;latex ; writing papers in Emacs has never been so fun 150 | ;;lean ; for folks with too much to prove 151 | ;;ledger ; be audit you can be 152 | lua ; one-based indices? one-based indices 153 | markdown ; writing docs for people to ignore 154 | ;;nim ; python + lisp at the speed of c 155 | ;;nix ; I hereby declare "nix geht mehr!" 156 | ;;ocaml ; an objective camel 157 | (org +roam2 +present) ; organize your plain life in plain text 158 | ;;php ; perl's insecure younger brother 159 | plantuml ; diagrams for confusing people more 160 | ;;purescript ; javascript, but functional 161 | ;;python ; beautiful is better than ugly 162 | ;;qt ; the 'cutest' gui framework ever 163 | ;;racket ; a DSL for DSLs 164 | ;;raku ; the artist formerly known as perl6 165 | ;;rest ; Emacs as a REST client 166 | ;;rst ; ReST in peace 167 | ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} 168 | (rust +lsp) ; Fe2O3.unwrap().unwrap().unwrap().unwrap() 169 | ;;scala ; java, but good 170 | ;;(scheme +guile) ; a fully conniving family of lisps 171 | sh ; she sells {ba,z,fi}sh shells on the C xor 172 | ;;sml 173 | ;;solidity ; do you need a blockchain? No. 174 | ;;swift ; who asked for emoji variables? 175 | ;;terra ; Earth and Moon in alignment for performance. 176 | web ; the tubes 177 | yaml ; JSON, but readable 178 | ;;zig ; C, but simpler 179 | 180 | :email 181 | ;;(mu4e +org +gmail) 182 | ;;notmuch 183 | ;;(wanderlust +gmail) 184 | 185 | :app 186 | ;;calendar 187 | ;;emms 188 | ;;everywhere ; *leave* Emacs!? You must be joking 189 | ;;irc ; how neckbeards socialize 190 | rss ; emacs as an RSS reader 191 | ;;twitter ; twitter client https://twitter.com/vnought 192 | 193 | :config 194 | ;;literate 195 | (default +bindings +smartparens)) 196 | -------------------------------------------------------------------------------- /.config/doom/marginalia.el: -------------------------------------------------------------------------------- 1 | ;;; marginalia.el -*- lexical-binding: t; -*- 2 | ;;; https://github.com/minad/marginalia/ 3 | 4 | (use-package! marginalia 5 | :config 6 | (add-to-list 'marginalia-prompt-categories '("\\" . function)) 7 | 8 | (defun marginalia--function-location (func) 9 | (let ((res (find-lisp-object-file-name func (symbol-function func)))) 10 | (if (symbolp res) (symbol-name res) (f-base res)))) 11 | 12 | (defun marginalia-annotate-function (cand) 13 | "Annotate function CAND with its documentation string." 14 | (when-let (sym (intern-soft cand)) 15 | (when (fboundp sym) 16 | (marginalia--fields 17 | (:left (marginalia-annotate-binding cand)) 18 | ((marginalia--symbol-class sym) :face 'marginalia-type) 19 | ((marginalia--function-args sym) :face 'marginalia-value :truncate 0.7) 20 | ((marginalia--function-doc sym) :face 'marginalia-documentation :truncate 1.0) 21 | ((marginalia--function-location sym) :face 'marginalia-file-name :truncate 0.5)))))) 22 | -------------------------------------------------------------------------------- /.config/doom/org-agenda.el: -------------------------------------------------------------------------------- 1 | ;;; org-agenda.el -*- lexical-binding: t; -*- 2 | 3 | (defun my/org-todos-p () 4 | "Return non-nil if current buffer has any todo entry. 5 | 6 | TODO entries marked as done are ignored, meaning that this 7 | function returns nil if current buffer contains only completed tasks." 8 | (seq-find 9 | (lambda (type) (eq type 'todo)) 10 | (org-element-map 11 | (org-element-parse-buffer 'headline) 12 | 'headline 13 | (lambda (h) (org-element-property :todo-type h))))) 14 | 15 | (defun my/org-update-agenda-tag () 16 | "Update AGENDA tag in the current buffer." 17 | (when (and (not (active-minibuffer-window)) 18 | (org-roam-buffer-p)) 19 | (save-excursion 20 | (goto-char (point-min)) 21 | (let* ((tags (my/org-get-filetags)) 22 | (original-tags tags)) 23 | (if (my/org-todos-p) 24 | (setq tags (cons "agenda" tags)) 25 | (setq tags (remove "agenda" tags))) 26 | 27 | ;; cleanup duplicates 28 | (setq tags (seq-uniq tags)) 29 | 30 | ;; update tags if changed 31 | (when (or (seq-difference tags original-tags) 32 | (seq-difference original-tags tags)) 33 | (my/org-set-filetags tags)))))) 34 | 35 | (defun my/org-agenda-files () 36 | "Return a list of note files containing 'agenda' tag." ; 37 | (seq-uniq 38 | (seq-map 39 | #'car 40 | (org-roam-db-query 41 | [:select [nodes:file] 42 | :from tags 43 | :left-join nodes 44 | :on (= tags:node-id nodes:id) 45 | :where (like tag (quote "%\"agenda\"%"))])))) 46 | 47 | (defun my/org-agenda-files-update (&rest _) 48 | "Update the value of `org-agenda-files'." 49 | (interactive) 50 | (setq org-agenda-files (my/org-agenda-files))) 51 | 52 | (add-hook 'before-save-hook #'my/org-update-agenda-tag) 53 | (advice-add 'org-agenda :before #'my/org-agenda-files-update) 54 | 55 | (defun my/org-summary-todo (n-done n-not-done) 56 | "Switch entry to DONE when all subentries are done, to TODO otherwise." 57 | (let (org-log-done org-todo-log-states) ; turn off logging 58 | (org-todo (if (= n-not-done 0) "DONE" "TODO")))) 59 | 60 | (add-hook 'org-after-todo-statistics-hook #'my/org-summary-todo) 61 | -------------------------------------------------------------------------------- /.config/doom/org-link.el: -------------------------------------------------------------------------------- 1 | ;;; org-link.el -*- lexical-binding: t; -*- 2 | 3 | ;;; https://orgmode.org/guide/Hyperlinks.html 4 | ;;; https://orgmode.org/manual/Hyperlinks.html 5 | 6 | (map! :leader "l a" #'my/org-link-description-to-acronym 7 | :leader "l b" #'my/org-link-description-to-bathonym 8 | :leader "l c" #'my/org-link-description-to-bathonym-acronym 9 | :leader "l d" #'my/org-link-description-downcase 10 | :leader "l i" #'org-insert-link 11 | :leader "l k" #'my/org-link-kill-raw 12 | :leader "l ·" #'my/org-link-description-switch 13 | :leader "l s" #'my/org-link-description-pluralize 14 | :leader "l t" #'org-toggle-link-display) 15 | 16 | (defun my/org-link-kill-raw (&optional link) 17 | "Kill raw LINK" 18 | (interactive) 19 | (unless link (setq link (org-element-context))) 20 | (kill-new (my/org-link-raw))) 21 | 22 | (defun my/org-link-rename-plus () 23 | (interactive) 24 | (let ((raw-path (my/org-link-raw)) 25 | (description (my/org-link-description))) 26 | (if (org-in-regexp org-link-bracket-re 1) 27 | (delete-region (match-beginning 0) (match-end 0))) 28 | (org-insert-link nil (s-replace " + " "·" raw-path) (s-replace " + " "·" description)))) 29 | 30 | (defun my/org-link-raw (&optional link) 31 | "Return raw LINK" 32 | (unless link (setq link (org-element-context))) 33 | (org-element-property :raw-link link)) 34 | 35 | (defun my/org-link-message-raw () 36 | "Message raw link at point" 37 | (interactive) 38 | (message (my/org-link-raw))) 39 | 40 | (defun my/org-link-path (&optional link) 41 | "Return path (scheme-less) of LINK" 42 | (unless link (setq link (org-element-context))) 43 | (org-element-property :path link)) 44 | 45 | (defun my/org-link-message-path () 46 | "Message path (scheme-less) of link at point" 47 | (interactive) 48 | (message (my/org-link-path))) 49 | 50 | (defun my/org-link-description-region (&optional link) 51 | "Return description's region of LINK" 52 | (unless link (setq link (org-element-context))) 53 | (list (org-element-property :contents-begin link) 54 | (org-element-property :contents-end link))) 55 | 56 | (defun my/org-link-description (&optional link) 57 | "Return description of LINK" 58 | (unless link (setq link (org-element-context))) 59 | (let ((region (my/org-link-description-region link))) 60 | (buffer-substring (nth 0 region) (nth 1 region)))) 61 | 62 | (defun my/org-link-description-replace (description &optional link) 63 | "Replace LINK's description by DESCRIPTION" 64 | (unless link (setq link (org-element-context))) 65 | (let ((region (my/org-link-description-region link))) 66 | (goto-char (nth 0 region)) 67 | (delete-region (nth 0 region) (nth 1 region)) 68 | (insert description))) 69 | 70 | (defun my/org-roam-node-from-link () 71 | "Return Org-Roam node from link at point" 72 | (org-roam-node-from-id (my/org-link-path))) 73 | 74 | ;;; description replacers 75 | 76 | (defun my/org-link-description-downcase () 77 | "Downcase description of link at point" 78 | (interactive) 79 | (my/org-link-description-replace (downcase (my/org-link-description)))) 80 | 81 | (defun my/org-link-description-pluralize () 82 | "Pluralize description of link at point" 83 | (interactive) 84 | (my/org-link-description-replace (concat (my/org-link-description) "s"))) 85 | 86 | (defun my/org-link-description-switch () 87 | "Switch the two parts of a combo (·) in the description of link at point" 88 | (interactive) 89 | (let* ((description (my/org-link-description)) 90 | (parts (split-string description "·" t " "))) 91 | (my/org-link-description-replace (concat (nth 1 parts) "·" (nth 0 parts))))) 92 | 93 | (defun my/org-link-description-to-acronym () 94 | "Turn the description of link into its acronym if it exists" 95 | (interactive) 96 | (let* ((node (my/org-roam-node-from-link)) 97 | (acronym (org-roam-node-acronym node))) 98 | (when (not (string= "" acronym)) 99 | (my/org-link-description-replace (concat "‹" acronym "›"))))) 100 | 101 | (defun my/org-link-description-to-bathonym () 102 | "Turn the description of link into its bathonym or title if it exists" 103 | (interactive) 104 | (let* ((node (my/org-roam-node-from-link)) 105 | (bathonym (org-roam-node-bathonym node)) 106 | (title (org-roam-node-title node))) 107 | (cond 108 | ((not (string= "" bathonym)) (my/org-link-description-replace bathonym)) 109 | ((not (string= "" title)) (my/org-link-description-replace title))))) 110 | 111 | (defun my/org-link-description-to-acronym-bathonym () 112 | "Turn the description of link into its ‹acronym› bathonym if it exists" 113 | (interactive) 114 | (let* ((node (my/org-roam-node-from-link)) 115 | (title (org-roam-node-title node)) 116 | (bathonym (org-roam-node-bathonym node)) 117 | (acronym (org-roam-node-acronym node))) 118 | (when (not (string= "" acronym)) 119 | (cond 120 | ((not (string= "" bathonym)) (my/org-link-description-replace (concat "‹" acronym "› " bathonym))) 121 | ((not (string= "" title)) (my/org-link-description-replace (concat "‹" acronym "› " title))))))) 122 | 123 | (defun my/org-link-description-to-bathonym-acronym () 124 | "Turn the description of link into its bathonym ‹acronym› if it exists" 125 | (interactive) 126 | (let* ((node (my/org-roam-node-from-link)) 127 | (title (org-roam-node-title node)) 128 | (bathonym (org-roam-node-bathonym node)) 129 | (acronym (org-roam-node-acronym node))) 130 | (when (not (string= "" acronym)) 131 | (cond 132 | ((not (string= "" bathonym)) (my/org-link-description-replace (concat bathonym " ‹" acronym "›"))) 133 | ((not (string= "" title)) (my/org-link-description-replace (concat title " ‹" acronym "›"))))))) 134 | 135 | (defun my/org-link-description-to-spec () 136 | "Turn the description of link into its spec «description» if it exists" 137 | (interactive) 138 | (let* ((node (my/org-roam-node-from-link)) 139 | (title (org-roam-node-title node)) 140 | (year (org-roam-node-released-at node)) 141 | (spec-description (org-roam-node-description node))) 142 | (when (not (string= "" spec-description)) 143 | (my/org-link-description-replace (concat title " (" year ") «" spec-description "»"))))) 144 | 145 | (defun my/org-link-description-to-gerund () 146 | "Turn the description of link into its gerund if it exists" 147 | (interactive) 148 | (let* ((node (my/org-roam-node-from-link)) 149 | (gerund (org-roam-node-gerund node))) 150 | (when (not (string= "" gerund)) 151 | (my/org-link-description-replace gerund)))) 152 | 153 | (defun my/org-link-description-to-tion () 154 | "Turn the description of link into its tion if it exists" 155 | (interactive) 156 | (let* ((node (my/org-roam-node-from-link)) 157 | (tion (org-roam-node-tion node))) 158 | (when (not (string= "" tion)) 159 | (my/org-link-description-replace tion)))) 160 | 161 | (defun my/org-link-description-with-released-at () 162 | "Append released-at property to the description of link if it exists" 163 | (interactive) 164 | (let* ((node (my/org-roam-node-from-link)) 165 | (title (org-roam-node-title node)) 166 | (released-at (org-roam-node-released-at node))) 167 | (when (not (string= " " released-at)) 168 | (my/org-link-description-replace (concat title " (" released-at ")"))))) 169 | 170 | (defun my/org-link-description-with-born-died-at () 171 | "Append born-died-at properties to the description of link if they exist" 172 | (interactive) 173 | (let* ((node (my/org-roam-node-from-link)) 174 | (title (org-roam-node-title node)) 175 | (born-at (org-roam-node-born-at node)) 176 | (died-at (org-roam-node-died-at node))) 177 | (when (and (not (string= "" born-at)) (not (string= "" died-at))) 178 | (my/org-link-description-replace (concat title " (" born-at "/" died-at ")"))))) 179 | 180 | (defun my/org-link-description-prepend-fa () 181 | "Prepend Font Awesome Icon for well-known brands" 182 | (interactive) 183 | (let ((description (my/org-link-description))) 184 | (when (s-ends-with? " - Wikipedia" description) 185 | (my/org-link-description-replace (concat " " (s-chop-suffix " - Wikipedia" description)))) 186 | (when (s-ends-with? " · GitHub" description) 187 | (my/org-link-description-replace (concat " " (s-chop-suffix " · GitHub" description)))) 188 | (when (s-starts-with? "GitHub - " description) 189 | (my/org-link-description-replace (concat " " (s-chop-prefix "GitHub - " description)))) 190 | (when (s-ends-with? " - Stack Overflow" description) 191 | (my/org-link-description-replace (concat " " (s-chop-suffix " - Stack Overflow" description)))) 192 | (when (s-ends-with? " - Server Fault" description) 193 | (my/org-link-description-replace (concat " " (s-chop-suffix " - Server Fault" description)))) 194 | (when (s-ends-with? " - Unix & Linux Stack Exchange" description) 195 | (my/org-link-description-replace (concat " " (s-chop-suffix " - Unix & Linux Stack Exchange" description)))) 196 | (when (s-ends-with? " - Super User" description) 197 | (my/org-link-description-replace (concat " " (s-chop-suffix " - Super User" description)))) 198 | (when (s-ends-with? " - Emacs Stack Exchange" description) 199 | (my/org-link-description-replace (concat " " (s-chop-suffix " - Emacs Stack Exchange" description)))) 200 | (when (s-ends-with? " - YouTube" description) 201 | (my/org-link-description-replace (concat " " (s-chop-suffix " - YouTube" description)))) 202 | (when (s-ends-with? " | Hacker News" description) 203 | (my/org-link-description-replace (concat " " (s-chop-suffix " | Hacker News" description)))) 204 | (when (s-ends-with? " - OpenBSD manual pages" description) 205 | (my/org-link-description-replace (concat " " (s-chop-suffix " - OpenBSD manual pages" description)))) 206 | )) 207 | 208 | (defun my/org-link-description-prepend-fa-wikipedia () 209 | (interactive) 210 | (my/org-link-description-replace (concat " " (my/org-link-description)))) 211 | 212 | (defun my/org-link-description-prepend-fa-docker () 213 | (interactive) 214 | (my/org-link-description-replace (concat " " (my/org-link-description)))) 215 | 216 | (defun my/org-link-description-prepend-fa-github () 217 | (interactive) 218 | (my/org-link-description-replace (concat " " (my/org-link-description)))) 219 | 220 | (defun my/org-link-description-prepend-fa-stackoverflow () 221 | (interactive) 222 | (my/org-link-description-replace (concat " " (my/org-link-description)))) 223 | -------------------------------------------------------------------------------- /.config/doom/org-property-drawer-dates.el: -------------------------------------------------------------------------------- 1 | ;;; property-drawer-dates.el -*- lexical-binding: t; -*- 2 | 3 | ; relative dates in property drawers 4 | ; currenly not used 5 | 6 | (defcustom org+-dateprop-reltime-number-of-items 3 7 | "Number of time items shown for relative time." 8 | :type 'number 9 | :group 'org) 10 | 11 | (defcustom org+-dateprop-properties '("asked-at" 12 | "built-at" 13 | "closed-at" 14 | "contributed-at" 15 | "created-at" 16 | "fetched-at" 17 | "last-commit-at" 18 | "merged-at" 19 | "released-at" 20 | "updated-at" 21 | "upgraded-at") 22 | "Names of properties with dates." 23 | :type 'org+-dateprop-properties-widget 24 | :group 'org) 25 | 26 | (defun org+-next-property-drawer (&optional limit) 27 | "Search for the next property drawer. 28 | When a property drawer is found position point behind :PROPERTIES: 29 | and return the property-drawer as org-element. 30 | Otherwise position point at the end of the buffer and return nil." 31 | (let (found drawer) 32 | (while (and (setq found (re-search-forward org-drawer-regexp limit 1) 33 | found (match-string-no-properties 1)) 34 | (or (and (setq drawer (org-element-context)) 35 | (null (eq (org-element-type drawer) 'property-drawer))) 36 | (string-match found "END")))) 37 | (and found drawer))) 38 | 39 | (defun org+-time-since-string (date) 40 | "Return a string representing the time since DATE." 41 | (let* ((time-diff (nreverse (seq-subseq (decode-time (time-subtract (current-time) (encode-time date))) 0 6))) 42 | (cnt 0)) 43 | (setf (car time-diff) (- (car time-diff) 1970)) 44 | (mapconcat 45 | #'identity 46 | (cl-loop 47 | for cnt from 1 upto org+-dateprop-reltime-number-of-items 48 | for val in time-diff 49 | for time-str in '("year" "month" "day" "hour" "minute" "second") 50 | unless (= val 0) 51 | collect (format "%d %s%s" val time-str (if (> val 1) "s" "")) 52 | ) 53 | " "))) 54 | 55 | (defvar-local org+-dateprop--overlays nil 56 | "List of overlays used for custom properties.") 57 | 58 | (defun org+-dateprop-properties-re (properties) 59 | "Return regular expression corresponding to `org+-dateprop-properties'." 60 | (org-re-property (regexp-opt properties) t)) 61 | 62 | (defvar org+-dateprop--properties-re (org+-dateprop-properties-re org+-dateprop-properties) 63 | "Regular expression matching the properties listed in `org+-dateprop-properties'. 64 | You should not set this regexp diretly but through customization of `org+-dateprop-properties'.") 65 | 66 | (defun my/org-dateprop (&optional absolute) 67 | "Toggle display of ABSOLUTE or relative time of 68 | properties in `org-dateprop-properties'." 69 | (interactive "P") 70 | (if org+-dateprop--overlays 71 | (progn (mapc #'delete-overlay org+-dateprop--overlays) 72 | (setq org+-dateprop--overlays nil)) 73 | (unless absolute 74 | (org-with-wide-buffer 75 | (goto-char (point-min)) 76 | (let (drawer-el) 77 | (while (setq drawer-el (org+-next-property-drawer)) 78 | (let ((drawer-end (org-element-property :contents-end drawer-el))) 79 | (while (re-search-forward org+-dateprop--properties-re drawer-end t) 80 | ;; See `org-property-re' for the regexp-groups. 81 | ;; Group 3 is PROPVAL without surrounding whitespace. 82 | (let* ((val-begin (match-beginning 3)) 83 | (val-end (match-end 3)) 84 | (time (org-parse-time-string (replace-regexp-in-string "[[:alpha:]]" " " (match-string 3)))) 85 | (time-diff-string (format "%s ago" (org+-time-since-string time))) 86 | (o (make-overlay val-begin val-end))) 87 | (overlay-put o 'display time-diff-string) 88 | (overlay-put o 'org+-dateprop t) 89 | (push o org+-dateprop--overlays)) 90 | )))))))) 91 | 92 | (define-widget 'org+-dateprop-properties-widget 93 | 'repeat 94 | "Like widget '(repeat string) but also updates `org+-dateprop-properties'." 95 | :value-to-external 96 | (lambda (_ value) 97 | (setq org+-dateprop--properties-re (org+-dateprop-properties-re value)) value) 98 | :args '(string)) 99 | -------------------------------------------------------------------------------- /.config/doom/org-property-drawer.el: -------------------------------------------------------------------------------- 1 | ;;; property-drawer.el -*- lexical-binding: t; -*- 2 | 3 | (require 'cl-lib) 4 | 5 | (defun my/kill-drawer () 6 | "Kill drawer" 7 | (interactive) 8 | (let ((element (org-element-context))) 9 | (unless (eq (car element) 'drawer) 10 | (setq element (org-element-property :parent element))) 11 | (kill-region (org-element-property :begin element) 12 | (org-element-property :end element)))) 13 | 14 | (defun my/empty-property-drawer (len) 15 | (let ((element (org-get-property-block))) 16 | (when element 17 | (setq org-property-format (concat "%-" (number-to-string len) "s %s")) 18 | (kill-region (car element) (cdr element))))) 19 | 20 | (defun my/org-set-prop (prop key alist) 21 | (let ((value (or (assoc-default key alist) "null"))) 22 | (cond ((numberp value) (org-set-property prop (number-to-string value))) 23 | (t (org-set-property prop value))))) 24 | 25 | (defun my/org-set-number-prop (prop key alist) 26 | (org-set-property prop (number-to-string (assoc-default key alist)))) 27 | 28 | (defun my/org-set-boolean-prop (prop key alist) 29 | (unless (eq :json-false (assoc-default key alist)) 30 | (org-set-property prop "true"))) 31 | 32 | (defun my/fetched-at () 33 | "Set drawer property fetched-at to now in ISO8601" 34 | (org-set-property "fetched-at" (iso8601-format)) 35 | (setq org-property-format "%-10s %s")) 36 | 37 | (defun my/upgraded-at () 38 | "Set drawer property upgrated-at to now in ISO8601" 39 | (interactive) 40 | (org-set-property "upgraded-at" (iso8601-format))) 41 | 42 | (defun my/released-at (date) 43 | "Set drawer property released-at to provided DATE" 44 | (interactive "sreleased-at? ") 45 | (org-set-property "released-at" date)) 46 | 47 | (defun my/created-at () 48 | "Set drawer property created-at to now in ISO8601" 49 | (interactive) 50 | (org-set-property "created-at" (iso8601-format))) 51 | 52 | (defun my/played-at () 53 | "Set drawer property played-at to now in ISO8601" 54 | (interactive) 55 | (org-set-property "played-at" (iso8601-format))) 56 | 57 | (defun my/sloc (count) 58 | "Set drawer property sloc to provided COUNT" 59 | (interactive "sSLOC? ") 60 | (org-set-property "sloc" count)) 61 | 62 | (defun my/infer-created-at () 63 | "Set drawer property created-at to date in buffer name" 64 | (interactive) 65 | (let ((y (substring (buffer-name) 0 4)) 66 | (M (substring (buffer-name) 4 6)) 67 | (d (substring (buffer-name) 6 8)) 68 | (h (substring (buffer-name) 8 10)) 69 | (m (substring (buffer-name) 10 12)) 70 | (s (substring (buffer-name) 12 14))) 71 | (org-with-point-at 1 72 | (org-set-property "created-at" (concat y "-" M "-" d "T" h ":" m ":" s "+0200"))))) 73 | 74 | ;; overriden lowercase version 75 | (defun my/org-insert-property-drawer () 76 | "Insert a property drawer into the current entry. 77 | Do nothing if the drawer already exists. The newly created 78 | drawer is immediately hidden." 79 | (org-with-wide-buffer 80 | ;; Set point to the position where the drawer should be inserted. 81 | (if (or (not (featurep 'org-inlinetask)) (org-inlinetask-in-task-p)) 82 | (org-back-to-heading-or-point-min t) 83 | (org-with-limited-levels (org-back-to-heading-or-point-min t))) 84 | (if (org-before-first-heading-p) 85 | (while (and (org-at-comment-p) (bolp)) (forward-line)) 86 | (forward-line) 87 | (when (looking-at-p org-planning-line-re) (forward-line))) 88 | (unless (looking-at-p org-property-drawer-re) 89 | ;; Make sure we start editing a line from current entry, not from 90 | ;; next one. It prevents extending text properties or overlays 91 | ;; belonging to the latter. 92 | (when (and (bolp) (> (point) (point-min))) (backward-char)) 93 | (let ((begin (if (bobp) (point) (1+ (point)))) 94 | (inhibit-read-only t)) 95 | (unless (bobp) (insert "\n")) 96 | (insert ":properties:\n:end:") 97 | (org-fold-region (line-end-position 0) (point) t (if (eq org-fold-core-style 'text-properties) 'drawer 'outline)) 98 | (when (or (eobp) (= begin (point-min))) (insert "\n")) 99 | (org-indent-region begin (point)))))) 100 | 101 | (advice-add 'org-insert-property-drawer :override #'my/org-insert-property-drawer) 102 | 103 | (defun my/org-keywords-to-lowercase () 104 | "Lower case Org keywords and block identifiers. 105 | 106 | Example: \"#+TITLE\" -> \"#+title\" 107 | \"#+BEGIN_EXAMPLE\" -> \"#+begin_example\" 108 | 109 | Inspiration: 110 | https://code.orgmode.org/bzg/org-mode/commit/13424336a6f30c50952d291e7a82906c1210daf0." 111 | (interactive) 112 | (save-excursion 113 | (goto-char (point-min)) 114 | (let ((case-fold-search nil) 115 | (count 0)) 116 | ;; Match examples: "#+FOO bar", "#+FOO:", "=#+FOO=", "~#+FOO~", 117 | ;; "‘#+FOO’", "“#+FOO”", ",#+FOO bar", 118 | ;; "#+FOO_bar", "#+FOO". 119 | (while (re-search-forward "\\(?1:#\\+[A-Z_]+\\(?:_[[:alpha:]]+\\)*\\)\\(?:[ :=~’”]\\|$\\)" nil :noerror) 120 | (setq count (1+ count)) 121 | (replace-match (downcase (match-string-no-properties 1)) :fixedcase nil nil 1)) 122 | (message "Lower-cased %d matches" count)))) 123 | 124 | 125 | (defun my/substring-ym (string) 126 | (substring string 0 (min 10 (length string)))) 127 | 128 | (defun my/org-drawer-recap (drawer-props) 129 | "Compute recap of an org properties-drawer" 130 | (let ((parts '())) 131 | (when-let (prop (cdr (assoc "TYPE" drawer-props))) 132 | (push (concat "‡" prop) parts)) 133 | ;; dates 134 | (when-let (prop (cdr (assoc "FETCHED-AT" drawer-props))) 135 | (push (concat "↓" (substring prop 0 10)) parts)) 136 | (when-let (prop (cdr (assoc "UPGRADED-AT" drawer-props))) 137 | (push (concat "↑" (substring prop 0 10)) parts)) 138 | (when-let (prop (cdr (assoc "RELEASED-AT" drawer-props))) 139 | (push (my/substring-ym prop) parts)) 140 | (when-let (prop (cdr (assoc "BORN-AT" drawer-props))) 141 | (push (concat "⧖" (my/substring-ym prop)) parts)) 142 | (when-let (prop (cdr (assoc "DIED-AT" drawer-props))) 143 | (push (concat "⧗" (my/substring-ym prop)) parts)) 144 | (when-let (prop (cdr (assoc "PLAYED-AT" drawer-props))) 145 | (push (substring prop 0 7) parts)) 146 | ;; suffixes 147 | (when-let (prop (cdr (assoc "REVISIONS" drawer-props))) 148 | (push (concat (my/number-approx prop) "_revisions") parts)) 149 | (when-let (prop (cdr (assoc "FOLLOWERS" drawer-props))) 150 | (push (concat (my/number-approx prop) "_followers") parts)) 151 | (when-let (prop (cdr (assoc "SCORE" drawer-props))) 152 | (push (concat (my/number-approx prop) "★") parts)) 153 | (when-let (prop (cdr (assoc "STARS" drawer-props))) 154 | (push (concat (my/number-approx prop) (if (cdr (assoc "STARRED" drawer-props)) "★" "☆")) parts)) 155 | (when-let (prop (cdr (assoc "VIEWS" drawer-props))) 156 | (push (concat (my/number-approx prop) "_views") parts)) 157 | (when-let (prop (cdr (assoc "DEPENDENCIES" drawer-props))) 158 | (push (concat prop "dependencies") parts)) 159 | (when-let (prop (cdr (assoc "REPOSITORIES" drawer-props))) 160 | (push (concat prop "repositories") parts)) 161 | (when-let (prop (cdr (assoc "SOURCE-RANK" drawer-props))) 162 | (push (concat prop "source-rank") parts)) 163 | (when-let (prop (cdr (assoc "SLOC" drawer-props))) 164 | (push (concat prop "SLOC") parts)) 165 | ;; booleans 166 | (when-let (prop (cdr (assoc "TYPES" drawer-props))) 167 | (push (if (not (string= prop "null")) "types" "") parts)) 168 | ;; raws 169 | (when-let (prop (cdr (assoc "ACRONYM" drawer-props))) 170 | (push prop parts)) 171 | (when-let (prop (cdr (assoc "STATE" drawer-props))) 172 | (push prop parts)) 173 | (when-let (prop (cdr (assoc "LANGUAGE" drawer-props))) 174 | (push prop parts)) 175 | (let ((recap (s-join " " (reverse parts)))) 176 | (if (string-empty-p recap) ":properties:" recap)))) 177 | 178 | (defun my/org-replace-drawers-with-recap () 179 | "Replace all org properties-drawers beginnings with a recap" 180 | (interactive) 181 | (org-element-map (org-element-parse-buffer) 'property-drawer 182 | (lambda (drawer) 183 | (let* ((begin (org-element-property :begin drawer)) 184 | (props (org-entry-properties begin)) 185 | (overlay (make-overlay begin (+ begin (length ":properties:"))))) 186 | (overlay-put overlay 'display (my/org-drawer-recap props)))))) 187 | 188 | ;; https://stackoverflow.com/questions/5580562/formatting-an-integer-using-iso-prefixes-for-kb-mb-gb-and-kib-mib-gib 189 | (defconst number-to-string-approx-suffixes 190 | '("k" "M" "G" "T" "P" "E" "Z" "Y")) 191 | (defun number-to-string-approx-suffix (n &optional binary) 192 | "Return an approximate decimal representation of NUMBER as a string, 193 | followed by a multiplier suffix (k, M, G, T, P, E, Z, Y). The representation 194 | is at most 5 characters long for numbers between 0 and 10^19-5*10^16. 195 | Uses a minus sign if negative. 196 | NUMBER may be an integer or a floating point number. 197 | If the optional argument BINARY is non-nil, use 1024 instead of 1000 as 198 | the base multiplier." 199 | (if (zerop n) 200 | "0" 201 | (let ((sign "") 202 | (b (if binary 1024 1000)) 203 | (suffix "") 204 | (bigger-suffixes number-to-string-approx-suffixes)) 205 | (if (< n 0) 206 | (setq n (- n) 207 | sign "-")) 208 | (while (and (>= n 999.5) (consp bigger-suffixes)) 209 | (setq n (/ n b) ; TODO: this is rounding down; nearest would be better 210 | suffix (car bigger-suffixes) 211 | bigger-suffixes (cdr bigger-suffixes))) 212 | (concat sign 213 | (if (integerp n) (int-to-string n) (number-to-string (floor n))) 214 | suffix)))) 215 | (defun my/number-approx (s) 216 | (number-to-string-approx-suffix (string-to-number s))) 217 | -------------------------------------------------------------------------------- /.config/doom/org-roam-ql.el: -------------------------------------------------------------------------------- 1 | ;;; org-roam-ql.el -*- lexical-binding: t; -*- 2 | ;;; https://github.com/ahmed-shariff/org-roam-ql 3 | 4 | (use-package! org-roam-ql 5 | :config 6 | 7 | (defun my/sort-by-released-at (node1 node2) 8 | (string< (org-roam-node-released-at node1) (org-roam-node-released-at node2))) 9 | (org-roam-ql-register-sort-fn "released-at" #'my/sort-by-released-at) 10 | 11 | (defun org-dblock-write:combos (params) 12 | "Write org block for org-roam-combos with PARAMS." 13 | (let* ((title (or (plist-get params :title) (my/org-get-acronym) (org-get-title))) 14 | (parts (s-split "·" title)) 15 | (depth (plist-get params :depth)) 16 | (alt "\\|") 17 | (start "\\(^") 18 | (end "$\\)") 19 | (compound (cond 20 | ((= (length parts) 2) (concat alt start (nth 0 parts) "·.*·" (nth 1 parts) end 21 | alt start ".*·" (nth 0 parts) "·.*·" (nth 1 parts) end 22 | alt start (nth 0 parts) "·.*·" (nth 1 parts) "·.*" end)) 23 | ((= (length parts) 3) (concat alt start (nth 0 parts) "·.*·" (nth 1 parts) "·" (nth 2 parts) end 24 | alt start (nth 0 parts) "·" (nth 1 parts) "·.*·" (nth 2 parts) end)) 25 | ((= (length parts) 4) (concat alt start (nth 0 parts) "·.*·" (nth 1 parts) "·" (nth 2 parts) "·" (nth 3 parts) end 26 | alt start (nth 0 parts) "·" (nth 1 parts) "·.*·" (nth 2 parts) "·" (nth 3 parts) end 27 | alt start (nth 0 parts) "·" (nth 1 parts) "·" (nth 2 parts) "·.*·" (nth 3 parts) end)) 28 | (t "")))) 29 | (org-dblock-write:org-roam-ql `(:query (and (title ,(concat start title "·\\)" 30 | alt "\\(·" title end 31 | alt "\\(·" title "·\\)" 32 | compound))) 33 | :columns (combo-link combos acronym bathonym) 34 | :headers ("Link" "Combo" "Acro" "Batho") 35 | :combos-depth ,depth 36 | :no-link true)))) 37 | 38 | (defun org-dblock-write:org-roam-artist (params) 39 | "Write org block for org-roam-artist with PARAMS." 40 | (let ((country (plist-get params :country)) 41 | (year (plist-get params :year))) 42 | (when country 43 | (org-dblock-write:org-roam-ql `(:query (and (tags "artist") (properties "country" ,country)) 44 | :columns (link released-at city live) 45 | :headers ("Artist" "Year" "City" "Live") 46 | :no-link true))) 47 | (when year 48 | (org-dblock-write:org-roam-ql `(:query (and (tags "artist") (properties "released-at" ,year)) 49 | :columns (link country live) 50 | :headers ("Artist" "Country" "Live") 51 | :no-link true))))) 52 | 53 | (defun org-dblock-write:artists-by-country (_params) 54 | (org-dblock-write:org-roam-artist `(:country ,(org-get-title)))) 55 | 56 | (defun org-dblock-write:artists-by-year (_params) 57 | (org-dblock-write:org-roam-artist `(:year ,(org-get-title)))) 58 | 59 | (defun org-dblock-write:org-roam-albums (params) 60 | "Write org block for org-roam-albums with PARAMS." 61 | (let ((artist (plist-get params :artist)) 62 | (year (plist-get params :year))) 63 | (when artist 64 | (org-dblock-write:org-roam-ql `(:query (and (tags "album") (properties "artist" ,(concat "\\[" artist "\\]\\]"))) 65 | :columns (released-at album-link index tracks-count) 66 | :headers ("Year" "Album" "#" "Tracks") 67 | :sort "released-at" 68 | :no-link true))) 69 | (when year 70 | (org-dblock-write:org-roam-ql `(:query (and (tags "album") (properties "released-at" ,year)) 71 | :columns (artist album-link index tracks-count) 72 | :headers ("Artist" "Album" "#" "Tracks") 73 | :no-link true))))) 74 | 75 | (defun org-dblock-write:albums-by-artist (_params) 76 | (org-dblock-write:org-roam-albums `(:artist ,(org-get-title)))) 77 | 78 | (defun org-dblock-write:albums-by-year (_params) 79 | (org-dblock-write:org-roam-albums `(:year ,(org-get-title)))) 80 | 81 | (defun org-dblock-write:org-roam-tracks (params) 82 | "Write org block for org-roam-tracks with PARAMS." 83 | (let ((artist (plist-get params :artist))) 84 | (org-dblock-write:org-roam-ql `(:query (and (properties type "track") (properties "artist" ,(concat "\\[" artist "\\]\\]"))) 85 | :columns (link instruments features tier played-at play-count) 86 | :no-link true)))) 87 | 88 | (defun org-dblock-write:tracks-by-artist (_params) 89 | (org-dblock-write:org-roam-tracks `(:artist ,(org-get-title)))) 90 | 91 | (defun org-dblock-write:org-roam-books (params) 92 | "Write org block for org-roam-books with PARAMS." 93 | (let ((author (plist-get params :author)) 94 | (year (plist-get params :year))) 95 | (when author 96 | (org-dblock-write:org-roam-ql `(:query (and (tags "book") (properties "author" ,author)) 97 | :columns (released-at link live) 98 | :sort "released-at" 99 | :no-link true))) 100 | (when year 101 | (org-dblock-write:org-roam-ql `(:query (and (tags "book") (properties "released-at" ,year)) 102 | :columns (link author live) 103 | :no-link true))))) 104 | 105 | (defun org-dblock-write:books-by-author (_params) 106 | (org-dblock-write:org-roam-books `(:author ,(org-get-title)))) 107 | 108 | (defun org-dblock-write:books-by-year (_params) 109 | (org-dblock-write:org-roam-books `(:year ,(org-get-title)))) 110 | 111 | (defun org-dblock-write:org-roam-people (params) 112 | "Write org block for org-roam-people with PARAMS." 113 | (let ((year (plist-get params :year)) 114 | (country (plist-get params :country))) 115 | (when year 116 | (org-dblock-write:org-roam-ql `(:query (and (tags "person") (or (properties "born-at" ,year) (properties "died-at" ,year))) 117 | :columns (link born-at died-at country) 118 | :no-link true))) 119 | (when country 120 | (org-dblock-write:org-roam-ql `(:query (and (tags "person") (properties "country" ,country)) 121 | :columns (link born-at died-at) 122 | :no-link true))))) 123 | 124 | (defun org-dblock-write:people-by-year (_params) 125 | (org-dblock-write:org-roam-people `(:year ,(org-get-title)))) 126 | 127 | ;; geo 128 | 129 | (defun org-dblock-write:people-by-country (_params) 130 | (org-dblock-write:org-roam-people `(:country ,(org-get-title)))) 131 | 132 | (defun org-dblock-write:org-roam-departements (params) 133 | "Write org block for org-roam-departements with PARAMS." 134 | (let ((region (plist-get params :region))) 135 | (org-dblock-write:org-roam-ql `(:query (and (tags "departement") (properties "region" ,region)) 136 | :columns (link prefecture) 137 | :no-link true)))) 138 | 139 | (defun org-dblock-write:departements-by-region (_params) 140 | (org-dblock-write:org-roam-departements `(:region ,(org-get-title)))) 141 | 142 | (defun org-dblock-write:org-roam-cities (params) 143 | "Write org block for org-roam-cities with PARAMS." 144 | (let ((departement (plist-get params :departement)) 145 | (country (plist-get params :country))) 146 | (when departement 147 | (org-dblock-write:org-roam-ql `(:query (and (tags "city") (properties "departement" ,departement)) 148 | :columns (link population role live) 149 | :no-link true))) 150 | (when country 151 | (org-dblock-write:org-roam-ql `(:query (and (tags "city") (properties "country" ,country)) 152 | :columns (link population role live) 153 | :no-link true))))) 154 | 155 | (defun org-dblock-write:cities-by-country (_params) 156 | (org-dblock-write:org-roam-cities `(:country ,(org-get-title)))) 157 | 158 | (defun org-dblock-write:cities-by-departement (_params) 159 | (org-dblock-write:org-roam-cities `(:departement ,(org-get-title)))) 160 | 161 | ;; companies 162 | 163 | (defun org-dblock-write:org-roam-companies (params) 164 | "Write org block for org-roam-companies with PARAMS." 165 | (let ((year (plist-get params :year)) 166 | (country (plist-get params :country))) 167 | (when year 168 | (org-dblock-write:org-roam-ql `(:query (and (tags "company") (properties "released-at" ,year)) 169 | :columns (link country) 170 | :no-link true))) 171 | (when country 172 | (org-dblock-write:org-roam-ql `(:query (and (tags "company") (properties "country" ,country)) 173 | :columns (link city released-at) 174 | :no-link true))))) 175 | 176 | (defun org-dblock-write:companies-by-year (_params) 177 | (org-dblock-write:org-roam-companies `(:year ,(org-get-title)))) 178 | 179 | (defun org-dblock-write:companies-by-country (_params) 180 | (org-dblock-write:org-roam-companies `(:country ,(org-get-title)))) 181 | 182 | ;; overwrite table generation to handle :headers 183 | ;; https://github.com/ahmed-shariff/org-roam-ql/issues/10 184 | 185 | (defun org-dblock-write:org-roam-ql (params) 186 | "Write org block for org-roam-ql with PARAMS." 187 | (let ((query (plist-get params :query)) 188 | (columns (plist-get params :columns)) 189 | (headers (plist-get params :headers)) 190 | (sort (plist-get params :sort)) 191 | (take (plist-get params :take)) 192 | (combos-depth (plist-get params :combos-depth)) 193 | (no-link (plist-get params :no-link))) 194 | (if (and query columns) 195 | (-if-let (nodes (org-roam-ql-nodes query sort)) 196 | (progn 197 | (when take 198 | (setq nodes (cl-etypecase take 199 | ((and integer (satisfies cl-minusp)) (-take-last (abs take) nodes)) 200 | (integer (-take take nodes))))) 201 | (when combos-depth 202 | (setq nodes (--filter 203 | (>= combos-depth (length (s-split "·" (org-roam-node-title it)))) nodes))) 204 | ;; headers 205 | (insert "|" 206 | (if no-link "" "|") 207 | (string-join (--map-indexed 208 | (pcase it 209 | ((pred symbolp) (if headers 210 | (if (eq it-index 0) 211 | (concat (nth it-index headers) " - " (number-to-string (length nodes))) 212 | (nth it-index headers)) 213 | (capitalize (symbol-name it)))) 214 | (`(,_ ,name) name)) 215 | columns) 216 | " | ") 217 | "|\n|-\n") 218 | (dolist (node nodes) 219 | (insert "|" 220 | (if no-link 221 | "" 222 | (format "[[id:%s][link]]|" (org-roam-node-id node))) 223 | (string-join (--map (let ((value (funcall (intern-soft 224 | (format "org-roam-node-%s" it)) 225 | node))) 226 | (pcase value 227 | ((pred listp) (string-join (--map (format "%s" it) value) ",")) 228 | (_ (format "%s" value)))) 229 | columns) 230 | "|") 231 | "|\n")) 232 | (delete-char -1) 233 | (org-table-align)) 234 | (message "Query results is empty")) 235 | (user-error "Dynamic block needs to specify :query and :columns"))))) 236 | -------------------------------------------------------------------------------- /.config/doom/org.el: -------------------------------------------------------------------------------- 1 | ;;; org.el -*- lexical-binding: t; -*- 2 | 3 | ;; If you use `org' and don't want your org files in the default location below, 4 | ;; change `org-directory'. It must be set before org loads! 5 | (setq org-directory "~/Sync/org/") 6 | (setq org-element-use-cache nil) 7 | 8 | (load! "org-link.el") 9 | 10 | ;; To dynamically build org-agenda-files when a TODO is present 11 | (defun my/org-get-filetags () 12 | (interactive) 13 | (split-string-and-unquote (or (cadr (assoc "FILETAGS" 14 | (org-collect-keywords '("filetags")))) "") 15 | "[ :]")) 16 | 17 | (defun my/org-set-filetags (tags) 18 | (org-roam-set-keyword "filetags" (org-make-tag-string (seq-uniq tags)))) 19 | 20 | (defun my/org-clean-filetags () 21 | (interactive) 22 | (my/org-set-filetags (sort (my/org-get-filetags) #'string<))) 23 | 24 | (defun my/org-todos-p () 25 | "Return non-nil if current buffer has any todo entry. 26 | 27 | TODO entries marked as done are ignored, meaning that this 28 | function returns nil if current buffer contains only completed tasks." 29 | (seq-find 30 | (lambda (type) (eq type 'todo)) 31 | (org-element-map 32 | (org-element-parse-buffer 'headline) 33 | 'headline 34 | (lambda (h) 35 | (org-element-property :todo-type h))))) 36 | 37 | (defun my/org-update-agenda-tag () 38 | "Update AGENDA tag in the current buffer." 39 | (when (and (not (active-minibuffer-window)) 40 | (org-roam-buffer-p)) 41 | (save-excursion 42 | (goto-char (point-min)) 43 | (let* ((tags (my/org-get-filetags)) 44 | (original-tags tags)) 45 | (if (my/org-todos-p) 46 | (setq tags (cons "agenda" tags)) 47 | (setq tags (remove "agenda" tags))) 48 | 49 | ;; cleanup duplicates 50 | (setq tags (seq-uniq tags)) 51 | 52 | ;; update tags if changed 53 | (when (or (seq-difference tags original-tags) 54 | (seq-difference original-tags tags)) 55 | (my/org-set-filetags tags)))))) 56 | 57 | (defun my/org-agenda-files () 58 | "Return a list of note files containing 'agenda' tag." ; 59 | (seq-uniq 60 | (seq-map 61 | #'car 62 | (org-roam-db-query 63 | [:select [nodes:file] 64 | :from tags 65 | :left-join nodes 66 | :on (= tags:node-id nodes:id) 67 | :where (like tag (quote "%\"agenda\"%"))])))) 68 | 69 | (defun my/org-agenda-files-update (&rest _) 70 | "Update the value of `org-agenda-files'." 71 | (setq org-agenda-files (my/org-agenda-files))) 72 | 73 | ;; this huge function is a copy of the original 74 | ;; the only nuance is about the filetags handling :( 75 | (defun my/org-fontify-meta-lines-and-blocks-1 (limit) 76 | "Fontify #+ lines and blocks." 77 | (let ((case-fold-search t)) 78 | (when (re-search-forward 79 | (rx bol (group (zero-or-more (any " \t")) "#" 80 | (group (group (or (seq "+" (one-or-more (any "a-zA-Z")) (optional ":")) 81 | (any " \t") 82 | eol)) 83 | (optional (group "_" (group (one-or-more (any "a-zA-Z")))))) 84 | (zero-or-more (any " \t")) 85 | (group (group (zero-or-more (not (any " \t\n")))) 86 | (zero-or-more (any " \t")) 87 | (group (zero-or-more any))))) 88 | limit t) 89 | (let ((beg (match-beginning 0)) 90 | (end-of-beginline (match-end 0)) 91 | ;; Including \n at end of #+begin line will include \n 92 | ;; after the end of block content. 93 | (block-start (match-end 0)) 94 | (block-end nil) 95 | (lang (match-string 7)) ; The language, if it is a source block. 96 | (bol-after-beginline (line-beginning-position 2)) 97 | (dc1 (downcase (match-string 2))) 98 | (dc3 (downcase (match-string 3))) 99 | (whole-blockline org-fontify-whole-block-delimiter-line) 100 | beg-of-endline end-of-endline nl-before-endline quoting block-type) 101 | (cond 102 | ((and (match-end 4) (equal dc3 "+begin")) 103 | ;; Truly a block 104 | (setq block-type (downcase (match-string 5)) 105 | ;; Src, example, export, maybe more. 106 | quoting (member block-type org-protecting-blocks)) 107 | (when (re-search-forward 108 | (rx-to-string `(group bol (or (seq (one-or-more "*") space) 109 | (seq (zero-or-more (any " \t")) 110 | "#+end" 111 | ,(match-string 4) 112 | word-end 113 | (zero-or-more any))))) 114 | ;; We look further than LIMIT on purpose. 115 | nil t) 116 | ;; We do have a matching #+end line. 117 | (setq beg-of-endline (match-beginning 0) 118 | end-of-endline (match-end 0) 119 | nl-before-endline (1- (match-beginning 0))) 120 | (setq block-end (match-beginning 0)) ; Include the final newline. 121 | (when quoting 122 | (org-remove-flyspell-overlays-in bol-after-beginline nl-before-endline) 123 | (remove-text-properties beg end-of-endline 124 | '(display t invisible t intangible t))) 125 | (add-text-properties 126 | beg end-of-endline '(font-lock-fontified t font-lock-multiline t)) 127 | (org-remove-flyspell-overlays-in beg bol-after-beginline) 128 | (org-remove-flyspell-overlays-in nl-before-endline end-of-endline) 129 | (cond 130 | ((and org-src-fontify-natively 131 | (string= block-type "src")) 132 | (save-match-data 133 | (org-src-font-lock-fontify-block (or lang "") block-start block-end)) 134 | (add-text-properties bol-after-beginline block-end '(src-block t))) 135 | (quoting 136 | (add-text-properties 137 | bol-after-beginline beg-of-endline 138 | (list 'face 139 | (list :inherit 140 | (let ((face-name 141 | (intern (format "org-block-%s" lang)))) 142 | (append (and (facep face-name) (list face-name)) 143 | '(org-block))))))) 144 | ((not org-fontify-quote-and-verse-blocks)) 145 | ((string= block-type "quote") 146 | (add-face-text-property 147 | bol-after-beginline beg-of-endline 'org-quote t)) 148 | ((string= block-type "verse") 149 | (add-face-text-property 150 | bol-after-beginline beg-of-endline 'org-verse t))) 151 | ;; Fontify the #+begin and #+end lines of the blocks 152 | (add-text-properties 153 | beg (if whole-blockline bol-after-beginline end-of-beginline) 154 | '(face org-block-begin-line)) 155 | (unless (eq (char-after beg-of-endline) ?*) 156 | (add-text-properties 157 | beg-of-endline 158 | (if whole-blockline 159 | (let ((beg-of-next-line (1+ end-of-endline))) 160 | (min (point-max) beg-of-next-line)) 161 | (min (point-max) end-of-endline)) 162 | '(face org-block-end-line))) 163 | t)) 164 | ((member dc1 '("+title:" "+subtitle:" "+author:" "+email:" "+date:" "+filetags:")) 165 | (org-remove-flyspell-overlays-in 166 | (match-beginning 0) 167 | (if (equal "+title:" dc1) (match-end 2) (match-end 0))) 168 | (add-text-properties 169 | beg (match-end 3) 170 | (if (member (intern (substring dc1 1 -1)) org-hidden-keywords) 171 | '(font-lock-fontified t invisible t) 172 | '(font-lock-fontified t face org-document-info-keyword))) 173 | (add-text-properties 174 | (match-beginning 6) (min (point-max) (1+ (match-end 6))) 175 | (if (string-equal dc1 "+title:") 176 | '(font-lock-fontified t face org-document-title) 177 | '(font-lock-fontified t face org-document-info)))) 178 | ((string-prefix-p "+caption" dc1) 179 | (org-remove-flyspell-overlays-in (match-end 2) (match-end 0)) 180 | (remove-text-properties (match-beginning 0) (match-end 0) 181 | '(display t invisible t intangible t)) 182 | ;; Handle short captions 183 | (save-excursion 184 | (forward-line 0) 185 | (looking-at (rx (group (zero-or-more (any " \t")) 186 | "#+caption" 187 | (optional "[" (zero-or-more any) "]") 188 | ":") 189 | (zero-or-more (any " \t"))))) 190 | (add-text-properties (line-beginning-position) (match-end 1) 191 | '(font-lock-fontified t face org-meta-line)) 192 | (add-text-properties (match-end 0) (line-end-position) 193 | '(font-lock-fontified t face org-block)) 194 | t) 195 | ((member dc3 '(" " "")) 196 | ;; Just a comment, the plus was not there 197 | (org-remove-flyspell-overlays-in beg (match-end 0)) 198 | (add-text-properties 199 | beg (match-end 0) 200 | '(font-lock-fontified t face font-lock-comment-face))) 201 | (t ;; Just any other in-buffer setting, but not indented 202 | (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) 203 | (remove-text-properties (match-beginning 0) (match-end 0) 204 | '(display t invisible t intangible t)) 205 | (add-text-properties beg (match-end 0) 206 | '(font-lock-fontified t face org-meta-line)) 207 | t)))))) 208 | 209 | ;; https://github.com/rexim/org-cliplink 210 | (defun my/org-cliplink () 211 | "Takes a URL from the clipboard and inserts an org-mode link 212 | with the title of a page and the optional target found by the URL 213 | into the current buffer" 214 | (interactive) 215 | (org-cliplink-insert-transformed-title 216 | (org-cliplink-clipboard-content) ;take the URL from the CLIPBOARD 217 | (lambda (url title) 218 | (let* ((parsed-url (url-generic-parse-url url)) 219 | (clean-title 220 | (cond 221 | ;; if the host is github.com, cleanup the title 222 | ;;((string= (url-host parsed-url) "github.com") 223 | ;;(replace-regexp-in-string "GitHub - .*: \\(.*\\)" "\\1" title)) 224 | ;; otherwise keep the original title 225 | (t title))) 226 | (target (url-target parsed-url)) 227 | (clean-title (if target (concat clean-title "#" target) clean-title))) 228 | (message url) 229 | (message clean-title) 230 | ;; forward the title to the default org-cliplink transformer 231 | (org-cliplink-org-mode-link-transformer url clean-title))))) 232 | 233 | ;; (add-hook 'find-file-hook #'my/org-update-agenda-tag) 234 | (add-hook 'before-save-hook #'my/org-update-agenda-tag) 235 | 236 | (advice-add 'org-agenda :before #'my/org-agenda-files-update) 237 | (advice-add 'org-fontify-meta-lines-and-blocks-1 :override #'my/org-fontify-meta-lines-and-blocks-1) 238 | -------------------------------------------------------------------------------- /.config/doom/packages.el: -------------------------------------------------------------------------------- 1 | ;; -*- no-byte-compile: t; -*- 2 | ;;; $DOOMDIR/packages.el 3 | ;;; https://github.com/doomemacs/doomemacs/blob/master/templates/packages.example.el 4 | 5 | ;; To install a package with Doom you must declare them here and run 'doom sync' 6 | ;; on the command line, then restart Emacs for the changes to take effect -- or 7 | ;; use 'M-x doom/reload'. 8 | 9 | 10 | ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: 11 | ;(package! some-package) 12 | 13 | ;; To install a package directly from a remote git repo, you must specify a 14 | ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: 15 | ;; https://github.com/radian-software/straight.el#the-recipe-format 16 | ;(package! another-package 17 | ; :recipe (:host github :repo "username/repo")) 18 | 19 | ;; If the package you are trying to install does not contain a PACKAGENAME.el 20 | ;; file, or is located in a subdirectory of the repo, you'll need to specify 21 | ;; `:files' in the `:recipe': 22 | ;(package! this-package 23 | ; :recipe (:host github :repo "username/repo" 24 | ; :files ("some-file.el" "src/lisp/*.el"))) 25 | 26 | ;; If you'd like to disable a package included with Doom, you can do so here 27 | ;; with the `:disable' property: 28 | ;(package! builtin-package :disable t) 29 | 30 | ;; You can override the recipe of a built in package without having to specify 31 | ;; all the properties for `:recipe'. These will inherit the rest of its recipe 32 | ;; from Doom or MELPA/ELPA/Emacsmirror: 33 | ;(package! builtin-package :recipe (:nonrecursive t)) 34 | ;(package! builtin-package-2 :recipe (:repo "myfork/package")) 35 | 36 | ;; Specify a `:branch' to install a package from a particular branch or tag. 37 | ;; This is required for some packages whose default branch isn't 'master' (which 38 | ;; our package manager can't deal with; see radian-software/straight.el#279) 39 | ;(package! builtin-package :recipe (:branch "develop")) 40 | 41 | ;; Use `:pin' to specify a particular commit to install. 42 | ;(package! builtin-package :pin "1a2b3c4d5e") 43 | 44 | 45 | ;; Doom's packages are pinned to a specific commit and updated from release to 46 | ;; release. The `unpin!' macro allows you to unpin single packages... 47 | ;(unpin! pinned-package) 48 | ;; ...or multiple packages 49 | ;(unpin! pinned-package another-pinned-package) 50 | ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) 51 | ;(unpin! t) 52 | 53 | (package! org-download) 54 | (package! fish-mode) 55 | (package! olivetti) 56 | (package! memoize) 57 | (package! org-roam-ql) 58 | -------------------------------------------------------------------------------- /.config/doom/theme.el: -------------------------------------------------------------------------------- 1 | ;;; theme.el -*- lexical-binding: t; -*- 2 | 3 | ;; Doom exposes five (optional) variables for controlling fonts in Doom: 4 | ;; 5 | ;; - `doom-font' -- the primary font to use 6 | ;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable) 7 | ;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for 8 | ;; presentations or streaming. 9 | ;; - `doom-unicode-font' -- for unicode glyphs 10 | ;; - `doom-serif-font' -- for the `fixed-pitch-serif' face 11 | ;; 12 | ;; See 'C-h v doom-font' for documentation and more examples of what they 13 | ;; accept. For example: 14 | ;; 15 | ;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light) 16 | ;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13)) 17 | ;; 18 | ;; If you or Emacs can't find your font, use 'M-x describe-font' to look them 19 | ;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to 20 | ;; refresh your font settings. If Emacs still can't find your font, it likely 21 | ;; wasn't installed correctly. Font issues are rarely Doom issues! 22 | (setq doom-font (font-spec :family "Iosevka" :size 24)) 23 | (setq doom-variable-pitch-font (font-spec :family "Liberation Serif" :size 24)) 24 | (setq doom-unicode-font (font-spec :family "Noto Color Emoji" :size 24)) 25 | 26 | ;; There are two ways to load a theme. Both assume the theme is installed and 27 | ;; available. You can either set `doom-theme' or manually load a theme with the 28 | ;; `load-theme' function. This is the default: 29 | (setq doom-theme 'doom-dracula) 30 | ;; ~/.config/emacs/.local/straight/repos/themes 31 | (setq 32 | dracula-background "#282a36" 33 | dracula-current-line "#44475a" 34 | dracula-comment "#6272a4" 35 | dracula-foreground "#f8f8f2" 36 | 37 | dracula-cyan "#8be9fd" 38 | dracula-green "#50fa7b" 39 | dracula-orange "#ffb86c" 40 | dracula-pink "#ff79c6" 41 | dracula-purple "#bd93f9" 42 | dracula-red "#ff5555" 43 | dracula-yellow "#f1fa8c" 44 | 45 | ; unofficial 46 | dracula-grey "#adb2cb") 47 | 48 | (custom-set-faces! 49 | `(bold :weight bold :foreground ,dracula-orange) 50 | ;; yellow titles: in regular buffer and sidebar 51 | `(org-document-title :weight: light :height 2.0 :foreground ,dracula-foreground :family "Iosevka Etoile") 52 | `(org-roam-header-line :weight bold :height 2.0 :foreground ,dracula-foreground) 53 | ;; cyan Links / Backlinks titles in sidebar 54 | `(magit-section-heading :height 1.4 :foreground ,dracula-cyan) 55 | ;; outline in sidebar 56 | `(org-roam-olp :foreground ,dracula-comment) 57 | ;; nodes titles in sidebar 58 | `(org-roam-title :weight bold :height 1.4) 59 | `(org-meta-line :foreground ,dracula-comment) 60 | `(org-document-info-keyword :foreground ,dracula-comment) 61 | `(org-special-keyword :foreground ,dracula-comment) 62 | `(org-property-value :foreground ,dracula-grey) 63 | `(org-document-info :foreground ,dracula-grey) 64 | `(org-agenda-done :foreground ,dracula-grey) 65 | `(org-headline-done :foreground ,dracula-grey) 66 | `(org-quote :slant italic :foreground ,dracula-grey) 67 | `(org-link :weight normal :foreground ,dracula-foreground) 68 | `(org-block :foreground ,dracula-grey) 69 | `(org-inline-src-block :foreground ,dracula-grey) 70 | `(org-table :foreground ,dracula-grey) 71 | `(outline-1 :height 1.4 :foreground ,dracula-foreground :family "Iosevka Etoile") 72 | `(outline-2 :height 0.8 :foreground ,dracula-foreground) 73 | `(outline-3 :foreground ,dracula-foreground)) 74 | -------------------------------------------------------------------------------- /.config/fish/completions/az.fish: -------------------------------------------------------------------------------- 1 | function __fish_az_resource_groups 2 | az group list | jq -r .[].name 3 | end 4 | 5 | function __fish_az_resource_uris 6 | az resource list | jq -r .[].id 7 | end 8 | 9 | complete -c az --long-option resource-uri --require-parameter --no-files --arguments '(__fish_az_resource_uris)' 10 | complete -c az --short-option g --long-option resource-group --require-parameter --no-files --arguments '(__fish_az_resource_groups)' 11 | complete -c az -f -a '(__fish_argcomplete_complete az)' 12 | -------------------------------------------------------------------------------- /.config/fish/completions/tldr.fish: -------------------------------------------------------------------------------- 1 | # 2 | # Completions for the tealdeer implementation of tldr 3 | # https://github.com/dbrgn/tealdeer/ 4 | # 5 | 6 | complete -c tldr -s h -l help -d 'Print the help message.' -f 7 | complete -c tldr -s v -l version -d 'Show version information.' -f 8 | complete -c tldr -s l -l list -d 'List all commands in the cache.' -f 9 | complete -c tldr -s f -l render -d 'Render a specific markdown file.' -r 10 | complete -c tldr -s o -l os -d 'Override the operating system.' -xa 'linux osx sunos windows other' 11 | complete -c tldr -s u -l update -d 'Update the local cache.' -f 12 | complete -c tldr -s c -l clear-cache -d 'Clear the local cache.' -f 13 | complete -c tldr -s q -l quiet -d 'Suppress informational messages.' -f 14 | complete -c tldr -l config-path -d 'Show config file path.' -f 15 | complete -c tldr -l seed-config -d 'Create a basic config.' -f 16 | 17 | function __tealdeer_entries 18 | tldr --list | string replace -a -i -r "\,\s" "\n" 19 | end 20 | 21 | complete -f -c tldr -a '(__tealdeer_entries)' 22 | -------------------------------------------------------------------------------- /.config/fish/config.fish: -------------------------------------------------------------------------------- 1 | set -x EDITOR kak 2 | set -x VISUAL kak 3 | 4 | alias ...='cd ../../' 5 | alias ....='cd ../../../' 6 | alias .....='cd ../../../../' 7 | alias ......='cd ../../../../../' 8 | 9 | # plurals 10 | alias builtins='builtin --names' 11 | 12 | # curl 13 | abbr --add --position anywhere -- --jwt '--header "Authorization: Bearer $JWT"' 14 | 15 | # docker / podman 16 | abbr --add --position anywhere -- --transient '--rm --interactive --tty' 17 | 18 | # use fish_key_reader 19 | 20 | # ctrl+backspace 21 | bind \b backward-kill-bigword 22 | 23 | # ← arrow 24 | bind \e\[1\;3D backward-kill-word 25 | bind \e\[1\;4D backward-kill-bigword 26 | # → arrow 27 | bind \e\[1\;3C kill-word 28 | bind \e\[1\;4C kill-bigword 29 | 30 | # prompt 31 | if type -q starship 32 | function starship_transient_prompt_func 33 | starship module character 34 | end 35 | 36 | starship init fish | source 37 | enable_transience 38 | end 39 | 40 | if type -q direnv 41 | direnv hook fish | source 42 | end 43 | 44 | if type -q zoxide 45 | zoxide init fish | source 46 | end 47 | 48 | if test -e /opt/asdf-vm/asdf.fish 49 | source /opt/asdf-vm/asdf.fish 50 | end 51 | 52 | if status is-interactive && type -q atuin 53 | atuin init fish | source 54 | end 55 | 56 | -------------------------------------------------------------------------------- /.config/fish/functions/azcopy.fish: -------------------------------------------------------------------------------- 1 | function azcopy --description 'quiet azcopy' 2 | command azcopy --skip-version-check $argv 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/browser-search.fish: -------------------------------------------------------------------------------- 1 | function browser-search --description 'browser search with various engines' 2 | set --function engine "$argv[1]" 3 | set --function query "$argv[1..-1]" 4 | 5 | set --function browser xdg-open 6 | set --function engines \ 7 | arch \ 8 | arch-wiki \ 9 | bitbucket \ 10 | bugzilla \ 11 | deepl \ 12 | devdocs \ 13 | duckduckgo \ 14 | gitlab \ 15 | github \ 16 | google \ 17 | hacker-news \ 18 | hacker-news-url \ 19 | jsr \ 20 | linguee \ 21 | lobsters \ 22 | mdn \ 23 | musicbrainz \ 24 | npm \ 25 | repology \ 26 | stackoverflow \ 27 | wikipedia-en \ 28 | wikipedia-fr \ 29 | wiktionary-en \ 30 | wiktionary-fr \ 31 | wordnik 32 | 33 | if test -z "$engine" 34 | set --function engine (printf '%s\n' $engines | fzf --prompt 'browser-search ❯ ' --info inline --reverse --no-separator) 35 | end 36 | # pressing escape/enter key 37 | if test -z "$engine" 38 | exit 39 | end 40 | 41 | if test -z "$query" 42 | read --prompt-str "$engine ❯ " query 43 | end 44 | # pressing enter key 45 | if test -z "$query" 46 | exit 47 | end 48 | 49 | switch $engine 50 | case arch 51 | $browser "https://archlinux.org/packages/?q=$query" 52 | 53 | case arch-wiki 54 | $browser "https://wiki.archlinux.org/index.php?search=$query" 55 | 56 | case bitbucket bb 57 | $browser "https://bitbucket.org/repo/all/?name=$query" 58 | 59 | case bugzilla 60 | $browser "https://bugzilla.mozilla.org/buglist.cgi?quicksearch=$query" 61 | 62 | case deepl 63 | $browser "https://www.deepl.com/translator#en/fr/$query" 64 | 65 | case devdocs 66 | $browser "https://devdocs.io/?q=$query" 67 | 68 | case duckduckgo ddg 69 | # https://duckduckgo.com/settings 70 | # https://duckduckgo.com/duckduckgo-help-pages/settings/params/ 71 | # - kav infinite scroll 72 | # - kp safe search 73 | # - kaj metric system 74 | # - kak, kax install ddg 75 | # - kaq, kap newsletter 76 | # - kao privacy tips 77 | # - kau help improve 78 | # - km center 79 | # - kae theme 80 | $browser "https://duckduckgo.com/?kav=1&kp=-2&kaj=m&kak=-1&kax=-1&kaq=-1&kap=-1&kao=-1&kau=-1&km=m&kae=d&q=$query" 81 | 82 | case github gh 83 | $browser "https://github.com/search?q=$query" 84 | 85 | case gitlab gl 86 | $browser "https://gitlab.com/search?search=$query" 87 | 88 | case google goo 89 | $browser "https://www.google.com/search?q=$query" 90 | 91 | case hacker-news hn 92 | $browser "https://hn.algolia.com/?q=$query" 93 | 94 | case hacker-news-url hn 95 | $browser "https://hn.algolia.com/api/v1/search?restrictSearchableAttributes=url&query=$query" 96 | 97 | case jsr 98 | $browser "https://jsr.io/packages?search=$query" 99 | 100 | case linguee 101 | $browser "https://www.linguee.com/english-french/search?query=$query" 102 | 103 | case lobsters 104 | $browser "https://lobste.rs/search?q=$query" 105 | 106 | case mdn 107 | $browser "https://developer.mozilla.org/en-US/search?q=$query" 108 | 109 | case musicbrainz mb 110 | $browser "https://musicbrainz.org/search?type=artist&query=$query" 111 | 112 | case npm 113 | $browser "https://www.npmjs.com/search?q=$query" 114 | 115 | case repology repo 116 | $browser "https://repology.org/projects/?search=$query" 117 | 118 | case stackoverflow stack 119 | $browser "https://stackoverflow.com/search?q=$query" 120 | 121 | case wikipedia-en wiki 122 | $browser "https://en.wikipedia.org/wiki/Special:Search?search=$query" 123 | 124 | case wikipedia-fr wikifr 125 | $browser "https://fr.wikipedia.org/wiki/Special:Search?search=$query" 126 | 127 | case wiktionary-en dico 128 | $browser "https://en.wiktionary.org/w/index.php?search=$query" 129 | 130 | case wiktionary-fr dicofr 131 | $browser "https://fr.wiktionary.org/w/index.php?search=$query" 132 | 133 | case wordnik 134 | $browser "https://www.wordnik.com/words/$query" 135 | 136 | case '*' 137 | $browser "https://duckduckgo.com/?kav=1&kp=-2&kaj=m&kak=-1&kax=-1&kaq=-1&kap=-1&kao=-1&kau=-1&km=m&kae=d&q=$query" 138 | 139 | end 140 | 141 | sleep 0.2 142 | end 143 | 144 | -------------------------------------------------------------------------------- /.config/fish/functions/browser.fish: -------------------------------------------------------------------------------- 1 | function browser --description 'browser: bookmarks, search-engines, tabs' 2 | set --function source "$argv[1]" 3 | set --function sources \ 4 | bookmarks \ 5 | search-engines \ 6 | tabs 7 | 8 | if test -z "$source" 9 | set --function source (printf '%s\n' $sources | fzf --prompt 'browser ❯ ' --info inline --reverse --no-separator) 10 | end 11 | # pressing escape/enter key 12 | if test -z "$source" 13 | exit 14 | end 15 | 16 | switch $source 17 | 18 | case bookmarks 19 | fz browser-bookmarks 20 | 21 | case search-engines 22 | browser-search 23 | 24 | case tabs 25 | fz browser-tabs 26 | 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /.config/fish/functions/cal.fish: -------------------------------------------------------------------------------- 1 | function cal --description 'french calendar' 2 | command cal --monday $argv 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/cdr.fish: -------------------------------------------------------------------------------- 1 | function cdr --description 'cd to git repo root' 2 | cd "$(git rev-parse --show-toplevel)" 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/cert.fish: -------------------------------------------------------------------------------- 1 | function cert --description 'alias for step-cli certificate' 2 | step-cli certificate $argv 3 | end 4 | 5 | -------------------------------------------------------------------------------- /.config/fish/functions/date.fish: -------------------------------------------------------------------------------- 1 | function date --description 'default to ISO8601 and ts subcommand' 2 | switch $argv[1] 3 | case '' 4 | command date --iso-8601=seconds $argv 5 | 6 | case 'ts' 7 | # timestamp in seconds 8 | command date +%s 9 | # timestamp in milliseconds 10 | command date +%s%3N 11 | 12 | case '*' 13 | command date $argv 14 | end 15 | end 16 | 17 | -------------------------------------------------------------------------------- /.config/fish/functions/docker.fish: -------------------------------------------------------------------------------- 1 | function docker --description 'docker wrapper' 2 | switch $argv[1] 3 | 4 | case 'ls' 5 | docker containers 6 | printf "\n" 7 | docker images 8 | printf "\n" 9 | docker volumes 10 | printf "\n" 11 | docker networks 12 | 13 | case 'containers' 14 | command docker container ls --all --format 'table {{.ID}}\t{{slice .CreatedAt 0 10}}\t{{.Image}}\t{{.Command}}\t{{.RunningFor}}\t{{.Status}}\t{{.Ports}}\t{{.Names}}' 15 | 16 | case 'contexts' 17 | command docker context ls 18 | 19 | case 'images' 20 | command docker image ls --format 'table {{.ID}}\t{{slice .CreatedAt 0 10}}\t{{.Repository}}\t{{.Tag}}\t{{if .CreatedSince }}{{.CreatedSince}}{{else}}N/A{{end}}\t{{.Size}}' 21 | 22 | case 'networks' 23 | command docker network ls --format 'table {{.ID}}\t{{slice .CreatedAt 0 10}}\t{{.Driver}}\t{{.Scope}}\t{{.Name}}' 24 | 25 | case 'volumes' 26 | # volumes do not have ids, nor createdAt 27 | command docker volume ls --format 'table {{.Driver}}\t{{.Scope}}\t{{.Name}}' 28 | 29 | case '*' 30 | command docker $argv 31 | end 32 | end 33 | 34 | -------------------------------------------------------------------------------- /.config/fish/functions/dot-versions.fish: -------------------------------------------------------------------------------- 1 | function dot-versions --description 'list commom tools versions' 2 | type -q bat && echo "bat $(bat --version | awk '{ print $2 }')" || begin; set_color red; echo 'bat'; set_color normal; end; 3 | type -q broot && broot --version || begin; set_color red; echo 'broot'; set_color normal; end; 4 | type -q caddy && echo "caddy $(caddy version)" || begin; set_color red; echo 'caddy'; set_color normal; end; 5 | type -q chars && chars --version || begin; set_color red; echo 'chars'; set_color normal; end; 6 | type -q dog && echo "dog $(dog --version | head -n 2 | tail -n 1)" || begin; set_color red; echo 'dog'; set_color normal; end; 7 | type -q entr && echo "entr $(entr 2>&1 | head -n 1 | awk '{ print $2 }')" || begin; set_color red; echo 'entr'; set_color normal; end; 8 | type -q eza && echo "eza $(eza --version | head -n 2 | tail -n 1 | awk '{ print $1 }')" || begin; set_color red; echo 'eza'; set_color normal; end; 9 | type -q fd && fd --version || begin; set_color red; echo 'fd'; set_color normal; end; 10 | type -q fish && echo "fish $(fish --version | awk '{ print $3 }')" || begin; set_color red; echo 'fish'; set_color normal; end; 11 | type -q flameshot && echo "flameshot $(flameshot --version | head -n 1 | awk '{ print $2 }')" || begin; set_color red; echo 'flameshot'; set_color normal; end; 12 | type -q fzf && echo "fzf $(fzf --version)" || begin; set_color red; echo 'fzf'; set_color normal; end; 13 | type -q git && echo "git $(git --version | awk '{ print $3 }')" || begin; set_color red; echo 'git'; set_color normal; end; 14 | type -q gitui && gitui --version || begin; set_color red; echo 'gitui'; set_color normal; end; 15 | type -q grex && grex --version || begin; set_color red; echo 'grex'; set_color normal; end; 16 | type -q htop && echo "htop $(htop --version | head -n 1 | awk '{ print $2 }')" || begin; set_color red; echo 'htop'; set_color normal; end; 17 | type -q hyperfine && hyperfine --version || begin; set_color red; echo 'hyperfine'; set_color normal; end; 18 | type -q i3 && echo "i3 $(i3 --version | awk '{ print $3 }')" || begin; set_color red; echo 'i3'; set_color normal; end; 19 | type -q jo && jo -v || begin; set_color red; echo 'jo'; set_color normal; end; 20 | type -q jq && jq --version | tr '-' ' ' || begin; set_color red; echo 'jq'; set_color normal; end; 21 | type -q jwt && jwt --version | head -n 1 || begin; set_color red; echo 'jwt'; set_color normal; end; 22 | type -q kak && kak -version | tr '[:upper:]' '[:lower:]' || begin; set_color red; echo 'kak'; set_color normal; end; 23 | type -q kitty && kitty --version | awk '{ print $1" "$2 }' || begin; set_color red; echo 'kitty'; set_color normal; end; 24 | type -q lazydocker && echo "lazydocker $(lazydocker --version | head -n 1 | awk '{ print $2 }')" || begin; set_color red; echo 'lazydocker'; set_color normal; end; 25 | type -q lf && echo "lf $(lf --version)" || begin; set_color red; echo 'lf'; set_color normal; end; 26 | type -q meld && meld --version || begin; set_color red; echo 'meld'; set_color normal; end; 27 | type -q mons && mons -v | head -n 1 | tr '[:upper:]' '[:lower:]' || begin; set_color red; echo 'mons'; set_color normal; end; 28 | type -q mpd && echo "mpd $(mpd --version | head -n 1 | awk '{ print $4 }')" || begin; set_color red; echo 'mpd'; set_color normal; end; 29 | type -q mpv && mpv --version | head -n 1 | awk '{ print $1" "$2 }' || begin; set_color red; echo 'mpv'; set_color normal; end; 30 | type -q ncmpcpp && ncmpcpp --version | head -n 1 || begin; set_color red; echo 'ncmpcpp'; set_color normal; end; 31 | type -q nvim && nvim --version | head -n 1 | tr '[:upper:]' '[:lower:]' || begin; set_color red; echo 'nvim'; set_color normal; end; 32 | type -q nu && echo "nu $(nu --version)" || begin; set_color red; echo 'nu'; set_color normal; end; 33 | type -q pastel && pastel --version || begin; set_color red; echo 'pastel'; set_color normal; end; 34 | type -q rg && rg --version | head -n 1 || begin; set_color red; echo 'rg'; set_color normal; end; 35 | type -q rofi && echo "rofi $(rofi -v | awk '{ print $2 }')" || begin; set_color red; echo 'rofi'; set_color normal; end; 36 | type -q rofimoji && rofimoji --version || begin; set_color red; echo 'rofimoji'; set_color normal; end; 37 | type -q sad && sad --version || begin; set_color red; echo 'sad'; set_color normal; end; 38 | type -q semgrep && echo "semgrep $(semgrep --version)" || begin; set_color red; echo 'semgrep'; set_color normal; end; 39 | type -q starship && starship --version | head -n 1 || begin; set_color red; echo 'starship'; set_color normal; end; 40 | type -q sxiv && sxiv -v || begin; set_color red; echo 'sxiv'; set_color normal; end; 41 | type -q tldr && tldr --version || begin; set_color red; echo 'tldr'; set_color normal; end; 42 | type -q tig && tig --version | head -n 1 | awk '{ print $1" "$3 }' || begin; set_color red; echo 'tig'; set_color normal; end; 43 | type -q tokei && tokei --version | awk '{ print $1" "$2}' || begin; set_color red; echo 'tokei'; set_color normal; end; 44 | type -q units && units --version | head -n 1 || begin; set_color red; echo 'units'; set_color normal; end; 45 | type -q xsv && echo "xsv $(xsv --version)" || begin; set_color red; echo 'xsv'; set_color normal; end; 46 | type -q zola && zola --version || begin; set_color red; echo 'zola'; set_color normal; end; 47 | type -q websocketd && websocketd --version | awk '{ print $1" "$2 }' || begin; set_color red; echo 'websocketd'; set_color normal; end; 48 | end 49 | -------------------------------------------------------------------------------- /.config/fish/functions/dot.fish: -------------------------------------------------------------------------------- 1 | function dot --description 'interact with dot in the sky' 2 | set -x GIT_COMMITTER_NAME 'Delapouite' 3 | set -x GIT_COMMITTER_EMAIL 'delapouite@gmail.com' 4 | set -x GIT_AUTHOR_NAME 'Delapouite' 5 | set -x GIT_AUTHOR_EMAIL 'delapouite@gmail.com' 6 | 7 | /usr/bin/git --git-dir=$HOME/.dot-in-the-sky --work-tree=$HOME $argv 8 | end 9 | -------------------------------------------------------------------------------- /.config/fish/functions/glow.fish: -------------------------------------------------------------------------------- 1 | function glow --description 'glowing vampire' 2 | command glow --style dracula $argv 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/ip.fish: -------------------------------------------------------------------------------- 1 | function ip --description 'show / manipulate routing, network devices, interfaces and tunnels' 2 | command ip --color $argv 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/jqz.fish: -------------------------------------------------------------------------------- 1 | function jqz --description 'fzf + jq' 2 | if count $argv > /dev/null 3 | echo '' | fzf --print-query --preview "cat $argv | jq -C {q}" 4 | else 5 | echo '' | fzf --print-query --preview "cat *.json | jq -C {q}" 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /.config/fish/functions/jwt.fish: -------------------------------------------------------------------------------- 1 | function jwt --description 'inspect JWT' 2 | switch $argv[1] 3 | case 'validate' 4 | set json (command jwt decode --json $argv[2]) 5 | set exp (echo "$json" | jq '.payload.exp') 6 | 7 | echo "$json" | jq . 8 | echo "" 9 | 10 | set ts (date +'%s') 11 | 12 | if test "$exp" -gt "$ts" 13 | echo 'not expired' 14 | else 15 | echo 'expired' 16 | end 17 | 18 | case '*' 19 | command jwt $argv 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /.config/fish/functions/kb.fish: -------------------------------------------------------------------------------- 1 | function kb --description 'change keyboard layout' 2 | switch $argv[1] 3 | case 'bepo' 4 | setxkbmap fr bepo 5 | 6 | case 'delafayette' 7 | xkbcomp -w0 -I$HOME/.config/xkb $HOME/.config/xkb/keymap/delafayette $DISPLAY 8 | 9 | case '*' 10 | setxkbmap $argv 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /.config/fish/functions/le.fish: -------------------------------------------------------------------------------- 1 | function le --description 'print sorted and colorful environment variables' 2 | set --local hide 0 3 | 4 | if test -n "$argv[1]" 5 | set hide 1 6 | end 7 | 8 | set --local direnv 'DIRENV_DIFF|DIRENV_DIR|DIRENV_FILE|DIRENV_WATCHES' 9 | set --local eza 'EZA_COLORS' 10 | set --local kitty 'KITTY_INSTALLATION_DIR|KITTY_PID|KITTY_PUBLIC_KEY|KITTY_WINDOW_ID' 11 | set --local ssh 'SSH_AGENT_PID|SSH_AUTH_SOCK' 12 | set --local starship 'STARSHIP_SESSION_KEY|STARSHIP_SHELL' 13 | set --local systemd 'DBUS_SESSION_BUS_ADDRESS|INVOCATION_ID|MEMORY_PRESSURE_WATCH|MEMORY_PRESSURE_WRITE|SYSTEMD_EXEC_PID' 14 | set --local term 'COLORTERM|TERM|TERMINFO' 15 | set --local tool 'ASDF_DIR|FZF_DEFAULT_OPTS|I3SOCK' 16 | set --local wellknown 'EDITOR|HOME|LANG|LOGNAME|MAIL|MOTD_SHOWN|PATH|PWD|SHELL|SHLVL|USER|VISUAL' 17 | set --local xdg 'DESKTOP_STARTUP_ID|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SESSION_CLASS|XDG_SESSION_ID|XDG_SESSION_TYPE|XDG_VTNR' 18 | set --local xorg 'DISPLAY|WINDOWID|WINDOWPATH|XAUTHORITY' 19 | set --local masked "$eza|$direnv|$kitty|$ssh|$starship|$systemd|$term|$tool|$wellknown|$xdg|$xorg" 20 | 21 | env -0 | sort -z | tr '\0' '\n' | awk "\ 22 | match(\$0, /^($masked)=(.*)/, m) { \ 23 | if ($hide == 0) { printf \"\x1b[38;2;98;114;164m%s\x1b[m \x1b[38;2;173;178;203m%s\x1b[m\n\", m[1], m[2]; } \ 24 | next; \ 25 | } \ 26 | match(\$0, /([^=]*)=(.*)/, m) { \ 27 | printf \"\x1b[36m%s\x1b[m %s\n\", m[1], m[2]; \ 28 | }" 29 | end 30 | 31 | -------------------------------------------------------------------------------- /.config/fish/functions/lh.fish: -------------------------------------------------------------------------------- 1 | function lh --description 'list only hidden files' 2 | eza \ 3 | --all \ 4 | --classify \ 5 | --color-scale all \ 6 | --color-scale-mode fixed \ 7 | --git \ 8 | --links \ 9 | --list-dirs \ 10 | --long \ 11 | --octal-permissions \ 12 | .* 13 | end 14 | 15 | # see also ll and llh 16 | 17 | -------------------------------------------------------------------------------- /.config/fish/functions/ll.fish: -------------------------------------------------------------------------------- 1 | function ll --description 'list files verbosely' 2 | eza \ 3 | --classify \ 4 | --color-scale all \ 5 | --color-scale-mode fixed \ 6 | --git \ 7 | --links \ 8 | --long \ 9 | --octal-permissions \ 10 | $argv 11 | end 12 | 13 | # see also lh, llh 14 | -------------------------------------------------------------------------------- /.config/fish/functions/lld.fish: -------------------------------------------------------------------------------- 1 | function lld --description 'list directories verbosely' 2 | eza \ 3 | --classify \ 4 | --color-scale all \ 5 | --color-scale-mode fixed \ 6 | --git \ 7 | --links \ 8 | --long \ 9 | --octal-permissions \ 10 | --only-dirs \ 11 | $argv 12 | end 13 | 14 | # see also lh, llh 15 | -------------------------------------------------------------------------------- /.config/fish/functions/llh.fish: -------------------------------------------------------------------------------- 1 | function llh --description 'list all files verbosely' 2 | eza \ 3 | --all \ 4 | --classify \ 5 | --color-scale all \ 6 | --color-scale-mode fixed \ 7 | --git \ 8 | --links \ 9 | --long \ 10 | --octal-permissions \ 11 | $argv 12 | end 13 | 14 | # see also ll, lh 15 | -------------------------------------------------------------------------------- /.config/fish/functions/ln.fish: -------------------------------------------------------------------------------- 1 | function ln --description 'verbose ln' 2 | command ln --verbose $argv 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/lt.fish: -------------------------------------------------------------------------------- 1 | function lt --description 'list files verbosely as a tree' 2 | eza \ 3 | --classify \ 4 | --color-scale all \ 5 | --color-scale-mode fixed \ 6 | --git \ 7 | --links \ 8 | --long \ 9 | --octal-permissions \ 10 | --tree \ 11 | $argv 12 | end 13 | 14 | -------------------------------------------------------------------------------- /.config/fish/functions/man.fish: -------------------------------------------------------------------------------- 1 | function man --description 'batman' 2 | command batman $argv 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/me.fish: -------------------------------------------------------------------------------- 1 | function me --description 'show info about current user and accounts' 2 | printf "\n🛒 Caddy" 3 | if systemctl is-active --quiet caddy 4 | printf " ✅:\n" 5 | else 6 | printf " ❌:\n" 7 | end 8 | rg --before-context 1 --no-line-number --no-filename reverse_proxy /etc/caddy/conf.d/ 9 | 10 | printf "\n🧛 id:\n" 11 | id 12 | 13 | printf "\n🔑 SSH Agent (ssh-add -l):\n" 14 | ssh-add -l 15 | 16 | printf "\n☁️ Azure (az account show):\n" 17 | az account show 18 | 19 | printf "\n🐳 Docker (config.json .auths)" 20 | if systemctl is-active --quiet docker 21 | printf " ✅:\n" 22 | else 23 | printf " ❌:\n" 24 | end 25 | jq '.auths | keys' ~/.docker/config.json 26 | end 27 | -------------------------------------------------------------------------------- /.config/fish/functions/mkcd.fish: -------------------------------------------------------------------------------- 1 | function mkcd 2 | mkdir -p $argv 3 | cd $argv 4 | end 5 | -------------------------------------------------------------------------------- /.config/fish/functions/mpc.fish: -------------------------------------------------------------------------------- 1 | function mpc --description 'wrapper to add subcommands aliases to mpc' 2 | switch $argv[1] 3 | 4 | case 'album' 5 | command mpc search album $argv[2] 6 | 7 | case 'albums' 8 | command mpc list album | fzf 9 | 10 | case 'artist' 11 | command mpc search artist $argv[2] 12 | 13 | case 'artists' 14 | command mpc list artist | fzf 15 | 16 | case 'dates' 17 | command mpc list date | fzf 18 | 19 | case 'playlists' 20 | command mpc lsplaylists 21 | 22 | case '*' 23 | command mpc $argv 24 | end 25 | 26 | end 27 | 28 | set -l subcommands consume crossfade queued mixrampdb mixrampdelay next \ 29 | pause play prev random repeat replaygain single seek seekthrough stop \ 30 | toggle add insert clear crop del mv searchplay shuffle load lsplaylists \ 31 | playlist rm save listall ls search search find findadd list stats mount \ 32 | mount unmount outputs disable enable toggleoutput channels sendmessage \ 33 | waitmessage subscribe idle idleloop version volume update rescan current 34 | 35 | complete -c mpc -n "not __fish_seen_subcommand_from $subcommands" -a albums -d "List albums" 36 | complete -c mpc -n "not __fish_seen_subcommand_from $subcommands" -a artists -d "List artists" 37 | complete -c mpc -n "not __fish_seen_subcommand_from $subcommands" -a dates -d "List dates" 38 | complete -c mpc -n "not __fish_seen_subcommand_from $subcommands" -a playlists -d "List playlists" 39 | 40 | -------------------------------------------------------------------------------- /.config/fish/functions/npm.fish: -------------------------------------------------------------------------------- 1 | function npm --description 'npm' 2 | switch $argv[1] 3 | 4 | case 'nuke' 5 | find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; 6 | 7 | case 'outdated' 8 | command npm outdated -l 9 | 10 | case '*' 11 | command npm $argv 12 | 13 | end 14 | end 15 | 16 | -------------------------------------------------------------------------------- /.config/fish/functions/pandock.fish: -------------------------------------------------------------------------------- 1 | function pandock --description 'run pandoc/minimal container' 2 | docker run \ 3 | --rm \ 4 | --volume "$(pwd):/data" \ 5 | --user $(id -u):$(id -g) \ 6 | pandoc/minimal \ 7 | $argv 8 | end 9 | 10 | -------------------------------------------------------------------------------- /.config/fish/functions/podman.fish: -------------------------------------------------------------------------------- 1 | function podman --description 'podman wrapper' 2 | switch $argv[1] 3 | 4 | case 'ls' 5 | command podman pod ls 6 | printf "\n" 7 | command podman container ls --all 8 | printf "\n" 9 | command podman image ls 10 | printf "\n" 11 | command podman volume ls 12 | printf "\n" 13 | command podman network ls 14 | 15 | case '*' 16 | command podman $argv 17 | end 18 | end 19 | 20 | -------------------------------------------------------------------------------- /.config/fish/functions/radix.fish: -------------------------------------------------------------------------------- 1 | function radix --description 'conversion between number radix' 2 | # unfortunately bc's ibase can't be higher than 36 3 | # so conversion from base64 (tetrasexagesimal) is not possible 4 | 5 | if not command --query bc 6 | echo 'unknown command bc' 7 | return 1 8 | end 9 | 10 | # bc only accepts uppercase hexa 11 | set -l num (string upper $argv[2]) 12 | 13 | switch $argv[1] 14 | # h = hexadecimal 16, d = decimal 10, o = octal 8, b = binary 2 15 | # obase needs to be specified first: 16 | # https://unix.stackexchange.com/questions/199615/understand-ibase-and-obase-in-case-of-conversions-with-bc 17 | 18 | # from h 19 | case 'h' 20 | echo h: $num 21 | echo h: (echo $num | sed ':a;s/\B[0-F]\{2\}\>/ &/;ta') 22 | echo d: (echo "obase=10; ibase=16; $num" | bc) 23 | echo d: (echo "obase=10; ibase=16; $num" | bc | sed ':a;s/\B[0-9]\{3\}\>/ &/;ta') 24 | echo o: (echo "obase=8; ibase=16; $num" | bc) 25 | echo b: (echo "obase=2; ibase=16; $num" | bc) 26 | echo b: (echo "obase=2; ibase=16; $num" | bc | sed ':a;s/\B[0-9]\{8\}\>/ &/;ta') 27 | echo b: (echo "obase=2; ibase=16; $num" | bc | sed ':a;s/\B[0-9]\{4\}\>/ &/;ta') 28 | 29 | case 'hd' 30 | echo "obase=10; ibase=16; $num" | bc 31 | 32 | case 'ho' 33 | echo "obase=8; ibase=16; $num" | bc 34 | 35 | case 'hb' 36 | echo "obase=2; ibase=16; $num" | bc 37 | 38 | # from d 39 | case 'd' 40 | echo h: (echo "obase=16; ibase=10; $num" | bc) 41 | echo h: (echo "obase=16; ibase=10; $num" | bc | sed ':a;s/\B[0-F]\{2\}\>/ &/;ta') 42 | echo d: $num 43 | echo d: (echo $num | sed ':a;s/\B[0-9]\{3\}\>/ &/;ta') 44 | echo o: (echo "obase=8; ibase=10; $num" | bc) 45 | echo b: (echo "obase=2; ibase=10; $num" | bc) 46 | echo b: (echo "obase=2; ibase=10; $num" | bc | sed ':a;s/\B[0-9]\{8\}\>/ &/;ta') 47 | echo b: (echo "obase=2; ibase=10; $num" | bc | sed ':a;s/\B[0-9]\{4\}\>/ &/;ta') 48 | 49 | case 'dh' 50 | echo "obase=16; ibase=10; $num" | bc 51 | 52 | case 'do' 53 | echo "obase=8; ibase=10; $num" | bc 54 | 55 | case 'db' 56 | echo "obase=2; ibase=10; $num" | bc 57 | 58 | # from o 59 | case 'o' 60 | echo h: (echo "obase=16; ibase=8; $num" | bc) 61 | echo h: (echo "obase=16; ibase=8; $num" | bc | sed ':a;s/\B[0-F]\{2\}\>/ &/;ta') 62 | echo d: (echo "obase=10; ibase=8; $num" | bc) 63 | echo d: (echo "obase=10; ibase=8; $num" | bc | sed ':a;s/\B[0-9]\{3\}\>/ &/;ta') 64 | echo o: $num 65 | echo b: (echo "obase=2; ibase=8; $num" | bc) 66 | echo b: (echo "obase=2; ibase=8; $num" | bc | sed ':a;s/\B[0-9]\{8\}\>/ &/;ta') 67 | echo b: (echo "obase=2; ibase=8; $num" | bc | sed ':a;s/\B[0-9]\{4\}\>/ &/;ta') 68 | 69 | case 'oh' 70 | echo "obase=16; ibase=8; $num" | bc 71 | 72 | case 'od' 73 | echo "obase=10; ibase=8; $num" | bc 74 | 75 | case 'ob' 76 | echo "obase=2; ibase=8; $num" | bc 77 | 78 | # from b 79 | case 'b' 80 | echo h: (echo "obase=16; ibase=2; $num" | bc) 81 | echo h: (echo "obase=16; ibase=2; $num" | bc | sed ':a;s/\B[0-F]\{2\}\>/ &/;ta') 82 | echo d: (echo "obase=10; ibase=2; $num" | bc) 83 | echo d: (echo "obase=10; ibase=2; $num" | bc | sed ':a;s/\B[0-9]\{3\}\>/ &/;ta') 84 | echo o: (echo "obase=8; ibase=2; $num" | bc) 85 | echo b: $num 86 | echo b: (echo $num | sed ':a;s/\B[0-9]\{8\}\>/ &/;ta') 87 | echo b: (echo $num | sed ':a;s/\B[0-9]\{4\}\>/ &/;ta') 88 | 89 | case 'bh' 90 | echo "obase=16; ibase=2; $num" | bc 91 | 92 | case 'bd' 93 | echo "obase=10; ibase=2; $num" | bc 94 | 95 | case 'bo' 96 | echo "obase=8; ibase=2; $num" | bc 97 | 98 | case '*' 99 | echo 'unknown subcommand' 100 | end 101 | end 102 | -------------------------------------------------------------------------------- /.config/fish/functions/rg.fish: -------------------------------------------------------------------------------- 1 | function rg --description 'ripgrep with different default values' 2 | command rg \ 3 | --max-columns 200 \ 4 | --max-columns-preview \ 5 | $argv 6 | end 7 | -------------------------------------------------------------------------------- /.config/fish/functions/ssh.fish: -------------------------------------------------------------------------------- 1 | function ssh --description 'wrapper to change kitty theme depending on host env' 2 | if string match -q -r -- '\-prod-' $argv 3 | kitty @ set-colors -a "~/.config/kitty/themes/red-alert.conf" 4 | else if string match -q -r -- '\-staging-' $argv 5 | kitty @ set-colors -a "~/.config/kitty/themes/espresso-libre.conf" 6 | else if string match -q -r -- '\-qual-' $argv 7 | kitty @ set-colors -a "~/.config/kitty/themes/espresso-libre.conf" 8 | else if string match -q -r -- '\-dev-' $argv 9 | kitty @ set-colors -a "~/.config/kitty/themes/grass.conf" 10 | end 11 | 12 | command ssh $argv 13 | end 14 | -------------------------------------------------------------------------------- /.config/fish/functions/starship.fish: -------------------------------------------------------------------------------- 1 | function starship --description 'starship' 2 | switch $argv[1] 3 | 4 | case 'toggle' 5 | set --global --export STARSHIP_CONFIG "/tmp/starship-$STARSHIP_SESSION_KEY.toml" 6 | if not test -e "$STARSHIP_CONFIG" 7 | cp ~/.config/starship.toml "$STARSHIP_CONFIG" 8 | end 9 | 10 | command starship toggle "$argv[2]" 11 | 12 | case '*' 13 | command starship $argv 14 | 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /.config/fish/functions/startx.fish: -------------------------------------------------------------------------------- 1 | function startx --description 'start ssh-agent for the session' 2 | ssh-agent startx 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/utc.fish: -------------------------------------------------------------------------------- 1 | function utc --description 'default to UTC ISO8601' 2 | command date --iso-8601=seconds --utc $argv 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/vagrant.fish: -------------------------------------------------------------------------------- 1 | function vagrant --description 'wrapper to change kitty theme depending on host env' 2 | switch $argv[1] 3 | case 'ssh' 4 | kitty @ set-colors -a "~/.config/kitty/themes/ocean.conf" 5 | end 6 | 7 | command vagrant $argv 8 | end 9 | -------------------------------------------------------------------------------- /.config/fish/functions/xclip.fish: -------------------------------------------------------------------------------- 1 | function xclip --description 'xclip with selection clipboard default' 2 | command xclip -selection clipboard $argv 3 | end 4 | -------------------------------------------------------------------------------- /.config/fish/functions/xclipx.fish: -------------------------------------------------------------------------------- 1 | function xclipx --description 'output xclip clipboard in more meaningful ways' 2 | set --local content (command xclip -out -selection clipboard) 3 | 4 | if string match --quiet --regex '^[0-9]{10}$' -- $content 5 | # seconds 6 | command date --iso-8601=seconds --date "@$content" 7 | else if string match --quiet --regex '^[0-9]{13}$' -- $content 8 | # milliseconds 9 | set --local ms (string sub --length 10 $content) 10 | command date --iso-8601=seconds --date "@$ms" 11 | else 12 | echo 'clipboard content is none of the following formats: seconds, milliseconds' 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /.config/fish/themes/Delacula.theme: -------------------------------------------------------------------------------- 1 | # https://fishshell.com/docs/current/interactive.html#syntax-highlighting 2 | # Use 'fish_config theme save Delacula' to apply this theme 3 | # name: 'Delacula' 4 | # preferred_background: 282A36 5 | 6 | # default color 7 | fish_color_normal F8F8F2 #foreground 8 | 9 | # commands like echo 10 | fish_color_command F8F8F2 #foreground 11 | 12 | # keywords like if - this falls back on the command color if unset 13 | fish_color_keyword F8F8F2 #foreground 14 | 15 | # quoted text like "abc" 16 | fish_color_quote F1FA8C #yellow 17 | 18 | # IO redirections like >/dev/null 19 | fish_color_redirection 8BE9FD #cyan 20 | 21 | # process separators like ; and & 22 | fish_color_end 50FA7B #green 23 | 24 | # syntax errors 25 | fish_color_error FF5555 #red 26 | 27 | # ordinary command parameters 28 | fish_color_param FF79C6 #pink 29 | 30 | # options starting with “-”, up to the first “--” parameter 31 | fish_color_option FFB86C #orange 32 | 33 | # parameter expansion operators like * and ~ 34 | fish_color_operator 8BE9FD #cyan 35 | 36 | # comments like ‘# important’ 37 | fish_color_comment 6272A4 #comment 38 | 39 | # character escapes like \n and \x70 40 | fish_color_escape 8BE9FD #cyan 41 | 42 | # parameters that are filenames (if the file exists) 43 | fish_color_valid_path --underline 44 | 45 | # autosuggestions (the proposed rest of a command) 46 | fish_color_autosuggestion 6272A4 #comment 47 | 48 | # the ‘^C’ indicator on a canceled command 49 | fish_color_cancel -r 50 | 51 | # selected text in vi visual mode 52 | fish_color_selection F8F8F2 --bold --background=brblack 53 | 54 | # history search matches and selected pager items (background only) 55 | fish_color_search_match bryellow --background=brblack 56 | 57 | # used by dirh command 58 | fish_color_history_current --bold 59 | 60 | 61 | # default prompt (so not really relevant with starship) 62 | 63 | # the current working directory in the default prompt 64 | fish_color_cwd 50FA7B #green 65 | 66 | # the current working directory root in the default prompt 67 | fish_color_cwd_root FF5555 #red 68 | 69 | # the username in the default prompt 70 | fish_color_user 50FA7B #green 71 | 72 | # the hostname in the default prompt 73 | fish_color_host F8F8F2 #foreground 74 | 75 | # the hostname in the default prompt for remote sessions (like ssh) 76 | fish_color_host_remote F8F8F2 #foreground 77 | 78 | 79 | # the fish pager is used when pressing the tab key 80 | 81 | fish_pager_color_completion F8F8F2 #foreground 82 | fish_pager_color_description BD93F9 #purple 83 | fish_pager_color_prefix F8F8F2 --bold --underline 84 | fish_pager_color_selected_background --background=44475A #current-line 85 | 86 | # bottom indicator "and xxx more rows" 87 | fish_pager_color_progress -r 88 | 89 | -------------------------------------------------------------------------------- /.config/git/config: -------------------------------------------------------------------------------- 1 | [user] 2 | email = delapouite@gmail.com 3 | name = Delapouite 4 | useConfigOnly = true 5 | 6 | [includeIf "gitdir:~/code/github/"] 7 | path = ~/code/github/.gitconfig 8 | 9 | [includeIf "gitdir:~/code/gitlab/"] 10 | path = ~/code/gitlab/.gitconfig 11 | 12 | [includeIf "gitdir:~/projects/"] 13 | path = ~/projects/.gitconfig 14 | 15 | [core] 16 | editor = kak 17 | hooksPath = ~/.config/git/hooks/ 18 | # pager = delta --theme='Monokai Extended' 19 | 20 | [alias] 21 | # plurals 22 | aliases = !git config --list | grep alias | cut --characters 7- 23 | branches = branch --all --sort=-committerdate --format='%(committerdate:short) %(color:magenta)%(objectname:short) %(refname:short)%(color:reset) %(color:blue)%(upstream:short)%(color:reset) - %(contents:subject) - %(color:cyan)%(authorname)%(color:reset)' 24 | files = ls-files 25 | hooks = !fd . .git/hooks --exclude '*.sample' 26 | remotes = remote --verbose 27 | stashes = stash list 28 | tags = tag -n 29 | worktrees = worktree list 30 | 31 | # synonyms 32 | # remember to use .mailmap to merge authors 33 | authors = shortlog --summary --numbered --email 34 | first = !git rev-list --max-parents=0 HEAD | xargs git show 35 | fix = rebase -i HEAD~2 36 | nuke = !git branch --merged | grep -v -P '^\\*|master|main|staging|develop' | xargs -n1 -r git branch -d 37 | tidy = rebase -i @{upstream}.. 38 | 39 | # undo 40 | amend = commit --amend 41 | uncommit = reset --mixed HEAD~ 42 | unstage = restore --staged 43 | 44 | # personal 45 | bh = log --branches --no-walk --author=bheridet 46 | 47 | b = branches 48 | ci = commit -v 49 | co = checkout 50 | draft = !mkdir _drafts && echo '*' > ./_drafts/.gitignore 51 | dw = diff --word-diff 52 | dsf = "!git diff --color $@ | diff-so-fancy" 53 | l = log --graph --format='%C(yellow)%h% %C(red)%d%Creset %s %Cgreen(%cr) %C(blue)%an%Creset' 54 | ls = "!cd ${GIT_PREFIX:-`pwd`}; printf \"# HEAD: \"; git log --oneline | head -n1; git status" 55 | rb = rebase 56 | s = status --short --branch 57 | ui = !gitui 58 | 59 | [log] 60 | date = iso 61 | 62 | [push] 63 | default = simple 64 | 65 | [pull] 66 | rebase = merges 67 | 68 | [status] 69 | showUntrackedFiles = all 70 | 71 | [diff] 72 | wordRegex = . 73 | 74 | [color] 75 | ui = auto 76 | 77 | [merge] 78 | tool = meld 79 | 80 | [mergetool "meld"] 81 | cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED" 82 | 83 | [rerere] 84 | enabled = true 85 | 86 | [fetch] 87 | prune = true 88 | [init] 89 | defaultBranch = main 90 | -------------------------------------------------------------------------------- /.config/git/hooks/prepare-commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # https://git-scm.com/docs/githooks#_prepare_commit_msg 4 | 5 | ORIG_MSG_FILE="$1" 6 | # message, template, merge, squash, commit or empty 7 | COMMIT_SOURCE="$2" 8 | 9 | # only enrich the commit message in simple scenarii (when empty) 10 | if test -n "$COMMIT_SOURCE"; then 11 | exit 0; 12 | fi; 13 | 14 | TEMP="$(mktemp /tmp/git-XXXXX)" 15 | 16 | USER_NAME="$(git config --get user.name)" 17 | USER_EMAIL="$(git config --get user.email)" 18 | 19 | (printf "\n# User: %s (%s)\n\n" "$USER_NAME" "$USER_EMAIL"; \ 20 | git log --oneline | head -n 5 | sed 's/^/# /'; \ 21 | cat "$ORIG_MSG_FILE") > "$TEMP" 22 | 23 | cat "$TEMP" > "$ORIG_MSG_FILE" 24 | rm "$TEMP" 25 | -------------------------------------------------------------------------------- /.config/git/ignore: -------------------------------------------------------------------------------- 1 | # Linux 2 | 3 | .envrc 4 | .envrc.d 5 | 6 | # macOS 7 | 8 | .DS_Store 9 | 10 | # Windows 11 | 12 | Thumbs.db 13 | [Dd]esktop.ini 14 | $RECYCLE.BIN/ 15 | -------------------------------------------------------------------------------- /.config/i3/config: -------------------------------------------------------------------------------- 1 | # This file has been auto-generated by i3-config-wizard(1). 2 | # It will not be overwritten, so edit it as you like. 3 | # i3 config file (v4) 4 | # Please see http://i3wm.org/docs/userguide.html for a complete reference! 5 | 6 | font pango:DejaVu Sans Mono 10 7 | # avoid black flash on new terminals 8 | exec --no-startup-id xsetroot -solid "#282a36" 9 | 10 | # use Mouse+$mod to drag floating windows 11 | set $mod Mod4 12 | 13 | # floating 14 | floating_modifier $mod 15 | floating_minimum_size 100 x 36 16 | floating_maximum_size -1 x -1 17 | for_window [instance="scratchpad"] move scratchpad ; scratchpad show 18 | for_window [instance="floating-term"] floating enable, resize set 80ppt 40ppt, move position center 19 | # toggle tiling / floating 20 | bindsym $mod+space floating toggle 21 | # change focus between tiling / floating windows 22 | bindsym $mod+Shift+space focus mode_toggle 23 | 24 | bindsym $mod+Escape kill 25 | # hover window title 26 | bindsym $mod+button2 kill 27 | 28 | # mirror Kitty keybindings 29 | bindsym $mod+F1 exec firefox-developer-edition 'https://i3wm.org/docs/userguide.html' 30 | bindsym $mod+F2 exec kitty --single-instance 'kak' '~/.config/i3/config' 31 | bindsym $mod+F5 reload 32 | 33 | bindsym $mod+Return exec kitty --single-instance 34 | bindsym $mod+BackSpace exec kitty --single-instance --class floating-term fish -c browser 35 | # note: not working with xclip :( https://github.com/astrand/xclip/issues/4 ? 36 | bindsym $mod+y exec kitty --single-instance --class floating-term fish -c 'firefoxctl tab list | jq ".[] | select(.active)" | xsel --clipboard' 37 | 38 | bindsym $mod+backslash resize set width 30 ppt 39 | bindsym $mod+s exec kitty --single-instance --name=scratchpad 40 | 41 | bindsym $mod+p exec kitty --single-instance --class floating-term fish -c 'fz i3-windows' 42 | bindsym $mod+minus exec kitty --single-instance --class floating-term fish -c browser-search 43 | bindsym $mod+plus exec kitty --single-instance --class floating-term fish -c 'fz browser-bookmarks' 44 | bindsym $mod+dead_circumflex exec kitty --single-instance --class floating-term fish -c 'fz browser-tabs' 45 | bindsym $mod+dead_diaeresis exec kitty --single-instance --class floating-term fish -c 'fz org-roam-links' 46 | 47 | bindsym $mod+Shift+asciitilde move scratchpad 48 | bindsym $mod+asciitilde scratchpad show 49 | 50 | # change focus 51 | bindsym $mod+h focus left 52 | bindsym $mod+j focus down 53 | bindsym $mod+k focus up 54 | bindsym $mod+l focus right 55 | bindsym $mod+Prior focus parent 56 | bindsym $mod+Next focus child 57 | 58 | # move focused window 59 | bindsym $mod+Shift+h move left 60 | bindsym $mod+Shift+j move down 61 | bindsym $mod+Shift+k move up 62 | bindsym $mod+Shift+l move right 63 | 64 | bindsym --whole-window $mod+button9 move left 65 | bindsym --whole-window $mod+button8 move right 66 | 67 | # the first available screen of each list will be used 68 | set $laptop_screens eDP-1 69 | set $external_screens DP-1 HDMI-1 DP-2-2 70 | 71 | # change focus between screens 72 | bindsym $mod+q focus output $laptop_screens 73 | bindsym $mod+w focus output $external_screens 74 | 75 | # move focused workspace between screens 76 | bindsym $mod+Shift+q move workspace to output $laptop_screens 77 | bindsym $mod+Shift+w move workspace to output $external_screens 78 | 79 | # fullscreen 80 | bindsym $mod+f fullscreen toggle 81 | bindsym $mod+Shift+f fullscreen toggle global 82 | 83 | # change container layout 84 | bindsym $mod+z layout stacking 85 | bindsym $mod+x layout tabbed 86 | bindsym $mod+c layout splith 87 | bindsym $mod+v layout splitv 88 | 89 | # horizontal orientation is [][][] 90 | bindsym $mod+Shift+c split h 91 | bindsym $mod+Shift+v split v 92 | 93 | # workspaces 94 | 95 | bindsym $mod+Tab workspace back_and_forth 96 | bindsym $mod+Left workspace prev 97 | bindsym $mod+Right workspace next 98 | 99 | bindsym $mod+1 workspace 1 100 | bindsym $mod+2 workspace 2 101 | bindsym $mod+3 workspace 3 102 | bindsym $mod+4 workspace 4 103 | bindsym $mod+5 workspace 5 104 | bindsym $mod+6 workspace 6 105 | bindsym $mod+7 workspace 7 106 | bindsym $mod+8 workspace 8 107 | bindsym $mod+9 workspace 9 108 | bindsym $mod+0 workspace 10 109 | 110 | bindsym $mod+Shift+1 move container to workspace 1 111 | bindsym $mod+Shift+2 move container to workspace 2 112 | bindsym $mod+Shift+3 move container to workspace 3 113 | bindsym $mod+Shift+4 move container to workspace 4 114 | bindsym $mod+Shift+5 move container to workspace 5 115 | bindsym $mod+Shift+6 move container to workspace 6 116 | bindsym $mod+Shift+7 move container to workspace 7 117 | bindsym $mod+Shift+8 move container to workspace 8 118 | bindsym $mod+Shift+9 move container to workspace 9 119 | bindsym $mod+Shift+0 move container to workspace 10 120 | 121 | # modes 122 | 123 | bindsym $mod+o mode $openmode 124 | set $openmode "open: vs[c]ode [e]macs [f]irefox [g]imp [k]akoune [i]nkscape [l]f nc[m]pcpp [n]ode [s]creenshot" 125 | mode $openmode { 126 | bindsym o exec kitty --single-instance --class floating-term fish -c 'fz bin-bookmarks' ; mode default 127 | 128 | bindsym c exec code ; mode default 129 | bindsym e exec emacs --background-color '#282a36'; mode default 130 | bindsym f exec firefox-developer-edition ; mode default 131 | bindsym g exec gimp ; mode default 132 | bindsym k exec kitty --single-instance kak ; mode default 133 | bindsym i exec inkscape ; mode default 134 | bindsym l exec kitty --single-instance lf ; mode default 135 | bindsym m exec kitty --single-instance ncmpcpp ; mode default 136 | bindsym n exec kitty --single-instance node ; mode default 137 | bindsym s exec flameshot gui ; mode default 138 | # standalone terminal 139 | bindsym t exec kitty ; mode default 140 | bindsym u exec chromium ; mode default 141 | bindsym v exec kitty --single-instance nvim ; mode default 142 | 143 | bindsym Return mode default 144 | bindsym Escape mode default 145 | } 146 | 147 | bindsym $mod+m mode $musicmode 148 | set $musicmode "music: [hp]rev [ln]ext [t]oggle [r]andom [f]av [y]outube" 149 | mode $musicmode { 150 | bindsym h exec "mpc prev" 151 | bindsym p exec "mpc prev" 152 | bindsym l exec "mpc next" 153 | bindsym n exec "mpc next" 154 | bindsym t exec "mpc toggle" 155 | bindsym r exec "mpc random" 156 | bindsym f exec mpd-fav 157 | bindsym y exec mpd-youtube; mode default 158 | 159 | bindsym Return mode default 160 | bindsym Escape mode default 161 | } 162 | 163 | # https://cgit.freedesktop.org/xorg/proto/x11proto/tree/XF86keysym.h 164 | # sound F1-F4 165 | bindsym XF86AudioMute exec "amixer set Master toggle" 166 | bindsym XF86AudioLowerVolume exec "amixer set Master 3%-" 167 | bindsym XF86AudioRaiseVolume exec "amixer set Master 3%+" 168 | bindsym XF86AudioMicMute exec "amixer set Capture toggle" 169 | 170 | bindsym XF86AudioPrev exec "mpc prev" 171 | bindsym XF86AudioPlay exec "mpc toggle" 172 | bindsym XF86AudioPause exec "mpc pause" 173 | bindsym XF86AudioStop exec "mpc stop" 174 | bindsym XF86AudioNext exec "mpc next" 175 | 176 | bindsym $mod+Delete mode $i3mode 177 | set $i3mode "i3: [c]onfig [d]oc [q]uit [l]ock [b]ar b[o]rder [g]aps [r]esize" 178 | mode $i3mode { 179 | bindsym Delete reload; restart 180 | # also $mod+F2 181 | bindsym c exec kitty --single-instance 'kak' '~/.config/i3/config' ; mode default 182 | # also $mod+F1 183 | bindsym d exec firefox-developer-edition 'https://i3wm.org/docs/userguide.html' ; mode default 184 | bindsym q exit 185 | 186 | bindsym l --release exec i3lock --no-unlock-indicator --image ~/images/wallpapers/bsod.png ; mode default 187 | 188 | # sub-modes 189 | bindsym b mode $barmode ; bar mode dock; 190 | bindsym o mode $bordermode 191 | bindsym g mode $gapsmode 192 | bindsym r mode $resizemode 193 | 194 | # monitors 195 | bindsym 1 exec mons -o ; mode default 196 | bindsym 2 exec mons -e top ; mode default 197 | 198 | bindsym Return mode default 199 | bindsym Escape mode default 200 | } 201 | 202 | # https://i3wm.org/docs/userguide.html#_display_mode 203 | set $barmode "bar: [d]ock [h]ide [i]nvisible [t]oggle" 204 | mode $barmode { 205 | # always visible 206 | bindsym d bar mode dock; 207 | # appear on pressing $mod or emergency 208 | bindsym h bar mode hide; 209 | # always invisible 210 | bindsym i bar mode invisible; 211 | # toggle between dock and hide modes 212 | bindsym t bar mode toggle; 213 | 214 | # hidden_state only works when in hide mode 215 | bindsym a bar hidden_state hide; 216 | bindsym s bar hidden_state show; 217 | # toggle between show and hide hidden_state 218 | bindsym y bar hidden_state toggle; 219 | 220 | bindsym Return mode default 221 | bindsym Escape mode default 222 | } 223 | 224 | set $resizemode "resize: [1-0] size [hjkl]" 225 | mode $resizemode { 226 | bindsym $mod+h focus left 227 | bindsym $mod+j focus down 228 | bindsym $mod+k focus up 229 | bindsym $mod+l focus right 230 | 231 | # Resize the border in the desired direction. 232 | bindsym h resize grow left 1 px or 1 ppt 233 | bindsym Shift+h resize shrink left 1 px or 1 ppt 234 | bindsym j resize grow down 1 px or 1 ppt 235 | bindsym Shift+j resize shrink down 1 px or 1 ppt 236 | bindsym k resize grow up 1 px or 1 ppt 237 | bindsym Shift+k resize shrink up 1 px or 1 ppt 238 | bindsym l resize grow right 1 px or 1 ppt 239 | bindsym Shift+l resize shrink right 1 px or 1 ppt 240 | 241 | bindsym Left resize shrink width 1 px or 1 ppt 242 | bindsym Down resize shrink height 1 px or 1 ppt 243 | bindsym Up resize grow height 1 px or 1 ppt 244 | bindsym Right resize grow width 1 px or 1 ppt 245 | 246 | bindsym 1 resize set width 10 ppt 247 | bindsym 2 resize set width 20 ppt 248 | bindsym 3 resize set width 30 ppt 249 | bindsym 4 resize set width 40 ppt 250 | bindsym 5 resize set width 50 ppt 251 | bindsym 6 resize set width 60 ppt 252 | bindsym 7 resize set width 70 ppt 253 | bindsym 8 resize set width 80 ppt 254 | bindsym 9 resize set width 90 ppt 255 | 256 | bindsym q resize set height 10 ppt 257 | bindsym w resize set height 20 ppt 258 | bindsym e resize set height 30 ppt 259 | bindsym r resize set height 40 ppt 260 | bindsym t resize set height 50 ppt 261 | bindsym y resize set height 60 ppt 262 | bindsym u resize set height 70 ppt 263 | bindsym i resize set height 80 ppt 264 | bindsym o resize set height 90 ppt 265 | 266 | bindsym Return mode default 267 | bindsym Escape mode default 268 | } 269 | 270 | set $bordermode "border: [1-0] size [t]oggle" 271 | mode $bordermode { 272 | bindsym 1 border pixel 1 273 | bindsym 2 border pixel 2 274 | bindsym 3 border pixel 3 275 | bindsym 4 border pixel 4 276 | bindsym 5 border pixel 5 277 | bindsym 6 border pixel 6 278 | bindsym 7 border pixel 7 279 | bindsym 8 border pixel 8 280 | bindsym 9 border pixel 9 281 | bindsym 0 border pixel 10 282 | bindsym t border toggle 283 | 284 | bindsym Return mode default 285 | bindsym Escape mode default 286 | } 287 | 288 | set $gapspx 0 289 | set $gapsdeltapx 10 290 | gaps inner $gapspx 291 | gaps outer $gapspx 292 | smart_gaps on 293 | 294 | set $gapsmode "gaps: [i]nner [o]uter" 295 | mode $gapsmode { 296 | bindsym i mode $gapsmodeinner 297 | bindsym o mode $gapsmodeouter 298 | 299 | bindsym Return mode default 300 | bindsym Escape mode default 301 | } 302 | 303 | set $gapsmodeinner "gaps-inner: [hl] all [jk] current [r]eset [i]nner" 304 | mode $gapsmodeinner { 305 | bindsym h gaps inner all minus $gapsdeltapx 306 | bindsym l gaps inner all plus $gapsdeltapx 307 | 308 | bindsym j gaps inner current minus $gapsdeltapx 309 | bindsym k gaps inner current plus $gapsdeltapx 310 | 311 | bindsym r gaps inner all set 0 312 | 313 | bindsym o mode $gapsmodeouter 314 | 315 | bindsym Return mode default 316 | bindsym Escape mode default 317 | } 318 | 319 | set $gapsmodeouter "gaps-outer: [hl] all [jk] current [r]eset [o]uter" 320 | mode $gapsmodeouter { 321 | bindsym h gaps outer all minus $gapsdeltapx 322 | bindsym l gaps outer all plus $gapsdeltapx 323 | 324 | bindsym j gaps outer current minus $gapsdeltapx 325 | bindsym k gaps outer current plus $gapsdeltapx 326 | 327 | bindsym r gaps outer all set 0 328 | 329 | bindsym i mode $gapsmodeinner 330 | 331 | bindsym Return mode default 332 | bindsym Escape mode default 333 | } 334 | 335 | # decorations 336 | default_border pixel 2 337 | hide_edge_borders smart 338 | for_window [class=".*"] title_format " %title" 339 | 340 | # dracula 341 | set $void "#000000" 342 | set $black "#282a36" 343 | set $gray "#44475a" 344 | set $white "#f8f8f2" 345 | set $blue "#6272a4" 346 | set $cyan "#8be9fd" 347 | set $green "#50fa7b" 348 | set $orange "#ffb86c" 349 | set $pink "#ff79c6" 350 | set $purple "#bd93f9" 351 | set $red "#ff5555" 352 | set $yellow "#f1fa8c" 353 | 354 | # class border bg text indicator child_border 355 | client.focused $cyan $blue $white $pink $cyan 356 | client.focused_inactive $gray $black $gray $pink $void 357 | client.unfocused $gray $black $blue $pink $void 358 | # sleep 3; echo -e '\a' 359 | client.urgent $red $red $white $pink $red 360 | client.placeholder $void $black $white $void $black 361 | client.background $black 362 | 363 | # Start i3bar to display a workspace bar (plus i3status info) 364 | bar { 365 | status_command i3status-rs 366 | mode invisible 367 | position top 368 | tray_output none 369 | separator_symbol "–" 370 | 371 | colors { 372 | background $black 373 | statusline $white 374 | separator $gray 375 | 376 | # border bg text 377 | focused_workspace $white $cyan $black 378 | active_workspace $white $black $white 379 | inactive_workspace $gray $black $white 380 | urgent_workspace $white $red $white 381 | binding_mode $black $pink $black 382 | } 383 | } 384 | -------------------------------------------------------------------------------- /.config/i3/i3status.conf: -------------------------------------------------------------------------------- 1 | general { 2 | output_format = "i3bar" 3 | colors = true 4 | interval = 5 5 | color_good = "#50fa7b" 6 | color_degraded = "#ffb86c" 7 | color_bad = "#ff5555" 8 | } 9 | 10 | order += "window" 11 | order += "mpd_status" 12 | order += "volume master" 13 | order += "wireless _first_" 14 | order += "battery all" 15 | order += "tztime local" 16 | 17 | # needs python-mpd2 package 18 | mpd_status { 19 | color_play = "#8be9fd" 20 | hide_on_error = true 21 | format="{artist} - {title} · {album} ({date}) {time} → {next_artist} - {next_title}" 22 | 23 | on_click 1 = "exec mpc toggle" 24 | on_click 3 = "exec mpc next" 25 | } 26 | 27 | volume master { 28 | device = "default" 29 | mixer = "Master" 30 | mixer_idx = 0 31 | format = "♪%volume" 32 | 33 | on_click 1 = "exec amixer set Master toggle" 34 | on_click 4 = "exec amixer set Master 1%+" 35 | on_click 5 = "exec amixer set Master 1%-" 36 | } 37 | 38 | wireless _first_ { 39 | format_up = "%quality at %essid" 40 | format_down = "Wifi down" 41 | } 42 | 43 | battery all { 44 | status_chr = "^" 45 | status_bat = "v" 46 | status_unk = "?" 47 | status_full = "☻" 48 | format = "%status %percentage %remaining" 49 | } 50 | 51 | tztime local { 52 | format = "%m/%d %H:%M:%S" 53 | } 54 | -------------------------------------------------------------------------------- /.config/kak/colors/dracula.kak: -------------------------------------------------------------------------------- 1 | # dracula theme 2 | # https://draculatheme.com/ 3 | 4 | evaluate-commands %sh{ 5 | black="rgb:282a36" 6 | gray="rgb:44475a" 7 | white="rgb:f8f8f2" 8 | 9 | pink="rgb:ff79c6" 10 | purple="rgb:bd93f9" 11 | blue="rgb:6272a4" 12 | cyan="rgb:8be9fd" 13 | green="rgb:50fa7b" 14 | yellow="rgb:f1fa8c" 15 | orange="rgb:ffb86c" 16 | red="rgb:ff5555" 17 | 18 | echo " 19 | face global value $green 20 | face global type $purple 21 | face global variable $red 22 | face global function $red 23 | face global module $red 24 | face global string $yellow 25 | face global error $red 26 | face global keyword $cyan 27 | face global operator $orange 28 | face global attribute $pink 29 | face global comment $blue+i 30 | face global meta $red 31 | face global builtin $white+b 32 | 33 | face global title $red 34 | face global header $orange 35 | face global bold $pink 36 | face global italic $purple 37 | face global mono $green 38 | face global block $cyan 39 | face global link $green 40 | face global bullet $green 41 | face global list $white 42 | 43 | face global Default $white,$black 44 | 45 | face global PrimarySelection $black,$pink 46 | face global PrimaryCursor $black,$cyan 47 | face global PrimaryCursorEol $black,$cyan 48 | 49 | face global SecondarySelection $black,$purple 50 | face global SecondaryCursor $black,$orange 51 | face global SecondaryCursorEol $black,$orange 52 | 53 | face global MatchingChar $black,$blue 54 | face global Search $blue,$green 55 | face global CurrentWord $white,$blue 56 | 57 | # listchars 58 | face global Whitespace $gray,$black+f 59 | # ~ lines at EOB 60 | face global BufferPadding $gray,$black 61 | # must use wrap -marker hl 62 | face global WrapMarker Whitespace 63 | 64 | face global LineNumbers $gray,$black 65 | # must use -hl-cursor 66 | face global LineNumberCursor $white,$gray+b 67 | face global LineNumbersWrapped $gray,$black+i 68 | 69 | # when item focused in menu 70 | face global MenuForeground $blue,$white+b 71 | # default bottom menu and autocomplete 72 | face global MenuBackground $white,$blue 73 | # complement in autocomplete like path 74 | face global MenuInfo $cyan,$blue 75 | # clippy 76 | face global Information $yellow,$gray 77 | face global Error $black,$red 78 | 79 | # all status line: what we type, but also client@[session] 80 | face global StatusLine $white,$black 81 | # insert mode, prompt mode 82 | face global StatusLineMode $black,$green 83 | # message like '1 sel' 84 | face global StatusLineInfo $purple,$black 85 | # count 86 | face global StatusLineValue $orange,$black 87 | face global StatusCursor $white,$blue 88 | # like the word 'select:' when pressing 's' 89 | face global Prompt $black,$green 90 | " 91 | } 92 | -------------------------------------------------------------------------------- /.config/kak/kakrc: -------------------------------------------------------------------------------- 1 | colorscheme dracula 2 | 3 | set-option global tabstop 2 4 | set-option global indentwidth 2 5 | set-option global scrolloff 5,1 6 | set-option global grepcmd 'rg --column' 7 | set-option global completers filename word=all 8 | set-option global startup_info_version 20420101 9 | set-option -add global matching_pairs ‹ › « » “ ” ‘ ’ 10 | set-option -add global ui_options ncurses_assistant=none ncurses_change_colors=true ncurses_status_on_top=true 11 | 12 | define-command update-status %{ evaluate-commands %sh{ 13 | printf %s 'set-option buffer modelinefmt %{' 14 | if [ "$kak_opt_lsp_diagnostic_error_count" -ne 0 ]; then 15 | printf %s '{DiagnosticError}%opt{lsp_diagnostic_error_count}!{Default} ' 16 | fi 17 | if [ "$kak_opt_lsp_diagnostic_warning_count" -ne 0 ]; then 18 | printf %s '{DiagnosticWarning}%opt{lsp_diagnostic_warning_count}!{Default} ' 19 | fi 20 | printf %s '{{context_info}} {{mode_info}} ' 21 | printf %s ' · %val{bufname} [%opt{filetype}]' 22 | printf %s ' · %val{cursor_line}:%val{cursor_char_column}/%val{buf_line_count}' 23 | case "$kak_client" in client*) ;; *) printf %s " · $kak_client";; esac 24 | case "$kak_session" in ''|*[!0-9]*) printf %s " @$kak_session";; esac 25 | printf %s '}' 26 | }} 27 | hook global WinDisplay .* update-status 28 | hook global BufSetOption lsp_diagnostic_error_count=.* update-status 29 | hook global BufSetOption lsp_diagnostic_warning_count=.* update-status 30 | 31 | # needs those kitty map for disambiguation hack: 32 | # map ctrl+h send_text all \u24D7 // ⓗ 33 | # map ctrl+i send_text all \u24D8 // ⓘ 34 | # map ctrl+j send_text all \u24D9 // ⓙ 35 | # map ctrl+m send_text all \u24DC // ⓜ 36 | # map ctrl+return send_text all \u240D // ␍ 37 | # map ctrl+space send_text all \u2420 // ␠ 38 | 39 | map global normal '' 40 | 41 | # equivalent is defined afer auto-percent is loaded 42 | map global normal ': extend-line-down %val{count}' -docstring 'extend line down' 43 | map global normal C '' -docstring 'join lines' 44 | map global normal '' -docstring 'join lines and select spaces' 45 | 46 | map global normal 'C' -docstring 'copy selection on next line' 47 | map global normal '' -docstring 'copy selection on previous line' 48 | 49 | map global normal ']p;' -docstring 'next paragraph' 50 | map global normal '[p;' -docstring 'previous paragraph' 51 | 52 | map global normal , -docstring 'remove all selections except main' 53 | map global normal -docstring 'remove main sel' 54 | 55 | map global normal . ':' -docstring 'enter command prompt' 56 | map global normal : '.' -docstring 'repeat last insert' 57 | 58 | map global normal '#' ': comment-line' -docstring 'comment-line' 59 | map global normal '' ': comment-block' -docstring 'comment-block' 60 | map global normal '=' ': format' -docstring 'format' 61 | 62 | map global insert '' -docstring 'temp escape to normal mode' 63 | map global insert '' -docstring 'escape to normal mode' 64 | map global insert '"' -docstring 'paste' 65 | 66 | map global goto -docstring 'jump backward' 67 | map global goto -docstring 'jump forward' 68 | map global goto m 'm;' -docstring 'matching next char' 69 | map global goto n ']p;' -docstring 'next paragraph' 70 | map global goto p '[p;' -docstring 'previous paragraph' 71 | map global goto ';' -docstring 'matching previous char' 72 | 73 | map global user : -docstring 'command (: alias)' 74 | map global user g ': grep ' -docstring 'grep' 75 | 76 | alias global h doc 77 | alias global u enter-user-mode 78 | 79 | hook global InsertChar j %{ try %{ 80 | execute-keys -draft hH jj d 81 | execute-keys 82 | }} 83 | 84 | hook global InsertChar k %{ try %{ 85 | execute-keys -draft hH jk d 86 | execute-keys 87 | write 88 | }} 89 | 90 | hook global InsertCompletionShow .* %{ 91 | map window insert 92 | map window insert 93 | } 94 | 95 | hook global InsertCompletionHide .* %{ 96 | unmap window insert 97 | unmap window insert 98 | } 99 | 100 | hook global WinSetOption filetype=rust %{ 101 | set-option window formatcmd 'rustfmt' 102 | } 103 | 104 | hook global WinSetOption filetype=json %{ 105 | set-option window formatcmd 'jq .' 106 | } 107 | 108 | hook global WinSetOption filetype=scss %{ 109 | set-option window formatcmd 'prettier --stdin --parser scss' 110 | } 111 | 112 | hook global WinSetOption filetype=javascript %{ 113 | set-option window lintcmd 'eslint --format ~/eslint-kakoune.js' 114 | set-option window formatcmd 'prettier --no-semi --trailing-comma all --jsx-bracket-same-line --single-quote --stdin --parser babel' 115 | } 116 | 117 | hook global WinSetOption filetype=json %{ 118 | set-option window formatcmd 'prettier --stdin --parser json' 119 | } 120 | 121 | hook global BufWritePre .* %{ evaluate-commands %sh{ 122 | container=$(dirname "$kak_hook_param") 123 | test -d "$container" || mkdir --parents "$container" 124 | }} 125 | 126 | # display matching char in insert mode (the one before cursor) 127 | # https://github.com/mawww/kakoune/issues/1192#issuecomment-277637280 128 | declare-option -hidden range-specs show_matching_range 129 | hook global InsertChar [[(<{}>)\]] %{ 130 | evaluate-commands -draft %{ 131 | try %{ 132 | execute-keys -no-hooks \;hm..\; 133 | set-option window show_matching_range "%val{timestamp} %val{selection_desc}|MatchingChar" 134 | } 135 | 136 | hook window -once InsertChar [^[(<{}>)\]] %{ 137 | set-option window show_matching_range 138 | } 139 | } 140 | } 141 | 142 | hook global ModeChange pop:insert:normal %{ 143 | set-option buffer show_matching_range 144 | } 145 | 146 | declare-option -hidden regex curword 147 | 148 | hook global NormalIdle .* %{ 149 | evaluate-commands -draft -no-hooks %{ try %{ 150 | execute-keys w \A\w+\z 151 | set-option window curword "\b\Q%val{selection}\E\b" 152 | } catch %{ 153 | set-option window curword '' 154 | }} 155 | } 156 | 157 | hook global WinCreate .* %{ 158 | add-highlighter window/ number-lines -hlcursor 159 | add-highlighter window/ show-whitespaces 160 | add-highlighter window/trailing-whitespaces regex '\h+$' 0:Error 161 | add-highlighter window/ dynregex '%opt{curword}' 0:+ub 162 | add-highlighter window/ show-matching 163 | add-highlighter window/ ranges show_matching_range 164 | } 165 | 166 | source '~/.config/kak/plugins/plug.kak/rc/plug.kak' 167 | 168 | plug 'alexherbo2/connect.kak' %{ 169 | map global user r %{:connect lf %val{buffile} } -docstring 'lf' 170 | } 171 | 172 | plug 'alexherbo2/explore.kak' 173 | 174 | plug 'alexherbo2/pad-number.kak' 175 | 176 | plug 'alexherbo2/split-object.kak' %{ 177 | # 178 | map global normal ␠ ': enter-user-mode split-object' -docstring 'split object mode' 179 | } 180 | 181 | plug 'alexherbo2/volatile-highlighter.kak' %{ 182 | set-face global Volatile +bi 183 | } 184 | 185 | plug 'andreyorst/fzf.kak' config %{ 186 | map global user f ': fzf-mode' -docstring 'fzf' 187 | } defer 'fzf' %{ 188 | set-option global fzf_file_command 'rg' 189 | set-option global fzf_highlight_command 'bat' 190 | } 191 | 192 | plug 'delapouite/kakoune-auto-percent' %{ 193 | map global normal ': extend-line-up %val{count}' -docstring 'extend line up' 194 | map global normal D '' -docstring 'keep selections matching regex' 195 | map global normal '' -docstring 'keep selections not matching regex' 196 | } 197 | 198 | plug 'delapouite/kakoune-buffers' %{ 199 | map global normal ^ q 200 | map global normal Q 201 | map global normal q b 202 | map global normal Q B 203 | map global normal 204 | map global normal 205 | map global normal b ': enter-buffers-mode' -docstring 'buffers mode' 206 | map global normal B ': enter-user-mode -lock buffers' -docstring 'buffers mode lock' 207 | } 208 | 209 | plug 'delapouite/kakoune-cd' %{ 210 | map global user c ': enter-user-mode cd' -docstring 'cd' 211 | alias global pwd print-working-directory 212 | } 213 | 214 | plug 'delapouite/kakoune-hump' %{ 215 | map global normal « ': select-previous-hump' -docstring 'select prev hump' 216 | map global normal » ': select-next-hump' -docstring 'select next hump' 217 | map global normal ‹ ': extend-previous-hump' -docstring 'extend prev hump' 218 | map global normal › ': extend-next-hump' -docstring 'extend next hump' 219 | } 220 | 221 | plug 'delapouite/kakoune-i3' %{ 222 | map global user 3 ': enter-user-mode i3' -docstring 'i3 mode' 223 | } 224 | 225 | plug 'delapouite/kakoune-goto-file' %{ 226 | map global goto f ': goto-file' -docstring 'file' 227 | map global goto F f -docstring 'file (legacy)' 228 | } 229 | 230 | plug 'delapouite/kakoune-mirror' %{ 231 | map global normal "'" ': enter-user-mode -lock mirror' -docstring 'mirror mode lock' 232 | } 233 | 234 | plug 'delapouite/kakoune-select-view' %{ 235 | map global view s ': select-view' -docstring 'select view' 236 | } 237 | 238 | plug 'delapouite/kakoune-text-objects' %{ 239 | map global selectors 's' ': if-cursor s s' -docstring 'auto-percent s' 240 | map global selectors 'p' ': if-cursor S S' -docstring 'auto-percent S' 241 | map global selectors '' ': if-cursor a-s> a-s> no-hooks' -docstring 'auto-percent ' 242 | map global selectors 'm' ': if-cursor a-S> a-S> no-hooks' -docstring 'auto-percent ' 243 | map global selectors 'f' ': if-cursor a-s>a-k> a-k>' -docstring 'auto-percent ' 244 | map global selectors 'r' ': if-cursor a-s>a-K> a-K>' -docstring 'auto-percent ' 245 | map global selectors 'v' ': select-view' -docstring 'select view' 246 | map global normal s ': enter-user-mode selectors' -docstring 'selectors' 247 | } 248 | 249 | plug 'delapouite/kakoune-user-modes' %{ 250 | alias global u enter-user-mode 251 | map global normal ': enter-user-mode anchor' -docstring 'anchor mode' 252 | map global user s ': enter-user-mode echo' -docstring 'echo mode' 253 | map global user / ': enter-user-mode search' -docstring 'search mode' 254 | map global user l ': enter-user-mode lint' -docstring 'lint mode' 255 | map global user L ': enter-user-mode -lock lint' -docstring 'lint mode lock' 256 | map global user k ': enter-user-mode keep' -docstring 'keep mode' 257 | map global user _ ': enter-user-mode trim' -docstring 'trim mode' 258 | map global user = ': enter-user-mode trim' -docstring 'format mode' 259 | } 260 | 261 | plug 'https://gitlab.com/FlyingWombat/case.kak' %{ 262 | map global normal '`' ': enter-user-mode case' -docstring 'case mode' 263 | } 264 | 265 | plug 'https://gitlab.com/Screwtapello/kakoune-inc-dec' %{ 266 | map global normal ': inc-dec-modify-numbers + %val{count}' -docstring 'increment' 267 | map global normal ': inc-dec-modify-numbers - %val{count}' -docstring 'decrement' 268 | } 269 | 270 | plug "lePerdu/kakboard" %{ 271 | hook global WinCreate .* %{ kakboard-enable } 272 | } 273 | 274 | plug 'occivink/kakoune-expand' %{ 275 | map global normal + ': expand' -docstring 'expand' 276 | } 277 | 278 | plug 'occivink/kakoune-phantom-selection' %{ 279 | map global normal æ ': phantom-selection-add-selection' -docstring 'phantom add' 280 | map global normal ® ': phantom-selection-select-all; phantom-selection-clear' -docstring 'phantom select' 281 | map global normal é ': phantom-selection-iterate-prev' -docstring 'phantom prev' 282 | map global normal è ': phantom-selection-iterate-next' -docstring 'phantom next' 283 | } 284 | 285 | plug 'occivink/kakoune-vertical-selection' 286 | 287 | plug "ul/kak-lsp" do %{ 288 | cargo install --locked --force --path . 289 | } %{ 290 | set-option global lsp_cmd "kak-lsp -s %val{session} -vvv --log /tmp/kak-lsp.log" 291 | hook global WinSetOption filetype=(typescript) %{ 292 | lsp-auto-hover-enable 293 | lsp-enable-window 294 | set-option global lsp_hover_anchor true 295 | map global user l ': enter-user-mode lsp' -docstring 'lsp' 296 | } 297 | } 298 | 299 | plug "ul/kak-tree" do %{ 300 | cargo install --force --path . --features "css html javascript json typescript" 301 | } %{ 302 | declare-user-mode tree 303 | map global tree h ': tree-select-previous-node' -docstring 'select previous' 304 | map global tree l ': tree-select-next-node' -docstring 'select next' 305 | map global tree k ': tree-select-parent-node' -docstring 'select parent' 306 | map global tree j ': tree-select-children' -docstring 'select children' 307 | map global tree f ': tree-select-first-child' -docstring 'select first child' 308 | map global tree s ': tree-node-sexp' -docstring 'show info' 309 | map global user t ': enter-user-mode tree' -docstring 'tree mode' 310 | map global normal þ ': enter-user-mode -lock tree' -docstring 'tree mode lock' 311 | } 312 | 313 | define-command -hidden -params 1 extend-line-down %{ 314 | execute-keys "%arg{1}X" 315 | } 316 | 317 | define-command -hidden -params 1 extend-line-up %{ 318 | execute-keys "%arg{1}K" 319 | try %{ 320 | execute-keys -draft ';\n' 321 | execute-keys X 322 | } 323 | execute-keys '' 324 | } 325 | 326 | -------------------------------------------------------------------------------- /.config/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # man kitty.conf 2 | # https://sw.kovidgoyal.net/kitty/conf/#sample-kitty-conf 3 | # kitty +runpy 'from kitty.config import *; print(commented_out_default_config())' > /tmp/kitty.conf 4 | 5 | # kitty_mod ctrl+shift 6 | 7 | # kitty_mod+F1 to open the documentation 8 | # kitty_mod+F2 to open this config file 9 | # kitty_mod+F5 to reload this config file 10 | # kitty_mod+F6 to see current config values 11 | 12 | # UI 13 | 14 | include themes/dracula.conf 15 | window_padding_width 8 16 | cursor_trail 1000 17 | 18 | # font 19 | # kitty +list-fonts 20 | 21 | font_family Iosevka Term 22 | bold_font Iosevka Term Extrabold 23 | italic_font Iosevka Term Italic 24 | bold_italic_font Iosevka Term Extrabold Italic 25 | font_size 10.0 26 | 27 | # behavior 28 | 29 | allow_remote_control yes 30 | enable_audio_bell no 31 | open_url_with default 32 | 33 | map kitty_mod+enter new_os_window_with_cwd 34 | 35 | # modes 36 | # https://sw.kovidgoyal.net/kitty/mapping/#modal-mappings 37 | 38 | # filter 39 | 40 | map --new-mode filter --on-action end kitty_mod+f 41 | map --mode filter esc pop_keyboard_mode 42 | 43 | map --mode filter l launch --stdin-source=@last_cmd_output --stdin-add-formatting /usr/bin/fzf --ansi --tac --no-sort 44 | map --mode filter s launch --stdin-source=@screen_scrollback --stdin-add-formatting /usr/bin/fzf --ansi --tac --no-sort 45 | 46 | # scroll 47 | 48 | scrollback_lines 10000 49 | 50 | map kitty_mod+kp_home scroll_home 51 | map kitty_mod+kp_end scroll_end 52 | map kitty_mod+kp_page_up scroll_page_up 53 | map kitty_mod+kp_page_down scroll_page_down 54 | map kitty_mod+kp_up scroll_to_prompt -1 55 | map kitty_mod+kp_down scroll_to_prompt +1 56 | 57 | map --new-mode scroll kitty_mod+s 58 | map --mode scroll esc pop_keyboard_mode 59 | 60 | ## some key mappings are redundant on purpose 61 | map --mode scroll kp_home scroll_home 62 | map --mode scroll kp_page_up scroll_page_up 63 | map --mode scroll kp_page_down scroll_page_down 64 | map --mode scroll kp_end scroll_end 65 | 66 | map --mode scroll p scroll_to_prompt -1 67 | map --mode scroll k scroll_to_prompt -1 68 | map --mode scroll kp_up scroll_to_prompt -1 69 | map --mode scroll n scroll_to_prompt +1 70 | map --mode scroll j scroll_to_prompt +1 71 | map --mode scroll kp_down scroll_to_prompt +1 72 | 73 | map --mode scroll o show_last_visited_command_output 74 | 75 | # https://sw.kovidgoyal.net/kitty/marks/ 76 | 77 | map --new-mode mark kitty_mod+m 78 | map --mode mark esc pop_keyboard_mode 79 | 80 | map --mode mark t toggle_marker itext 1 error 81 | map --mode mark p scroll_to_mark prev 82 | map --mode mark n scroll_to_mark next 83 | -------------------------------------------------------------------------------- /.config/kitty/themes/dracula.conf: -------------------------------------------------------------------------------- 1 | # https://draculatheme.com/kitty 2 | # 3 | # Installation instructions: 4 | # 5 | # cp dracula.conf ~/.config/kitty/ 6 | # echo "include dracula.conf" >> ~/.config/kitty/kitty.conf 7 | # 8 | # Then reload kitty for the config to take affect. 9 | # Alternatively copy paste below directly into kitty.conf 10 | 11 | foreground #f8f8f2 12 | background #282a36 13 | selection_foreground #44475a 14 | selection_background #f8f8f2 15 | 16 | url_color #ffb86c 17 | 18 | # black 19 | color0 #44475a 20 | color8 #6272a4 21 | 22 | # red 23 | color1 #ff5555 24 | color9 #ff6e6e 25 | 26 | # green 27 | color2 #50fa7b 28 | color10 #69ff94 29 | 30 | # yellow 31 | color3 #f1fa8c 32 | color11 #ffffa5 33 | 34 | # blue 35 | color4 #bd93f9 36 | color12 #d6acff 37 | 38 | # magenta 39 | color5 #ff79c6 40 | color13 #ff92df 41 | 42 | # cyan 43 | color6 #8be9fd 44 | color14 #a4ffff 45 | 46 | # white 47 | color7 #f8f8f2 48 | color15 #ffffff 49 | 50 | # Cursor colors 51 | cursor #f8f8f2 52 | cursor_text_color background 53 | 54 | # Tab bar colors 55 | active_tab_foreground #44475a 56 | active_tab_background #f8f8f2 57 | inactive_tab_foreground #282a36 58 | inactive_tab_background #6272a4 59 | -------------------------------------------------------------------------------- /.config/kitty/themes/espresso-libre.conf: -------------------------------------------------------------------------------- 1 | background #2a211c 2 | foreground #b8a898 3 | cursor #ffffff 4 | selection_background #c3dcff 5 | color0 #000000 6 | color8 #545753 7 | color1 #cc0000 8 | color9 #ef2828 9 | color2 #1a921c 10 | color10 #9aff87 11 | color3 #efe43a 12 | color11 #fffa5c 13 | color4 #0066ff 14 | color12 #43a8ed 15 | color5 #c5656b 16 | color13 #ff8089 17 | color6 #05989a 18 | color14 #34e2e2 19 | color7 #d3d7cf 20 | color15 #ededec 21 | selection_foreground #2a211c 22 | -------------------------------------------------------------------------------- /.config/kitty/themes/grass.conf: -------------------------------------------------------------------------------- 1 | # Theme ported from the Mac Terminal application. 2 | 3 | background #12773d 4 | foreground #fff0a4 5 | cursor #8b2800 6 | selection_background #b64825 7 | color0 #000000 8 | color8 #545454 9 | color1 #ba0000 10 | color9 #ba0000 11 | color2 #00ba00 12 | color10 #00ba00 13 | color3 #e6af00 14 | color11 #e6af00 15 | color4 #0000a3 16 | color12 #0000ba 17 | color5 #950062 18 | color13 #ff54ff 19 | color6 #00baba 20 | color14 #54ffff 21 | color7 #bababa 22 | color15 #ffffff 23 | selection_foreground #12773d 24 | -------------------------------------------------------------------------------- /.config/kitty/themes/ocean.conf: -------------------------------------------------------------------------------- 1 | # Theme ported from the Mac Terminal application. 2 | 3 | background #214fbc 4 | foreground #ffffff 5 | cursor #7f7f7f 6 | selection_background #216dff 7 | color0 #000000 8 | color8 #666666 9 | color1 #990000 10 | color9 #e50000 11 | color2 #00a600 12 | color10 #00d900 13 | color3 #999900 14 | color11 #e5e500 15 | color4 #0000b2 16 | color12 #0000ff 17 | color5 #b200b2 18 | color13 #e500e5 19 | color6 #00a6b2 20 | color14 #00e5e5 21 | color7 #bebebe 22 | color15 #e5e5e5 23 | selection_foreground #214fbc 24 | -------------------------------------------------------------------------------- /.config/kitty/themes/red-alert.conf: -------------------------------------------------------------------------------- 1 | background #762423 2 | foreground #ffffff 3 | cursor #ffffff 4 | selection_background #073642 5 | color0 #000000 6 | color8 #262626 7 | color1 #d52e4d 8 | color9 #e02453 9 | color2 #71be6b 10 | color10 #aff08b 11 | color3 #beb86b 12 | color11 #dfddb7 13 | color4 #479bed 14 | color12 #65a9f0 15 | color5 #e878d6 16 | color13 #ddb7df 17 | color6 #6bbeb8 18 | color14 #b7dfdd 19 | color7 #d6d6d6 20 | color15 #ffffff 21 | selection_foreground #762423 22 | -------------------------------------------------------------------------------- /.config/lf/lfrc: -------------------------------------------------------------------------------- 1 | map gk top 2 | map gj bottom 3 | map gc cd ~/.config 4 | map e $$EDITOR $fx 5 | map $$EDITOR $fx 6 | 7 | set previewer ~/.config/lf/previewer.sh 8 | set ratios 2:5 9 | -------------------------------------------------------------------------------- /.config/lf/previewer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | bat --color=always --style=plain --theme=base16 "$1" 3 | -------------------------------------------------------------------------------- /.config/ncmpcpp/bindings: -------------------------------------------------------------------------------- 1 | # https://github.com/ncmpcpp/ncmpcpp/blob/master/doc/bindings 2 | def_key "k" 3 | scroll_up 4 | def_key "j" 5 | scroll_down 6 | def_key "h" 7 | previous 8 | def_key "l" 9 | next 10 | def_key "n" 11 | next_found_item 12 | def_key "N" 13 | previous_found_item 14 | def_key "right" 15 | seek_forward 16 | def_key "left" 17 | seek_backward 18 | 19 | -------------------------------------------------------------------------------- /.config/ncmpcpp/config: -------------------------------------------------------------------------------- 1 | # https://github.com/ncmpcpp/ncmpcpp/blob/master/doc/config 2 | alternative_header_first_line_format = $b$1$aqqu$/a$9 {$3%N$9} - {%t}|{%f} $1$atqq$/a$9$/b 3 | alternative_header_second_line_format = {{$4$b%a$/b$9}{ - $7$b%b$/b$9}{ ($5$b%y$/b$9)}}|{%D} 4 | song_list_format = {%a - }{%b - }{%t}|{$8%f$9}$R{$3(%l)$9} {%y} {%g} 5 | # (width of the column)[color of the column]{displayed tag} 6 | song_columns_list_format = (20)[]{a} (6f)[green]{NE} (50)[white]{t|f:Title} (20)[cyan]{b} (7f)[magenta]{l} (4f)[blue]{y} 7 | playlist_separate_albums = yes 8 | autocenter_mode = yes 9 | centered_cursor = yes 10 | user_interface = alternative 11 | -------------------------------------------------------------------------------- /.config/nvim/init.vim: -------------------------------------------------------------------------------- 1 | set clipboard=unnamedplus 2 | set inccommand=split 3 | 4 | nnoremap Q :echo "!" 5 | nnoremap U 6 | nnoremap Y y$ 7 | 8 | inoremap jj 9 | inoremap jk :w 10 | -------------------------------------------------------------------------------- /.config/pacman.conf: -------------------------------------------------------------------------------- 1 | # included from /etc/pacman.conf 2 | 3 | ILoveCandy 4 | VerbosePkgLists 5 | ParallelDownloads = 5 6 | -------------------------------------------------------------------------------- /.config/procs/config.toml: -------------------------------------------------------------------------------- 1 | [[columns]] 2 | kind = "Pid" 3 | style = "BrightYellow|Yellow" 4 | numeric_search = true 5 | nonnumeric_search = false 6 | align = "Left" 7 | 8 | [[columns]] 9 | kind = "User" 10 | style = "BrightGreen|Green" 11 | numeric_search = false 12 | nonnumeric_search = true 13 | align = "Left" 14 | 15 | [[columns]] 16 | kind = "Separator" 17 | style = "White|BrightBlack" 18 | numeric_search = false 19 | nonnumeric_search = false 20 | align = "Left" 21 | 22 | [[columns]] 23 | kind = "State" 24 | style = "ByState" 25 | numeric_search = false 26 | nonnumeric_search = false 27 | align = "Left" 28 | 29 | [[columns]] 30 | kind = "Nice" 31 | style = "BrightMagenta|Magenta" 32 | numeric_search = false 33 | nonnumeric_search = false 34 | align = "Right" 35 | 36 | [[columns]] 37 | kind = "Tty" 38 | style = "BrightWhite|Black" 39 | numeric_search = false 40 | nonnumeric_search = false 41 | align = "Left" 42 | 43 | [[columns]] 44 | kind = "UsageCpu" 45 | style = "ByPercentage" 46 | numeric_search = false 47 | nonnumeric_search = false 48 | align = "Right" 49 | 50 | [[columns]] 51 | kind = "UsageMem" 52 | style = "ByPercentage" 53 | numeric_search = false 54 | nonnumeric_search = false 55 | align = "Right" 56 | 57 | [[columns]] 58 | kind = "VmSize" 59 | style = "ByUnit" 60 | numeric_search = false 61 | nonnumeric_search = false 62 | align = "Right" 63 | 64 | [[columns]] 65 | kind = "VmRss" 66 | style = "ByUnit" 67 | numeric_search = false 68 | nonnumeric_search = false 69 | align = "Right" 70 | 71 | [[columns]] 72 | kind = "TcpPort" 73 | style = "BrightCyan|Cyan" 74 | numeric_search = true 75 | nonnumeric_search = false 76 | align = "Left" 77 | max_width = 20 78 | 79 | [[columns]] 80 | kind = "UdpPort" 81 | style = "BrightCyan|Cyan" 82 | numeric_search = true 83 | nonnumeric_search = false 84 | align = "Left" 85 | max_width = 20 86 | 87 | [[columns]] 88 | kind = "ReadBytes" 89 | style = "ByUnit" 90 | numeric_search = false 91 | nonnumeric_search = false 92 | align = "Right" 93 | 94 | [[columns]] 95 | kind = "WriteBytes" 96 | style = "ByUnit" 97 | numeric_search = false 98 | nonnumeric_search = false 99 | align = "Right" 100 | 101 | [[columns]] 102 | kind = "Slot" 103 | style = "ByUnit" 104 | numeric_search = false 105 | nonnumeric_search = false 106 | align = "Right" 107 | 108 | [[columns]] 109 | kind = "Separator" 110 | style = "White|BrightBlack" 111 | numeric_search = false 112 | nonnumeric_search = false 113 | align = "Left" 114 | 115 | [[columns]] 116 | kind = "CpuTime" 117 | style = "BrightCyan|Cyan" 118 | numeric_search = false 119 | nonnumeric_search = false 120 | align = "Left" 121 | 122 | [[columns]] 123 | kind = "StartTime" 124 | style = "BrightMagenta|Magenta" 125 | numeric_search = false 126 | nonnumeric_search = false 127 | align = "Left" 128 | 129 | [[columns]] 130 | kind = "Docker" 131 | style = "BrightGreen|Green" 132 | numeric_search = false 133 | nonnumeric_search = true 134 | align = "Left" 135 | 136 | [[columns]] 137 | kind = "Separator" 138 | style = "White|BrightBlack" 139 | numeric_search = false 140 | nonnumeric_search = false 141 | align = "Left" 142 | 143 | [[columns]] 144 | kind = "Command" 145 | style = "BrightWhite|Black" 146 | numeric_search = false 147 | nonnumeric_search = true 148 | align = "Left" 149 | 150 | [style] 151 | header = "BrightWhite|Black" 152 | unit = "BrightWhite|Black" 153 | tree = "BrightWhite|Black" 154 | 155 | [style.by_percentage] 156 | color_000 = "BrightBlue|Blue" 157 | color_025 = "BrightGreen|Green" 158 | color_050 = "BrightYellow|Yellow" 159 | color_075 = "BrightRed|Red" 160 | color_100 = "BrightRed|Red" 161 | 162 | [style.by_state] 163 | color_d = "BrightRed|Red" 164 | color_r = "BrightGreen|Green" 165 | color_s = "BrightBlue|Blue" 166 | color_t = "BrightCyan|Cyan" 167 | color_z = "BrightMagenta|Magenta" 168 | color_x = "BrightMagenta|Magenta" 169 | color_k = "BrightYellow|Yellow" 170 | color_w = "BrightYellow|Yellow" 171 | color_p = "BrightYellow|Yellow" 172 | 173 | [style.by_unit] 174 | color_k = "BrightBlue|Blue" 175 | color_m = "BrightGreen|Green" 176 | color_g = "BrightYellow|Yellow" 177 | color_t = "BrightRed|Red" 178 | color_p = "BrightRed|Red" 179 | color_x = "BrightBlue|Blue" 180 | 181 | [search] 182 | numeric_search = "Exact" 183 | nonnumeric_search = "Partial" 184 | logic = "And" 185 | 186 | [display] 187 | show_self = false 188 | cut_to_terminal = true 189 | cut_to_pager = false 190 | cut_to_pipe = false 191 | color_mode = "Auto" 192 | separator = "│" 193 | ascending = "▲" 194 | descending = "▼" 195 | tree_symbols = ["│", "─", "┬", "├", "└"] 196 | abbr_sid = true 197 | 198 | [sort] 199 | column = 0 200 | order = "Ascending" 201 | 202 | [docker] 203 | path = "unix:///var/run/docker.sock" 204 | 205 | [pager] 206 | mode = "Auto" 207 | -------------------------------------------------------------------------------- /.config/starship.toml: -------------------------------------------------------------------------------- 1 | # https://starship.rs/config/ 2 | 3 | "$schema" = 'https://starship.rs/config-schema.json' 4 | 5 | format = """ 6 | $time\ 7 | $username\ 8 | $hostname\ 9 | $kubernetes\ 10 | $directory\ 11 | $git_branch\ 12 | $git_commit\ 13 | $git_state\ 14 | ${custom.git}\ 15 | $git_status\ 16 | $package\ 17 | $dotnet\ 18 | $golang\ 19 | $java\ 20 | $nodejs\ 21 | $python\ 22 | $ruby\ 23 | $rust\ 24 | $nix_shell\ 25 | $conda\ 26 | $memory_usage\ 27 | $aws\ 28 | $env_var\ 29 | ${custom.docker}\ 30 | $azure\ 31 | $cmd_duration\ 32 | 33 | $line_break\ 34 | 35 | $jobs\ 36 | $battery\ 37 | ${custom.ssh_keys}\ 38 | ${custom.direnv_allowed}\ 39 | ${custom.direnv_denied}\ 40 | ${custom.envars}\ 41 | ${custom.files_hidden}\ 42 | ${custom.sudo}\ 43 | $shell\ 44 | $character\ 45 | $status\ 46 | """ 47 | 48 | [time] 49 | disabled = false 50 | time_format = "%T" 51 | format = "[$time]($style) " 52 | style = "" 53 | 54 | [shell] 55 | disabled = true 56 | # does not work yet, nushell keeps displaying the fish :( 57 | fish_indicator = "🐟" 58 | unknown_indicator = "mystery shell" 59 | 60 | [directory] 61 | disabled = false 62 | truncation_length = 4 63 | truncate_to_repo = false 64 | repo_root_style = "bold" 65 | style = "yellow" 66 | 67 | [git_commit] 68 | disabled = false 69 | only_detached = false 70 | tag_disabled = false 71 | style = "purple" 72 | 73 | [git_status] 74 | disabled = false 75 | conflicted = '=$count' 76 | deleted = '✘$count' 77 | modified = '!$count' 78 | renamed = '»$count' 79 | staged = '+$count' 80 | stashed = '\$$count' 81 | untracked = '?$count' 82 | style = "blue" 83 | 84 | [package] 85 | disabled = false 86 | display_private = true 87 | 88 | [battery] 89 | disabled = true 90 | 91 | [character] 92 | disabled = false 93 | error_symbol = "[✖](bold red)" 94 | 95 | [status] 96 | disabled = false 97 | symbol = "" 98 | format = '[$symbol$common_meaning$signal_name$maybe_int]($style) ' 99 | map_symbol = false 100 | style = "bold red" 101 | 102 | [azure] 103 | disabled = true 104 | format = "on [$symbol($subscription) ($username)]($style) " 105 | symbol = "Azure ☁️ " 106 | style = "cyan" 107 | 108 | [env_var] 109 | disabled = true 110 | 111 | [env_var.AZURE_STORAGE_ACCOUNT] 112 | default = 'unknown AZURE_STORAGE_ACCOUNT' 113 | style = "cyan" 114 | 115 | # https://man.archlinux.org/man/git-log.1#PRETTY_FORMATS 116 | [custom.git] 117 | disabled = false 118 | description = "Author and date of last git commit" 119 | command = "git log -1 --format='%an - %ad' --date=relative" 120 | when = "true" 121 | format = "[$output]($style) " 122 | style = "cyan" 123 | 124 | [custom.docker] 125 | disabled = false 126 | description = "Docker symbol if the current directory has Dockerfile or docker-compose.yml files" 127 | shell = ["bash", "--noprofile", "--norc"] 128 | detect_files = ["Dockerfile", "docker-compose.yml", "docker-compose.yaml"] 129 | when = "command -v docker &> /dev/null; exit (echo $?);" 130 | format = "🐳 " 131 | 132 | [custom.sudo] 133 | disabled = false 134 | description = "Valid sudo timestamp marker" 135 | when = "sudo -vn &>/dev/null" 136 | format = "[sudo]($style)" 137 | style = "bold cyan" 138 | 139 | [custom.ssh_keys] 140 | disabled = false 141 | description = "SSH key count" 142 | command = "ssh-add -l | grep --invert-match 'no identities' | wc --lines" 143 | when = "ssh-add -l | grep --invert-match --quiet 'no identities'" 144 | shell = ["bash", "--noprofile", "--norc"] 145 | format = "[$output]($style)🔑" 146 | style = "bold green" 147 | 148 | [custom.direnv_allowed] 149 | disabled = false 150 | description = "Direnv allowed" 151 | when = "direnv status | grep --quiet 'Found RC allowed true'" 152 | format = " [direnv]($style)🌕" 153 | style = "bold green" 154 | 155 | [custom.direnv_denied] 156 | disabled = false 157 | description = "Direnv denied" 158 | when = "direnv status | grep --quiet 'Found RC allowed false'" 159 | format = " [direnv]($style)🌑" 160 | style = "bold red" 161 | 162 | [custom.envars] 163 | disabled = false 164 | description = "Envars count" 165 | command = "env | wc --lines" 166 | when = "true" 167 | format = " [$output]($style)🌱" 168 | style = "normal" 169 | 170 | [custom.files_hidden] 171 | disabled = false 172 | description = 'Number of hidden files' 173 | command = "ll -d .* | wc --lines" 174 | when = "ll -d .*" 175 | format = " [$output]($style)🥷" 176 | style = "normal" 177 | -------------------------------------------------------------------------------- /.config/tig/config: -------------------------------------------------------------------------------- 1 | # Vim-style keybindings for Tig 2 | # 3 | # To use these keybindings copy the file to your HOME directory and include 4 | # it from your ~/.tigrc file: 5 | # 6 | # $ cp contrib/vim.tigrc ~/.tigrc.vim 7 | # $ echo "source ~/.tigrc.vim" >> ~/.tigrc 8 | 9 | bind generic h scroll-left 10 | bind generic j move-down 11 | bind generic k move-up 12 | bind generic l scroll-right 13 | 14 | bind generic g none 15 | bind generic gg move-first-line 16 | bind generic gj next 17 | bind generic gk previous 18 | bind generic gp parent 19 | bind generic gP back 20 | bind generic gn view-next 21 | 22 | bind main G move-last-line 23 | bind generic G move-last-line 24 | 25 | bind generic move-page-down 26 | bind generic move-page-up 27 | 28 | bind generic v none 29 | bind generic vm view-main 30 | bind generic vd view-diff 31 | bind generic vl view-log 32 | bind generic vt view-tree 33 | bind generic vb view-blob 34 | bind generic vx view-blame 35 | bind generic vr view-refs 36 | bind generic vs view-status 37 | bind generic vu view-stage 38 | bind generic vy view-stash 39 | bind generic vg view-grep 40 | bind generic vp view-pager 41 | bind generic vh view-help 42 | 43 | bind generic o none 44 | bind generic oo :toggle sort-order 45 | bind generic os :toggle sort-field 46 | bind generic on :toggle line-number 47 | bind generic od :toggle date 48 | bind generic oa :toggle author 49 | bind generic og :toggle line-graphics 50 | bind generic of :toggle file-name 51 | bind generic op :toggle ignore-space 52 | bind generic oi :toggle id 53 | bind generic ot :toggle commit-title-overflow 54 | bind generic oF :toggle file-filter 55 | bind generic or :toggle commit-title-refs 56 | 57 | bind generic @ none 58 | bind generic @j :/^@@ 59 | bind generic @k :?^@@ 60 | bind generic @- :toggle diff-context -1 61 | bind generic @+ :toggle diff-context +1 62 | 63 | bind status u none 64 | bind stage u none 65 | bind generic uu status-update 66 | bind generic ur status-revert 67 | bind generic um status-merge 68 | bind generic ul stage-update-line 69 | bind generic us stage-split-chunk 70 | 71 | bind generic c none 72 | bind generic cc !git commit 73 | bind generic ca !?@git commit --amend --no-edit 74 | 75 | bind generic K view-help 76 | bind generic view-next 77 | 78 | color cursor default default reverse bold 79 | color title-focus magenta default reverse bold 80 | color title-blur white purple 81 | -------------------------------------------------------------------------------- /.config/xkb/keymap/delafayette: -------------------------------------------------------------------------------- 1 | // To apply this keymap, use: 2 | // xkbcomp $HOME/.config/xkb/keymap/delafayette $DISPLAY 3 | 4 | // Main config files can be found in arch at /usr/share/X11/xkb/ 5 | // See also /usr/include/X11/keysymdef.h 6 | 7 | xkb_keymap { 8 | // /usr/share/X11/xkb/keycodes/evdev 9 | xkb_keycodes { include "evdev" }; 10 | 11 | // /usr/share/X11/xkb/types/complete 12 | xkb_types { include "complete" }; 13 | 14 | // /usr/share/X11/xkb/compat/complete 15 | xkb_compatibility { 16 | include "complete" 17 | virtual_modifiers Shift; 18 | 19 | interpret ISO_Level2_Latch { 20 | action = LatchMods(modifiers = Shift); 21 | }; 22 | }; 23 | 24 | partial alphanumeric_keys modifier_keys 25 | 26 | xkb_symbols "delafayette" { 27 | // /usr/share/X11/xkb/symbols/pc 28 | include "pc" 29 | // /usr/share/X11/xkb/symbols/evdev 30 | include "inet(evdev)" 31 | // /usr/share/X11/xkb/symbols/ctrl 32 | include "ctrl(nocaps)" // CAPS is another Control_L 33 | 34 | // Multi_key → compose (see https://cgit.freedesktop.org/xorg/lib/libX11/plain/nls/en_US.UTF-8/Compose.pre) 35 | // NoSymbol → preserve previously defined symbol in lafayette 36 | // VoidSymbol → don't produce anything 37 | 38 | // The “OneDeadKey” is an ISO_Level3_Latch, i.e. a “dead AltGr” key. 39 | // This is the only way to have a multi-purpose dead key with XKB. 40 | 41 | // The real AltGr key should be an ISO_Level5_Switch; however, 42 | // ISO_Level5_Switch does not work as expected when applying this layout 43 | // with xkbcomp, so let’s use two groups instead and make the AltGr key a group selector. 44 | 45 | name[group1] = "French (Qwerty-Delafayette)"; 46 | name[group2] = "AltGr"; 47 | 48 | key.type[group1] = "FOUR_LEVEL"; 49 | key.type[group2] = "TWO_LEVEL"; 50 | 51 | // Digits 52 | key {[ 1 , exclam , U201E , exclamdown ],[ acute , onesuperior ]}; // 1 ! „ ¡ ´ ¹ 53 | key {[ 2 , at , U201C , U2018 ],[ parenleft , twosuperior ]}; // 2 @ “ ‘ ( ² 54 | key {[ 3 , numbersign , U201D , U2019 ],[ parenright , threesuperior ]}; // 3 # ” ’ ) ³ 55 | key {[ 4 , dollar , VoidSymbol , VoidSymbol ],[ grave , foursuperior ]}; // 4 $ ` ⁴ 56 | key {[ 5 , percent , U2030 , VoidSymbol ],[ VoidSymbol , fivesuperior ]}; // 5 % ‰ ⁵ 57 | key {[ 6 , asciicircum , VoidSymbol , VoidSymbol ],[ VoidSymbol , sixsuperior ]}; // 6 ^ ⁶ 58 | key {[ 7 , ampersand , VoidSymbol , VoidSymbol ],[ U2228 , sevensuperior ]}; // 7 & ∨ ⁷ 59 | key {[ 8 , asterisk , infinity , VoidSymbol ],[ U2227 , eightsuperior ]}; // 8 * ∞ ∧ ⁸ 60 | key {[ 9 , parenleft , VoidSymbol , VoidSymbol ],[ VoidSymbol , ninesuperior ]}; // 9 ( ⁹ 61 | key {[ 0 , parenright , degree , division ],[ VoidSymbol , zerosuperior ]}; // 0 ) ° ÷ ⁰ 62 | 63 | // Letters, first row 64 | key {[ q , Q , ae , AE ],[ guillemotleft , U2039 ]}; // q Q æ Æ « ‹ 65 | key {[ w , W , eacute , Eacute ],[ less , lessthanequal ]}; // w W é É < ≤ 66 | key {[ e , E , egrave , Egrave ],[ greater , greaterthanequal]}; // e E è È > ≥ 67 | key {[ r , R , registered , trademark ],[ guillemotright , U203A ]}; // r R ® ™ » › 68 | key {[ t , T , thorn , Thorn ],[ VoidSymbol , VoidSymbol ]}; // t T þ Þ 69 | key {[ y , Y , dead_currency , VoidSymbol ],[ U2282 , VoidSymbol ]}; // y Y ¤ ⊂ 70 | key {[ u , U , ugrave , Ugrave ],[ U222A , VoidSymbol ]}; // u U ù Ù ∪ 71 | key {[ i , I , U0133 , U0132 ],[ U2229 , VoidSymbol ]}; // i I ij IJ ∩ 72 | key {[ o , O , oe , OE ],[ U2283 , VoidSymbol ]}; // o O œ Œ ⊃ 73 | key {[ p , P , section , paragraph ],[ VoidSymbol , VoidSymbol ]}; // p P § ¶ 74 | 75 | // Letters, second row 76 | key {[ a , A , agrave , Agrave ],[ braceleft , U27EA ]}; // a A à À { ⟪ 77 | key {[ s , S , ssharp , U1E9E ],[ bracketleft , U27E8 ]}; // s S ß ẞ [ ⟨ 78 | key {[ d , D , eth , Eth ],[ bracketright , U27E9 ]}; // d D ð Ð ] ⟩ 79 | key {[ f , F , ordfeminine , VoidSymbol ],[ braceright , U27EB ]}; // f F ª } ⟫ 80 | key {[ g , G , dead_greek , VoidSymbol ],[ copyright , VoidSymbol ]}; // g G Ω © 81 | key {[ h , H , leftarrow , U21D0 ],[ Home , VoidSymbol ]}; // h H ← ⇐ ⇱ 82 | key {[ j , J , downarrow , U21D3 ],[ slash , VoidSymbol ]}; // j J ↓ ⇓ / 83 | key {[ k , K , uparrow , U21D1 ],[ backslash , VoidSymbol ]}; // k K ↑ ⇑ \ 84 | key {[ l , L , rightarrow , U21D2 ],[ End , VoidSymbol ]}; // l L → ⇒ ⇲ 85 | key {[ ISO_Level3_Latch, ISO_Level3_Latch, Multi_key , Multi_key ],[ VoidSymbol , VoidSymbol ]}; // magic 86 | 87 | // Letters, third row 88 | key {[ z , Z , VoidSymbol , VoidSymbol ],[ underscore , VoidSymbol ]}; // z Z _ 89 | key {[ x , X , multiply , U2716 ],[ plus , VoidSymbol ]}; // x X × ✖ + 90 | key {[ c , C , ccedilla , Ccedilla ],[ asciicircum , VoidSymbol ]}; // c C ç Ç ^ 91 | key {[ v , V , U2713 , U2714 ],[ dollar , VoidSymbol ]}; // v V ✓ ✔ $ 92 | key {[ b , B , dagger , doubledagger ],[ ampersand , VoidSymbol ]}; // b B † ‡ & 93 | key {[ n , N , ntilde , Ntilde ],[ VoidSymbol , VoidSymbol ]}; // n N ñ Ñ 94 | key {[ m , M , masculine , VoidSymbol ],[ VoidSymbol , VoidSymbol ]}; // m M º 95 | key {[ comma , semicolon , periodcentered , U2022 ],[ comma , VoidSymbol ]}; // , ; · • , 96 | key {[ period , colon , ellipsis , notsign ],[ period , VoidSymbol ]}; // . : … ¬ . 97 | key {[ question , questiondown , U061F , VoidSymbol ],[ VoidSymbol , VoidSymbol ]}; // ? ¿ ؟ 98 | 99 | // Left Pinky keys 100 | key {[ asciitilde , dead_tilde , VoidSymbol , VoidSymbol ],[ U2248 , U2249 ]}; // ~ ◌̃ ≈ ≉ 101 | key {[ Alt_L , Alt_L ], type = "TWO_LEVEL" }; 102 | 103 | // Right Pinky keys 104 | key {[ minus , underscore , overline , VoidSymbol ],[ emdash , endash ]}; // - _ ‾ — – 105 | key {[ equal , plus , notequal , VoidSymbol ],[ plusminus , U2213 ]}; // = + ≠ ± ∓ 106 | key {[ dead_circumflex , dead_acute , dead_caron , VoidSymbol ],[ VoidSymbol , VoidSymbol ]}; // ◌̂ ◌́ ◌̌ 107 | key {[ dead_diaeresis , dead_grave , dead_breve , VoidSymbol ],[ VoidSymbol , VoidSymbol ]}; // ◌̈ ◌̀ ◌̆ 108 | key {[ apostrophe , quotedbl , dead_schwa , VoidSymbol ],[ VoidSymbol , VoidSymbol ]}; // ' " ə 109 | key {[ bar , brokenbar , VoidSymbol , VoidSymbol ],[ VoidSymbol , VoidSymbol ]}; // | ¦ 110 | 111 | // Space bar 112 | key {[ space , space , VoidSymbol , VoidSymbol ],[ Escape , nobreakspace ]}; 113 | 114 | // Arrows - AltGr + Arrow is hard to type :( 115 | // left and right triangles are problematic because they are rendered as Emojis in certain apps and there's no way to apply VS15 116 | key {[ NoSymbol , Home , U25C0 , U25C1 ],[ Home ]}; 117 | key {[ NoSymbol , Page_Down , U25BC , U25BD ],[ Page_Down ]}; 118 | key {[ NoSymbol , Page_Up , U25B2 , U25B3 ],[ Page_Up ]}; 119 | key {[ NoSymbol , End , U25B6 , U25B7 ],[ End ]}; 120 | key {[ NoSymbol , Home , Home , Home ],[ Home ]}; 121 | key {[ NoSymbol , End , End , End ],[ End ]}; 122 | 123 | // AltGr 124 | // Note: the `ISO_Level5_Latch` here is meaningless but helps with Chromium (no idea why) 125 | key { 126 | type = "TWO_LEVEL", 127 | symbols = [ ISO_Level5_Latch, ISO_Level5_Latch ], 128 | actions = [ SetGroup(group=2), SetGroup(group=2) ] 129 | }; 130 | key { 131 | type = "TWO_LEVEL", 132 | symbols = [ ISO_Level5_Latch, ISO_Level5_Latch ], 133 | actions = [ SetGroup(group=2), SetGroup(group=2) ] 134 | }; 135 | 136 | // Lock AltGr (2nd group) 137 | key {[ ISO_Next_Group, ISO_Next_Group ], [ ISO_Next_Group, ISO_Next_Group ] }; 138 | 139 | // Print screen as symmetric Super_L 140 | // key {[ Hyper_R, Hyper_R ]}; 141 | // modifier_map Mod4 { }; 142 | 143 | // Shifts - needs the "LatchMods" section above to work 144 | // Press one shift then the other one to enable/disable Caps_Lock 145 | // key { [ ISO_Level2_Latch, Caps_Lock ] }; 146 | 147 | // TypeMatrix 2030 in 106 mode (Fn + F3 to activate) 148 | 149 | // Alt and AltGr are "switched" up side down to be compatible with Laptop 150 | 151 | // [ Ctrl ][ Super ][ AltGr ][ Space ][ Alt ][ Super ] 152 | // [ Super ][ Alt ] [ AltGr ] 153 | 154 | // Antislash key - Romaji keycode 97 155 | // key {[ backslash, bar, VoidSymbol, VoidSymbol ],[ brokenbar, VoidSymbol ]}; 156 | 157 | // These keys are remapped to Super_L via xmodmap (for now) 158 | // Shuffle key - Muhenkan keycode 102 159 | // key {type[group1] = "ONE_LEVEL", [ Super_L ]}; 160 | // modifier_map Mod4 { }; 161 | // key { 162 | // type = "TWO_LEVEL", 163 | // symbols = [ ISO_Level5_Latch, ISO_Level5_Latch ], 164 | // actions = [ SetGroup(group=2), SetGroup(group=2) ] 165 | // }; 166 | 167 | // Desktop key - Henkan keycode 100 168 | // key {type[group1] = "ONE_LEVEL", [ Super_L ]}; 169 | // modifier_map Mod4 { }; 170 | // key {[ Alt_L ]}; 171 | 172 | // Play key, next to left ctrl 173 | // key {type[group1] = "ONE_LEVEL", [ Control_L ]}; 174 | // modifier_map Control { }; 175 | 176 | // key

{type[group1] = "ONE_LEVEL", [ Super_L ]}; 177 | // key {type[group1] = "ONE_LEVEL", [ Super_L ]}; 178 | 179 | // keys right of p, useful for kakoune 180 | 181 | // // dead key shift, lock shift 182 | // key { 183 | // type = "TWO_LEVEL", 184 | // symbols = [ VoidSymbol, VoidSymbol ], 185 | // actions = [ LatchMods(modifiers = Shift), LockMods(modifiers = Shift) ] 186 | // }; 187 | 188 | // // dead key alt, lock alt 189 | // key { 190 | // type = "TWO_LEVEL", 191 | // symbols = [ VoidSymbol, VoidSymbol ], 192 | // actions = [ LatchMods(modifiers = Mod1), LockMods(modifiers = Mod1) ] 193 | // }; 194 | 195 | // // emergency reset 196 | // key { 197 | // type = "TWO_LEVEL", 198 | // symbols = [ VoidSymbol, VoidSymbol ], 199 | // // actions = [ SetMods(modifiers = none), SetMods(modifiers = none) ] 200 | // actions = [ SetMods(clearLocks), SetMods(clearLocks) ] 201 | // }; 202 | }; 203 | }; 204 | -------------------------------------------------------------------------------- /.xinitrc: -------------------------------------------------------------------------------- 1 | fish -c 'kb delafayette' 2 | 3 | # dbus used by flameshot 4 | exec dbus-launch i3 5 | --------------------------------------------------------------------------------