remove old stuff, add new stuff
This commit is contained in:
parent
d7ce26a7c0
commit
3f84cef7fb
|
|
@ -1,20 +1 @@
|
||||||
/emacs/secrets.el
|
/mpd/playlists
|
||||||
/emacs/eln-cache/
|
|
||||||
/emacs/url/
|
|
||||||
/emacs/recentf
|
|
||||||
/emacs/history
|
|
||||||
/emacs/straight/repos/
|
|
||||||
/emacs/elisp
|
|
||||||
/emacs/straight/
|
|
||||||
/emacs/ellama-sessions/
|
|
||||||
/emacs/claude/
|
|
||||||
/emacs/games/
|
|
||||||
/emacs/tramp
|
|
||||||
emacs/flycheck_init.el
|
|
||||||
/emacs/.org-id-locations
|
|
||||||
/emacs/detached/
|
|
||||||
/emacs/elisa/
|
|
||||||
/emacs/perspectives
|
|
||||||
/emacs/persist/
|
|
||||||
/emacs/network-security.data
|
|
||||||
/emacs/forge-database.sqlite
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
always_encrypt = true
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
WorkspaceDirectories = [
|
||||||
|
]
|
||||||
|
|
||||||
|
FormatOnPut = true
|
||||||
|
CodeActionsOnPut = ["source.organizeImports"]
|
||||||
|
|
||||||
|
[Servers]
|
||||||
|
|
||||||
|
[Servers.gopls]
|
||||||
|
Command = ["gopls", "serve", "-rpc.trace"]
|
||||||
|
StderrFile = "gopls.stderr.log"
|
||||||
|
LogFile = "gopls.log"
|
||||||
|
|
||||||
|
[Servers.gopls.Options]
|
||||||
|
hoverKind = "FullDocumentation"
|
||||||
|
|
||||||
|
[Servers.clangd]
|
||||||
|
Command = ["clangd", "--background-index", "--clang-tidy"]
|
||||||
|
StderrFile = "clangd.stderr.log"
|
||||||
|
LogFile = "clangd.log"
|
||||||
|
|
||||||
|
[Servers.clangd.Options]
|
||||||
|
hoverKind = "FullDocumentation"
|
||||||
|
|
||||||
|
[[FilenameHandlers]]
|
||||||
|
Pattern = "[/\\\\]go\\.mod$"
|
||||||
|
LanguageID = "go.mod"
|
||||||
|
ServerKey = "gopls"
|
||||||
|
|
||||||
|
[[FilenameHandlers]]
|
||||||
|
Pattern = "[/\\\\]go\\.sum$"
|
||||||
|
LanguageID = "go.sum"
|
||||||
|
ServerKey = "gopls"
|
||||||
|
|
||||||
|
[[FilenameHandlers]]
|
||||||
|
Pattern = "\\.go$"
|
||||||
|
LanguageID = "go"
|
||||||
|
ServerKey = "gopls"
|
||||||
|
|
||||||
|
[[FilenameHandlers]]
|
||||||
|
Pattern = "\\.cpp$"
|
||||||
|
LanguageID = "cpp"
|
||||||
|
ServerKey = "clangd"
|
||||||
|
|
||||||
|
[[FilenameHandlers]]
|
||||||
|
Pattern = "\\.c$"
|
||||||
|
LanguageID = "c"
|
||||||
|
ServerKey = "clangd"
|
||||||
|
|
||||||
|
[[FilenameHandlers]]
|
||||||
|
Pattern = "\\.h$"
|
||||||
|
LanguageID = "c"
|
||||||
|
ServerKey = "clangd"
|
||||||
|
|
||||||
|
[[FilenameHandlers]]
|
||||||
|
Pattern = "\\.hpp$"
|
||||||
|
LanguageID = "cpp"
|
||||||
|
ServerKey = "clangd"
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
((nil (eglot-workspace-configuration . ((gopls . ((staticcheck . t)
|
|
||||||
(matcher . "CaseSensitive")))))))
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
transient
|
|
||||||
.local
|
|
||||||
\#*\#
|
|
||||||
project-explorer-cache
|
|
||||||
projectile-bookmarks.eld
|
|
||||||
**/*.elc
|
|
||||||
persp-confs
|
|
||||||
elpa
|
|
||||||
eshell
|
|
||||||
auto-save-list
|
|
||||||
quelpa
|
|
||||||
*.*~
|
|
||||||
.*~
|
|
||||||
.lsp-session*
|
|
||||||
projects
|
|
||||||
*.cache
|
|
||||||
/emms/
|
|
||||||
bookmarks
|
|
||||||
/.persistent-scratch
|
|
||||||
bookmarks
|
|
||||||
/var/
|
|
||||||
.mc-lists.el
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
;;; custom.el --- Contains settings generated by customize -*- lexical-binding: t; -*-
|
|
||||||
|
|
||||||
;; Copyright (C) 2024 Levi Neely
|
|
||||||
|
|
||||||
;; Author: Levi Neely <me@lkn.uber.space>
|
|
||||||
;; Version: 0.1
|
|
||||||
;; Package-Requires: ((emacs "29.4"))
|
|
||||||
;; Keywords: custom
|
|
||||||
;; URL: https://github.com/USERNAME/REPOSITORY
|
|
||||||
|
|
||||||
;; This file is not part of GNU Emacs.
|
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or modify
|
|
||||||
;; it under the terms of the GNU General Public License as published by
|
|
||||||
;; the Free Software Foundation, either version 3 of the License, or
|
|
||||||
;; (at your option) any later version.
|
|
||||||
|
|
||||||
;; This program is distributed in the hope that it will be useful,
|
|
||||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
;; GNU General Public License for more details.
|
|
||||||
|
|
||||||
;; You should have received a copy of the GNU General Public License
|
|
||||||
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
;;; Commentary:
|
|
||||||
|
|
||||||
;; This file contains settings generated by customize.
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(custom-set-variables
|
|
||||||
;; custom-set-variables was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(cursor-type 'bar)
|
|
||||||
'(custom-safe-themes
|
|
||||||
'("9c22d1654fbfed0285a519541b5ea76462d9b03d778d1dc34779fd38613bf7c8" "2224b07a70ad0e4f11eef482f9551efa57d7cc27c943ffd43edd01ed85ed2ebf" "fbd3f3b9e2b5c2fefd006c70afb5c514dd37b0c0427cff007ca589eedfcfa2b9" default))
|
|
||||||
'(elfeed-feeds
|
|
||||||
'("https://www.thenation.com/feed/?post_type=article" "https://feeds2.feedburner.com/google/RzFQ" "https://api.substack.com/feed/podcast/365422.rss" "https://stallman.org/rss/rss.xml" "https://danielpocock.com/feed.atom"))
|
|
||||||
'(indent-tabs-mode nil)
|
|
||||||
'(mc/always-run-for-all t)
|
|
||||||
'(menu-bar-mode nil)
|
|
||||||
'(safe-local-variable-values
|
|
||||||
'((flycheck-disabled-checkers emacs-lisp-checkdoc emacs-lisp)))
|
|
||||||
'(tab-width 2)
|
|
||||||
'(tool-bar-mode nil))
|
|
||||||
(custom-set-faces
|
|
||||||
;; custom-set-faces was added by Custom.
|
|
||||||
;; If you edit it by hand, you could mess it up, so be careful.
|
|
||||||
;; Your init file should contain only one such instance.
|
|
||||||
;; If there is more than one, they won't work right.
|
|
||||||
'(default ((t (:weight regular :height 120 :width normal :foundry "CF " :family "Space Mono" :slant normal))))
|
|
||||||
'(mc/cursor-bar-face ((t (:background "dim gray" :height 1)))))
|
|
||||||
|
|
||||||
(provide 'custom)
|
|
||||||
|
|
||||||
;;; custom.el ends here.
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
;; (setenv "LSP_USE_PLISTS" "true") ;; doesn't work
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
;;; feature-base.el -- defines the "base" configuration
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; This file defines what modules should be loaded as part of the
|
|
||||||
;;; "basic" editor configuration.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-base)
|
|
||||||
(require 'module-region)
|
|
||||||
(require 'module-hydra)
|
|
||||||
(require 'module-detached)
|
|
||||||
(require 'module-dired)
|
|
||||||
(require 'module-async)
|
|
||||||
(require 'module-remotefs)
|
|
||||||
(require 'module-which-key)
|
|
||||||
(require 'module-multi-cursor)
|
|
||||||
(require 'module-eshell)
|
|
||||||
(require 'module-scratch)
|
|
||||||
(require 'module-eyecandy)
|
|
||||||
(require 'module-avy)
|
|
||||||
(require 'module-browser)
|
|
||||||
(require 'module-grep)
|
|
||||||
(require 'module-piper)
|
|
||||||
(require 'module-calendar)
|
|
||||||
(require 'module-gc)
|
|
||||||
|
|
||||||
(provide 'feature-base)
|
|
||||||
|
|
||||||
;;; feature-base.el ends here.
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
;;; feature-better-minibuf.el -- better minibuffers
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Emacs minibuffer kind of sucks by default. Improves and extends
|
|
||||||
;;; Emacs minibuffer functionality.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-vertico)
|
|
||||||
(require 'module-embark)
|
|
||||||
|
|
||||||
(provide 'feature-better-minibuf)
|
|
||||||
|
|
||||||
;;; feature-better-minibuf.el ends here.
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
;;; feature-bsgen.el -- bullshit generators
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Loads modules related to generating plausible sounding bullshit.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-llm)
|
|
||||||
|
|
||||||
(provide 'feature-bsgen)
|
|
||||||
;;; feature-bsgen.el ends here.
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
;;; feature-completion.el -- automatic completion
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Automatic completion modules for lazy people.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-orderless)
|
|
||||||
(require 'module-snippets)
|
|
||||||
(require 'module-marginalia)
|
|
||||||
(require 'module-corfu)
|
|
||||||
(require 'module-eglot)
|
|
||||||
(provide 'feature-completion)
|
|
||||||
|
|
||||||
;;; feature-completion.el ends here.
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
;;; feature-consult.el -- consult
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Consult provides enhanced search and navigation functionality for
|
|
||||||
;;; Emacs. It is broad enough in scope, and has enough extensions, to
|
|
||||||
;;; warrant its own feature.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
|
|
||||||
(require 'module-consult)
|
|
||||||
(require 'module-consult-projectile)
|
|
||||||
|
|
||||||
(provide 'feature-consult)
|
|
||||||
;;; feature-consult.el ends here.
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
;;; feature-dev.el -- coding stuff
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Enables support for development related packages, such as
|
|
||||||
;;; programming language major modes.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-ctags)
|
|
||||||
(require 'module-golang)
|
|
||||||
(require 'module-golang-playground)
|
|
||||||
(require 'module-python)
|
|
||||||
(require 'module-web)
|
|
||||||
(require 'module-protobuf)
|
|
||||||
(require 'module-kotlin)
|
|
||||||
(require 'module-yaml)
|
|
||||||
(require 'module-json)
|
|
||||||
(require 'module-rego)
|
|
||||||
(require 'module-syntax)
|
|
||||||
(require 'module-lmtf)
|
|
||||||
(require 'module-apitest)
|
|
||||||
(require 'module-qt)
|
|
||||||
(require 'module-eglot)
|
|
||||||
;; (require 'module-lsp)
|
|
||||||
|
|
||||||
(provide 'feature-dev)
|
|
||||||
;;; feature-dev.el ends here.
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
;;; feature-diagram.el -- diagramming modules
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Diagramming in plain text!
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-graphviz)
|
|
||||||
(require 'module-plantuml)
|
|
||||||
|
|
||||||
(provide 'feature-diagram)
|
|
||||||
;;; feature-diagram.el ends here.
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
;;; feature-email.el -- email
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Because ya gotta...
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-notmuch)
|
|
||||||
|
|
||||||
(provide 'feature-email)
|
|
||||||
;;; feature-km.el ends here.
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
;;; feature-feeds.el -- news feeds
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Read news feeds from Emacs, because browsing the web sucks.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-rss)
|
|
||||||
|
|
||||||
(provide 'feature-feeds)
|
|
||||||
;;; feature-feeds.el ends here.
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
;;; feature-finance.el - money shit
|
|
||||||
;;;
|
|
||||||
;;; Damn that money, go walking out my door
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-ledger) ;; ledger-mode and config
|
|
||||||
|
|
||||||
(provide 'feature-finance)
|
|
||||||
|
|
||||||
;;; feature-finance.el ends here.
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
;;; feature-fuzzy.el -- fuzzy search
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Loads modules related to knowledge management.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'feature-fuzzy)
|
|
||||||
;;; feature-fuzzy.el ends here.
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
;;; feature-km.el -- knowledge management
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Loads modules related to knowledge management.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-org)
|
|
||||||
(require 'module-org-denote)
|
|
||||||
(require 'module-org-drill)
|
|
||||||
(require 'module-denote)
|
|
||||||
;;(require 'module-denote-multidir)
|
|
||||||
(require 'module-denote-index)
|
|
||||||
|
|
||||||
(require 'module-collect)
|
|
||||||
|
|
||||||
(provide 'feature-km)
|
|
||||||
;;; feature-km.el ends here.
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
;;; feature-project.el -- projects
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Provides a definition of a "project" to Emacs, and facilities for
|
|
||||||
;;; working with them.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-projectile)
|
|
||||||
(require 'module-perspective)
|
|
||||||
(require 'module-work-projects)
|
|
||||||
|
|
||||||
(provide 'feature-project)
|
|
||||||
;;; feature-project.el ends here.
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
;;; feature-vcs.el -- version control systems
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Provides version control integration.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-magit)
|
|
||||||
(require 'module-change-history)
|
|
||||||
;; (require 'module-code-review) ;; BROKEN
|
|
||||||
|
|
||||||
(provide 'feature-vcs)
|
|
||||||
;;; feature-vcs.el ends here.
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
;;; init.el --- Emacs configuration entry point
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Configure Emacs. In this configuration, a "module" is a logical
|
|
||||||
;;; unit of functionality, e.g., org or denote. The "module" consists
|
|
||||||
;;; of loading and configuring zero or more Emacs packages. The
|
|
||||||
;;; "feature" layer is designed to allow users to compose modules to
|
|
||||||
;;; build features. A "feature" defines a larger capability composed
|
|
||||||
;;; of zero or more modules (noting that a zero-module feature is
|
|
||||||
;;; noop).
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
;; enable disabled-by-default functions
|
|
||||||
(put 'erase-buffer 'disabled nil)
|
|
||||||
(put 'narrow-to-region 'disabled nil)
|
|
||||||
(put 'narrow-to-defun 'disabled nil)
|
|
||||||
(put 'narrow-to-page 'disabled nil)
|
|
||||||
(put 'widen 'disabled nil)
|
|
||||||
|
|
||||||
;; setup load paths
|
|
||||||
(add-to-list
|
|
||||||
'load-path (expand-file-name
|
|
||||||
"cfg" user-emacs-directory))
|
|
||||||
(add-to-list
|
|
||||||
'load-path (expand-file-name
|
|
||||||
"lisp" user-emacs-directory))
|
|
||||||
(add-to-list
|
|
||||||
'load-path (expand-file-name
|
|
||||||
"module" user-emacs-directory))
|
|
||||||
(add-to-list
|
|
||||||
'load-path (expand-file-name
|
|
||||||
"feature" user-emacs-directory))
|
|
||||||
|
|
||||||
(require 'feature-base) ; prep the beast
|
|
||||||
;; (require 'feature-km) ; knowledge management (migrated to obsidian)
|
|
||||||
(require 'feature-better-minibuf) ; better minibuffer
|
|
||||||
(require 'feature-completion) ; automatic completion
|
|
||||||
(require 'feature-dev) ; coding
|
|
||||||
(require 'feature-vcs) ; version control
|
|
||||||
(require 'feature-diagram) ; diagramming in plain text!
|
|
||||||
(require 'feature-project) ; project support
|
|
||||||
(require 'feature-consult) ; consult is its own feature...
|
|
||||||
(require 'feature-feeds) ; read newsfeeds
|
|
||||||
(require 'feature-bsgen) ; bullshit generators
|
|
||||||
(require 'feature-finance) ; damn that money!
|
|
||||||
(require 'feature-email) ; because ya gotta...
|
|
||||||
(require 'server)
|
|
||||||
(if (not (server-running-p))
|
|
||||||
(server-start))
|
|
||||||
|
|
||||||
(provide 'init)
|
|
||||||
;;; init.el ends here
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
;;; module-apitest.el --- api testing shit -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Postman is bullshit. Do your API testing in Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'plz)
|
|
||||||
|
|
||||||
(provide 'module-apitest)
|
|
||||||
|
|
||||||
;;; module-apitest.el ends here.
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
;;; module-async.el --- async functionality -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Enable async support in Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require 'async)
|
|
||||||
(pkg/require 'async-status)
|
|
||||||
|
|
||||||
(provide 'module-async)
|
|
||||||
|
|
||||||
;;; module-async.el ends here.
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
;;; module-avy.el --- quick jump -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Adds quick-jump functionality to Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require 'avy)
|
|
||||||
|
|
||||||
(avy-setup-default)
|
|
||||||
(setq avy-background t)
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x j j") #'avy-goto-char)
|
|
||||||
(global-set-key (kbd "C-x j c") #'avy-goto-char-2)
|
|
||||||
(global-set-key (kbd "C-x j l") #'avy-goto-line)
|
|
||||||
(global-set-key (kbd "C-x j w") #'avy-goto-word-1)
|
|
||||||
(global-set-key (kbd "C-x j .") #'avy-resume)
|
|
||||||
|
|
||||||
(provide 'module-avy)
|
|
||||||
|
|
||||||
;;; module-avy.el ends here.
|
|
||||||
|
|
@ -1,95 +0,0 @@
|
||||||
;;; module-base.el -- configure emacs behavior and user interface
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;; Exactly what it looks like.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'warnings)
|
|
||||||
(require 'tramp)
|
|
||||||
(require 'tramp-sh)
|
|
||||||
|
|
||||||
(defun copy-file-path-to-clipboard ()
|
|
||||||
"Copy the current buffer's file path to the clipboard."
|
|
||||||
(interactive)
|
|
||||||
(let ((filepath (buffer-file-name)))
|
|
||||||
(when filepath
|
|
||||||
(kill-new filepath)
|
|
||||||
(message "Copied file path: %s" filepath))))
|
|
||||||
|
|
||||||
(defun my-compile-init-file ()
|
|
||||||
"Compile the init file."
|
|
||||||
(let ((init-file (file-truename user-init-file)))
|
|
||||||
(when (string= (buffer-file-name) init-file)
|
|
||||||
(byte-compile-file init-file))))
|
|
||||||
|
|
||||||
(defun my/setup-elisp-formatting-key ()
|
|
||||||
"Set up the formatting key for Emacs Lisp buffers."
|
|
||||||
(local-set-key (kbd "C-c f") 'my/format-elisp-buffer))
|
|
||||||
(add-hook 'emacs-lisp-mode-hook #'my/setup-elisp-formatting-key)
|
|
||||||
|
|
||||||
(defun my/reload-init-file ()
|
|
||||||
"Reload the Emacs init file."
|
|
||||||
(interactive)
|
|
||||||
(load-file user-init-file))
|
|
||||||
|
|
||||||
(defun my/format-elisp-buffer ()
|
|
||||||
"Format the whole elisp buffer."
|
|
||||||
(interactive)
|
|
||||||
(save-excursion
|
|
||||||
(indent-region (point-min) (point-max))))
|
|
||||||
|
|
||||||
(tool-bar-mode -1)
|
|
||||||
(menu-bar-mode -1)
|
|
||||||
(scroll-bar-mode -1)
|
|
||||||
|
|
||||||
(setq backup-by-copying t
|
|
||||||
completion-cycle-threshold 3
|
|
||||||
create-lockfiles nil
|
|
||||||
delete-old-versions t
|
|
||||||
enable-recursive-minibuffers t
|
|
||||||
focus-follows-mouse t
|
|
||||||
indent-tabs-mode nil
|
|
||||||
inhibit-startup-screen t
|
|
||||||
kept-new-versions 20
|
|
||||||
kept-old-versions 2
|
|
||||||
minibuffer-prompt-properties '(read-only t cursor-intangible t
|
|
||||||
face minibuffer-prompt)
|
|
||||||
mouse-autoselect-window t
|
|
||||||
read-extended-command-predicate #'command-completion-default-include-p
|
|
||||||
read-process-output-max (* 1024 1024)
|
|
||||||
tab-always-indent 'complete
|
|
||||||
tab-width 4
|
|
||||||
use-short-answers t
|
|
||||||
version-control t
|
|
||||||
backup-directory-alist `((".*" . ,(concat user-emacs-directory "backup")))
|
|
||||||
read-extended-command-predicate #'command-completion-default-include-p
|
|
||||||
gc-cons-threshold 100000000
|
|
||||||
auth-sources '("~/.authinfo.gpg")
|
|
||||||
warning-minimum-level :emergency
|
|
||||||
large-file-warning-threshold nil
|
|
||||||
tramp-persistency-file-name "~/.config/emacs/tramp"
|
|
||||||
tramp-inline-compress-start-size 1000)
|
|
||||||
|
|
||||||
;; load custom file
|
|
||||||
(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
|
|
||||||
(when (file-exists-p custom-file)
|
|
||||||
(load custom-file))
|
|
||||||
|
|
||||||
;; compile init.el on save
|
|
||||||
(add-hook 'after-save-hook #'my-compile-init-file)
|
|
||||||
|
|
||||||
;; setup base key bindings
|
|
||||||
(global-set-key (kbd "M-/") 'dabbrev-expand)
|
|
||||||
(global-set-key (kbd "M-s r") 'replace-regexp)
|
|
||||||
(global-set-key (kbd "M-s M-r") 'replace-string)
|
|
||||||
(global-set-key (kbd "C-x E n p") #'narrow-to-page)
|
|
||||||
(global-set-key (kbd "C-x E n f") #'narrow-to-defun)
|
|
||||||
(global-set-key (kbd "C-x E n r") #'narrow-to-region)
|
|
||||||
(global-set-key (kbd "C-x E w") #'widen)
|
|
||||||
(global-set-key (kbd "C-x c r") #'my/reload-init-file)
|
|
||||||
(global-set-key (kbd "C-x y b p") 'copy-file-path-to-clipboard)
|
|
||||||
|
|
||||||
(provide 'module-base)
|
|
||||||
|
|
||||||
;;; module-base.el ends here.
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
;;; module-browser.el --- open webpages -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Modern web browsers suck. Open a webpage from within Emacs, and
|
|
||||||
;;; allow opening with a sucky browser if you really have to.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'eww)
|
|
||||||
(setq shr-max-image-proportion 0.7)
|
|
||||||
(setq shr-image-animate nil)
|
|
||||||
(setq browse-url-browser-function 'eww-browse-url)
|
|
||||||
|
|
||||||
;; for pages that require JS for some stupid reason...
|
|
||||||
(defun browse-url-xdg-open (url &optional _new-window)
|
|
||||||
"Open URL using the default browser via `xdg-open'."
|
|
||||||
(interactive (browse-url-interactive-arg "URL: "))
|
|
||||||
(call-process "xdg-open" nil 0 nil url))
|
|
||||||
|
|
||||||
(defun eww-open-in-default-browser ()
|
|
||||||
"Open the current EWW page in the default system browser."
|
|
||||||
(interactive)
|
|
||||||
(browse-url-xdg-open (eww-current-url)))
|
|
||||||
|
|
||||||
(define-key eww-mode-map (kbd "C-c o") 'eww-open-in-default-browser)
|
|
||||||
|
|
||||||
(provide 'module-browser)
|
|
||||||
|
|
||||||
;;; module-browser.el ends here.
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
;;; module-calendar.el -- calendar stuff
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;; Emacs calendar stuff.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'german-holidays)
|
|
||||||
|
|
||||||
(provide 'module-calendar)
|
|
||||||
;;; module-calendar.el ends here.
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
;;; module-change-history.el --- vcs change history
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; View change history via vcs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require 'why-this)
|
|
||||||
(global-set-key (kbd "C-x W w") 'why-this-mode)
|
|
||||||
(global-set-key (kbd "C-x W W") 'why-this-annotate)
|
|
||||||
|
|
||||||
(provide 'module-change-history)
|
|
||||||
|
|
||||||
;;; module-change-history.el ends here.
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
;;;; module-code-review.el - Module Code Review
|
|
||||||
|
|
||||||
;; Commentary:
|
|
||||||
|
|
||||||
;; This module provides functions for code review.
|
|
||||||
|
|
||||||
;;;; Code:
|
|
||||||
|
|
||||||
(require 'package)
|
|
||||||
(pkg/require 'code-review)
|
|
||||||
(provide 'module-code-review)
|
|
||||||
|
|
||||||
;;;; module-code-review.el ends here.
|
|
||||||
|
|
@ -1,248 +0,0 @@
|
||||||
;;; module-collect.el --- manage document collections
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; This module provides the ability to create, rename, and delete
|
|
||||||
;;; collections of documents. Each collection is a subdirectory of the
|
|
||||||
;;; path defined by the variable collect/store-path.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
|
|
||||||
;;; collect/store-path is a variable that stores a string defining the path to the directory under which collections are stored.
|
|
||||||
|
|
||||||
(require 'url)
|
|
||||||
(require 'time-date)
|
|
||||||
(require 'eww)
|
|
||||||
|
|
||||||
(defvar collect/store-path "~/collections")
|
|
||||||
|
|
||||||
(defvar collect/supported-mime-types
|
|
||||||
'("text/plain"
|
|
||||||
"text/html"
|
|
||||||
"text/css"
|
|
||||||
"text/javascript"
|
|
||||||
"application/json"
|
|
||||||
"application/xml"
|
|
||||||
"text/xml"
|
|
||||||
"text/markdown"
|
|
||||||
"text/csv")
|
|
||||||
"List of MIME types supported for collection.")
|
|
||||||
|
|
||||||
(defun collect/delete-collection-internal (collection-name)
|
|
||||||
"Delete an existing collection, moving its contents (except .collection-metadata) into the no-name collection."
|
|
||||||
(let ((source-dir (expand-file-name collection-name collect/store-path))
|
|
||||||
(target-dir (expand-file-name "no-name" collect/store-path)))
|
|
||||||
(if (file-exists-p source-dir)
|
|
||||||
(progn
|
|
||||||
(unless (file-exists-p target-dir)
|
|
||||||
(make-directory target-dir t))
|
|
||||||
;; Move all contents, excluding .collection-metadata
|
|
||||||
(dolist (file (directory-files source-dir t "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\)"))
|
|
||||||
(let ((file-name (file-name-nondirectory file)))
|
|
||||||
(unless (string= file-name ".collection-metadata")
|
|
||||||
(let ((target-file (expand-file-name file-name target-dir)))
|
|
||||||
(if (file-directory-p file)
|
|
||||||
(copy-directory file target-file t t t)
|
|
||||||
(rename-file file target-file t))))))
|
|
||||||
;; Force remove the directory
|
|
||||||
(delete-directory source-dir t)
|
|
||||||
(message "Collection '%s' deleted and contents moved to 'no-name' collection." collection-name))
|
|
||||||
(error "Collection '%s' does not exist" collection-name))))
|
|
||||||
|
|
||||||
(defun collect/delete-collection ()
|
|
||||||
"Interactively delete an existing collection."
|
|
||||||
(interactive)
|
|
||||||
(let* ((collections (collect/get-collections))
|
|
||||||
(choice (completing-read "Select collection to delete: " (mapcar #'car collections) nil t))
|
|
||||||
(dir-to-delete (cdr (assoc choice collections))))
|
|
||||||
(when dir-to-delete
|
|
||||||
(collect/delete-collection-internal (file-name-nondirectory dir-to-delete)))))
|
|
||||||
|
|
||||||
(defun collect/create-collection ()
|
|
||||||
"Interactively create a new collection."
|
|
||||||
(interactive)
|
|
||||||
(let ((collection-name (read-string "Enter collection name: ")))
|
|
||||||
(collect/create-collection-internal collection-name)))
|
|
||||||
|
|
||||||
(defun collect/create-collection-internal (collection-name)
|
|
||||||
"Create a new collection with the given name."
|
|
||||||
(let* ((unix-path (replace-regexp-in-string "[^[:alnum:]_-]" "-"
|
|
||||||
(downcase (string-trim collection-name))))
|
|
||||||
(full-path (expand-file-name unix-path collect/store-path))
|
|
||||||
(metadata-file (expand-file-name ".collection-metadata" full-path))
|
|
||||||
(current-time (format-time-string "%Y-%m-%d %H:%M:%S")))
|
|
||||||
(cond
|
|
||||||
((string-empty-p unix-path)
|
|
||||||
(error "Collection name cannot be empty"))
|
|
||||||
((file-exists-p full-path)
|
|
||||||
(error "Collection '%s' already exists" collection-name))
|
|
||||||
(t
|
|
||||||
(make-directory full-path t)
|
|
||||||
(with-temp-file metadata-file
|
|
||||||
(insert (format "name: %s\n" collection-name)
|
|
||||||
(format "created: %s\n" current-time)
|
|
||||||
(format "updated: %s\n" current-time)))
|
|
||||||
(message "Collection '%s' created successfully with metadata." collection-name)))))
|
|
||||||
|
|
||||||
(defun collect/rename-collection-internal (old-name new-name)
|
|
||||||
"Rename collection from OLD-NAME to NEW-NAME."
|
|
||||||
(let ((old-dir (expand-file-name old-name collect/store-path))
|
|
||||||
(new-dir (expand-file-name
|
|
||||||
(replace-regexp-in-string "[^[:alnum:]_-]" "-"
|
|
||||||
(downcase (string-trim new-name)))
|
|
||||||
collect/store-path)))
|
|
||||||
(when (file-exists-p old-dir)
|
|
||||||
;; Create new collection
|
|
||||||
(collect/create-collection-internal new-name)
|
|
||||||
;; Move contents
|
|
||||||
(dolist (file (directory-files old-dir t "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\)"))
|
|
||||||
(let ((file-name (file-name-nondirectory file)))
|
|
||||||
(unless (string= file-name ".collection-metadata")
|
|
||||||
(let ((target-file (expand-file-name file-name new-dir)))
|
|
||||||
(if (file-directory-p file)
|
|
||||||
(copy-directory file target-file t t t)
|
|
||||||
(rename-file file target-file t))))))
|
|
||||||
;; Update metadata file
|
|
||||||
(let ((old-metadata-file (expand-file-name ".collection-metadata" old-dir))
|
|
||||||
(new-metadata-file (expand-file-name ".collection-metadata" new-dir)))
|
|
||||||
(when (file-exists-p old-metadata-file)
|
|
||||||
(with-temp-file new-metadata-file
|
|
||||||
(insert-file-contents old-metadata-file)
|
|
||||||
(goto-char (point-min))
|
|
||||||
(when (re-search-forward "^name: .*$" nil t)
|
|
||||||
(replace-match (concat "name: " new-name)))
|
|
||||||
(goto-char (point-min))
|
|
||||||
(when (re-search-forward "^updated: .*$" nil t)
|
|
||||||
(replace-match (concat "updated: " (format-time-string "%Y-%m-%d %H:%M:%S")))))))
|
|
||||||
;; Delete old collection directory
|
|
||||||
(delete-directory old-dir t)
|
|
||||||
(message "Collection '%s' renamed to '%s'." old-name new-name))))
|
|
||||||
|
|
||||||
(defun collect/rename-collection ()
|
|
||||||
"Interactively rename an existing collection."
|
|
||||||
(interactive)
|
|
||||||
(let* ((collections (collect/get-collections))
|
|
||||||
(old-name (completing-read "Select collection to rename: " (mapcar #'car collections) nil t))
|
|
||||||
(new-name (read-string (format "Enter new name for collection '%s': " old-name))))
|
|
||||||
(when (and old-name new-name)
|
|
||||||
(let ((dir-to-rename (cdr (assoc old-name collections))))
|
|
||||||
(when dir-to-rename
|
|
||||||
(collect/rename-collection-internal (file-name-nondirectory dir-to-rename) new-name))))))
|
|
||||||
|
|
||||||
(defun collect/add-file-to-collection ()
|
|
||||||
"Add a file to a specified collection."
|
|
||||||
(interactive)
|
|
||||||
(let* ((file-to-add (read-file-name "Select file to add: "))
|
|
||||||
(all-files (directory-files collect/store-path t "^[^.]"))
|
|
||||||
(collections (cl-remove-if
|
|
||||||
(lambda (dir)
|
|
||||||
(or (not (file-directory-p dir))
|
|
||||||
(string= (file-name-nondirectory dir) "no-name")))
|
|
||||||
all-files))
|
|
||||||
(collection-names
|
|
||||||
(mapcar (lambda (dir)
|
|
||||||
(let ((metadata-file (expand-file-name ".collection-metadata" dir)))
|
|
||||||
(if (file-exists-p metadata-file)
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert-file-contents metadata-file)
|
|
||||||
(if (re-search-forward "^name: \\(.*\\)$" nil t)
|
|
||||||
(match-string 1)
|
|
||||||
(file-name-nondirectory dir)))
|
|
||||||
(file-name-nondirectory dir))))
|
|
||||||
collections))
|
|
||||||
(selected-collection (completing-read "Select collection to add to: " collection-names nil t))
|
|
||||||
(target-dir (nth (cl-position selected-collection collection-names :test 'string=) collections)))
|
|
||||||
(when (and file-to-add target-dir)
|
|
||||||
(let ((target-file (expand-file-name (file-name-nondirectory file-to-add) target-dir)))
|
|
||||||
(if (file-exists-p target-file)
|
|
||||||
(if (y-or-n-p "File already exists in collection. Overwrite?")
|
|
||||||
(copy-file file-to-add target-file t)
|
|
||||||
(message "File not added to collection."))
|
|
||||||
(copy-file file-to-add target-file))
|
|
||||||
(message "File '%s' added to collection '%s'."
|
|
||||||
(file-name-nondirectory file-to-add)
|
|
||||||
selected-collection)))))
|
|
||||||
|
|
||||||
(defun collect/get-collections ()
|
|
||||||
"Get a list of collections with their names and directories."
|
|
||||||
(let ((all-dirs (directory-files collect/store-path t "^[^.]")))
|
|
||||||
(cl-remove-if #'null
|
|
||||||
(mapcar (lambda (dir)
|
|
||||||
(when (file-directory-p dir)
|
|
||||||
(let* ((metadata-file (expand-file-name ".collection-metadata" dir))
|
|
||||||
(name (collect/get-collection-name metadata-file)))
|
|
||||||
(when name
|
|
||||||
(cons name dir)))))
|
|
||||||
all-dirs))))
|
|
||||||
|
|
||||||
(defun collect/get-collection-name (metadata-file)
|
|
||||||
"Get the collection name from the metadata file."
|
|
||||||
(when (file-exists-p metadata-file)
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert-file-contents metadata-file)
|
|
||||||
(goto-char (point-min))
|
|
||||||
(when (re-search-forward "^name: \\(.+\\)$" nil t)
|
|
||||||
(match-string 1)))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun collect/add-webpage-to-collection ()
|
|
||||||
"Add a webpage to a specified collection."
|
|
||||||
(interactive)
|
|
||||||
(let* ((url (read-string "Enter URL to add: "))
|
|
||||||
(collections (collect/get-collections))
|
|
||||||
(selected-collection (completing-read "Select collection to add to: " (mapcar #'car collections) nil t))
|
|
||||||
(target-dir (cdr (assoc selected-collection collections))))
|
|
||||||
(when (and url (file-directory-p target-dir))
|
|
||||||
(collect/add-webpage-to-collection-internal url target-dir selected-collection))))
|
|
||||||
|
|
||||||
(defun collect/add-webpage-to-collection-internal (url target-dir collection-name)
|
|
||||||
"Internal function to add a webpage to a collection."
|
|
||||||
(let* ((filename (collect/generate-filename url))
|
|
||||||
(target-file (expand-file-name filename target-dir)))
|
|
||||||
(url-retrieve url
|
|
||||||
(lambda (status target-file filename collection-name)
|
|
||||||
(if (plist-get status :error)
|
|
||||||
(message "Error fetching webpage: %s" (plist-get status :error))
|
|
||||||
(goto-char (point-min))
|
|
||||||
(re-search-forward "\n\n")
|
|
||||||
(write-region (point) (point-max) target-file)
|
|
||||||
(message "Webpage '%s' added to collection '%s'." filename collection-name)))
|
|
||||||
(list target-file filename collection-name))))
|
|
||||||
|
|
||||||
(defun collect/generate-filename (url)
|
|
||||||
"Generate a filename for the given URL."
|
|
||||||
(let* ((timestamp (format-time-string "%Y%m%dT%H%M%S"))
|
|
||||||
(parsed-url (url-generic-parse-url url))
|
|
||||||
(host (url-host parsed-url))
|
|
||||||
(path (url-filename parsed-url))
|
|
||||||
(path-without-schema (replace-regexp-in-string "^/+" "" path))
|
|
||||||
(sanitized-path (replace-regexp-in-string "[^a-zA-Z0-9._-]" "_" path-without-schema))
|
|
||||||
(full-path (concat host "_" sanitized-path))
|
|
||||||
(extension (if (string-match "\\.[^.]+$" full-path)
|
|
||||||
(match-string 0 full-path)
|
|
||||||
".html")))
|
|
||||||
(concat timestamp "_" (file-name-sans-extension full-path) extension)))
|
|
||||||
|
|
||||||
(defun collect/add-eww-page-to-collection ()
|
|
||||||
"Add the current eww page to a specified collection."
|
|
||||||
(interactive)
|
|
||||||
(if (eq major-mode 'eww-mode)
|
|
||||||
(progn
|
|
||||||
(eww-copy-page-url)
|
|
||||||
(let* ((url (read-string "Enter URL to add: " (current-kill 0)))
|
|
||||||
(collections (collect/get-collections))
|
|
||||||
(selected-collection (completing-read "Select collection to add to: "
|
|
||||||
(mapcar #'car collections) nil t))
|
|
||||||
(target-dir (cdr (assoc selected-collection collections))))
|
|
||||||
(if (and url (file-directory-p target-dir))
|
|
||||||
(progn
|
|
||||||
(message "Adding webpage to collection...")
|
|
||||||
(collect/add-webpage-to-collection-internal url target-dir selected-collection))
|
|
||||||
(message "Invalid URL or collection directory."))))
|
|
||||||
(message "This function can only be used in eww-mode.")))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'module-collect)
|
|
||||||
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
;;; module-consult-projectile.el --- consult/projectile integration
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Integrate consult with projectile.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(require 'module-consult)
|
|
||||||
(require 'module-projectile)
|
|
||||||
|
|
||||||
(pkg/require 'consult-projectile)
|
|
||||||
|
|
||||||
(with-eval-after-load 'consult-projectile
|
|
||||||
(defun my-consult-projectile-find-file ()
|
|
||||||
"Use consult-projectile-find-file, consult-find-file outside of project."
|
|
||||||
(interactive)
|
|
||||||
(if (projectile-project-p)
|
|
||||||
(consult-projectile-find-file)
|
|
||||||
(consult-projectile)))
|
|
||||||
|
|
||||||
(pkg/with-eval-after-load
|
|
||||||
(consult projectile)
|
|
||||||
|
|
||||||
(advice-add 'projectile-find-file :override #'consult-projectile-find-file)
|
|
||||||
(advice-add 'projectile-find-dir :override #'consult-projectile-find-dir)
|
|
||||||
(advice-add 'projectile-switch-to-buffer :override #'consult-projectile-switch-to-buffer)
|
|
||||||
(advice-add 'projectile-switch-project :override #'consult-projectile-switch-project))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x p") projectile-command-map)
|
|
||||||
(define-key projectile-command-map (kbd "f") #'consult-projectile-find-file)
|
|
||||||
(define-key projectile-command-map (kbd "d") #'consult-projectile-find-dir)
|
|
||||||
(define-key projectile-command-map (kbd "b") #'consult-projectile-switch-to-buffer)
|
|
||||||
(define-key projectile-command-map (kbd "s") #'consult-projectile-switch-project)
|
|
||||||
(define-key projectile-command-map (kbd "p") #'consult-projectile)
|
|
||||||
(define-key projectile-command-map (kbd "/") #'consult-ripgrep)
|
|
||||||
(define-key projectile-command-map (kbd "f") #'my-consult-projectile-find-file))
|
|
||||||
|
|
||||||
(provide 'module-consult-projectile)
|
|
||||||
|
|
||||||
;;; module-consult-projectile.el ends here.
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
;;; module-consult.el --- setup consult for emacs
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Setup consult for Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'consult)
|
|
||||||
|
|
||||||
(setq consult-preview-key nil)
|
|
||||||
|
|
||||||
;; use ripgrep
|
|
||||||
(setq consult-ripgrep-command "rg --null --line-buffered --color=ansi --max-columns=1000 --no-heading --line-number . -e ARG OPTS")
|
|
||||||
(setq consult-grep-command "rg --null --line-buffered --color=ansi --max-columns=1000 --no-heading --line-number . -e ARG OPTS")
|
|
||||||
|
|
||||||
;; mode-specific histories
|
|
||||||
(setq consult-mode-histories
|
|
||||||
'((comint-mode . comint-input-ring)
|
|
||||||
(eshell-mode . eshell-history-ring)
|
|
||||||
(geiser-repl-mode . geiser-repl--history)
|
|
||||||
(inferior-python-mode . comint-input-ring)
|
|
||||||
(minibuffer-local-map . consult-history)))
|
|
||||||
|
|
||||||
(consult-customize
|
|
||||||
consult-theme
|
|
||||||
:preview-key '(:debounce 0.2 any)
|
|
||||||
consult-ripgrep consult-git-grep consult-grep
|
|
||||||
consult-bookmark consult-recent-file consult-xref
|
|
||||||
consult--source-bookmark consult--source-recent-file
|
|
||||||
consult--source-project-recent-file
|
|
||||||
:preview-key '(:debounce 0.4 any))
|
|
||||||
|
|
||||||
;; async search
|
|
||||||
(setq consult-async-min-input 2
|
|
||||||
consult-async-refresh-delay 0.15
|
|
||||||
consult-async-input-throttle 0.2
|
|
||||||
consult-async-input-debounce 0.1)
|
|
||||||
|
|
||||||
;; select xref locations with preview
|
|
||||||
(setq xref-show-xrefs-function #'consult-xref
|
|
||||||
xref-show-definitions-function #'consult-xref)
|
|
||||||
|
|
||||||
(global-set-key (kbd "M-s l") #'consult-line)
|
|
||||||
(global-set-key (kbd "M-s L") #'consult-line-multi)
|
|
||||||
(global-set-key (kbd "C-c h") #'consult-history)
|
|
||||||
(global-set-key (kbd "C-c m") #'consult-mode-command)
|
|
||||||
(global-set-key (kbd "C-c k") #'consult-kmacro)
|
|
||||||
(global-set-key (kbd "C-c s") #'consult-ripgrep)
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'module-consult)
|
|
||||||
|
|
||||||
;;; module-consult.el ends here.
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
;;; module-corfu.el --- Corfu module support
|
|
||||||
;;
|
|
||||||
;;; Commentary:
|
|
||||||
;; This module provides support for Corfu, a library that provides
|
|
||||||
;; inline completion.
|
|
||||||
;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'corfu)
|
|
||||||
|
|
||||||
(setq corfu-cycle nil) ;; Enable cycling for `corfu-next/previous'
|
|
||||||
(setq corfu-auto nil) ;; Enable auto completion
|
|
||||||
(setq corfu-separator ?\s) ;; Orderless field separator
|
|
||||||
(setq corfu-quit-at-boundary t) ;; Never quit at completion boundary
|
|
||||||
(setq corfu-quit-no-match t) ;; Never quit, even if there is no match
|
|
||||||
;; (setq corfu-preview-current nil) ;; Disable current candidate preview
|
|
||||||
;; (setqcorfu-preselect 'prompt) ;; Preselect the prompt
|
|
||||||
(setq corfu-on-exact-match t) ;; Configure handling of exact matches
|
|
||||||
;; (setq corfu-scroll-margin 5) ;; Use scroll margin
|
|
||||||
(setq tab-always-indent 'complete)
|
|
||||||
(setq text-mode-ispell-word-completion nil)
|
|
||||||
(setq read-extended-command-predicate #'command-completion-default-include-p)
|
|
||||||
(global-corfu-mode)
|
|
||||||
|
|
||||||
(provide 'module-corfu)
|
|
||||||
;;; module-corfu.el ends here
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
;;; module-ctags.el --- ctags functions -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Generate ctags from inside Emacs. Nifty!
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(defun generate-tags-for-directory (directory)
|
|
||||||
"Generate CTAGS for the specified DIRECTORY."
|
|
||||||
(interactive
|
|
||||||
(list (read-directory-name "Generate tags for directory: " default-directory nil t)))
|
|
||||||
(let ((default-directory directory))
|
|
||||||
(shell-command "ctags -e -R .")
|
|
||||||
(message "Tags generated for %s" directory)))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x E t") 'generate-tags-for-directory)
|
|
||||||
|
|
||||||
(provide 'module-ctags)
|
|
||||||
|
|
||||||
;;; module-ctags.el ends here.
|
|
||||||
|
|
@ -1,90 +0,0 @@
|
||||||
;;; module-denote-index.el -- index and metadata for denote notes
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Provides a mechanism for maintaining an index of denote notes with
|
|
||||||
;;; useful metadata to facilitate search.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-denote)
|
|
||||||
|
|
||||||
(with-eval-after-load 'denote
|
|
||||||
|
|
||||||
(defvar my/denote-metadata-index-file (concat denote-directory "../denote-metadata.org")
|
|
||||||
"Path to the metadata index file.")
|
|
||||||
|
|
||||||
(defun my/extract-date-from-filename (file)
|
|
||||||
"Extract date from FILE name. Assumes first 8 characters are YYYYMMDD."
|
|
||||||
(substring (file-name-nondirectory file) 0 8))
|
|
||||||
|
|
||||||
(defun my/format-date (date-string)
|
|
||||||
"Format DATE-STRING (YYYYMMDD) as YYYY-MM-DD."
|
|
||||||
(format "%s-%s-%s"
|
|
||||||
(substring date-string 0 4)
|
|
||||||
(substring date-string 4 6)
|
|
||||||
(substring date-string 6 8)))
|
|
||||||
|
|
||||||
(defun my/extract-summary (file)
|
|
||||||
"Extract summary from FILE."
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert-file-contents file)
|
|
||||||
(goto-char (point-min))
|
|
||||||
(when (re-search-forward "^\\* Summary$" nil t)
|
|
||||||
(forward-line)
|
|
||||||
(let ((start (point)))
|
|
||||||
(if (re-search-forward "^\\*" nil t)
|
|
||||||
(string-trim (buffer-substring-no-properties start (line-beginning-position)))
|
|
||||||
(string-trim (buffer-substring-no-properties start (point-max))))))))
|
|
||||||
|
|
||||||
(defun my/update-denote-metadata-index ()
|
|
||||||
"Update the metadata index for Denote notes in Org format."
|
|
||||||
(interactive)
|
|
||||||
(with-temp-file my/denote-metadata-index-file
|
|
||||||
(insert "#+TITLE: Denote Metadata Index\n")
|
|
||||||
(insert "#+AUTHOR: Your Name\n")
|
|
||||||
(insert "#+DATE: " (format-time-string "%Y-%m-%d") "\n\n")
|
|
||||||
(dolist (file (directory-files-recursively denote-directory "\\.org$"))
|
|
||||||
(let ((file-contents (with-temp-buffer
|
|
||||||
(insert-file-contents file)
|
|
||||||
(buffer-string))))
|
|
||||||
(with-temp-buffer
|
|
||||||
(insert file-contents)
|
|
||||||
(goto-char (point-min))
|
|
||||||
(when (re-search-forward "^#\\+title: \\(.+\\)$" nil t)
|
|
||||||
(let* ((title (string-trim (match-string 1)))
|
|
||||||
(keywords (denote-extract-keywords-from-path file))
|
|
||||||
(date-string (my/extract-date-from-filename file))
|
|
||||||
(formatted-date (my/format-date date-string))
|
|
||||||
(is-journal (and (listp keywords) (member "journal" keywords)))
|
|
||||||
(summary (if is-journal
|
|
||||||
(format "Journal entry for [%s]" formatted-date)
|
|
||||||
(my/extract-summary file))))
|
|
||||||
(with-current-buffer (find-file-noselect my/denote-metadata-index-file)
|
|
||||||
(goto-char (point-max))
|
|
||||||
(insert (format "* [[file:%s][%s]]\n" file title))
|
|
||||||
(insert " :PROPERTIES:\n")
|
|
||||||
(insert (format " :KEYWORDS: %s\n" keywords))
|
|
||||||
(insert (format " :DATE: [%s]\n" formatted-date))
|
|
||||||
(insert " :END:\n\n")
|
|
||||||
(insert (if summary
|
|
||||||
summary
|
|
||||||
"No summary provided."))
|
|
||||||
(unless (string-suffix-p "\n\n" (or summary ""))
|
|
||||||
(insert "\n\n"))))))))))
|
|
||||||
|
|
||||||
|
|
||||||
(defun my/search-denote-notes ()
|
|
||||||
"Use consult-ripgrep to search Denote notes in denote-directory."
|
|
||||||
(interactive)
|
|
||||||
(let ((consult-ripgrep-args
|
|
||||||
"rg --null --ignore-case --type org --line-buffered --color=never --max-columns=500 --no-heading --line-number"))
|
|
||||||
(if (file-directory-p denote-directory)
|
|
||||||
(consult-ripgrep denote-directory)
|
|
||||||
(message "Denote directory not found: %s" denote-directory))))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x n /") #'my/search-denote-notes))
|
|
||||||
|
|
||||||
(provide 'module-denote-index)
|
|
||||||
|
|
||||||
;;; module-denote-index.el ends here
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
;;; module-denote-multidir.el --- denote with multi-dir support
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Extend denote with support for multiple notes directories.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-denote)
|
|
||||||
(require 'module-denote-index)
|
|
||||||
(require 'module-remotefs) ;; depends on remotefs for some functions
|
|
||||||
|
|
||||||
(autoload 'my/denote-create-note "denote" nil t)
|
|
||||||
|
|
||||||
(with-eval-after-load 'denote
|
|
||||||
|
|
||||||
(defvar my/denote-local-notes-directory "~/notes/")
|
|
||||||
(defvar my/denote-remote-notes-directory "~/notes/")
|
|
||||||
|
|
||||||
(setq denote-directory my/denote-local-notes-directory)
|
|
||||||
|
|
||||||
(defun my/denote-open-or-create ()
|
|
||||||
"Ensure remotefs is mounted before creating or opening a note."
|
|
||||||
(interactive)
|
|
||||||
(let ((target (denote-file-prompt nil nil :no-require-match)))
|
|
||||||
(if (and target (file-exists-p target))
|
|
||||||
(find-file target)
|
|
||||||
(denote--command-with-features (denote-command-prompt) :use-file-prompt-as-def-title nil nil nil))))
|
|
||||||
|
|
||||||
(defun my/denote-echo-current-directory ()
|
|
||||||
"Echo the current value of denote-directory."
|
|
||||||
(declare (interactive-only t))
|
|
||||||
(interactive)
|
|
||||||
(message "Current Denote directory: %s" denote-directory))
|
|
||||||
|
|
||||||
(defun my/denote-directory-segment ()
|
|
||||||
"Return the current Denote directory for the mode line."
|
|
||||||
(when (bound-and-true-p denote-directory)
|
|
||||||
(format " Denote:%s " (file-name-nondirectory (directory-file-name denote-directory)))))
|
|
||||||
|
|
||||||
(defun my/denote-switch-directory ()
|
|
||||||
"Switch current denote working directory."
|
|
||||||
(interactive)
|
|
||||||
(let ((new-dir (if (string= denote-directory my/denote-local-notes-directory)
|
|
||||||
my/denote-remote-notes-directory
|
|
||||||
my/denote-local-notes-directory)))
|
|
||||||
(setq denote-directory new-dir)
|
|
||||||
(setq my/denote-metadata-index-file (concat denote-directory "../denote-metadata.org"))
|
|
||||||
(message "Denote directory switched to %s" new-dir)))
|
|
||||||
|
|
||||||
(defun my/denote-use-both-directories (orig-fun &rest args)
|
|
||||||
"Temporarily use both directories for a given ORIG-FUN and ARGS."
|
|
||||||
(let ((original-dir denote-directory)
|
|
||||||
(result nil))
|
|
||||||
(setq denote-directory my/denote-local-notes-directory)
|
|
||||||
(setq result (apply orig-fun args))
|
|
||||||
(setq denote-directory my/denote-remote-notes-directory)
|
|
||||||
(setq result (append result (apply orig-fun args)))
|
|
||||||
(setq denote-directory original-dir)
|
|
||||||
result))
|
|
||||||
|
|
||||||
(defun my/denote-create-note ()
|
|
||||||
"Create a note in directory of choice."
|
|
||||||
(interactive)
|
|
||||||
(let* ((dirs (list my/denote-local-notes-directory my/denote-remote-notes-directory))
|
|
||||||
(chosen-dir (completing-read "Choose directory: " dirs)))
|
|
||||||
(let ((denote-directory chosen-dir))
|
|
||||||
(call-interactively #'denote))))
|
|
||||||
|
|
||||||
(advice-add 'denote-directory-files
|
|
||||||
:around #'my/denote-use-both-directories)
|
|
||||||
(advice-add 'denote-directory-subdirectories
|
|
||||||
:around #'my/denote-use-both-directories)
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x n f") #'my/denote-open-or-create)
|
|
||||||
(global-set-key (kbd "C-x n n") #'my/denote-create-note)
|
|
||||||
(global-set-key (kbd "C-x n d s") #'my/denote-switch-directory)
|
|
||||||
(global-set-key (kbd "C-x n d d") #'my/denote-echo-current-directory))
|
|
||||||
|
|
||||||
(provide 'module-denote-multidir)
|
|
||||||
|
|
||||||
;;; module-denote-multidir.el ends here.
|
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
;;; module-denote.el --- sane note taking
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Capturing and managing notes for sane people.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(require 'module-dired)
|
|
||||||
|
|
||||||
(pkg/require 'denote)
|
|
||||||
|
|
||||||
(setq denote-directory "~/notes/")
|
|
||||||
|
|
||||||
(with-eval-after-load 'denote
|
|
||||||
|
|
||||||
(denote-rename-buffer-mode 1)
|
|
||||||
|
|
||||||
(setq denote-save-buffers nil
|
|
||||||
denote-known-keywords '("emacs" "golang" "dev")
|
|
||||||
denote-infer-keywords t
|
|
||||||
denote-sort-keywords t
|
|
||||||
denote-file-type nil
|
|
||||||
denote-history-completion-in-prompts nil
|
|
||||||
denote-prompts '(title keywords)
|
|
||||||
denote-excluded-directories-regexp nil
|
|
||||||
denote-excluded-keywords-regexp nil
|
|
||||||
denote-rename-confirmations '(rewrite-front-matter modify-file-name)
|
|
||||||
denote-date-prompt-use-org-read-date t
|
|
||||||
denote-date-format nil
|
|
||||||
denote-backlinks-show-context t)
|
|
||||||
|
|
||||||
(global-unset-key (kbd "C-x n"))
|
|
||||||
(global-set-key (kbd "C-x n n") #'denote)
|
|
||||||
(global-set-key (kbd "C-x n f") #'denote-open-or-create)
|
|
||||||
(global-set-key (kbd "C-x n c") #'denote-region)
|
|
||||||
(global-set-key (kbd "C-x n !") #'denote-date)
|
|
||||||
(global-set-key (kbd "C-x n z") #'denote-signature)
|
|
||||||
(global-set-key (kbd "C-x n s") #'denote-subdirectory)
|
|
||||||
(global-set-key (kbd "C-x n S-n") #'denote-type)
|
|
||||||
(global-set-key (kbd "C-x n t") #'denote-template)
|
|
||||||
(global-set-key (kbd "C-x n l l") #'denote-link)
|
|
||||||
(global-set-key (kbd "C-x n l a") #'denote-add-links)
|
|
||||||
(global-set-key (kbd "C-x n l f") #'denote-find-link)
|
|
||||||
(global-set-key (kbd "C-x n b l") #'denote-backlinks)
|
|
||||||
(global-set-key (kbd "C-x n b f") #'denote-find-backlink)
|
|
||||||
(global-set-key (kbd "C-x n r r") #'denote-rename-file)
|
|
||||||
(global-set-key (kbd "C-x n r f") #'denote-rename-file-using-front-matter)
|
|
||||||
(let ((map dired-mode-map))
|
|
||||||
(define-key map (kbd "C-x n d") #'denote-dired-mode)
|
|
||||||
(define-key map (kbd "C-x n i") #'denote-link-dired-marked-notes)
|
|
||||||
(define-key map (kbd "C-x n k") #'denote-dired-rename-marked-files-with-keywords)
|
|
||||||
(define-key map (kbd "C-x n r r") #'denote-dired-rename-files)
|
|
||||||
(define-key map (kbd "C-x n r f") #'denote-dired-rename-marked-files-using-front-matter)))
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'module-denote)
|
|
||||||
|
|
||||||
;;; module-denote.el ends here.
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
;;; module-detached.el --- dtach for Emacs
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Setup dtach and Emacs integration.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require 'detached)
|
|
||||||
|
|
||||||
(setq detached-terminal-data-command system-type)
|
|
||||||
|
|
||||||
(detached-init)
|
|
||||||
|
|
||||||
(global-set-key [remap async-shell-command] 'detached-shell-command)
|
|
||||||
(global-set-key [remap compile] 'detached-compile)
|
|
||||||
(global-set-key [remap recompile] 'detached-compile-recompile)
|
|
||||||
(global-set-key [remap detached-open-session] 'detached-consult-session)
|
|
||||||
|
|
||||||
(provide 'module-detached)
|
|
||||||
|
|
||||||
;;; module-detached.el ends here.
|
|
||||||
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
;;; module-dired.el --- dired stuff
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Configure settings and extensions for Dired.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(require 'dired)
|
|
||||||
|
|
||||||
(pkg/require 'dired-sidebar)
|
|
||||||
|
|
||||||
(defun my/dired-duplicate-file (file)
|
|
||||||
"Duplicate the current FILE in Dired."
|
|
||||||
(interactive "p")
|
|
||||||
(let ((filename (dired-get-filename))
|
|
||||||
(target '()))
|
|
||||||
(setq target (concat (file-name-sans-extension filename)
|
|
||||||
"-old"
|
|
||||||
(if (> file 1) (number-to-string file))
|
|
||||||
(file-name-extension filename t)))
|
|
||||||
(if (file-directory-p filename)
|
|
||||||
(copy-file filename target))))
|
|
||||||
|
|
||||||
(defun my/dired-mouse-find-file (event)
|
|
||||||
"In Dired, visit the file or directory name you click on."
|
|
||||||
(interactive "e")
|
|
||||||
(let (window pos file)
|
|
||||||
(save-excursion
|
|
||||||
(setq window (posn-window (event-end event))
|
|
||||||
pos (posn-point (event-end event)))
|
|
||||||
(if (not (windowp window))
|
|
||||||
(error "No file chosen"))
|
|
||||||
(set-buffer (window-buffer window))
|
|
||||||
(goto-char pos)
|
|
||||||
(setq file (dired-get-file-for-visit)))
|
|
||||||
(if (file-directory-p file)
|
|
||||||
(or (and (cdr dired-subdir-alist)
|
|
||||||
(dired-goto-subdir file))
|
|
||||||
(dired file))
|
|
||||||
(find-file file))))
|
|
||||||
|
|
||||||
(define-key dired-mode-map [mouse-2] 'my/dired-mouse-find-file)
|
|
||||||
(global-set-key (kbd "<f12>") 'dired-sidebar-toggle-sidebar)
|
|
||||||
(define-key dired-mode-map (kbd "C-c d") 'my/dired-duplicate-file)
|
|
||||||
(define-key dired-mode-map (kbd "C-c t") 'dired-create-empty-file)
|
|
||||||
(define-key dired-mode-map (kbd "C-c C-k") 'dired-kill-subdir)
|
|
||||||
|
|
||||||
(provide 'module-dired)
|
|
||||||
|
|
||||||
;;; module-dired.el ends here.
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
;;; module-eglot.el --- Eglot support for Emacs
|
|
||||||
;;;
|
|
||||||
;;; Commentary: This file provides basic functionality for using Eglot
|
|
||||||
;;; with Emacs. It's a starting point, not a complete implementation.
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'eglot)
|
|
||||||
(pkg/require 'go-mode)
|
|
||||||
|
|
||||||
(add-hook 'go-mode-hook 'eglot-ensure)
|
|
||||||
(add-hook 'c-mode-hook 'eglot-ensure)
|
|
||||||
|
|
||||||
(defun eglot-format-buffer-before-save ()
|
|
||||||
(add-hook 'before-save-hook #'eglot-format-buffer -10 t))
|
|
||||||
(add-hook 'go-mode-hook #'eglot-format-buffer-before-save)
|
|
||||||
|
|
||||||
(setq-default eglot-workspace-configuration
|
|
||||||
'((:gopls .
|
|
||||||
((staticcheck . t)
|
|
||||||
(matcher . "CaseSensitive")))))
|
|
||||||
|
|
||||||
(defun go-mode-setup-organize-imports ()
|
|
||||||
(add-hook 'before-save-hook
|
|
||||||
(lambda ()
|
|
||||||
(call-interactively 'eglot-code-action-organize-imports))
|
|
||||||
nil t))
|
|
||||||
(add-hook 'go-mode-hook #'go-mode-setup-organize-imports)
|
|
||||||
|
|
||||||
(provide 'module-eglot)
|
|
||||||
;;; module-eglot.el ends here
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
;;; module-ellama-capture-definition.el --- Ellama capture definitions
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; This file provides functions to interactively add definitions to
|
|
||||||
;;; the Ellama context. This can be useful, for example, when dealing
|
|
||||||
;;; with custom data formats, such as denote notes, where the training
|
|
||||||
;;; data is unlikely to contain information about the format.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'ellama)
|
|
||||||
|
|
||||||
(defun ellama-capture-add-definition ()
|
|
||||||
"Interactively choose and add a definition to the Ellama context."
|
|
||||||
(interactive)
|
|
||||||
(let* ((funcs (apropos-internal "^ellama-capture-add-.*-definition$"))
|
|
||||||
(choices (mapcar (lambda (func)
|
|
||||||
(string-match "ellama-capture-add-\\(.*\\)-definition" (symbol-name func))
|
|
||||||
(match-string 1 (symbol-name func)))
|
|
||||||
funcs))
|
|
||||||
(choice (completing-read "Choose definition to add: " choices nil t)))
|
|
||||||
(if (fboundp (intern (format "ellama-capture-add-%s-definition" choice)))
|
|
||||||
(funcall (intern (format "ellama-capture-add-%s-definition" choice)))
|
|
||||||
(message "No function found for %s" choice))))
|
|
||||||
|
|
||||||
(defun ellama-capture-add-filetag-definition ()
|
|
||||||
"Add the filetag definition to the Ellama context."
|
|
||||||
(interactive)
|
|
||||||
(let ((filetag-definition
|
|
||||||
"Search for exact matches of the specified filetag(s) in the provided files only. The user will provide a quoted string \":tag:\" in the response, and you shall search for an exact match. Do not rely on
|
|
||||||
keyword recognition or generating new filetags. Use this syntax to identify filetags: #+filetags:
|
|
||||||
:tag1:tag2:tag3:"))
|
|
||||||
(ellama-context-add-text filetag-definition)
|
|
||||||
(message "Filetag definition added to Ellama context")))
|
|
||||||
|
|
||||||
(provide 'module-ellama-capture-definitions)
|
|
||||||
;;; module-ellama-capture-definitions.el ends here.
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
;;; module-ellama-capture.el -- improve ellama chat interaction
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; This module provides an org-capture-like functionality for
|
|
||||||
;;; interacting with Ellama. It allows users to pop up a temporary
|
|
||||||
;;; buffer for inputting and submitting text, which can then be fed
|
|
||||||
;;; into Ellama's underlying functions.
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'ellama)
|
|
||||||
(require 'dired)
|
|
||||||
|
|
||||||
(defvar ellama-capture-buffer-name "*Ellama Input*"
|
|
||||||
"Name of the buffer used for Ellama input capture.")
|
|
||||||
|
|
||||||
(defun ellama-capture ()
|
|
||||||
"Create a temporary pop-up buffer for Ellama input."
|
|
||||||
(interactive)
|
|
||||||
(let ((buf (get-buffer-create ellama-capture-buffer-name)))
|
|
||||||
(with-current-buffer buf
|
|
||||||
(erase-buffer)
|
|
||||||
(text-mode)
|
|
||||||
(use-local-map (copy-keymap text-mode-map))
|
|
||||||
(local-set-key (kbd "C-c C-c") 'ellama-capture-finalize)
|
|
||||||
(local-set-key (kbd "C-c C-k") 'ellama-capture-abort)
|
|
||||||
(local-set-key (kbd "C-c f") 'ellama-context-add-file)
|
|
||||||
(local-set-key (kbd "C-c i") 'ellama-context-add-info-node)
|
|
||||||
(local-set-key (kbd "C-c d") 'ellama-capture-add-definition)
|
|
||||||
(local-set-key (kbd "C-c D") 'dired)
|
|
||||||
(setq header-line-format
|
|
||||||
(substitute-command-keys
|
|
||||||
"C-c C-c: send, C-c C-k: abort, C-c f: file, C-c i: info node, C-c d: definition C-c D: dired")))
|
|
||||||
(let ((display-buffer-alist
|
|
||||||
`(((lambda (buffer-name _) (equal buffer-name ,ellama-capture-buffer-name))
|
|
||||||
(display-buffer-in-side-window)
|
|
||||||
(side . bottom)
|
|
||||||
(slot . 0)
|
|
||||||
(window-height . 0.3)))))
|
|
||||||
(pop-to-buffer buf))
|
|
||||||
(message "Chat with the bot using this buffer. C-c C-c to send, C-c C-k to cancel.")))
|
|
||||||
|
|
||||||
(defun ellama-capture-finalize ()
|
|
||||||
"Send the content of the Ellama input buffer to Ellama and close the window."
|
|
||||||
(interactive)
|
|
||||||
(let ((content (buffer-string)))
|
|
||||||
(quit-window t)
|
|
||||||
(ellama-chat content)))
|
|
||||||
|
|
||||||
(defun ellama-capture-abort ()
|
|
||||||
"Kill the Ellama input buffer without sending its content."
|
|
||||||
(interactive)
|
|
||||||
(quit-window t)
|
|
||||||
(message "Ellama input aborted"))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x A SPC") #'ellama-capture)
|
|
||||||
|
|
||||||
(provide 'module-ellama-capture)
|
|
||||||
|
|
||||||
;;; module-ellama-capture.el ends here.
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
;;; module-embark.el --- context-sensitive actions -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Provide context-sensitive actions on current target, including
|
|
||||||
;;; minibuffer targets.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'embark)
|
|
||||||
|
|
||||||
(setq prefix-help-command #'embark-prefix-help-command)
|
|
||||||
|
|
||||||
(add-to-list 'display-buffer-alist
|
|
||||||
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
|
|
||||||
nil
|
|
||||||
(window-parameters (mode-line-format . none))))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-.") #'embark-act)
|
|
||||||
(global-set-key (kbd "C-;") #'embark-dwim)
|
|
||||||
(global-set-key (kbd "C-h B") #'embark-bindings)
|
|
||||||
|
|
||||||
(provide 'module-embark)
|
|
||||||
|
|
||||||
;;; module-embark.el ends here.
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
;;; module-eshell.el --- eshell enhancements.
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Make eshell a little more usable.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require 'eshell)
|
|
||||||
(pkg/require 'eshell-autojump)
|
|
||||||
(pkg/require 'eshell-bookmark)
|
|
||||||
(pkg/require 'eshell-git-prompt)
|
|
||||||
(pkg/require 'eshell-toggle)
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-<escape>") #'eshell-toggle)
|
|
||||||
|
|
||||||
(provide 'module-eshell)
|
|
||||||
|
|
||||||
;;; module-eshell.el ends here.
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
;;; module-eyecandy.el --- make emacs shiny -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Add some eye candy to Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
;; themes
|
|
||||||
(pkg/require 'acme-theme)
|
|
||||||
|
|
||||||
;; modeline
|
|
||||||
(pkg/require 'doom-modeline)
|
|
||||||
(doom-modeline-mode 1)
|
|
||||||
|
|
||||||
;; icons
|
|
||||||
(pkg/require 'nerd-icons)
|
|
||||||
(pkg/require 'nerd-icons-dired)
|
|
||||||
(pkg/require 'nerd-icons-completion)
|
|
||||||
(pkg/require 'nerd-icons-ibuffer)
|
|
||||||
(pkg/require 'kind-icon)
|
|
||||||
|
|
||||||
(add-hook 'dired-mode-hook #'nerd-icons-dired-mode)
|
|
||||||
|
|
||||||
;; fonts
|
|
||||||
(pkg/require 'unicode-fonts)
|
|
||||||
|
|
||||||
|
|
||||||
;; theme
|
|
||||||
;; (pkg/require 'punpun-themes)
|
|
||||||
;; (load-theme 'punpun-dark)
|
|
||||||
|
|
||||||
(provide 'module-eyecandy)
|
|
||||||
|
|
||||||
;;; module-eyecandy.el ends here.
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
;;; module-gc.el -- clean up
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;; Emacs garbage collection.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'gc-buffers)
|
|
||||||
(gc-buffers-mode 1)
|
|
||||||
|
|
||||||
(provide 'module-gc)
|
|
||||||
;;; module-gc.el ends here.
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
;;; module-golang-playground.el --- go experimentation sandbox -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; An experimentation sandbox for go programming.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'go-playground)
|
|
||||||
|
|
||||||
(provide 'module-golang-playground)
|
|
||||||
|
|
||||||
;;; module-golang-playground.el ends here.
|
|
||||||
|
|
@ -1,61 +0,0 @@
|
||||||
;;; module-golang.el --- support golang -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Adds support for golang to Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'go-mode)
|
|
||||||
|
|
||||||
(defun project-find-go-module (dir)
|
|
||||||
(when-let ((root (locate-dominating-file dir "go.mod")))
|
|
||||||
(cons 'go-module root)))
|
|
||||||
|
|
||||||
(cl-defmethod project-root ((project (head go-module)))
|
|
||||||
(cdr project))
|
|
||||||
|
|
||||||
(add-hook 'project-find-functions #'project-find-go-module)
|
|
||||||
|
|
||||||
(with-eval-after-load 'go-mode
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.go$" . go-mode))
|
|
||||||
(add-hook 'before-save-hook #'gofmt-before-save))
|
|
||||||
|
|
||||||
(defun my/godoc-at-point ()
|
|
||||||
"Run godoc on the selected region or symbol at point, including dot-separated parts."
|
|
||||||
(interactive)
|
|
||||||
(let (default start end)
|
|
||||||
(if (use-region-p)
|
|
||||||
(setq start (region-beginning)
|
|
||||||
end (region-end)
|
|
||||||
default (buffer-substring-no-properties start end))
|
|
||||||
(let ((bounds (bounds-of-thing-at-point 'symbol)))
|
|
||||||
(setq start (if bounds (car bounds) (point))
|
|
||||||
end (if bounds (cdr bounds) (point))
|
|
||||||
default (if bounds
|
|
||||||
(buffer-substring-no-properties start end)
|
|
||||||
nil))))
|
|
||||||
(unless (use-region-p)
|
|
||||||
(save-excursion
|
|
||||||
(goto-char start)
|
|
||||||
(while (and (> (point) (point-min))
|
|
||||||
(eq (char-before) ?.))
|
|
||||||
(backward-sexp)
|
|
||||||
(setq start (point)))
|
|
||||||
(goto-char end)
|
|
||||||
(while (and (< (point) (point-max))
|
|
||||||
(eq (char-after) ?.))
|
|
||||||
(forward-sexp)
|
|
||||||
(setq end (point)))
|
|
||||||
(setq default (buffer-substring-no-properties start end))))
|
|
||||||
(godoc (read-string "Go documentation: " default))))
|
|
||||||
|
|
||||||
(add-hook 'go-mode-hook
|
|
||||||
(lambda ()
|
|
||||||
(local-set-key (kbd "C-c C-d") 'godoc-at-point-with-default)))
|
|
||||||
|
|
||||||
(provide 'module-golang)
|
|
||||||
|
|
||||||
;;; module-golang.el ends here.
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
;;; module-graphviz.el --- diagrams for old people -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Plain text diagramming software built before I was born.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'graphviz-dot-mode)
|
|
||||||
|
|
||||||
(with-eval-after-load 'org
|
|
||||||
(org-babel-do-load-languages
|
|
||||||
'org-babel-load-languages '((dot . t))))
|
|
||||||
|
|
||||||
(provide 'module-graphviz)
|
|
||||||
|
|
||||||
;;; module-graphviz.el ends here.
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
;;; module-grep.el -- grep stuff
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;; Exactly what it looks like.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'wgrep)
|
|
||||||
|
|
||||||
(provide 'module-grep)
|
|
||||||
;;; module-grep.el ends here.
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
;;; module-hydra.el --- better keybindings
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Setup more convenient keybindings for Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(require 'module-region)
|
|
||||||
|
|
||||||
(pkg/require 'hydra)
|
|
||||||
|
|
||||||
(defhydra hydra-vertical-nav (:color red)
|
|
||||||
"Vertical navigation"
|
|
||||||
("n" next-line "down")
|
|
||||||
("p" previous-line "up")
|
|
||||||
("C-n" next-line "down")
|
|
||||||
("C-p" previous-line "up")
|
|
||||||
("f" forward-paragraph "forward paragraph")
|
|
||||||
("b" backward-paragraph "backward paragraph")
|
|
||||||
("q" nil "quit" :exit t))
|
|
||||||
|
|
||||||
(defhydra hydra-expand-region (:color red :hint nil)
|
|
||||||
"
|
|
||||||
Expand/Contract region
|
|
||||||
"
|
|
||||||
("e" er/expand-region "expand")
|
|
||||||
("c" er/contract-region "contract")
|
|
||||||
("w" er/mark-word "word")
|
|
||||||
("s" er/mark-symbol "symbol")
|
|
||||||
("d" er/mark-defun "function")
|
|
||||||
("p" er/mark-inside-pairs "inside pairs")
|
|
||||||
("P" er/mark-outside-pairs "outside pairs")
|
|
||||||
("q" er/mark-inside-quotes "inside quotes")
|
|
||||||
("Q" er/mark-outside-quotes "outside quotes")
|
|
||||||
("." er/mark-text-sentence "sentence")
|
|
||||||
("h" er/mark-html-attribute "html attribute")
|
|
||||||
("t" er/mark-inner-tag "inner tag")
|
|
||||||
("T" er/mark-outer-tag "outer tag")
|
|
||||||
("u" undo "undo" :color blue)
|
|
||||||
("r" redo "redo" :color blue)
|
|
||||||
("q" nil "quit" :color blue))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-c v") 'hydra-vertical-nav/body)
|
|
||||||
(global-set-key (kbd "C-c r") 'hydra-expand-region/body)
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'module-hydra)
|
|
||||||
|
|
||||||
;;; module-hydra.el ends here.
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
;;; module-json.el --- JS based data serialization format -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Add support for working with JSON data to Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'json-mode)
|
|
||||||
|
|
||||||
(with-eval-after-load 'json-mode
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.json$" . json-mode)))
|
|
||||||
|
|
||||||
(provide 'module-json)
|
|
||||||
|
|
||||||
;;; module-json.el ends here.
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
;;; module-kotlin.el --- java for the less insane -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; A more tolerable programming language that compiles to JVM byte
|
|
||||||
;;; code. Add Kotlin support to Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'kotlin-mode)
|
|
||||||
|
|
||||||
;;(add-to-list 'auto-mode-alist ("\\.kt$" . kotlin-mode))
|
|
||||||
|
|
||||||
(provide 'module-kotlin)
|
|
||||||
|
|
||||||
;;; module-kotlin.el ends here.
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
;;; module-ledger.el - money shit
|
|
||||||
;;;
|
|
||||||
;;; Damn that money, go walking out my door
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(pkg/require 'hledger-mode)
|
|
||||||
|
|
||||||
(provide 'module-ledger)
|
|
||||||
|
|
||||||
;;; module-ledger.el ends here.
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
;;; module-llm.el --- bullshit generators -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;; Provides interface to bullshit generators.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require 'ellama)
|
|
||||||
(require 'llm-ollama)
|
|
||||||
(require 'dired)
|
|
||||||
|
|
||||||
(setq ellama-language "English")
|
|
||||||
(setq ellama-provider 'ollama)
|
|
||||||
(setq ellama-ollama-binary "/usr/local/bin/ollama")
|
|
||||||
|
|
||||||
(setopt ellama-provider
|
|
||||||
(make-llm-ollama
|
|
||||||
:chat-model "llama3:latest"
|
|
||||||
:embedding-model "nomic-embed-text"
|
|
||||||
:host "eris.fritz.box"
|
|
||||||
:default-chat-non-standard-params '(("num_ctx" . 8192))))
|
|
||||||
|
|
||||||
(setq ellama-keymap-prefix "C-x A") ;; ellama is the Assistant
|
|
||||||
(with-eval-after-load 'ellama
|
|
||||||
(ellama-setup-keymap))
|
|
||||||
|
|
||||||
(defun ellama-context-add-marked-files ()
|
|
||||||
"Add all marked files in Dired to Ellama context."
|
|
||||||
(interactive)
|
|
||||||
(let ((marked-files (dired-get-marked-files))
|
|
||||||
(added-count 0))
|
|
||||||
(if (null marked-files)
|
|
||||||
(message "No files marked")
|
|
||||||
(dolist (file marked-files)
|
|
||||||
(let ((default-directory (file-name-directory file)))
|
|
||||||
(let ((element (ellama-context-element-file :name file)))
|
|
||||||
(ellama-context-element-add element)
|
|
||||||
(cl-incf added-count))))
|
|
||||||
(message "Added %d file(s) to Ellama context" added-count))))
|
|
||||||
|
|
||||||
(with-eval-after-load 'dired
|
|
||||||
(define-key dired-mode-map (kbd "C-c e") #'ellama-context-add-marked-files))
|
|
||||||
|
|
||||||
(require 'module-ellama-capture)
|
|
||||||
(require 'module-ellama-capture-definitions)
|
|
||||||
|
|
||||||
(provide 'module-llm)
|
|
||||||
|
|
||||||
;;; module-llm.el ends here.
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
;;; module-lmtf.el --- lispy mctestface -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Make testing your shitty elisp a little easier.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(straight-use-package
|
|
||||||
'(lmtf :type git :host github :repo "lneely/lmtf"))
|
|
||||||
|
|
||||||
(require 'lmtf)
|
|
||||||
(define-key emacs-lisp-mode-map (kbd "C-c t !") #'lmtf-run-all-tests)
|
|
||||||
(define-key emacs-lisp-mode-map (kbd "C-c t r") #'lmtf-show-results)
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'module-lmtf)
|
|
||||||
|
|
||||||
;;; module-lmtf.el ends here.
|
|
||||||
|
|
@ -1,94 +0,0 @@
|
||||||
;;; module-lsp.el --- LSP configuration module -*- lexical-binding: t -*-
|
|
||||||
|
|
||||||
;;; Commentary:
|
|
||||||
;; This module sets up lsp-mode with specific configurations for Please build system
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'lsp-mode)
|
|
||||||
(require 'lsp-ui)
|
|
||||||
(require 'which-key)
|
|
||||||
|
|
||||||
;; LSP Mode core settings
|
|
||||||
(setq lsp-keymap-prefix "C-c l")
|
|
||||||
(setq lsp-idle-delay 0.500)
|
|
||||||
(setq lsp-log-io nil)
|
|
||||||
(setq lsp-completion-provider :capf)
|
|
||||||
(setq lsp-prefer-flymake nil)
|
|
||||||
|
|
||||||
;; Please build system specific configurations
|
|
||||||
(setq lsp-file-watch-ignored-directories
|
|
||||||
'("[/\\\\]\\.git$"
|
|
||||||
"[/\\\\]\\.hg$"
|
|
||||||
"[/\\\\]\\.bzr$"
|
|
||||||
"[/\\\\]_darcs$"
|
|
||||||
"[/\\\\]\\.svn$"
|
|
||||||
"[/\\\\]_FOSSIL_$"
|
|
||||||
"[/\\\\]\\.idea$"
|
|
||||||
"[/\\\\]\\.ensime_cache$"
|
|
||||||
"[/\\\\]\\.eunit$"
|
|
||||||
"[/\\\\]node_modules$"
|
|
||||||
"[/\\\\]\\.fslckout$"
|
|
||||||
"[/\\\\]\\.tox$"
|
|
||||||
"[/\\\\]\\.stack-work$"
|
|
||||||
"[/\\\\]\\.bloop$"
|
|
||||||
"[/\\\\]\\.metals$"
|
|
||||||
"[/\\\\]target$"
|
|
||||||
"[/\\\\]\\.ccls-cache$"
|
|
||||||
"[/\\\\]\\.deps$"
|
|
||||||
"[/\\\\]build-aux$"
|
|
||||||
"[/\\\\]autom4te.cache$"
|
|
||||||
"[/\\\\]\\.reference$"
|
|
||||||
"[/\\\\]plz-out$")) ;; Add plz-out to ignored directories
|
|
||||||
|
|
||||||
;; Increase watch threshold for large Please projects
|
|
||||||
(setq lsp-file-watch-threshold 10000)
|
|
||||||
|
|
||||||
;; LSP UI configurations
|
|
||||||
(setq lsp-ui-doc-enable t)
|
|
||||||
(setq lsp-ui-doc-show-with-cursor t)
|
|
||||||
(setq lsp-ui-doc-position 'at-point)
|
|
||||||
(setq lsp-ui-doc-delay 0.5)
|
|
||||||
(setq lsp-ui-sideline-enable t)
|
|
||||||
(setq lsp-ui-sideline-show-diagnostics t)
|
|
||||||
(setq lsp-ui-sideline-show-hover t)
|
|
||||||
(setq lsp-ui-sideline-show-code-actions t)
|
|
||||||
|
|
||||||
;; Performance optimizations for large projects
|
|
||||||
(setq gc-cons-threshold 100000000)
|
|
||||||
(setq read-process-output-max (* 3 1024 1024)) ;; Increased for larger projects
|
|
||||||
(setq lsp-response-timeout 20) ;; Increased timeout
|
|
||||||
(setq lsp-idle-delay 0.500)
|
|
||||||
|
|
||||||
;; Decrease the amount of data lsp has to process
|
|
||||||
(setq lsp-enable-file-watchers t)
|
|
||||||
(setq lsp-enable-folding nil)
|
|
||||||
(setq lsp-enable-text-document-color nil)
|
|
||||||
(setq lsp-enable-on-type-formatting nil)
|
|
||||||
(setq lsp-enable-links nil)
|
|
||||||
|
|
||||||
;; Which-key integration
|
|
||||||
(with-eval-after-load 'lsp-mode
|
|
||||||
(add-hook 'lsp-mode-hook #'lsp-enable-which-key-integration))
|
|
||||||
|
|
||||||
;; Enable LSP for specific modes
|
|
||||||
(add-hook 'python-mode-hook #'lsp-deferred)
|
|
||||||
(add-hook 'c-mode-hook #'lsp-deferred)
|
|
||||||
(add-hook 'c++-mode-hook #'lsp-deferred)
|
|
||||||
(add-hook 'rust-mode-hook #'lsp-deferred)
|
|
||||||
(add-hook 'go-mode-hook #'lsp-deferred)
|
|
||||||
(add-hook 'js-mode-hook #'lsp-deferred)
|
|
||||||
(add-hook 'typescript-mode-hook #'lsp-deferred)
|
|
||||||
|
|
||||||
;; Format on save (optional)
|
|
||||||
(add-hook 'before-save-hook #'lsp-format-buffer)
|
|
||||||
|
|
||||||
;; Keybindings
|
|
||||||
(define-key lsp-mode-map (kbd "C-c l f") #'lsp-format-buffer)
|
|
||||||
(define-key lsp-mode-map (kbd "C-c l r") #'lsp-rename)
|
|
||||||
(define-key lsp-mode-map (kbd "C-c l a") #'lsp-execute-code-action)
|
|
||||||
(define-key lsp-mode-map (kbd "C-c l d") #'lsp-find-definition)
|
|
||||||
(define-key lsp-mode-map (kbd "C-c l R") #'lsp-find-references)
|
|
||||||
|
|
||||||
(provide 'module-lsp)
|
|
||||||
;;; module-lsp.el ends here
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
;;; module-magit.el --- git integration
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Setup git integration with Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require 'magit)
|
|
||||||
(pkg/require 'magit-popup)
|
|
||||||
|
|
||||||
(with-eval-after-load 'magit
|
|
||||||
|
|
||||||
(setq magit-display-buffer-function
|
|
||||||
#'magit-display-buffer-same-window-except-diff-v1)
|
|
||||||
|
|
||||||
;; git reset --soft $(git merge-base branch1 branch2)
|
|
||||||
(defun magit-reset-to-merge-base ()
|
|
||||||
"Reset to merge-base of two branches using Magit's branch selection."
|
|
||||||
(interactive)
|
|
||||||
(require 'magit)
|
|
||||||
(let* ((branch1 (magit-read-branch "Select first branch: "))
|
|
||||||
(branch2 (magit-read-branch "Select second branch: "))
|
|
||||||
(merge-base (magit-git-string "merge-base" branch1 branch2)))
|
|
||||||
(if merge-base
|
|
||||||
(progn
|
|
||||||
(magit-reset-internal "--soft" merge-base)
|
|
||||||
(message "Reset to merge-base of %s and %s" branch1 branch2))
|
|
||||||
(user-error "No merge-base found between %s and %s" branch1 branch2))))
|
|
||||||
|
|
||||||
;; git reset --soft @{u}
|
|
||||||
(defun magit-reset-to-upstream ()
|
|
||||||
"Reset to upstream of the current branch using Magit."
|
|
||||||
(interactive)
|
|
||||||
(require 'magit)
|
|
||||||
(let ((current-branch (magit-get-current-branch)))
|
|
||||||
(if current-branch
|
|
||||||
(let ((upstream (magit-get-upstream-branch current-branch)))
|
|
||||||
(if upstream
|
|
||||||
(progn
|
|
||||||
(magit-reset-internal "--soft" "@{u}")
|
|
||||||
(message "Reset to upstream of %s (%s)" current-branch upstream))
|
|
||||||
(user-error "No upstream branch set for %s" current-branch)))
|
|
||||||
(user-error "Not on a branch"))))
|
|
||||||
|
|
||||||
(defvar my/magit-prefix-map (make-sparse-keymap))
|
|
||||||
(define-key ctl-x-map "g" my/magit-prefix-map)
|
|
||||||
(define-key my/magit-prefix-map "g" #'magit-status)
|
|
||||||
(define-key my/magit-prefix-map "rb" #'magit-reset-to-merge-base)
|
|
||||||
(define-key my/magit-prefix-map "ru" #'magit-reset-to-upstream)
|
|
||||||
(define-key my/magit-prefix-map "ll" #'magit-log)
|
|
||||||
(define-key my/magit-prefix-map "la" #'magit-log-all)
|
|
||||||
(define-key my/magit-prefix-map "lf" #'magit-log-buffer-file)
|
|
||||||
(define-key my/magit-prefix-map "Rs" #'magit-reset-soft)
|
|
||||||
(define-key my/magit-prefix-map "Rh" #'magit-reset-hard)
|
|
||||||
(define-key my/magit-prefix-map "!" #'magit-run)
|
|
||||||
(define-key my/magit-prefix-map "bb" #'magit-branch)
|
|
||||||
(define-key my/magit-prefix-map "bc" #'magit-branch-create)
|
|
||||||
(define-key my/magit-prefix-map "bs" #'magit-branch-checkout)
|
|
||||||
(define-key my/magit-prefix-map "mm" #'magit-merge)
|
|
||||||
(define-key my/magit-prefix-map "dd" #'magit-diff))
|
|
||||||
|
|
||||||
(provide 'module-magit)
|
|
||||||
|
|
||||||
;;; module-magit.el ends here.
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
;;; module-marginalia.el --- marginalia support
|
|
||||||
;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;; This file provides support for marginalia in org-mode.
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'marginalia)
|
|
||||||
(define-key minibuffer-local-map (kbd "M-A") 'marginalia-cycle)
|
|
||||||
|
|
||||||
(marginalia-mode)
|
|
||||||
(provide 'module-marginalia)
|
|
||||||
;;; module-marginalia.el ends here
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
;;; module-multi-cursor.el --- multiple cursors
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Multiple cursor support for Emacs. Everyone else is doing it,
|
|
||||||
;;; right?
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'multiple-cursors)
|
|
||||||
|
|
||||||
(multiple-cursors-mode 1)
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x C-<") 'mc/edit-lines)
|
|
||||||
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
|
||||||
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
|
|
||||||
(global-set-key (kbd "C-x C->") 'mc/mark-all-like-this)
|
|
||||||
|
|
||||||
(global-unset-key (kbd "C-<down-mouse-1>"))
|
|
||||||
(global-set-key (kbd "C-<mouse-1>") 'mc/add-cursor-on-click)
|
|
||||||
|
|
||||||
(provide 'module-multi-cursor)
|
|
||||||
|
|
||||||
;;; module-multi-cursor.el ends here.
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
;;; module-notmuch.el --- for email processing
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; notmuch email
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(pkg/require 'notmuch)
|
|
||||||
|
|
||||||
;; minor scope creep... oh well.
|
|
||||||
(require 'smtpmail)
|
|
||||||
(setq send-mail-function 'smtpmail-send-it
|
|
||||||
smtpmail-smtp-server "alioth.uberspace.de"
|
|
||||||
smtpmail-smtp-service 587
|
|
||||||
smtpmail-stream-type 'starttls
|
|
||||||
user-mail-address "me@lkn.uber.space"
|
|
||||||
user-full-name "Levi Neely")
|
|
||||||
|
|
||||||
(defun sync-and-index-mail ()
|
|
||||||
"Synchronize mail using mbsync and index with notmuch."
|
|
||||||
(interactive)
|
|
||||||
(let ((default-directory "~/"))
|
|
||||||
(message "Syncing mail...")
|
|
||||||
(shell-command "mbsync uberspace >/dev/null")
|
|
||||||
(message "Indexing mail...")
|
|
||||||
(shell-command "notmuch new >/dev/null")
|
|
||||||
(message "Mail sync and indexing completed.")))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x M") 'sync-and-index-mail)
|
|
||||||
|
|
||||||
(provide 'module-notmuch)
|
|
||||||
;;; module-qt.el ends here.
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
;;; module-orderless.el --- efficient minibuffer completion
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Provides minibuffer completion for Emacs with fuzzy search
|
|
||||||
;;; capabilities.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'orderless)
|
|
||||||
|
|
||||||
(setq completion-styles '(orderless basic)
|
|
||||||
completion-category-overrides '((file (styles . (partial-completion))))
|
|
||||||
completion-category-defaults nil
|
|
||||||
completion-ignore-case t
|
|
||||||
orderless-matching-styles '(orderless-literal orderless-prefixes orderless-initialism)
|
|
||||||
orderless-component-separator #'orderless-escapable-split-on-space)
|
|
||||||
|
|
||||||
(provide 'module-orderless)
|
|
||||||
;;; module-orderless.el ends here.
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
;;; module-org-denote.el --- denote extensions for org-mode
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Add denote-specific extensions to org-mode.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-org)
|
|
||||||
|
|
||||||
(with-eval-after-load 'denote
|
|
||||||
(defvar denote-org-capture-specifiers)
|
|
||||||
(setq denote-org-capture-specifiers "%l\n%i\n%?")
|
|
||||||
(add-to-list 'org-capture-templates
|
|
||||||
'("n" "New note (with denote.el)" plain
|
|
||||||
(file denote-last-path)
|
|
||||||
#'denote-org-capture
|
|
||||||
:no-save t
|
|
||||||
:immediate-finish nil
|
|
||||||
:kill-buffer t
|
|
||||||
:jump-to-captured t)))
|
|
||||||
|
|
||||||
(provide 'module-org-denote)
|
|
||||||
|
|
||||||
;;; module-org-denote.el ends here.
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
;;; module-org.el --- org-mode
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Setup org-mode and extensions for Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'org-drill)
|
|
||||||
|
|
||||||
|
|
||||||
(setq org-drill-use-visible-cloze-face-p t)
|
|
||||||
(setq org-drill-hide-item-headings-p t)
|
|
||||||
|
|
||||||
(add-to-list
|
|
||||||
'org-capture-templates
|
|
||||||
'("v" "Deutsch Vocabulary" entry
|
|
||||||
(file+headline "~/doc/deutsch.org" "Vocabulary")
|
|
||||||
"* %^{Word type|Noun|Verb|Adjective|Adverb|Preposition|Conjunction|Interjection|Pronoun} :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: twosided\n:END:\n** Deutsch\n%^{German word}\n** English\n%^{English translation}"))
|
|
||||||
|
|
||||||
(add-to-list
|
|
||||||
'org-capture-templates
|
|
||||||
'("V" "Bairisch Vocabulary" entry
|
|
||||||
(file+headline "~/doc/bairisch.org" "Vocabulary")
|
|
||||||
"* %^{Word type|Noun|Verb|Adjective|Adverb|Preposition|Conjunction|Interjection|Pronoun} :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: twosided\n:END:\n** Deutsch\n%^{German word}\n** English\n%^{English translation}"))
|
|
||||||
|
|
||||||
|
|
||||||
(add-to-list
|
|
||||||
'org-capture-templates
|
|
||||||
'("p" "Deutsch Phrase" entry
|
|
||||||
(file+headline "~/doc/deutsch.org" "Phrases")
|
|
||||||
"* %^{Phrase Type|Phrase|Greeting|Idiom|Saying} :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: twosided\n:END:\n** Deutsch\n%^{German phrase}\n** English\n%^{English translation}"))
|
|
||||||
|
|
||||||
(add-to-list
|
|
||||||
'org-capture-templates
|
|
||||||
'("P" "Bairisch Phrase" entry
|
|
||||||
(file+headline "~/doc/bairisch.org" "Phrases")
|
|
||||||
"* %^{Phrase Type|Phrase|Greeting|Idiom|Saying} :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: twosided\n:END:\n** Deutsch\n%^{German phrase}\n** English\n%^{English translation}"))
|
|
||||||
|
|
||||||
(add-to-list
|
|
||||||
'org-capture-templates
|
|
||||||
'("d" "Deutsch Noun Declension" entry
|
|
||||||
(file+headline "~/doc/deutsch.org" "Noun Declension")
|
|
||||||
"* %^{German word} :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: show2cloze\n:END:\n|---\n|Kasus|Singular|Plural|\n|---\n|Nominativ|[%^{nomsing}]|[%^{nompl}]|\n|Genitiv|[%^{gensing}]|[%^{genpl}]|\n|Dativ|[%^{datsing}]|[%^{datpl}]|\n|Akkusativ|[%^{akksing}]|[%^{akkpl}]|\n|---"))
|
|
||||||
|
|
||||||
(add-to-list
|
|
||||||
'org-capture-templates
|
|
||||||
'("d" "Bairisch Noun Declension" entry
|
|
||||||
(file+headline "~/doc/bairisch.org" "Noun Declension")
|
|
||||||
"* %^{German word} :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: show2cloze\n:END:\n|---\n|Kasus|Singular|Plural|\n|---\n|Nominativ|[%^{nomsing}]|[%^{nompl}]|\n|Genitiv|[%^{gensing}]|[%^{genpl}]|\n|Dativ|[%^{datsing}]|[%^{datpl}]|\n|Akkusativ|[%^{akksing}]|[%^{akkpl}]|\n|---"))
|
|
||||||
|
|
||||||
(add-to-list
|
|
||||||
'org-capture-templates
|
|
||||||
'("c" "Deutsch Verb Conjugation" entry
|
|
||||||
(file+headline "~/doc/deutsch.org" "Verb Conjugation")
|
|
||||||
"* %^{German word} :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: show2cloze\n:END:\n|---\n|ich|[%^{ich}]|wir|[%^{wir}]|\n|du|[%^{du}]|ihr|[%^{ihr}]\n|er/sie/es|[%^{er/sie/es}]|sie/Sie|[%^{sie/Sie}]|\n|--\n\nPerfekt: [%^{verb|haben|sein}] + [%^{perfekt}]."))
|
|
||||||
|
|
||||||
(add-to-list
|
|
||||||
'org-capture-templates
|
|
||||||
'("c" "Bairisch Verb Conjugation" entry
|
|
||||||
(file+headline "~/doc/bairisch.org" "Verb Conjugation")
|
|
||||||
"* %^{German word} :drill:\n:PROPERTIES:\n:DRILL_CARD_TYPE: show2cloze\n:END:\n|---\n|ich|[%^{ich}]|wir|[%^{wir}]|\n|du|[%^{du}]|ihr|[%^{ihr}]\n|er/sie/es|[%^{er/sie/es}]|sie/Sie|[%^{sie/Sie}]|\n|--\n\nPerfekt: [%^{verb|haben|sein}] + [%^{perfekt}]."))
|
|
||||||
|
|
||||||
(provide 'module-org-drill)
|
|
||||||
|
|
||||||
;;; module-org.el ends here.
|
|
||||||
|
|
@ -1,123 +0,0 @@
|
||||||
;;; module-org.el --- org-mode
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Setup org-mode and extensions for Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'org)
|
|
||||||
(pkg/require 'ox-clip)
|
|
||||||
(pkg/require 'org-board)
|
|
||||||
(pkg/require 'org-index)
|
|
||||||
(pkg/require 'org-ai)
|
|
||||||
|
|
||||||
(require 'org)
|
|
||||||
(require 'org-agenda)
|
|
||||||
(require 'org-capture)
|
|
||||||
|
|
||||||
(defun my/visit-todo ()
|
|
||||||
"Visit TODO.org in home."
|
|
||||||
(interactive)
|
|
||||||
(find-file "~/TODO.org"))
|
|
||||||
|
|
||||||
(defun my/kill-all-org-agenda-buffers ()
|
|
||||||
"Close all org-agenda-related buffers."
|
|
||||||
(interactive)
|
|
||||||
(dolist (buffer (buffer-list))
|
|
||||||
(with-current-buffer buffer
|
|
||||||
(when (or (derived-mode-p 'org-agenda-mode)
|
|
||||||
(and (buffer-file-name)
|
|
||||||
(member (buffer-file-name) (org-agenda-files))))
|
|
||||||
(kill-buffer buffer))))
|
|
||||||
(message "Closed all org-agenda-related buffers."))
|
|
||||||
|
|
||||||
(defun my-org-agenda-format-item (item)
|
|
||||||
"Format an agenda or to-do ITEM without the filename, but keep the keyword."
|
|
||||||
(let* ((marker (or (get-text-property 0 'org-marker item)
|
|
||||||
(get-text-property 0 'org-hd-marker item)))
|
|
||||||
(line (when marker
|
|
||||||
(org-with-point-at marker
|
|
||||||
(buffer-substring (line-beginning-position) (line-end-position)))))
|
|
||||||
(todo-keyword (when marker
|
|
||||||
(org-with-point-at marker
|
|
||||||
(org-get-todo-state))))
|
|
||||||
(truncated-line (when line
|
|
||||||
(replace-regexp-in-string "^\\[#[A-Z]\\] " "" line))))
|
|
||||||
(if truncated-line
|
|
||||||
(let ((clean-item (replace-regexp-in-string "^\\(\\*+ \\)" "" truncated-line)))
|
|
||||||
(if todo-keyword
|
|
||||||
(concat todo-keyword " " (replace-regexp-in-string (concat "^" todo-keyword " ?") "" clean-item))
|
|
||||||
clean-item))
|
|
||||||
item)))
|
|
||||||
|
|
||||||
(defun my/add-remote-todo-file ()
|
|
||||||
"Add remote TODO.org file to org-agenda-files."
|
|
||||||
(interactive)
|
|
||||||
(unless org-agenda-files
|
|
||||||
(setq org-agenda-files
|
|
||||||
(list "~/TODO.org"))))
|
|
||||||
|
|
||||||
|
|
||||||
;; org-mode general settings
|
|
||||||
(setq org-adapt-indentation nil
|
|
||||||
org-archive-location "%s_archive::datetree/"
|
|
||||||
org-log-done 'note
|
|
||||||
org-log-into-drawer t
|
|
||||||
org-outline-path-complete-in-steps nil
|
|
||||||
org-stuck-projects '("+prj/-maybe-someday"
|
|
||||||
("TODO" "WAIT" "CNCL" "prj")
|
|
||||||
nil
|
|
||||||
"")
|
|
||||||
org-tags-exclude-from-inheritance '("prj")
|
|
||||||
org-todo-keywords '((sequence "HOLD(h)" "TODO(t)" "WAIT(w)" "|"
|
|
||||||
"DONE(d)" "CNCL(x)"))
|
|
||||||
org-todo-keyword-faces
|
|
||||||
'(("HOLD" . (:foreground "orange" :weight bold))
|
|
||||||
("TODO" . (:foreground "red" :weight bold))
|
|
||||||
("DONE" . (:foreground "green" :weight bold))
|
|
||||||
("CNCL" . (:foreground "gray" :weight bold))))
|
|
||||||
|
|
||||||
;; org-agenda settings
|
|
||||||
(setq org-agenda-prefix-format '((agenda . "%i %?-12t% s ")
|
|
||||||
(todo . " %i ")
|
|
||||||
(tags . " %i ")
|
|
||||||
(search . " %i "))
|
|
||||||
org-agenda-inhibit-startup t
|
|
||||||
org-agenda-hide-tags-regexp "."
|
|
||||||
org-agenda-todo-keyword-format "%s"
|
|
||||||
org-agenda-hide-tags-regexp nil
|
|
||||||
org-agenda-tags-column -80)
|
|
||||||
|
|
||||||
;; org-refile settings
|
|
||||||
(setq org-refile-targets
|
|
||||||
'((nil :maxlevel . 9)
|
|
||||||
("~/TODO.org" :maxlevel . 9))
|
|
||||||
org-refile-use-outline-path 'file
|
|
||||||
org-refile-allow-creating-parent-nodes 'confirm)
|
|
||||||
|
|
||||||
;; org-capture settings
|
|
||||||
(setq org-capture-templates
|
|
||||||
'(("t" "TODO" entry (file "~/TODO.org")
|
|
||||||
"* TODO %?\n %i" :prepend t)))
|
|
||||||
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
|
|
||||||
(advice-add 'org-agenda :before #'my/add-remote-todo-file)
|
|
||||||
(advice-add 'org-agenda-format-item-line
|
|
||||||
:filter-return #'my-org-agenda-format-item)
|
|
||||||
(advice-add 'org-agenda-format-item
|
|
||||||
:filter-return #'my-org-agenda-format-item)
|
|
||||||
(org-babel-do-load-languages 'org-babel-load-languages
|
|
||||||
'((shell . t)))
|
|
||||||
|
|
||||||
;; key bindings
|
|
||||||
(global-set-key (kbd "C-x c O") 'my/reload-org-config)
|
|
||||||
(global-set-key (kbd "C-x O a") 'org-agenda)
|
|
||||||
(global-set-key (kbd "C-x O c") 'org-capture)
|
|
||||||
(global-set-key (kbd "C-x O t") 'my/visit-todo)
|
|
||||||
(global-set-key (kbd "C-x O k") 'my/kill-all-org-agenda-buffers)
|
|
||||||
|
|
||||||
(provide 'module-org)
|
|
||||||
|
|
||||||
;;; module-org.el ends here.
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
;;; module-perspective.el --- workspace management
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Declutter buffer lists.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'perspective)
|
|
||||||
(pkg/require 'persp-projectile)
|
|
||||||
|
|
||||||
(persp-mode +1)
|
|
||||||
(persp-turn-off-modestring)
|
|
||||||
(setq doom-modeline-persp-name t)
|
|
||||||
|
|
||||||
(defun create-perspectives-for-projects (root-dir)
|
|
||||||
"Create perspectives for each subdirectory in ROOT-DIR."
|
|
||||||
(interactive "DSelect root directory: ")
|
|
||||||
(let ((subdirs (directory-files root-dir t directory-files-no-dot-files-regexp)))
|
|
||||||
(dolist (dir subdirs)
|
|
||||||
(when (file-directory-p dir)
|
|
||||||
(let ((project-name (file-name-nondirectory dir)))
|
|
||||||
(persp-switch project-name)
|
|
||||||
(dired dir)
|
|
||||||
(persp-add-buffer (current-buffer)))))))
|
|
||||||
|
|
||||||
;; auto-create common perspectives
|
|
||||||
(persp-switch "notes")
|
|
||||||
(dired "~/notes")
|
|
||||||
(persp-add-buffer (current-buffer))
|
|
||||||
(persp-switch "main")
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x k") 'persp-kill-buffer*)
|
|
||||||
(global-set-key (kbd "C-x x s") 'persp-switch)
|
|
||||||
(global-set-key (kbd "C-x x k") 'persp-kill)
|
|
||||||
(global-set-key (kbd "C-x x r") 'persp-rename)
|
|
||||||
(global-set-key (kbd "C-x x n") 'persp-next)
|
|
||||||
(global-set-key (kbd "C-x x p") 'persp-prev)
|
|
||||||
(global-set-key (kbd "C-x C-b") 'persp-ibuffer)
|
|
||||||
|
|
||||||
(define-key projectile-mode-map (kbd "C-x p s") 'projectile-persp-switch-project)
|
|
||||||
|
|
||||||
(autoload 'projectile-project-root "projectile")
|
|
||||||
(setq consult-project-root-function #'projectile-project-root)
|
|
||||||
|
|
||||||
(persp-switch "main")
|
|
||||||
(provide 'module-perspective)
|
|
||||||
|
|
||||||
;;; module-projectile.el ends here.
|
|
||||||
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
;;; module-piper.el -- piping functions for emacs
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;; Convenient piping functions for emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-magit)
|
|
||||||
|
|
||||||
(defvar piper-mode-map
|
|
||||||
(let ((map (make-sparse-keymap)))
|
|
||||||
(define-key map (kbd "<SPC>") 'scroll-up-command)
|
|
||||||
(define-key map (kbd "<DEL>") 'scroll-down-command)
|
|
||||||
(define-key map (kbd "C-|") 'piper-popup)
|
|
||||||
map)
|
|
||||||
"Keymap for `piper-mode'.")
|
|
||||||
|
|
||||||
(define-minor-mode piper-mode
|
|
||||||
"Toggle Filtering mode."
|
|
||||||
;; The initial value.
|
|
||||||
:init-value nil
|
|
||||||
;; The indicator for the mode line.
|
|
||||||
:lighter " |"
|
|
||||||
;; The minor mode bindings.
|
|
||||||
:keymap piper-mode-map
|
|
||||||
:group 'piper)
|
|
||||||
|
|
||||||
(add-to-list 'emulation-mode-map-alists `((piper-mode . ,piper-mode-map)))
|
|
||||||
|
|
||||||
(with-eval-after-load 'magit-popup
|
|
||||||
(magit-define-popup piper-popup
|
|
||||||
"Show popup buffer featuring shell-like piper commands."
|
|
||||||
'piper-commands
|
|
||||||
:actions '((?f "Flush" flush-lines)
|
|
||||||
(?k "Keep" keep-lines)
|
|
||||||
(?c "Cut Columns" columns-lines)
|
|
||||||
(?s "Sort" sort-lines)
|
|
||||||
(?u "Unique Lines" uniquify-lines)
|
|
||||||
(?! "Next Pipe" pipe))
|
|
||||||
:default-action 'pipe))
|
|
||||||
|
|
||||||
(provide 'module-piper)
|
|
||||||
;;; module-piper.el ends here.
|
|
||||||
|
|
@ -1,95 +0,0 @@
|
||||||
;;; feature-pkg.el --- Brief description -*- lexical-binding: t; -*-
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; This feature provides a simple and predictable package management
|
|
||||||
;;; framework building upon built-in Emacs package management
|
|
||||||
;;; features. Frameworks like use-package and leaf are nice, but
|
|
||||||
;;; become difficult to manage and debug over time . feature-pkg.el
|
|
||||||
;;; is the foundation for adding and removing features in this Emacs
|
|
||||||
;;; configuration.
|
|
||||||
;;;
|
|
||||||
;;; Note that feature-pkg does not explicitly need to be required in
|
|
||||||
;;; the main Emacs config, as it will be loaded as a dependency by
|
|
||||||
;;; each feature.
|
|
||||||
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'package)
|
|
||||||
(with-eval-after-load 'package
|
|
||||||
(add-to-list 'package-archives
|
|
||||||
'("melpa" . "https://melpa.org/packages/")
|
|
||||||
'("nongnu" . "https://elpa.nongnu.org/nongnu/")))
|
|
||||||
(package-initialize)
|
|
||||||
|
|
||||||
;; install straight.el
|
|
||||||
(defvar bootstrap-version)
|
|
||||||
(let ((bootstrap-file
|
|
||||||
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
|
||||||
(bootstrap-version 5))
|
|
||||||
(unless (file-exists-p bootstrap-file)
|
|
||||||
(with-current-buffer
|
|
||||||
(url-retrieve-synchronously
|
|
||||||
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
|
|
||||||
'silent 'inhibit-cookies)
|
|
||||||
(goto-char (point-max))
|
|
||||||
(eval-print-last-sexp)))
|
|
||||||
(load bootstrap-file nil 'nomessage))
|
|
||||||
|
|
||||||
(defun pkg/ensure-installed (package)
|
|
||||||
"Ensure that PACKAGE is installed."
|
|
||||||
(unless (package-installed-p package)
|
|
||||||
(package-refresh-contents)
|
|
||||||
(package-install package)))
|
|
||||||
|
|
||||||
(defmacro pkg/require (feature &optional filename noerror)
|
|
||||||
"Ensure FEATURE is installed, then require it.
|
|
||||||
FILENAME and NOERROR are passed to `require'."
|
|
||||||
`(progn
|
|
||||||
(pkg/ensure-installed ,feature)
|
|
||||||
(require ,feature ,filename ,noerror)))
|
|
||||||
|
|
||||||
(defmacro pkg/require-defer (feature &optional filename noerror)
|
|
||||||
"Defer loading of FEATURE until it's actually needed.
|
|
||||||
Ensure FEATURE is installed first.
|
|
||||||
FILENAME, if non-nil, is the file to load to provide FEATURE.
|
|
||||||
If NOERROR is non-nil, don't signal an error if the file is not found."
|
|
||||||
(let ((feature-sym (if (and (listp feature) (eq (car feature) 'quote))
|
|
||||||
(cadr feature)
|
|
||||||
feature)))
|
|
||||||
`(progn
|
|
||||||
(pkg/ensure-installed ',feature-sym)
|
|
||||||
(unless (featurep ',feature-sym)
|
|
||||||
(autoload #',(intern (format "%s-autoloaded" feature-sym))
|
|
||||||
,(or filename (symbol-name feature-sym))
|
|
||||||
nil t)
|
|
||||||
(defalias ',feature-sym #',(intern (format "%s-autoloaded" feature-sym))))
|
|
||||||
',feature-sym)))
|
|
||||||
|
|
||||||
(defun pkg/require-defer-load (feature)
|
|
||||||
"Check if a deferred FEATURE is already loaded."
|
|
||||||
(unless (featurep feature)
|
|
||||||
(unload-feature feature t)
|
|
||||||
(require feature)
|
|
||||||
(fmakunbound (intern (format "%s-autoloaded" feature))))
|
|
||||||
feature)
|
|
||||||
|
|
||||||
(defmacro pkg/require-defer-timer (feature seconds)
|
|
||||||
"Ensure FEATURE is installed, then defer its loading by SECONDS idle time."
|
|
||||||
`(progn
|
|
||||||
(pkg/ensure-installed ,feature)
|
|
||||||
(run-with-idle-timer ,seconds nil #'require ',feature)))
|
|
||||||
|
|
||||||
(defun pkg/packages-loaded-p (&rest packages)
|
|
||||||
"Return t if all PACKAGES are loaded."
|
|
||||||
(cl-every #'featurep packages))
|
|
||||||
|
|
||||||
(defmacro pkg/with-eval-after-load (packages &rest body)
|
|
||||||
"Run BODY after all PACKAGES are loaded."
|
|
||||||
`(if (apply #'pkg/packages-loaded-p ',packages)
|
|
||||||
(progn ,@body)
|
|
||||||
(eval-after-load (car (last ',packages))
|
|
||||||
'(pkg/run-after-packages-load ',packages ,@body))))
|
|
||||||
|
|
||||||
(provide 'module-pkg)
|
|
||||||
|
|
||||||
;;; module-pkg.el ends here.
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
;;; module-plantuml.el --- diagramming for less old people -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Build UML diagrams in plain text, so nobody can read them.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'plantuml-mode)
|
|
||||||
|
|
||||||
(with-eval-after-load 'plantuml-mode
|
|
||||||
(setq plantuml-default-exec-mode 'jar
|
|
||||||
plantuml-jar-path "/usr/share/plantuml/plantuml.jar"
|
|
||||||
org-plantuml-jar-path (expand-file-name
|
|
||||||
"/usr/share/plantuml/plantuml.jar")))
|
|
||||||
|
|
||||||
(with-eval-after-load 'org
|
|
||||||
(org-babel-do-load-languages
|
|
||||||
'org-babel-load-languages '((plantuml . t))))
|
|
||||||
|
|
||||||
(with-eval-after-load 'plantuml-mode
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.puml$" . plantuml-mode)))
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'module-plantuml)
|
|
||||||
|
|
||||||
;;; module-plantuml.el ends here.
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
;;; module-projectile.el --- project management
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; The de facto standard for Emacs projects.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'projectile)
|
|
||||||
|
|
||||||
(projectile-mode +1)
|
|
||||||
|
|
||||||
(defun open-terminal-at-project-root ()
|
|
||||||
"Open an external terminal emulator at the project root directory."
|
|
||||||
(interactive)
|
|
||||||
(let* ((project-root (projectile-project-root))
|
|
||||||
(terminal-program "xterm")
|
|
||||||
(command (concat terminal-program " -e 'cd " project-root " && $SHELL'")))
|
|
||||||
(if project-root
|
|
||||||
(start-process-shell-command "external-terminal" nil command)
|
|
||||||
(message "Not in a project"))))
|
|
||||||
|
|
||||||
(provide 'module-projectile)
|
|
||||||
|
|
||||||
;;; module-projectile.el ends here.
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
;;; module-protobuf.el --- some google messaging shit -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Add support for working with Google protobuf message definitions.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'protobuf-mode)
|
|
||||||
|
|
||||||
(with-eval-after-load 'protobuf-mode
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.proto$" . protobuf-mode)))
|
|
||||||
|
|
||||||
(provide 'module-protobuf)
|
|
||||||
|
|
||||||
;;; module-protobuf.el ends here.
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
;;; module-python.el --- code that eats itself -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Add python language support to Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'python-mode)
|
|
||||||
(pkg/require-defer 'python-environment)
|
|
||||||
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.py$" . python-mode))
|
|
||||||
(add-to-list 'auto-mode-alist '("BUILD\\'" . python-mode))
|
|
||||||
|
|
||||||
(provide 'module-python)
|
|
||||||
|
|
||||||
;;; module-python.el ends here.
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
;;; module-qt.el --- for qt dev -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; gui dev stuff with qt
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(pkg/require 'qml-mode)
|
|
||||||
|
|
||||||
(provide 'module-qt)
|
|
||||||
;;; module-qt.el ends here.
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
;;; module-region.el --- region selection
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Setup more convenient region selection.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'expand-region)
|
|
||||||
(pkg/require 'surround)
|
|
||||||
|
|
||||||
(global-set-key (kbd "M-'") surround-keymap)
|
|
||||||
(provide 'module-region)
|
|
||||||
;;; module-region.el ends here.
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
;;; module-rego.el --- some policy language we use at work -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Adds support for rego, a policy definition language, to Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'rego-mode)
|
|
||||||
|
|
||||||
(provide 'module-rego)
|
|
||||||
|
|
||||||
;;; module-rego.el ends here.
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
;;; module-remotefs.el --- remotefs automount -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Automount remotefs on demand.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
|
|
||||||
(defvar remote-mounts nil
|
|
||||||
"Alist of remote mounts. Each entry is (name . (remote-path local-mountpoint)).")
|
|
||||||
|
|
||||||
(defun ensure-remote-mounted (name)
|
|
||||||
"Check if the remote mount NAME is mounted, and if not, mount it."
|
|
||||||
(let* ((mount-info (assoc name remote-mounts))
|
|
||||||
(local-path (cadr (cdr mount-info))))
|
|
||||||
(unless (file-exists-p (expand-file-name ".exists" local-path))
|
|
||||||
(mount-remote-sshfs name))))
|
|
||||||
|
|
||||||
(defun umount-remote-sshfs (name)
|
|
||||||
"Unmount the remote mount NAME using SSHFS."
|
|
||||||
(interactive
|
|
||||||
(list (completing-read "Unmount remote: " remote-mounts nil t)))
|
|
||||||
(let* ((mount-info (assoc name remote-mounts))
|
|
||||||
(local-path (cadr (cdr mount-info)))
|
|
||||||
(default-directory "~"))
|
|
||||||
(shell-command (format "umount %s" local-path))))
|
|
||||||
|
|
||||||
(defun mount-remote-sshfs (name)
|
|
||||||
"Mount the remote mount NAME using SSHFS."
|
|
||||||
(interactive
|
|
||||||
(list (completing-read "Mount remote: " remote-mounts nil t)))
|
|
||||||
(let* ((mount-info (assoc name remote-mounts))
|
|
||||||
(remote-path (cadr mount-info))
|
|
||||||
(local-path (cadr (cdr mount-info)))
|
|
||||||
(default-directory "~"))
|
|
||||||
(shell-command (format "sshfs %s %s" remote-path local-path))))
|
|
||||||
|
|
||||||
(defun check-and-mount-remote (path)
|
|
||||||
"Check if PATH is under a remote mount, and ensure it's mounted if so."
|
|
||||||
(let ((matching-mount
|
|
||||||
(cl-find-if
|
|
||||||
(lambda (mount)
|
|
||||||
(string-prefix-p
|
|
||||||
(expand-file-name (cadr (cdr mount)))
|
|
||||||
(expand-file-name path)))
|
|
||||||
remote-mounts)))
|
|
||||||
(when matching-mount
|
|
||||||
(ensure-remote-mounted (car matching-mount)))))
|
|
||||||
|
|
||||||
(add-hook 'find-file-hook
|
|
||||||
(lambda ()
|
|
||||||
(when buffer-file-name
|
|
||||||
(check-and-mount-remote buffer-file-name))))
|
|
||||||
|
|
||||||
(add-hook 'dired-mode-hook
|
|
||||||
(lambda ()
|
|
||||||
(check-and-mount-remote default-directory)))
|
|
||||||
|
|
||||||
(provide 'module-remotefs)
|
|
||||||
|
|
||||||
;;; module-remotefs.el ends here.
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
;;; module-orderless.el --- rss feeds in emacs
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Read RSS feeds in Emacs, stop browsing the web.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require-defer 'elfeed)
|
|
||||||
|
|
||||||
(provide 'module-rss)
|
|
||||||
;;; module-rss.el ends here.
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
;;; module-scratch.el --- scratch buffer enhancements
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Scratch buffer enhancements for Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'scratch)
|
|
||||||
(provide 'module-scratch)
|
|
||||||
|
|
||||||
;;; module-scratch.el ends here.
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
;;; module-snippets.el --- text snippets -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Sometimes it's just too much effort to type the same shit over and
|
|
||||||
;;; over again.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require 'yasnippet)
|
|
||||||
(pkg/require-defer 'yasnippet-snippets)
|
|
||||||
|
|
||||||
(with-eval-after-load 'yasnippet
|
|
||||||
(setq yas-snippet-dirs '("~/.config/emacs/snippets/"))
|
|
||||||
(yas-global-mode 1)
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x y i") #'yas-insert-snippet)
|
|
||||||
(global-set-key (kbd "C-x y n") #'yas-new-snippet)
|
|
||||||
(global-set-key (kbd "C-x y v") #'yas-visit-snippet-file)
|
|
||||||
|
|
||||||
(add-hook 'prog-mode-hook #'yas-minor-mode)
|
|
||||||
(add-hook 'org-mode-hook #'yas-minor-mode))
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'module-snippets)
|
|
||||||
|
|
||||||
;;; module-snippets.el ends here.
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
;;; module-syntax.el --- syntax checking and highlights
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Add syntax checking and special purpose highlights for
|
|
||||||
;;; programming. Let Emacs compile that shit code of yours into
|
|
||||||
;;; submission for you.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'fic-mode)
|
|
||||||
(add-hook 'prog-mode-hook 'fic-mode)
|
|
||||||
|
|
||||||
(pkg/require-defer 'flycheck)
|
|
||||||
|
|
||||||
(with-eval-after-load 'flycheck
|
|
||||||
(global-flycheck-mode)
|
|
||||||
(setq flycheck-emacs-lisp-load-path 'inherit))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(provide 'module-syntax)
|
|
||||||
|
|
||||||
;;; module-syntax.el ends here.
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
;;; module-vertico.el --- vertical completion
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Vertical completion UI for Emacs minibuffer.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
(pkg/require 'vertico)
|
|
||||||
|
|
||||||
|
|
||||||
(vertico-mode)
|
|
||||||
(setq vertico-cycle t
|
|
||||||
vertico-count 13
|
|
||||||
read-file-name-completion-ignore-case t
|
|
||||||
read-buffer-completion-ignore-case t)
|
|
||||||
|
|
||||||
(pkg/with-eval-after-load
|
|
||||||
(vertico)
|
|
||||||
|
|
||||||
(require 'vertico-quick)
|
|
||||||
(define-key vertico-map (kbd "C-q") #'vertico-quick-insert)
|
|
||||||
(define-key vertico-map (kbd "M-q") #'vertico-quick-exit))
|
|
||||||
|
|
||||||
(provide 'module-vertico)
|
|
||||||
;;; module-vertico.el ends here.
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
;;; module-web.el --- a veritable fucking mess -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Add packages to Emacs to facilitate the absolute mess that is
|
|
||||||
;;; modern web programming.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'mmm-mode)
|
|
||||||
(pkg/require-defer 'multi-web-mode)
|
|
||||||
(pkg/require-defer 'php-mode)
|
|
||||||
(pkg/require-defer 'emmet-mode)
|
|
||||||
|
|
||||||
(with-eval-after-load 'php-mode
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.php$" . php-mode)))
|
|
||||||
|
|
||||||
(provide 'module-web)
|
|
||||||
|
|
||||||
;;; module-web.el ends here.
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
;;; module-which-key.el --- which-key -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Help remember which key to press in the current key chord
|
|
||||||
;;; "context," because memorization is overrated.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require 'which-key)
|
|
||||||
|
|
||||||
(which-key-mode)
|
|
||||||
|
|
||||||
(provide 'module-which-key)
|
|
||||||
|
|
||||||
;;; module-which-key.el ends here.
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
;;; module-work-projects.el --- autoload work perspectives
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Autoload work projects into perspectives.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-perspective)
|
|
||||||
|
|
||||||
(defun auto-create-work-project-perspectives ()
|
|
||||||
"Automatically create perspectives for projects if the directory exists."
|
|
||||||
(interactive)
|
|
||||||
|
|
||||||
;; reduce context switching costs
|
|
||||||
(let ((projects-dir "~/src/pascom/mobydick"))
|
|
||||||
(when (file-directory-p projects-dir)
|
|
||||||
(create-perspectives-for-projects projects-dir)))
|
|
||||||
(let ((projects-dir "~/src/pascom/client"))
|
|
||||||
(when (file-directory-p projects-dir)
|
|
||||||
(create-perspectives-for-projects projects-dir)))
|
|
||||||
|
|
||||||
;; not much context switching for devops
|
|
||||||
(persp-switch "pascom20_cloudmanagement")
|
|
||||||
(dired "~/src/pascom/pascom20_cloudmanagement")
|
|
||||||
(persp-switch "aws-ci")
|
|
||||||
(dired "~/src/pascom/aws-ci")
|
|
||||||
(persp-add-buffer (current-buffer))
|
|
||||||
(persp-switch "main"))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-x x w") #'auto-create-work-project-perspectives)
|
|
||||||
|
|
||||||
(provide 'module-work-projects)
|
|
||||||
;;; module-work-projects.el ends here.
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
;;; module-yaml.el --- because we needed another fucking data format -*- lexical-binding: t; -*-
|
|
||||||
;;;
|
|
||||||
;;; Commentary:
|
|
||||||
;;;
|
|
||||||
;;; Adds support for working with YAML files to Emacs.
|
|
||||||
;;;
|
|
||||||
;;; Code:
|
|
||||||
|
|
||||||
(require 'module-pkg)
|
|
||||||
|
|
||||||
(pkg/require-defer 'yaml-mode)
|
|
||||||
|
|
||||||
(with-eval-after-load 'yaml-mode
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode)))
|
|
||||||
|
|
||||||
(provide 'module-yaml)
|
|
||||||
|
|
||||||
;;; module-yaml.el ends here.
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
;;; Compiled snippets and support files for `org-mode'
|
|
||||||
;;; Snippet definitions:
|
|
||||||
;;;
|
|
||||||
(yas-define-snippets 'org-mode
|
|
||||||
'(("aippx" "* ${1:What}\n\n#+begin_ai :service perplexity.ai :model llama-3.1-sonar-small-128k-online\n[SYS]: ${2:You are a helpful assistant.}\n\n[ME]: ${0}\n#+end_ai\n" "aippx" nil nil nil "/home/lkn/.config/emacs/snippets/org-mode/aippx" nil nil)
|
|
||||||
("aigpt" "* ${1:What}\n\n#+begin_ai :service openai :model gpt-3.5-turbo\n[SYS]: ${2:You are a helpful assistant.}\n\n[ME]: ${0}\n#+end_ai\n" "aigpt" nil nil nil "/home/lkn/.config/emacs/snippets/org-mode/aigpt" nil nil)
|
|
||||||
("aicld" "* ${1:What}\n\n#+begin_ai :service anthropic :model claude-3-5-sonnet-20240620\n[SYS]: ${2:You are a helpful assistant.}\n\n[ME]: ${0}\n#+end_ai\n" "aicld" nil nil nil "/home/lkn/.config/emacs/snippets/org-mode/aicld" nil nil)))
|
|
||||||
|
|
||||||
|
|
||||||
;;; Do not edit! File generated at Sat Sep 14 15:30:36 2024
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
# -*- mode: snippet -*-
|
|
||||||
# name: aicld
|
|
||||||
# key: aicld
|
|
||||||
# --
|
|
||||||
* ${1:What}
|
|
||||||
|
|
||||||
#+begin_ai :service anthropic :model claude-3-5-sonnet-20240620
|
|
||||||
[SYS]: ${2:You are a helpful assistant.}
|
|
||||||
|
|
||||||
[ME]: ${0}
|
|
||||||
#+end_ai
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
# -*- mode: snippet -*-
|
|
||||||
# name: aigpt
|
|
||||||
# key: aigpt
|
|
||||||
# --
|
|
||||||
* ${1:What}
|
|
||||||
|
|
||||||
#+begin_ai :service openai :model gpt-3.5-turbo
|
|
||||||
[SYS]: ${2:You are a helpful assistant.}
|
|
||||||
|
|
||||||
[ME]: ${0}
|
|
||||||
#+end_ai
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
# -*- mode: snippet -*-
|
|
||||||
# name: aippx
|
|
||||||
# key: aippx
|
|
||||||
# --
|
|
||||||
* ${1:What}
|
|
||||||
|
|
||||||
#+begin_ai :service perplexity.ai :model llama-3.1-sonar-small-128k-online
|
|
||||||
[SYS]: ${2:You are a helpful assistant.}
|
|
||||||
|
|
||||||
[ME]: ${0}
|
|
||||||
#+end_ai
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
# -*- mode: snippet -*-
|
|
||||||
# name: example
|
|
||||||
# key: example
|
|
||||||
# --
|
|
||||||
#+BEGIN_EXAMPLE ${1:lang}
|
|
||||||
${0}
|
|
||||||
#+END_EXAMPLE
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
# -*- mode: snippet -*-
|
|
||||||
# name: src
|
|
||||||
# key: src
|
|
||||||
# --
|
|
||||||
#+BEGIN_SRC ${1:lang}
|
|
||||||
${0}
|
|
||||||
#+END_SRC
|
|
||||||
228
i3/config
228
i3/config
|
|
@ -1,228 +0,0 @@
|
||||||
# This file has been auto-generated by i3-config-wizard(1).
|
|
||||||
# It will not be overwritten, so edit it as you like.
|
|
||||||
#
|
|
||||||
# Should you change your keyboard layout some time, delete
|
|
||||||
# this file and re-run i3-config-wizard(1).
|
|
||||||
#
|
|
||||||
|
|
||||||
# i3 config file (v4)
|
|
||||||
#
|
|
||||||
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
|
|
||||||
|
|
||||||
set $mod Mod4
|
|
||||||
|
|
||||||
# Font for window titles. Will also be used by the bar unless a different font
|
|
||||||
# is used in the bar {} block below.
|
|
||||||
font pango:monospace 12
|
|
||||||
|
|
||||||
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
|
||||||
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
|
||||||
#font pango:DejaVu Sans Mono 8
|
|
||||||
|
|
||||||
# Start XDG autostart .desktop files using dex. See also
|
|
||||||
# https://wiki.archlinux.org/index.php/XDG_Autostart
|
|
||||||
exec --no-startup-id dex --autostart --environment i3
|
|
||||||
|
|
||||||
# set background
|
|
||||||
exec --no-startup-id feh --bg-scale /home/lkn/img/bobsaway.jpg
|
|
||||||
|
|
||||||
# The combination of xss-lock, nm-applet and pactl is a popular choice, so
|
|
||||||
# they are included here as an example. Modify as you see fit.
|
|
||||||
|
|
||||||
# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
|
|
||||||
# screen before suspend. Use loginctl lock-session to lock your screen.
|
|
||||||
exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
|
|
||||||
|
|
||||||
# NetworkManager is the most popular way to manage wireless networks on Linux,
|
|
||||||
# and nm-applet is a desktop environment-independent system tray GUI for it.
|
|
||||||
exec --no-startup-id nm-applet
|
|
||||||
|
|
||||||
# Use pactl to adjust volume in PulseAudio.
|
|
||||||
set $refresh_i3status killall -SIGUSR1 i3status
|
|
||||||
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status
|
|
||||||
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status
|
|
||||||
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status
|
|
||||||
bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status
|
|
||||||
|
|
||||||
# Use Mouse+$mod to drag floating windows to their wanted position
|
|
||||||
floating_modifier $mod
|
|
||||||
|
|
||||||
# move tiling windows via drag & drop by left-clicking into the title bar,
|
|
||||||
# or left-clicking anywhere into the window while holding the floating modifier.
|
|
||||||
tiling_drag modifier titlebar
|
|
||||||
|
|
||||||
# start a terminal
|
|
||||||
bindsym $mod+Return exec xterm
|
|
||||||
|
|
||||||
# kill focused window
|
|
||||||
bindsym $mod+Shift+c kill
|
|
||||||
|
|
||||||
|
|
||||||
bindsym $mod+c exec emacsclient -c -F '((name . "org-capture"))' -e '(org-capture)'
|
|
||||||
bindsym $mod+Escape exec emacsclient -nc
|
|
||||||
|
|
||||||
# start dmenu (a program launcher)
|
|
||||||
#bindsym $mod+r exec --no-startup-id dmenu_run
|
|
||||||
# A more modern dmenu replacement is rofi:
|
|
||||||
bindsym $mod+r exec "rofi -modi drun,run -show run"
|
|
||||||
#bind $mod+r exec "rofi -show run"
|
|
||||||
# There also is i3-dmenu-desktop which only displays applications shipping a
|
|
||||||
# .desktop file. It is a wrapper around dmenu, so you need that installed.
|
|
||||||
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
|
|
||||||
|
|
||||||
# change focus
|
|
||||||
bindsym $mod+h focus left
|
|
||||||
bindsym $mod+n focus down
|
|
||||||
bindsym $mod+p focus up
|
|
||||||
bindsym $mod+t focus right
|
|
||||||
|
|
||||||
# alternatively, you can use the cursor keys:
|
|
||||||
bindsym $mod+Left focus left
|
|
||||||
bindsym $mod+Down focus down
|
|
||||||
bindsym $mod+Up focus up
|
|
||||||
bindsym $mod+Right focus right
|
|
||||||
|
|
||||||
# move focused window
|
|
||||||
bindsym $mod+Shift+h move left
|
|
||||||
bindsym $mod+Shift+n move down
|
|
||||||
bindsym $mod+Shift+p move up
|
|
||||||
bindsym $mod+Shift+t move right
|
|
||||||
|
|
||||||
# alternatively, you can use the cursor keys:
|
|
||||||
bindsym $mod+Shift+Left move left
|
|
||||||
bindsym $mod+Shift+Down move down
|
|
||||||
bindsym $mod+Shift+Up move up
|
|
||||||
bindsym $mod+Shift+Right move right
|
|
||||||
|
|
||||||
# split in horizontal orientation
|
|
||||||
bindsym $mod+b split h
|
|
||||||
|
|
||||||
# split in vertical orientation
|
|
||||||
bindsym $mod+v split v
|
|
||||||
|
|
||||||
# enter fullscreen mode for the focused container
|
|
||||||
bindsym $mod+f fullscreen toggle
|
|
||||||
|
|
||||||
# change container layout (stacked, tabbed, toggle split)
|
|
||||||
bindsym $mod+s layout stacking
|
|
||||||
bindsym $mod+w layout tabbed
|
|
||||||
bindsym $mod+e layout toggle split
|
|
||||||
|
|
||||||
# toggle tiling / floating
|
|
||||||
bindsym $mod+Shift+space floating toggle
|
|
||||||
|
|
||||||
# change focus between tiling / floating windows
|
|
||||||
bindsym $mod+space focus mode_toggle
|
|
||||||
|
|
||||||
# focus the parent container
|
|
||||||
bindsym $mod+a focus parent
|
|
||||||
|
|
||||||
# focus the child container
|
|
||||||
#bindsym $mod+d focus child
|
|
||||||
|
|
||||||
# Define names for default workspaces for which we configure key bindings later on.
|
|
||||||
# We use variables to avoid repeating the names in multiple places.
|
|
||||||
set $ws1 "1"
|
|
||||||
set $ws2 "2"
|
|
||||||
set $ws3 "3"
|
|
||||||
set $ws4 "4"
|
|
||||||
set $ws5 "5"
|
|
||||||
set $ws6 "6"
|
|
||||||
set $ws7 "7"
|
|
||||||
set $ws8 "8"
|
|
||||||
set $ws9 "9"
|
|
||||||
set $ws10 "10"
|
|
||||||
|
|
||||||
#set $ws1 "1: dev1"
|
|
||||||
#set $ws2 "2: test1"
|
|
||||||
#set $ws3 "3: dev2"
|
|
||||||
#set $ws4 "4: test2"
|
|
||||||
#set $ws5 "5: dev3"
|
|
||||||
#set $ws6 "6: test3"
|
|
||||||
#set $ws7 "7: dev4"
|
|
||||||
#set $ws8 "8: test4"
|
|
||||||
#set $ws9 "9: www"
|
|
||||||
#set $ws10 "10: msg"
|
|
||||||
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "1" to "$ws1"'
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "2" to "$ws2"'
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "3" to "$ws3"'
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "4" to "$ws4"'
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "5" to "$ws5"'
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "6" to "$ws6"'
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "7" to "$ws7"'
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "8" to "$ws8"'
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "9" to "$ws9"'
|
|
||||||
exec --no-startup-id i3-msg 'rename workspace "10" to "$ws10"'
|
|
||||||
|
|
||||||
|
|
||||||
# switch to workspace
|
|
||||||
bindsym $mod+1 workspace number $ws1
|
|
||||||
bindsym $mod+2 workspace number $ws2
|
|
||||||
bindsym $mod+3 workspace number $ws3
|
|
||||||
bindsym $mod+4 workspace number $ws4
|
|
||||||
bindsym $mod+5 workspace number $ws5
|
|
||||||
bindsym $mod+6 workspace number $ws6
|
|
||||||
bindsym $mod+7 workspace number $ws7
|
|
||||||
bindsym $mod+8 workspace number $ws8
|
|
||||||
bindsym $mod+9 workspace number $ws9
|
|
||||||
bindsym $mod+0 workspace number $ws10
|
|
||||||
|
|
||||||
# move focused container to workspace
|
|
||||||
bindsym $mod+Shift+1 move container to workspace number $ws1
|
|
||||||
bindsym $mod+Shift+2 move container to workspace number $ws2
|
|
||||||
bindsym $mod+Shift+3 move container to workspace number $ws3
|
|
||||||
bindsym $mod+Shift+4 move container to workspace number $ws4
|
|
||||||
bindsym $mod+Shift+5 move container to workspace number $ws5
|
|
||||||
bindsym $mod+Shift+6 move container to workspace number $ws6
|
|
||||||
bindsym $mod+Shift+7 move container to workspace number $ws7
|
|
||||||
bindsym $mod+Shift+8 move container to workspace number $ws8
|
|
||||||
bindsym $mod+Shift+9 move container to workspace number $ws9
|
|
||||||
bindsym $mod+Shift+0 move container to workspace number $ws10
|
|
||||||
|
|
||||||
#scratchpad buffer
|
|
||||||
bindsym $mod+Shift+minus move scratchpad
|
|
||||||
bindsym $mod+minus scratchpad show
|
|
||||||
|
|
||||||
# reload the configuration file
|
|
||||||
bindsym $mod+Shift+r reload
|
|
||||||
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
|
||||||
bindsym $mod+Shift+backslash restart
|
|
||||||
# exit i3 (logs you out of your X session)
|
|
||||||
# bindsym $mod+Shift+q exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
|
|
||||||
bindsym $mod+Shift+q exec "i3-msg exit"
|
|
||||||
|
|
||||||
# resize window (you can also use the mouse for that)
|
|
||||||
mode "resize" {
|
|
||||||
# These bindings trigger as soon as you enter the resize mode
|
|
||||||
|
|
||||||
# Pressing left will shrink the window’s width.
|
|
||||||
# Pressing right will grow the window’s width.
|
|
||||||
# Pressing up will shrink the window’s height.
|
|
||||||
# Pressing down will grow the window’s height.
|
|
||||||
bindsym h resize shrink width 10 px or 10 ppt
|
|
||||||
bindsym p resize grow height 10 px or 10 ppt
|
|
||||||
bindsym n resize shrink height 10 px or 10 ppt
|
|
||||||
bindsym t resize grow width 10 px or 10 ppt
|
|
||||||
|
|
||||||
# same bindings, but for the arrow keys
|
|
||||||
bindsym Left resize shrink width 10 px or 10 ppt
|
|
||||||
bindsym Down resize grow height 10 px or 10 ppt
|
|
||||||
bindsym Up resize shrink height 10 px or 10 ppt
|
|
||||||
bindsym Right resize grow width 10 px or 10 ppt
|
|
||||||
|
|
||||||
# back to normal: Enter or Escape or $mod+r
|
|
||||||
bindsym Return mode "default"
|
|
||||||
bindsym Escape mode "default"
|
|
||||||
bindsym $mod+d mode "default"
|
|
||||||
}
|
|
||||||
|
|
||||||
bindsym $mod+d mode "resize"
|
|
||||||
|
|
||||||
# Start i3bar to display a workspace bar (plus the system information i3status
|
|
||||||
# finds out, if available)
|
|
||||||
bar {
|
|
||||||
status_command i3status
|
|
||||||
position top
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,402 @@
|
||||||
|
# An example configuration file for MPD.
|
||||||
|
# Read the user manual for documentation: http://www.musicpd.org/doc/user/
|
||||||
|
|
||||||
|
|
||||||
|
# Files and directories #######################################################
|
||||||
|
#
|
||||||
|
# This setting controls the top directory which MPD will search to discover the
|
||||||
|
# available audio files and add them to the daemon's online database. This
|
||||||
|
# setting defaults to the XDG directory, otherwise the music directory will be
|
||||||
|
# be disabled and audio files will only be accepted over ipc socket (using
|
||||||
|
# file:// protocol) or streaming files over an accepted protocol.
|
||||||
|
#
|
||||||
|
music_directory "$XDG_MUSIC_DIR"
|
||||||
|
#music_directory "~/music"
|
||||||
|
#
|
||||||
|
# This setting sets the MPD internal playlist directory. The purpose of this
|
||||||
|
# directory is storage for playlists created by MPD. The server will use
|
||||||
|
# playlist files not created by the server but only if they are in the MPD
|
||||||
|
# format. This setting defaults to playlist saving being disabled.
|
||||||
|
#
|
||||||
|
playlist_directory "$XDG_CONFIG_HOME/mpd/playlists"
|
||||||
|
#playlist_directory "~/.mpd/playlists"
|
||||||
|
#
|
||||||
|
# This setting sets the location of the MPD database. This file is used to
|
||||||
|
# load the database at server start up and store the database while the
|
||||||
|
# server is not up. This setting defaults to disabled which will allow
|
||||||
|
# MPD to accept files over ipc socket (using file:// protocol) or streaming
|
||||||
|
# files over an accepted protocol.
|
||||||
|
#
|
||||||
|
db_file "$XDG_CACHE_HOME/mpd/database"
|
||||||
|
#db_file "~/.mpd/database"
|
||||||
|
|
||||||
|
# These settings are the locations for the daemon log files for the daemon.
|
||||||
|
#
|
||||||
|
# The special value "syslog" makes MPD use the local syslog daemon. This
|
||||||
|
# setting defaults to logging to syslog.
|
||||||
|
#
|
||||||
|
# If you use systemd, do not configure a log_file. With systemd, MPD
|
||||||
|
# defaults to the systemd journal, which is fine.
|
||||||
|
#
|
||||||
|
log_file "$XDG_CACHE_HOME/mpd/log"
|
||||||
|
#log_file "~/.mpd/log"
|
||||||
|
|
||||||
|
# This setting sets the location of the file which stores the process ID
|
||||||
|
# for use of mpd --kill and some init scripts. This setting is disabled by
|
||||||
|
# default and the pid file will not be stored.
|
||||||
|
#
|
||||||
|
# If you use systemd, do not configure a pid_file.
|
||||||
|
#
|
||||||
|
pid_file "$XDG_RUNTIME_DIR/mpd/mpd.pid"
|
||||||
|
#pid_file "~/.mpd/pid"
|
||||||
|
|
||||||
|
# This setting sets the location of the file which contains information about
|
||||||
|
# most variables to get MPD back into the same general shape it was in before
|
||||||
|
# it was brought down. This setting is disabled by default and the server
|
||||||
|
# state will be reset on server start up.
|
||||||
|
#
|
||||||
|
state_file "$XDG_RUNTIME_DIR/mpd/state"
|
||||||
|
#state_file "~/.mpd/state"
|
||||||
|
#
|
||||||
|
# The location of the sticker database. This is a database which
|
||||||
|
# manages dynamic information attached to songs.
|
||||||
|
#
|
||||||
|
sticker_file "$XDG_CACHE_HOME/sticker.sql"
|
||||||
|
#sticker_file "~/.mpd/sticker.sql"
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# General music daemon options ################################################
|
||||||
|
#
|
||||||
|
# This setting specifies the user that MPD will run as. MPD should never run as
|
||||||
|
# root and you may use this setting to make MPD change its user ID after
|
||||||
|
# initialization. This setting is disabled by default and MPD is run as the
|
||||||
|
# current user.
|
||||||
|
#
|
||||||
|
#user "nobody"
|
||||||
|
#
|
||||||
|
# This setting specifies the group that MPD will run as. If not specified
|
||||||
|
# primary group of user specified with "user" setting will be used (if set).
|
||||||
|
# This is useful if MPD needs to be a member of group such as "audio" to
|
||||||
|
# have permission to use sound card.
|
||||||
|
#
|
||||||
|
#group "nogroup"
|
||||||
|
#
|
||||||
|
# This setting sets the address for the daemon to listen on. Careful attention
|
||||||
|
# should be paid if this is assigned to anything other than the default, any.
|
||||||
|
# This setting can deny access to control of the daemon. Not effective if
|
||||||
|
# systemd socket activation is in use.
|
||||||
|
#
|
||||||
|
# For network
|
||||||
|
#bind_to_address "any"
|
||||||
|
#
|
||||||
|
# And for Unix Socket
|
||||||
|
#bind_to_address "$XDG_RUNTIME_DIR/mpd/socket"
|
||||||
|
#bind_to_address "~/.mpd/socket"
|
||||||
|
#
|
||||||
|
# This setting is the TCP port that is desired for the daemon to get assigned
|
||||||
|
# to.
|
||||||
|
#
|
||||||
|
#port "6600"
|
||||||
|
#
|
||||||
|
# Suppress all messages below the given threshold. Use "verbose" for
|
||||||
|
# troubleshooting. Available setting arguments are "notice", "info", "verbose",
|
||||||
|
# "warning" and "error".
|
||||||
|
#
|
||||||
|
#log_level "notice"
|
||||||
|
#
|
||||||
|
# Setting "restore_paused" to "yes" puts MPD into pause mode instead
|
||||||
|
# of starting playback after startup.
|
||||||
|
#
|
||||||
|
#restore_paused "no"
|
||||||
|
#
|
||||||
|
# This setting enables MPD to create playlists in a format usable by other
|
||||||
|
# music players.
|
||||||
|
#
|
||||||
|
save_absolute_paths_in_playlists "no"
|
||||||
|
#
|
||||||
|
# This setting defines a list of tag types that will be extracted during the
|
||||||
|
# audio file discovery process. The complete list of possible values can be
|
||||||
|
# found in the user manual.
|
||||||
|
#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc"
|
||||||
|
#
|
||||||
|
# This example just enables the "comment" tag without disabling all
|
||||||
|
# the other supported tags:
|
||||||
|
#metadata_to_use "+comment"
|
||||||
|
#
|
||||||
|
# This setting enables automatic update of MPD's database when files in
|
||||||
|
# music_directory are changed. (Linux only)
|
||||||
|
#
|
||||||
|
auto_update "yes"
|
||||||
|
#
|
||||||
|
# Limit the depth of the directories being watched, 0 means only watch
|
||||||
|
# the music directory itself. There is no limit by default.
|
||||||
|
#
|
||||||
|
#auto_update_depth "3"
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# Symbolic link behavior ######################################################
|
||||||
|
#
|
||||||
|
# If this setting is set to "yes", MPD will discover audio files by following
|
||||||
|
# symbolic links outside of the configured music_directory.
|
||||||
|
#
|
||||||
|
#follow_outside_symlinks "yes"
|
||||||
|
#
|
||||||
|
# If this setting is set to "yes", MPD will discover audio files by following
|
||||||
|
# symbolic links inside of the configured music_directory.
|
||||||
|
#
|
||||||
|
follow_inside_symlinks "yes"
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# Zeroconf / Avahi Service Discovery ##########################################
|
||||||
|
#
|
||||||
|
# If this setting is set to "yes", service information will be published with
|
||||||
|
# Zeroconf / Avahi.
|
||||||
|
#
|
||||||
|
#zeroconf_enabled "yes"
|
||||||
|
#
|
||||||
|
# The argument to this setting will be the Zeroconf / Avahi unique name for
|
||||||
|
# this MPD server on the network. %h will be replaced with the hostname.
|
||||||
|
#
|
||||||
|
#zeroconf_name "Music Player @ %h"
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# Permissions #################################################################
|
||||||
|
#
|
||||||
|
# If this setting is set, MPD will require password authorization. The password
|
||||||
|
# setting can be specified multiple times for different password profiles.
|
||||||
|
#
|
||||||
|
#password "password@read,add,control,admin"
|
||||||
|
#
|
||||||
|
# This setting specifies the permissions a user has who has not yet logged in.
|
||||||
|
#
|
||||||
|
#default_permissions "read,add,control,admin"
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# Database #######################################################################
|
||||||
|
#
|
||||||
|
# An example of a database section instead of the old 'db_file' setting.
|
||||||
|
# It enables mounting other storages into the music directory.
|
||||||
|
#
|
||||||
|
#database {
|
||||||
|
# plugin "simple"
|
||||||
|
# path "~/.local/share/mpd/db"
|
||||||
|
# cache_directory "~/.local/share/mpd/cache"
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of database config for a satellite setup
|
||||||
|
#
|
||||||
|
#music_directory "nfs://fileserver.local/srv/mp3"
|
||||||
|
#database {
|
||||||
|
# plugin "proxy"
|
||||||
|
# host "other.mpd.host"
|
||||||
|
# port "6600"
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Input #######################################################################
|
||||||
|
#
|
||||||
|
input {
|
||||||
|
plugin "curl"
|
||||||
|
# proxy "proxy.isp.com:8080"
|
||||||
|
# proxy_user "user"
|
||||||
|
# proxy_password "password"
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Audio Output ################################################################
|
||||||
|
#
|
||||||
|
# MPD supports various audio output types, as well as playing through multiple
|
||||||
|
# audio outputs at the same time, through multiple audio_output settings
|
||||||
|
# blocks. Setting this block is optional, though the server will only attempt
|
||||||
|
# autodetection for one sound card.
|
||||||
|
#
|
||||||
|
# An example of an ALSA output:
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "alsa"
|
||||||
|
# name "My ALSA Device"
|
||||||
|
## device "hw:0,0" # optional
|
||||||
|
## mixer_type "hardware" # optional
|
||||||
|
## mixer_device "default" # optional
|
||||||
|
## mixer_control "PCM" # optional
|
||||||
|
## mixer_index "0" # optional
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of an OSS output:
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "oss"
|
||||||
|
# name "My OSS Device"
|
||||||
|
## device "/dev/dsp" # optional
|
||||||
|
## mixer_type "hardware" # optional
|
||||||
|
## mixer_device "/dev/mixer" # optional
|
||||||
|
## mixer_control "PCM" # optional
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of a shout output (for streaming to Icecast):
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "shout"
|
||||||
|
# encoder "vorbis" # optional
|
||||||
|
# name "My Shout Stream"
|
||||||
|
# host "localhost"
|
||||||
|
# port "8000"
|
||||||
|
# mount "/mpd.ogg"
|
||||||
|
# password "hackme"
|
||||||
|
# quality "5.0"
|
||||||
|
# bitrate "128"
|
||||||
|
# format "44100:16:1"
|
||||||
|
## protocol "icecast2" # optional
|
||||||
|
## user "source" # optional
|
||||||
|
## description "My Stream Description" # optional
|
||||||
|
## url "http://example.com" # optional
|
||||||
|
## genre "jazz" # optional
|
||||||
|
## public "no" # optional
|
||||||
|
## timeout "2" # optional
|
||||||
|
## mixer_type "software" # optional
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of a recorder output:
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "recorder"
|
||||||
|
# name "My recorder"
|
||||||
|
# encoder "vorbis" # optional, vorbis or lame
|
||||||
|
# path "/var/lib/mpd/recorder/mpd.ogg"
|
||||||
|
## quality "5.0" # do not define if bitrate is defined
|
||||||
|
# bitrate "128" # do not define if quality is defined
|
||||||
|
# format "44100:16:1"
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of a httpd output (built-in HTTP streaming server):
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "httpd"
|
||||||
|
# name "My HTTP Stream"
|
||||||
|
# encoder "vorbis" # optional, vorbis or lame
|
||||||
|
# port "8000"
|
||||||
|
# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6
|
||||||
|
## quality "5.0" # do not define if bitrate is defined
|
||||||
|
# bitrate "128" # do not define if quality is defined
|
||||||
|
# format "44100:16:1"
|
||||||
|
# max_clients "0" # optional 0=no limit
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of a pulseaudio output (streaming to a remote pulseaudio server)
|
||||||
|
#
|
||||||
|
audio_output {
|
||||||
|
type "pulse"
|
||||||
|
name "My Pulse Output"
|
||||||
|
## server "remote_server" # optional
|
||||||
|
## sink "remote_server_sink" # optional
|
||||||
|
## media_role "media_role" #optional
|
||||||
|
}
|
||||||
|
#
|
||||||
|
# An example of a winmm output (Windows multimedia API).
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "winmm"
|
||||||
|
# name "My WinMM output"
|
||||||
|
## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
|
||||||
|
# or
|
||||||
|
## device "0" # optional
|
||||||
|
## mixer_type "hardware" # optional
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of a wasapi output (Windows multimedia API).
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "wasapi"
|
||||||
|
# name "My WASAPI output"
|
||||||
|
## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
|
||||||
|
# or
|
||||||
|
## device "0" # optional
|
||||||
|
## mixer_type "hardware" # optional
|
||||||
|
## Exclusive mode blocks all other audio source, and get best audio quality without resampling.
|
||||||
|
## exclusive "no" # optional
|
||||||
|
## Enumerate all devices in log.
|
||||||
|
## enumerate "no" # optional
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of an openal output.
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "openal"
|
||||||
|
# name "My OpenAL output"
|
||||||
|
## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of an sndio output.
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "sndio"
|
||||||
|
# name "sndio output"
|
||||||
|
# mixer_type "hardware"
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
# An example of an OS X output:
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "osx"
|
||||||
|
# name "My OS X Device"
|
||||||
|
## device "Built-in Output" # optional
|
||||||
|
## channel_map "-1,-1,0,1" # optional
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
## Example "pipe" output:
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "pipe"
|
||||||
|
# name "my pipe"
|
||||||
|
# command "aplay -f cd 2>/dev/null"
|
||||||
|
## Or if you're want to use AudioCompress
|
||||||
|
# command "AudioCompress -m | aplay -f cd 2>/dev/null"
|
||||||
|
## Or to send raw PCM stream through PCM:
|
||||||
|
# command "nc example.org 8765"
|
||||||
|
# format "44100:16:2"
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
## An example of a null output (for no audio output):
|
||||||
|
#
|
||||||
|
#audio_output {
|
||||||
|
# type "null"
|
||||||
|
# name "My Null Output"
|
||||||
|
# mixer_type "none" # optional
|
||||||
|
#}
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# Normalization automatic volume adjustments ##################################
|
||||||
|
#
|
||||||
|
# This setting specifies the type of ReplayGain to use. This setting can have
|
||||||
|
# the argument "off", "album", "track" or "auto". "auto" is a special mode that
|
||||||
|
# chooses between "track" and "album" depending on the current state of
|
||||||
|
# random playback. If random playback is enabled then "track" mode is used.
|
||||||
|
# See <https://wiki.hydrogenaud.io/index.php?title=Replaygain> for
|
||||||
|
# more details about ReplayGain.
|
||||||
|
# This setting is off by default.
|
||||||
|
#
|
||||||
|
#replaygain "album"
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
||||||
|
# Character Encoding ##########################################################
|
||||||
|
#
|
||||||
|
# If file or directory names do not display correctly for your locale then you
|
||||||
|
# may need to modify this setting.
|
||||||
|
#
|
||||||
|
#filesystem_charset "UTF-8"
|
||||||
|
#
|
||||||
|
###############################################################################
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
|
||||||
|
//@theme "/usr/local/share/rofi/themes/fancy.rasi"
|
||||||
|
|
||||||
|
@theme "/usr/share/rofi/themes/fancy.rasi"
|
||||||
|
|
@ -0,0 +1,129 @@
|
||||||
|
# Read `man 5 sway` for a complete reference.
|
||||||
|
|
||||||
|
### Variables
|
||||||
|
set $mod Mod4
|
||||||
|
set $left h
|
||||||
|
set $down n
|
||||||
|
set $up p
|
||||||
|
set $right t
|
||||||
|
set $term 9term
|
||||||
|
set $menu wmenu-run
|
||||||
|
|
||||||
|
### Output configuration
|
||||||
|
output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
|
||||||
|
|
||||||
|
### Input configuration
|
||||||
|
input * {
|
||||||
|
dwt enabled
|
||||||
|
}
|
||||||
|
input "type:keyboard" {
|
||||||
|
xkb_layout us
|
||||||
|
xkb_variant dvorak
|
||||||
|
xkb_options compose:ralt
|
||||||
|
}
|
||||||
|
input "type:touchpad" {
|
||||||
|
natural_scroll enabled
|
||||||
|
dwt disabled
|
||||||
|
drag enabled
|
||||||
|
drag_lock enabled
|
||||||
|
middle_emulation enabled
|
||||||
|
tap disabled # Disable tap to prevent accidental clicks in Emacs
|
||||||
|
}
|
||||||
|
input "type:pointer" {
|
||||||
|
natural_scroll disabled
|
||||||
|
}
|
||||||
|
|
||||||
|
# Startup applications
|
||||||
|
exec waybar &
|
||||||
|
exec swaybg -i /home/lkn/img/bg/nixos-asciiart.png
|
||||||
|
exec /usr/lib/polkit-kde-authentication-agent-1 &
|
||||||
|
exec wlr-randr --output eDP-1 --scale 1.25
|
||||||
|
exec plumber
|
||||||
|
exec plumber -n 1
|
||||||
|
exec plumber -n 2
|
||||||
|
exec plumber -n 3
|
||||||
|
exec plumber -n 4
|
||||||
|
exec plumber -n 5
|
||||||
|
exec plumber -n 6
|
||||||
|
exec plumber -n 7
|
||||||
|
exec plumber -n 8
|
||||||
|
exec plumber -n 9
|
||||||
|
|
||||||
|
# Keybindings
|
||||||
|
bindsym $mod+Return exec $term
|
||||||
|
bindsym $mod+Shift+c kill
|
||||||
|
bindsym $mod+Shift+s exec grim -g "$(slurp)"
|
||||||
|
bindsym $mod+r exec rofi -show run | xargs swaymsg exec --
|
||||||
|
bindsym $mod+space exec rofi -show drun | xargs swaymsg exec --
|
||||||
|
bindsym $mod+Shift+l exec swaylock
|
||||||
|
bindsym $mod+Shift+q exec swaymsg exit
|
||||||
|
bindsym $mod+h focus left
|
||||||
|
bindsym $mod+t focus right
|
||||||
|
bindsym $mod+p focus up
|
||||||
|
bindsym $mod+n focus down
|
||||||
|
bindsym $mod+Shift+h move left
|
||||||
|
bindsym $mod+Shift+t move right
|
||||||
|
bindsym $mod+Shift+p move up
|
||||||
|
bindsym $mod+Shift+n move down
|
||||||
|
bindsym $mod+1 workspace number 1
|
||||||
|
bindsym $mod+2 workspace number 2
|
||||||
|
bindsym $mod+3 workspace number 3
|
||||||
|
bindsym $mod+4 workspace number 4
|
||||||
|
bindsym $mod+5 workspace number 5
|
||||||
|
bindsym $mod+6 workspace number 6
|
||||||
|
bindsym $mod+7 workspace number 7
|
||||||
|
bindsym $mod+8 workspace number 8
|
||||||
|
bindsym $mod+9 workspace number 9
|
||||||
|
bindsym $mod+0 workspace number 10
|
||||||
|
bindsym $mod+Shift+1 move container to workspace number 1
|
||||||
|
bindsym $mod+Shift+2 move container to workspace number 2
|
||||||
|
bindsym $mod+Shift+3 move container to workspace number 3
|
||||||
|
bindsym $mod+Shift+4 move container to workspace number 4
|
||||||
|
bindsym $mod+Shift+5 move container to workspace number 5
|
||||||
|
bindsym $mod+Shift+6 move container to workspace number 6
|
||||||
|
bindsym $mod+Shift+7 move container to workspace number 7
|
||||||
|
bindsym $mod+Shift+8 move container to workspace number 8
|
||||||
|
bindsym $mod+Shift+9 move container to workspace number 9
|
||||||
|
bindsym $mod+Shift+0 move container to workspace number 10
|
||||||
|
bindsym $mod+b splith
|
||||||
|
bindsym $mod+v splitv
|
||||||
|
bindsym $mod+s layout stacking
|
||||||
|
bindsym $mod+w layout tabbed
|
||||||
|
bindsym $mod+e layout toggle split
|
||||||
|
bindsym $mod+f fullscreen
|
||||||
|
bindsym $mod+Shift+space floating toggle
|
||||||
|
bindsym $mod+Shift+f focus mode_toggle
|
||||||
|
bindsym $mod+a focus parent
|
||||||
|
bindsym $mod+Shift+minus move scratchpad
|
||||||
|
bindsym $mod+minus scratchpad show
|
||||||
|
bindsym XF86MonBrightnessDown exec light -U 10
|
||||||
|
bindsym XF86MonBrightnessUp exec light -A 10
|
||||||
|
bindsym XF86TouchpadToggle input type:touchpad events toggle
|
||||||
|
|
||||||
|
# Resize Mode
|
||||||
|
mode "resize" {
|
||||||
|
bindsym $left resize shrink width 10px
|
||||||
|
bindsym $down resize grow height 10px
|
||||||
|
bindsym $up resize shrink height 10px
|
||||||
|
bindsym $right resize grow width 10px
|
||||||
|
bindsym Left resize shrink width 10px
|
||||||
|
bindsym Down resize grow height 10px
|
||||||
|
bindsym Up resize shrink height 10px
|
||||||
|
bindsym Right resize grow width 10px
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
}
|
||||||
|
bindsym $mod+d mode "resize"
|
||||||
|
|
||||||
|
# Utilities
|
||||||
|
bindsym --locked XF86AudioMute exec pactl set-sink-mute \@DEFAULT_SINK@ toggle
|
||||||
|
bindsym --locked XF86AudioLowerVolume exec pactl set-sink-volume \@DEFAULT_SINK@ -5%
|
||||||
|
bindsym --locked XF86AudioRaiseVolume exec pactl set-sink-volume \@DEFAULT_SINK@ +5%
|
||||||
|
bindsym --locked XF86AudioMicMute exec pactl set-source-mute \@DEFAULT_SOURCE@ toggle
|
||||||
|
bindsym --locked XF86MonBrightnessDown exec brightnessctl set 5%-
|
||||||
|
bindsym --locked XF86MonBrightnessUp exec brightnessctl set 5%+
|
||||||
|
bindsym Print exec grim
|
||||||
|
|
||||||
|
floating_modifier $mod normal
|
||||||
|
|
||||||
|
include /etc/sway/config.d/*
|
||||||
|
|
@ -0,0 +1,219 @@
|
||||||
|
// -*- mode: jsonc -*-
|
||||||
|
{
|
||||||
|
// "layer": "top", // Waybar at top layer
|
||||||
|
// "position": "bottom", // Waybar position (top|bottom|left|right)
|
||||||
|
"height": 30, // Waybar height (to be removed for auto height)
|
||||||
|
// "width": 1280, // Waybar width
|
||||||
|
"spacing": 4, // Gaps between modules (4px)
|
||||||
|
// Choose the order of the modules
|
||||||
|
"modules-left": [
|
||||||
|
"sway/workspaces",
|
||||||
|
"hyprland/workspaces",
|
||||||
|
"sway/mode",
|
||||||
|
"sway/scratchpad"
|
||||||
|
],
|
||||||
|
"modules-center": [
|
||||||
|
"hyprland/window"
|
||||||
|
],
|
||||||
|
"modules-right": [
|
||||||
|
"idle_inhibitor",
|
||||||
|
"pulseaudio",
|
||||||
|
"network",
|
||||||
|
"power-profiles-daemon",
|
||||||
|
"cpu",
|
||||||
|
"memory",
|
||||||
|
"temperature",
|
||||||
|
"backlight",
|
||||||
|
"sway/language",
|
||||||
|
"battery",
|
||||||
|
"clock",
|
||||||
|
"tray"
|
||||||
|
],
|
||||||
|
"hyprland/workspaces": {
|
||||||
|
"format": "{icon}",
|
||||||
|
"on-scroll-up": "hyprctl dispatch workspace e+1",
|
||||||
|
"on-scroll-down": "hyprctl dispatch workspace e-1"
|
||||||
|
},
|
||||||
|
"hyprland/window": {
|
||||||
|
"separate-outputs": true
|
||||||
|
},
|
||||||
|
// Modules configuration
|
||||||
|
"sway/workspaces": {
|
||||||
|
"disable-scroll": true,
|
||||||
|
"all-outputs": true,
|
||||||
|
"warp-on-scroll": false,
|
||||||
|
"format": "{name}: {icon}",
|
||||||
|
"format-icons": {
|
||||||
|
"1": "",
|
||||||
|
"2": "",
|
||||||
|
"3": "",
|
||||||
|
"4": "",
|
||||||
|
"5": "",
|
||||||
|
"urgent": "",
|
||||||
|
"focused": "",
|
||||||
|
"default": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"keyboard-state": {
|
||||||
|
"numlock": true,
|
||||||
|
"capslock": true,
|
||||||
|
"format": "{name} {icon}",
|
||||||
|
"format-icons": {
|
||||||
|
"locked": "",
|
||||||
|
"unlocked": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sway/mode": {
|
||||||
|
"format": "<span style=\"italic\">{}</span>"
|
||||||
|
},
|
||||||
|
"sway/scratchpad": {
|
||||||
|
"format": "{icon} {count}",
|
||||||
|
"show-empty": false,
|
||||||
|
"format-icons": ["", ""],
|
||||||
|
"tooltip": true,
|
||||||
|
"tooltip-format": "{app}: {title}"
|
||||||
|
},
|
||||||
|
"mpd": {
|
||||||
|
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ⸨{songPosition}|{queueLength}⸩ {volume}% ",
|
||||||
|
"format-disconnected": "Disconnected ",
|
||||||
|
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ",
|
||||||
|
"unknown-tag": "N/A",
|
||||||
|
"interval": 5,
|
||||||
|
"consume-icons": {
|
||||||
|
"on": " "
|
||||||
|
},
|
||||||
|
"random-icons": {
|
||||||
|
"off": "<span color=\"#f53c3c\"></span> ",
|
||||||
|
"on": " "
|
||||||
|
},
|
||||||
|
"repeat-icons": {
|
||||||
|
"on": " "
|
||||||
|
},
|
||||||
|
"single-icons": {
|
||||||
|
"on": "1 "
|
||||||
|
},
|
||||||
|
"state-icons": {
|
||||||
|
"paused": "",
|
||||||
|
"playing": ""
|
||||||
|
},
|
||||||
|
"tooltip-format": "MPD (connected)",
|
||||||
|
"tooltip-format-disconnected": "MPD (disconnected)"
|
||||||
|
},
|
||||||
|
"idle_inhibitor": {
|
||||||
|
"format": "{icon}",
|
||||||
|
"format-icons": {
|
||||||
|
"activated": "",
|
||||||
|
"deactivated": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tray": {
|
||||||
|
// "icon-size": 21,
|
||||||
|
"spacing": 10
|
||||||
|
},
|
||||||
|
"clock": {
|
||||||
|
// "timezone": "America/New_York",
|
||||||
|
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
|
||||||
|
"format-alt": "{:%Y-%m-%d}"
|
||||||
|
},
|
||||||
|
"cpu": {
|
||||||
|
"format": "{usage}% ",
|
||||||
|
"tooltip": false
|
||||||
|
},
|
||||||
|
"memory": {
|
||||||
|
"format": "{}% "
|
||||||
|
},
|
||||||
|
"temperature": {
|
||||||
|
// "thermal-zone": 2,
|
||||||
|
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
|
||||||
|
"critical-threshold": 80,
|
||||||
|
// "format-critical": "{temperatureC}°C {icon}",
|
||||||
|
"format": "{temperatureC}°C {icon}",
|
||||||
|
"format-icons": ["", "", ""]
|
||||||
|
},
|
||||||
|
"backlight": {
|
||||||
|
// "device": "acpi_video1",
|
||||||
|
"format": "{percent}% {icon}",
|
||||||
|
"format-icons": ["🌑", "🌘", "🌗", "🌖", "🌕"]
|
||||||
|
},
|
||||||
|
"battery": {
|
||||||
|
"states": {
|
||||||
|
// "good": 95,
|
||||||
|
"warning": 30,
|
||||||
|
"critical": 15
|
||||||
|
},
|
||||||
|
"format": "{capacity}% {icon}",
|
||||||
|
"format-full": "{capacity}% {icon}",
|
||||||
|
"format-charging": "{capacity}% ",
|
||||||
|
"format-plugged": "{capacity}% ",
|
||||||
|
"format-alt": "{time} {icon}",
|
||||||
|
// "format-good": "", // An empty format will hide the module
|
||||||
|
// "format-full": "",
|
||||||
|
"format-icons": ["", "", "", "", ""]
|
||||||
|
},
|
||||||
|
"battery#bat2": {
|
||||||
|
"bat": "BAT2"
|
||||||
|
},
|
||||||
|
"power-profiles-daemon": {
|
||||||
|
"format": "{icon}",
|
||||||
|
"tooltip-format": "Power profile: {profile}\nDriver: {driver}",
|
||||||
|
"tooltip": true,
|
||||||
|
"format-icons": {
|
||||||
|
"default": "",
|
||||||
|
"performance": "",
|
||||||
|
"balanced": "",
|
||||||
|
"power-saver": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"network": {
|
||||||
|
// "interface": "wlp2*", // (Optional) To force the use of this interface
|
||||||
|
"format-wifi": "{essid} ({signalStrength}%) ",
|
||||||
|
"format-ethernet": "{ipaddr}/{cidr} ",
|
||||||
|
"tooltip-format": "{ifname} via {gwaddr} ",
|
||||||
|
"format-linked": "{ifname} (No IP) ",
|
||||||
|
"format-disconnected": "Disconnected ⚠",
|
||||||
|
"format-alt": "{ifname}: {ipaddr}/{cidr}"
|
||||||
|
},
|
||||||
|
"pulseaudio": {
|
||||||
|
// "scroll-step": 1, // %, can be a float
|
||||||
|
"format": "{volume}% {icon} {format_source}",
|
||||||
|
"format-bluetooth": "{volume}% {icon} {format_source}",
|
||||||
|
"format-bluetooth-muted": " {icon} {format_source}",
|
||||||
|
"format-muted": " {format_source}",
|
||||||
|
"format-source": "{volume}% ",
|
||||||
|
"format-source-muted": "",
|
||||||
|
"format-icons": {
|
||||||
|
"headphone": "",
|
||||||
|
"hands-free": "",
|
||||||
|
"headset": "",
|
||||||
|
"phone": "",
|
||||||
|
"portable": "",
|
||||||
|
"car": "",
|
||||||
|
"default": ["", "", ""]
|
||||||
|
},
|
||||||
|
"on-click": "pavucontrol"
|
||||||
|
},
|
||||||
|
"custom/media": {
|
||||||
|
"format": "{icon} {text}",
|
||||||
|
"return-type": "json",
|
||||||
|
"max-length": 40,
|
||||||
|
"format-icons": {
|
||||||
|
"spotify": "",
|
||||||
|
"default": "🎜"
|
||||||
|
},
|
||||||
|
"escape": true,
|
||||||
|
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
|
||||||
|
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
|
||||||
|
},
|
||||||
|
"custom/power": {
|
||||||
|
"format" : "⏻ ",
|
||||||
|
"tooltip": false,
|
||||||
|
"menu": "on-click",
|
||||||
|
"menu-file": "$HOME/.config/waybar/power_menu.xml", // Menu file in resources folder
|
||||||
|
"menu-actions": {
|
||||||
|
"shutdown": "shutdown",
|
||||||
|
"reboot": "reboot",
|
||||||
|
"suspend": "systemctl suspend",
|
||||||
|
"hibernate": "systemctl hibernate"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
@define-color rosewater #f2d5cf;
|
||||||
|
@define-color flamingo #eebebe;
|
||||||
|
@define-color pink #f4b8e4;
|
||||||
|
@define-color mauve #ca9ee6;
|
||||||
|
@define-color red #e78284;
|
||||||
|
@define-color maroon #ea999c;
|
||||||
|
@define-color peach #ef9f76;
|
||||||
|
@define-color yellow #e5c890;
|
||||||
|
@define-color green #a6d189;
|
||||||
|
@define-color teal #81c8be;
|
||||||
|
@define-color sky #99d1db;
|
||||||
|
@define-color sapphire #85c1dc;
|
||||||
|
@define-color blue #8caaee;
|
||||||
|
@define-color lavender #babbf1;
|
||||||
|
@define-color text #c6d0f5;
|
||||||
|
@define-color subtext1 #b5bfe2;
|
||||||
|
@define-color subtext0 #a5adce;
|
||||||
|
@define-color overlay2 #949cbb;
|
||||||
|
@define-color overlay1 #838ba7;
|
||||||
|
@define-color overlay0 #737994;
|
||||||
|
@define-color surface2 #626880;
|
||||||
|
@define-color surface1 #51576d;
|
||||||
|
@define-color surface0 #414559;
|
||||||
|
@define-color base #303446;
|
||||||
|
@define-color mantle #292c3c;
|
||||||
|
@define-color crust #232634;
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
@define-color rosewater #dc8a78;
|
||||||
|
@define-color flamingo #dd7878;
|
||||||
|
@define-color pink #ea76cb;
|
||||||
|
@define-color mauve #8839ef;
|
||||||
|
@define-color red #d20f39;
|
||||||
|
@define-color maroon #e64553;
|
||||||
|
@define-color peach #fe640b;
|
||||||
|
@define-color yellow #df8e1d;
|
||||||
|
@define-color green #40a02b;
|
||||||
|
@define-color teal #179299;
|
||||||
|
@define-color sky #04a5e5;
|
||||||
|
@define-color sapphire #209fb5;
|
||||||
|
@define-color blue #1e66f5;
|
||||||
|
@define-color lavender #7287fd;
|
||||||
|
@define-color text #4c4f69;
|
||||||
|
@define-color subtext1 #5c5f77;
|
||||||
|
@define-color subtext0 #6c6f85;
|
||||||
|
@define-color overlay2 #7c7f93;
|
||||||
|
@define-color overlay1 #8c8fa1;
|
||||||
|
@define-color overlay0 #9ca0b0;
|
||||||
|
@define-color surface2 #acb0be;
|
||||||
|
@define-color surface1 #bcc0cc;
|
||||||
|
@define-color surface0 #ccd0da;
|
||||||
|
@define-color base #eff1f5;
|
||||||
|
@define-color mantle #e6e9ef;
|
||||||
|
@define-color crust #dce0e8;
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
@define-color rosewater #f4dbd6;
|
||||||
|
@define-color flamingo #f0c6c6;
|
||||||
|
@define-color pink #f5bde6;
|
||||||
|
@define-color mauve #c6a0f6;
|
||||||
|
@define-color red #ed8796;
|
||||||
|
@define-color maroon #ee99a0;
|
||||||
|
@define-color peach #f5a97f;
|
||||||
|
@define-color yellow #eed49f;
|
||||||
|
@define-color green #a6da95;
|
||||||
|
@define-color teal #8bd5ca;
|
||||||
|
@define-color sky #91d7e3;
|
||||||
|
@define-color sapphire #7dc4e4;
|
||||||
|
@define-color blue #8aadf4;
|
||||||
|
@define-color lavender #b7bdf8;
|
||||||
|
@define-color text #cad3f5;
|
||||||
|
@define-color subtext1 #b8c0e0;
|
||||||
|
@define-color subtext0 #a5adcb;
|
||||||
|
@define-color overlay2 #939ab7;
|
||||||
|
@define-color overlay1 #8087a2;
|
||||||
|
@define-color overlay0 #6e738d;
|
||||||
|
@define-color surface2 #5b6078;
|
||||||
|
@define-color surface1 #494d64;
|
||||||
|
@define-color surface0 #363a4f;
|
||||||
|
@define-color base #24273a;
|
||||||
|
@define-color mantle #1e2030;
|
||||||
|
@define-color crust #181926;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue