;;; init.el --- bandali's emacs configuration -*- lexical-binding: t -*-
-;; Copyright (C) 2018-2021 Amin Bandali <bandali@gnu.org>
+;; Copyright (C) 2018-2022 Amin Bandali <bandali@gnu.org>
;; 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
user-mail-address "bandali@gnu.org")
\f
-;;; csetq (`custom' setq)
-
-(require 'cl-lib)
-
-(defmacro csetq (&rest args)
- "Set the value of user option VAR to VALUE.
-
-More generally, you can use multiple variables and values, as in
- (csetq VAR VALUE VAR VALUE...)
-This sets each user option VAR's value to the corresponding VALUE.
-
-\(fn [VAR VALUE]...)"
- (declare (debug setq))
- `(progn
- ,@(cl-loop for (var value) on args by 'cddr
- collect
- `(funcall (or (get ',var 'custom-set) #'set-default)
- ',var ,value))))
-
-\f
;;; Package management
;; variables of interest:
;; (package-generate-description-file d "refinery-theme-pkg.el"))
(run-with-idle-timer 0.01 nil #'require 'package)
(with-eval-after-load 'package
- ;; (csetq
+ ;; (setq
;; ;; package-archives
;; ;; `(,@package-archives
;; ;; ("bndl" . "https://p.bndl.org/elpa/"))
;; (yasnippet "0.14.0")))
(package-initialize))
-(csetq package-archive-upload-base "/ssh:caffeine:~/www/p/elpa")
+(setq package-archive-upload-base "/ssh:caffeine:~/www/p/elpa")
\f
;;; Initial setup
"Expand filename FILE relative to `b/lisp-dir'."
(expand-file-name (convert-standard-filename file) b/lisp-dir))
-(csetq
+(setq
auto-save-list-file-prefix (b/var "auto-save/sessions/")
nsm-settings-file (b/var "nsm-settings.el"))
;;;; C-level customizations
-(csetq
+(setq
;; line-spacing 3
;; completion case sensitivity
completion-ignore-case t
;; (define-key icomplete-fido-mode-map
;; (kbd "DEL") #'b/icomplete-fido-backward-updir))
-;; (with-eval-after-load 'subr
-;; (keyboard-translate ?\( ?\[)
-;; (keyboard-translate ?\) ?\])
-;; (keyboard-translate ?\[ ?\()
-;; (keyboard-translate ?\] ?\))
-
-;; ;; (keyboard-translate ?\( ?\()
-;; ;; (keyboard-translate ?\) ?\))
-;; ;; (keyboard-translate ?\[ ?\[)
-;; ;; (keyboard-translate ?\] ?\])
-;; )
+;; subr
+;; (keyboard-translate ?\( ?\[)
+;; (keyboard-translate ?\) ?\])
+;; (keyboard-translate ?\[ ?\()
+;; (keyboard-translate ?\] ?\))
;; minibuffer
-(csetq read-file-name-completion-ignore-case t)
+(setq read-file-name-completion-ignore-case t)
;; startup
;; don't need to see the startup echo area message
(advice-add #'display-startup-echo-area-message :override #'ignore)
-(csetq
+(setq
;; i want *scratch* as my startup buffer
initial-buffer-choice t
;; i don't need the default hint
inhibit-startup-echo-area-message user-login-name)
;; files
-(csetq
+(setq
;; backups (C-h v make-backup-files RET)
backup-by-copying t
backup-directory-alist (list (cons "." (b/var "backup/")))
;; novice
;; disable disabled commands
-(csetq disabled-command-function nil)
+(setq disabled-command-function nil)
;; lazy-person-friendly yes/no prompts
(defalias 'yes-or-no-p #'y-or-n-p)
;; autorevert: enable automatic reloading of changed buffers and files
-(csetq auto-revert-verbose nil
- global-auto-revert-non-file-buffers nil)
+(setq
+ ;; auto-revert-verbose nil
+ global-auto-revert-non-file-buffers nil)
(require 'autorevert)
(global-auto-revert-mode 1)
;; time and battery in mode-line
(run-with-idle-timer 0.1 nil #'require 'time)
(with-eval-after-load 'time
- (csetq
+ (setq
display-time-default-load-average nil
display-time-format " %a %b %-e %-l:%M%P"
display-time-mail-icon '(image :type xpm
(run-with-idle-timer 0.1 nil #'require 'battery)
(with-eval-after-load 'battery
- (csetq battery-mode-line-format " %p%% %t")
+ (setq battery-mode-line-format " %p%% %t")
(display-battery-mode))
;; (with-eval-after-load 'fringe
(run-with-idle-timer 0.1 nil #'require 'windmove)
(with-eval-after-load 'windmove
- (csetq windmove-wrap-around t)
+ (setq windmove-wrap-around t)
(global-set-key (kbd "M-H") #'windmove-left)
(global-set-key (kbd "M-L") #'windmove-right)
(global-set-key (kbd "M-K") #'windmove-up)
(ad-activate 'compilation-start))
;; isearch
-(csetq
+(setq
;; allow scrolling in Isearch
isearch-allow-scroll t
isearch-lazy-count t
;; replace
;; uncomment to extend the above behaviour to query-replace
-;; (csetq replace-char-fold t)
+;; (setq replace-char-fold t)
;; vc
(global-set-key (kbd "C-x v C-=") #'vc-ediff)
(with-eval-after-load 'vc-git
- (csetq vc-git-print-log-follow t
- vc-git-show-stash 0))
+ (setq vc-git-print-log-follow t
+ vc-git-show-stash 0))
-(csetq ediff-window-setup-function 'ediff-setup-windows-plain
- ediff-split-window-function 'split-window-horizontally)
+(setq ediff-window-setup-function 'ediff-setup-windows-plain
+ ediff-split-window-function 'split-window-horizontally)
(with-eval-after-load 'ediff
(add-hook 'ediff-after-quit-hook-internal #'winner-undo))
;; face-remap
-(csetq
+(setq
;; gentler font resizing
text-scale-mode-step 1.05)
(run-with-idle-timer 0.4 nil #'require 'mwheel)
-(csetq mouse-wheel-scroll-amount '(1 ((shift) . 1)) ; one line at a time
- mouse-wheel-progressive-speed nil ; don't accelerate scrolling
- mouse-wheel-follow-mouse t) ; scroll window under mouse
+(setq mouse-wheel-scroll-amount '(1 ((shift) . 1)) ; one line at a time
+ mouse-wheel-progressive-speed nil ; don't accelerate scrolling
+ mouse-wheel-follow-mouse t) ; scroll window under mouse
(run-with-idle-timer 0.4 nil #'require 'pixel-scroll)
(with-eval-after-load 'pixel-scroll
(pixel-scroll-mode 1))
;; epg-config
-(csetq
+(setq
epg-gpg-program (executable-find "gpg")
;; ask for GPG passphrase in minibuffer
;; this will fail if gpg>=2.1 is not available
epg-pinentry-mode 'loopback)
;; auth-source
-(csetq
+(setq
auth-sources '("~/.authinfo.gpg")
authinfo-hidden (regexp-opt '("password" "client-secret" "token")))
;; info
(with-eval-after-load 'info
- (csetq
+ (setq
Info-directory-list
`(,@Info-directory-list
,(expand-file-name
;; (require 'bandali-theme)
;; recently opened files
-(csetq recentf-max-saved-items 2000
- recentf-save-file (b/var "recentf-save.el"))
+(setq recentf-max-saved-items 2000
+ recentf-save-file (b/var "recentf-save.el"))
(run-with-idle-timer 0.2 nil #'require 'recentf)
(with-eval-after-load 'recentf
;; (add-to-list 'recentf-keep #'file-remote-p)
(with-eval-after-load 'help
(temp-buffer-resize-mode)
- (csetq help-window-select t))
+ (setq help-window-select t))
(with-eval-after-load 'help-mode
;; local key bindings
(define-key help-mode-map (kbd "n") #'forward-button))
(with-eval-after-load 'tramp
- (csetq tramp-auto-save-directory (b/var "tramp/auto-save/")
- tramp-persistency-file-name (b/var "tramp/persistency.el"))
+ (setq tramp-auto-save-directory (b/var "tramp/auto-save/")
+ tramp-persistency-file-name (b/var "tramp/persistency.el"))
(add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))
(add-to-list 'tramp-default-proxies-alist '("localhost" nil nil))
(add-to-list 'tramp-default-proxies-alist
(with-eval-after-load 'doc-view
(define-key doc-view-mode-map (kbd "M-RET") #'image-previous-line))
-(csetq shr-max-width 80)
+(setq shr-max-width 80)
;; Email (with Gnus, message, and smtpmail)
(require 'bandali-gnus)
(require 'bandali-message)
;; (with-eval-after-load 'smtpmail
-;; (csetq smtpmail-queue-mail t
+;; (setq smtpmail-queue-mail t
;; smtpmail-queue-dir (concat b/maildir "queue/")))
;; IRC (with ERC)
;; 'paste' service (aka scp + web server)
(add-to-list 'load-path (b/lisp "scpaste"))
(with-eval-after-load 'scpaste
- (csetq scpaste-http-destination "https://p.bndl.org"
- scpaste-scp-destination "p:~"))
+ (setq scpaste-http-destination "https://p.bndl.org"
+ scpaste-scp-destination "p:~"))
(autoload 'scpaste "scpaste" nil t)
(autoload 'scpaste-region "scpaste" nil t)
(global-set-key (kbd "C-c a p p") #'scpaste)
;; display Lisp objects at point in the echo area
(when (version< "25" emacs-version)
(with-eval-after-load 'eldoc
- (csetq eldoc-minor-mode-string " eldoc")
+ (setq eldoc-minor-mode-string " eldoc")
(global-eldoc-mode)))
;; highlight matching parens
;; (require 'elec-pair)
;; (electric-pair-mode)
-(csetq
+(setq
;; Save what I copy into clipboard from other applications into Emacs'
;; kill-ring, which would allow me to still be able to easily access
;; it in case I kill (cut or copy) something else inside Emacs before
;; save minibuffer history
(require 'savehist)
-(csetq savehist-file (b/var "savehist.el"))
+(setq savehist-file (b/var "savehist.el"))
(savehist-mode)
(add-to-list 'savehist-additional-variables 'kill-ring)
;; automatically save place in files
(when (version< "25" emacs-version)
- (csetq save-place-file (b/var "save-place.el"))
+ (setq save-place-file (b/var "save-place.el"))
(save-place-mode))
(defun indicate-buffer-boundaries-left ()
- (csetq indicate-buffer-boundaries 'left))
+ (setq indicate-buffer-boundaries 'left))
(with-eval-after-load 'prog-mode
(global-prettify-symbols-mode))
(add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left)
(add-to-list 'auto-mode-alist '("\\.bashrc$" . sh-mode))
(with-eval-after-load 'flyspell
- (csetq flyspell-mode-line-string " fly"))
+ (setq flyspell-mode-line-string " fly"))
;; ispell
;; http://endlessparentheses.com/ispell-and-apostrophes.html
;; (run-with-idle-timer 0.6 nil #'require 'ispell)
;; (with-eval-after-load 'ispell
;; ;; ’ can be part of a word
-;; (csetq ispell-local-dictionary-alist
-;; `((nil "[[:alpha:]]" "[^[:alpha:]]"
-;; "['\x2019]" nil ("-B") nil utf-8))
-;; ispell-program-name (executable-find "hunspell"))
+;; (setq ispell-local-dictionary-alist
+;; `((nil "[[:alpha:]]" "[^[:alpha:]]"
+;; "['\x2019]" nil ("-B") nil utf-8))
+;; ispell-program-name (executable-find "hunspell"))
;; ;; don't send ’ to the subprocess
;; (defun endless/replace-apostrophe (args)
;; (cons (replace-regexp-in-string
;; #'endless/replace-quote))
;; abbrev
-(csetq abbrev-file-name (b/etc "abbrev.el"))
+(setq abbrev-file-name (b/etc "abbrev.el"))
(add-hook 'text-mode-hook #'abbrev-mode)
\f
(add-to-list 'load-path (b/lisp "alloy-mode"))
(autoload 'alloy-mode "alloy-mode" nil t)
(with-eval-after-load 'alloy-mode
- (csetq alloy-basic-offset 2)
+ (setq alloy-basic-offset 2)
;; (defun b/alloy-simple-indent (start end)
;; (interactive "r")
;; ;; (if (region-active-p)
;; (run-with-idle-timer 0.4 nil #'require 'lean-mode)
;; (with-eval-after-load 'lean-mode
;; (require 'lean-input)
-;; (csetq default-input-method "Lean"
-;; lean-input-tweak-all '(lean-input-compose
-;; (lean-input-prepend "/")
-;; (lean-input-nonempty))
-;; lean-input-user-translations '(("/" "/")))
+;; (setq default-input-method "Lean"
+;; lean-input-tweak-all '(lean-input-compose
+;; (lean-input-prepend "/")
+;; (lean-input-nonempty))
+;; lean-input-user-translations '(("/" "/")))
;; (lean-input-setup)
;; ;; local key bindings
;; (define-key lean-mode-map (kbd "S-SPC") #'company-complete))
(with-eval-after-load 'sgml-mode
- (csetq sgml-basic-offset 0))
+ (setq sgml-basic-offset 0))
(with-eval-after-load 'css-mode
- (csetq css-indent-offset 2))
+ (setq css-indent-offset 2))
;; auctex
-;; (csetq font-latex-fontify-sectioning 'color)
+;; (setq font-latex-fontify-sectioning 'color)
(with-eval-after-load 'tex-mode
(cl-delete-if
;;; Emacs enhancements & auxiliary packages
(with-eval-after-load 'man
- (csetq Man-width 80))
+ (setq Man-width 80))
(defun b/*scratch* ()
"Switch to `*scratch*' buffer, creating it if it does not exist."
"yasnippet" (cmd))
(defconst yas-verbosity-cur yas-verbosity)
- (setq yas-verbosity 2)
- (csetq yas-snippet-dirs `(,(b/etc "yasnippet/snippets")))
+ (setq yas-verbosity 2
+ yas-snippet-dirs `(,(b/etc "yasnippet/snippets")))
;; (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t)
(yas-reload-all)
(setq yas-verbosity yas-verbosity-cur)
'("gnuzilla"))))
;; url and url-cache
-(csetq
+(setq
url-configuration-directory (b/var "url/configuration/")
url-cache-directory (b/var "url/cache/"))
;; eww
-(csetq eww-download-directory (file-name-as-directory
- (getenv "XDG_DOWNLOAD_DIR")))
+(setq eww-download-directory (file-name-as-directory
+ (getenv "XDG_DOWNLOAD_DIR")))
(global-set-key (kbd "C-c a e w") #'eww)
;; ;; org-ref
-;; (csetq
+;; (setq
;; reftex-default-bibliography '("~/usr/org/references.bib")
;; org-ref-default-bibliography '("~/usr/org/references.bib")
;; org-ref-bibliography-notes "~/usr/org/notes.org"
;; fill-column-indicator ?
;; window
-(csetq split-width-threshold 150)
+(setq split-width-threshold 150)
(global-set-key (kbd "C-c w s l")
(lambda ()
(interactive)
;; dmenu
(add-to-list 'load-path (b/lisp "dmenu"))
(with-eval-after-load 'dmenu
- (csetq dmenu-prompt-string "run: "
- dmenu-save-file (b/var "dmenu-items")))
+ (setq dmenu-prompt-string "run: "
+ dmenu-save-file (b/var "dmenu-items")))
(autoload 'dmenu "dmenu" nil t)
;; eosd ?
(require 'bandali-po)
(with-eval-after-load 'emms
- (csetq emms-directory (b/var "emms")))
+ (setq emms-directory (b/var "emms")))
\f
;;; Post initialization
;;; bandali-dired.el --- bandali's dired setup -*- lexical-binding: t; -*-
-;; Copyright (C) 2018-2020 Amin Bandali
+;; Copyright (C) 2018-2022 Amin Bandali
;; Author: Amin Bandali <bandali@gnu.org>
;; Keywords: files
;;; Code:
(with-eval-after-load 'dired
- (csetq
+ (setq
dired-dwim-target t
dired-listing-switches "-alh"
dired-recent-directories-file (b/var "dired-recent-directories.el")
(b/dired-start-process "zathura")))
(require 'dired-x)
- (csetq dired-guess-shell-alist-user
- '(("\\.pdf\\'" "evince" "zathura" "okular")
- ("\\.doc\\'" "libreoffice")
- ("\\.docx\\'" "libreoffice")
- ("\\.ppt\\'" "libreoffice")
- ("\\.pptx\\'" "libreoffice")
- ("\\.xls\\'" "libreoffice")
- ("\\.xlsx\\'" "libreoffice")
- ("\\.flac\\'" "mpv"))))
+ (setq
+ dired-guess-shell-alist-user
+ '(("\\.pdf\\'" "evince" "zathura" "okular")
+ ("\\.doc\\'" "libreoffice")
+ ("\\.docx\\'" "libreoffice")
+ ("\\.ppt\\'" "libreoffice")
+ ("\\.pptx\\'" "libreoffice")
+ ("\\.xls\\'" "libreoffice")
+ ("\\.xlsx\\'" "libreoffice")
+ ("\\.flac\\'" "mpv"))))
;; hooks
(add-hook 'dired-mode-hook #'dired-hide-details-mode)
;;; bandali-erc.el --- bandali's ERC setup -*- lexical-binding: t; -*-
-;; Copyright (C) 2018-2021 Amin Bandali
+;; Copyright (C) 2018-2022 Amin Bandali
;; Author: Amin Bandali <bandali@gnu.org>
;; Keywords: IRC, chat, client, Internet
(with-eval-after-load 'erc
(make-directory (b/var "erc/dcc") t)
- (csetq
+ (setq
erc-auto-query 'bury
erc-autojoin-domain-only nil
erc-dcc-get-default-directory (b/var "erc/dcc")
;; :foreground "steel blue")
;; erc-fill
- ;; (csetq
+ ;; (setq
;; erc-fill-column 77
;; erc-fill-function 'erc-fill-variable
;; erc-fill-static-center 18)
directory))
(defun b/erc-log-file-name (&rest _)
(concat (format-time-string "%Y-%m-%d") ".log"))
- (csetq
+ (setq
;; erc-enable-logging 'erc-log-all-but-server-buffers
erc-generate-log-file-name-function #'b/erc-log-file-name
erc-log-channels-directory #'b/erc-log-directory
erc-save-queries-on-quit nil)
;; erc-match
- (csetq
+ (setq
erc-pal-highlight-type 'nick
erc-pals
'("bremner" "^gopar" "^iank" "quidam" "^rwp" "sudoman"
:background "#ffffdf"))
;; erc-pcomplete
- (csetq erc-pcomplete-nick-postfix ",")
+ (setq erc-pcomplete-nick-postfix ",")
;; erc-stamp
- (csetq erc-timestamp-only-if-changed-flag nil
- erc-timestamp-format "%T "
- erc-insert-timestamp-function 'erc-insert-timestamp-left)
+ (setq erc-timestamp-only-if-changed-flag nil
+ erc-timestamp-format "%T "
+ erc-insert-timestamp-function 'erc-insert-timestamp-left)
(with-eval-after-load 'erc-match
(set-face-attribute
'erc-timestamp-face nil
:background 'unspecified))
;; erc-track
- (csetq
+ (setq
erc-track-enable-keybindings nil
erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT"
"324" "329" "332" "333" "353" "477")
;;; bandali-eshell.el --- bandali's Eshell setup -*- lexical-binding: t; -*-
-;; Copyright (C) 2018-2020 Amin Bandali
+;; Copyright (C) 2018-2022 Amin Bandali
;; Author: Amin Bandali <bandali@gnu.org>
;; Keywords: processes
(with-eval-after-load 'eshell
(make-directory (b/etc "eshell/") t)
- (csetq
+ (setq
eshell-aliases-file (b/etc "eshell/aliases")
eshell-directory-name (b/var "eshell/")
eshell-hist-ignoredups t
;;; bandali-exwm.el --- bandali's EXWM configuration -*- lexical-binding: t; -*-
-;; Copyright (C) 2018-2021 Amin Bandali
+;; Copyright (C) 2018-2022 Amin Bandali
;; Author: Amin Bandali <bandali@gnu.org>
;; Keywords: tools
(add-to-list 'load-path (b/lisp "xelb"))
(add-to-list 'load-path (b/lisp "exwm"))
(require 'exwm)
-(csetq ;; exwm-replace t
- exwm-workspace-show-all-buffers t)
+(setq ;; exwm-replace t
+ exwm-workspace-show-all-buffers t)
;; make class name the buffer name, truncating beyond 60 characters
(defun b/exwm-rename-buffer ()
(interactive)
5 \% 6 \^ 7 \& 8 \* 9 \()
"Mapping of shifted numbers on my keyboard.")
-(csetq exwm-workspace-number 10
- exwm-input-global-keys
- `(([?\s-R] . exwm-reset)
- ([?\s-b] . exwm-workspace-switch-to-buffer)
- ([?\s-\\] . exwm-workspace-switch)
- ([?\s-\s] . dmenu)
- ;; ([?\s-\s] . (lambda ()
- ;; (interactive)
- ;; (start-process-shell-command
- ;; "rofi" nil "rofi -show run")))
- ([?\S-\s-\s] . (lambda (command) ; doesn't work in X windows
- (interactive
- (list (read-shell-command "➜ ")))
- (start-process-shell-command
- command nil command)))
- ([s-return] . (lambda ()
- (interactive)
- (start-process "" nil "urxvt")))
- ([S-s-return] . (lambda ()
- (interactive)
- (start-process "" nil "urxvt"
- "-name" "floating")))
- ([?\C-\s-\s] . counsel-linux-app)
- ([?\M-\s-\s] . (lambda ()
- (interactive)
- (start-process-shell-command
- "rofi-pass" nil "rofi-pass")))
- ([?\s-h] . windmove-left)
- ([?\s-j] . windmove-down)
- ([?\s-k] . windmove-up)
- ([?\s-l] . windmove-right)
- ([?\s-H] . windmove-swap-states-left)
- ([?\s-J] . windmove-swap-states-down)
- ([?\s-K] . windmove-swap-states-up)
- ([?\s-L] . windmove-swap-states-right)
- ([?\s-N ?d] . (lambda ()
- (interactive)
- (start-process
- "" nil "dunstctl" "close")))
- ([?\s-N ?D] . (lambda ()
- (interactive)
- (start-process
- "" nil "dunstctl" "close-all")))
- ([?\s-N ?h] . (lambda ()
- (interactive)
- (start-process
- "" nil "dunstctl" "history-pop")))
- ([?\s-N return] . (lambda ()
- (interactive)
- (start-process
- "" nil "dunstctl" "context")))
- ([?\M-\s-h] . shrink-window-horizontally)
- ([?\M-\s-l] . enlarge-window-horizontally)
- ([?\M-\s-k] . shrink-window)
- ([?\M-\s-j] . enlarge-window)
- ([?\s-\[] . b/exwm-ws-prev)
- ([?\s-\]] . b/exwm-ws-next)
- ([mode-line mouse-4] . b/exwm-ws-prev) ; up
- ([mode-line mouse-5] . b/exwm-ws-next) ; down
- ([mode-line mouse-6] . b/exwm-ws-prev) ; left
- ([mode-line mouse-7] . b/exwm-ws-next) ; right
- ([?\s-{] . (lambda ()
- (interactive)
- (exwm-workspace-move-window
- (b/exwm-ws-prev-index))))
- ([?\s-}] . (lambda ()
- (interactive)
- (exwm-workspace-move-window
- (b/exwm-ws-next-index))))
- ,@(mapcar (lambda (i)
- `(,(kbd (format "s-%d" i)) .
- (lambda ()
- (interactive)
- (exwm-workspace-switch-create ,i))))
- (number-sequence 0 (1- exwm-workspace-number)))
- ,@(mapcar
- (lambda (i)
- `(,(kbd (format "s-%s"
- (plist-get b/shifted-ws-names i)))
- .
- (lambda ()
- (interactive)
- (exwm-workspace-move-window ,i))))
- (number-sequence 0 (1- exwm-workspace-number)))
- ([?\s-F] . exwm-floating-toggle-floating)
- ([?\s-f] . exwm-layout-toggle-fullscreen)
- ([?\s-W] . (lambda ()
- (interactive)
- (kill-buffer (current-buffer))))
- ([?\s-Q] . (lambda ()
- (interactive)
- (exwm-manage--kill-client)))
- ([?\s-\'] . (lambda ()
+(setq
+ exwm-workspace-number 10
+ exwm-input-global-keys
+ `(([?\s-R] . exwm-reset)
+ ([?\s-b] . exwm-workspace-switch-to-buffer)
+ ([?\s-\\] . exwm-workspace-switch)
+ ([?\s-\s] . dmenu)
+ ;; ([?\s-\s] . (lambda ()
+ ;; (interactive)
+ ;; (start-process-shell-command
+ ;; "rofi" nil "rofi -show run")))
+ ([?\S-\s-\s] . (lambda (command) ; doesn't work in X windows
+ (interactive
+ (list (read-shell-command "➜ ")))
+ (start-process-shell-command
+ command nil command)))
+ ([s-return] . (lambda ()
+ (interactive)
+ (start-process "" nil "urxvt")))
+ ([S-s-return] . (lambda ()
+ (interactive)
+ (start-process "" nil "urxvt"
+ "-name" "floating")))
+ ([?\C-\s-\s] . counsel-linux-app)
+ ([?\M-\s-\s] . (lambda ()
+ (interactive)
+ (start-process-shell-command
+ "rofi-pass" nil "rofi-pass")))
+ ([?\s-h] . windmove-left)
+ ([?\s-j] . windmove-down)
+ ([?\s-k] . windmove-up)
+ ([?\s-l] . windmove-right)
+ ([?\s-H] . windmove-swap-states-left)
+ ([?\s-J] . windmove-swap-states-down)
+ ([?\s-K] . windmove-swap-states-up)
+ ([?\s-L] . windmove-swap-states-right)
+ ([?\s-N ?d] . (lambda ()
+ (interactive)
+ (start-process
+ "" nil "dunstctl" "close")))
+ ([?\s-N ?D] . (lambda ()
+ (interactive)
+ (start-process
+ "" nil "dunstctl" "close-all")))
+ ([?\s-N ?h] . (lambda ()
+ (interactive)
+ (start-process
+ "" nil "dunstctl" "history-pop")))
+ ([?\s-N return] . (lambda ()
(interactive)
- (start-process-shell-command
- "rofi-light" nil "rofi-light")))
- ([XF86AudioMute] . ; borken on my X200 :-(
+ (start-process
+ "" nil "dunstctl" "context")))
+ ([?\M-\s-h] . shrink-window-horizontally)
+ ([?\M-\s-l] . enlarge-window-horizontally)
+ ([?\M-\s-k] . shrink-window)
+ ([?\M-\s-j] . enlarge-window)
+ ([?\s-\[] . b/exwm-ws-prev)
+ ([?\s-\]] . b/exwm-ws-next)
+ ([mode-line mouse-4] . b/exwm-ws-prev) ; up
+ ([mode-line mouse-5] . b/exwm-ws-next) ; down
+ ([mode-line mouse-6] . b/exwm-ws-prev) ; left
+ ([mode-line mouse-7] . b/exwm-ws-next) ; right
+ ([?\s-{] . (lambda ()
+ (interactive)
+ (exwm-workspace-move-window
+ (b/exwm-ws-prev-index))))
+ ([?\s-}] . (lambda ()
+ (interactive)
+ (exwm-workspace-move-window
+ (b/exwm-ws-next-index))))
+ ,@(mapcar (lambda (i)
+ `(,(kbd (format "s-%d" i)) .
+ (lambda ()
+ (interactive)
+ (exwm-workspace-switch-create ,i))))
+ (number-sequence 0 (1- exwm-workspace-number)))
+ ,@(mapcar
+ (lambda (i)
+ `(,(kbd (format "s-%s"
+ (plist-get b/shifted-ws-names i)))
+ .
(lambda ()
(interactive)
- (start-process "" nil "pamixer" "--toggle-mute")))
- ([XF86Launch1] .
- (lambda ()
- (interactive)
- (start-process "" nil "pamixer" "--toggle-mute")))
- ([\s-XF86Launch1] . ; toggle mic mute
- (lambda ()
- (interactive)
- (start-process
- "" nil "pamixer" "--default-source" "--toggle-mute")))
- ([XF86AudioLowerVolume] .
- (lambda ()
- (interactive)
- (start-process
- "" nil "pamixer" "--allow-boost" "--decrease" "5")))
- ([XF86AudioRaiseVolume] .
- (lambda ()
- (interactive)
- (start-process
- "" nil "pamixer" "--allow-boost" "--increase" "5")))
- ([XF86AudioPlay] .
- (lambda ()
- (interactive)
- (start-process "" nil "mpc" "toggle")))
- ([XF86AudioPrev] .
- (lambda ()
- (interactive)
- (start-process "" nil "mpc" "prev")))
- ([XF86AudioNext] .
- (lambda ()
- (interactive)
- (start-process "" nil "mpc" "next")))
- ([XF86MonBrightnessDown] .
- (lambda ()
- (interactive)
- (start-process "" nil "light" "-U" "5")))
- ([XF86MonBrightnessUp] .
- (lambda ()
- (interactive)
- (start-process "" nil "light" "-A" "5")))
- ([XF86ScreenSaver] .
- (lambda ()
- (interactive)
- (start-process "" nil "dm-tool" "lock")))
- ([\s-XF86Back] . previous-buffer)
- ([\s-XF86Forward] . next-buffer)))
+ (exwm-workspace-move-window ,i))))
+ (number-sequence 0 (1- exwm-workspace-number)))
+ ([?\s-F] . exwm-floating-toggle-floating)
+ ([?\s-f] . exwm-layout-toggle-fullscreen)
+ ([?\s-W] . (lambda ()
+ (interactive)
+ (kill-buffer (current-buffer))))
+ ([?\s-Q] . (lambda ()
+ (interactive)
+ (exwm-manage--kill-client)))
+ ([?\s-\'] . (lambda ()
+ (interactive)
+ (start-process-shell-command
+ "rofi-light" nil "rofi-light")))
+ ([XF86AudioMute] . ; borken on my X200 :-(
+ (lambda ()
+ (interactive)
+ (start-process "" nil "pamixer" "--toggle-mute")))
+ ([XF86Launch1] .
+ (lambda ()
+ (interactive)
+ (start-process "" nil "pamixer" "--toggle-mute")))
+ ([\s-XF86Launch1] . ; toggle mic mute
+ (lambda ()
+ (interactive)
+ (start-process
+ "" nil "pamixer" "--default-source" "--toggle-mute")))
+ ([XF86AudioLowerVolume] .
+ (lambda ()
+ (interactive)
+ (start-process
+ "" nil "pamixer" "--allow-boost" "--decrease" "5")))
+ ([XF86AudioRaiseVolume] .
+ (lambda ()
+ (interactive)
+ (start-process
+ "" nil "pamixer" "--allow-boost" "--increase" "5")))
+ ([XF86AudioPlay] .
+ (lambda ()
+ (interactive)
+ (start-process "" nil "mpc" "toggle")))
+ ([XF86AudioPrev] .
+ (lambda ()
+ (interactive)
+ (start-process "" nil "mpc" "prev")))
+ ([XF86AudioNext] .
+ (lambda ()
+ (interactive)
+ (start-process "" nil "mpc" "next")))
+ ([XF86MonBrightnessDown] .
+ (lambda ()
+ (interactive)
+ (start-process "" nil "light" "-U" "5")))
+ ([XF86MonBrightnessUp] .
+ (lambda ()
+ (interactive)
+ (start-process "" nil "light" "-A" "5")))
+ ([XF86ScreenSaver] .
+ (lambda ()
+ (interactive)
+ (start-process "" nil "dm-tool" "lock")))
+ ([\s-XF86Back] . previous-buffer)
+ ([\s-XF86Forward] . next-buffer)))
;; Line-editing shortcuts
-(csetq exwm-input-simulation-keys
- '(;; movement
- ([?\C-b] . [left])
- ([?\M-b] . [C-left])
- ([?\C-f] . [right])
- ([?\M-f] . [C-right])
- ([?\C-p] . [up])
- ([?\C-n] . [down])
- ([?\C-a] . [home])
- ([?\C-e] . [end])
- ([?\M-v] . [prior])
- ([?\C-v] . [next])
- ([?\C-d] . [delete])
- ([?\C-k] . [S-end ?\C-x])
- ([?\M-<] . C-home)
- ([?\M->] . C-end)
- ;; cut/copy/paste
- ([?\C-w] . [?\C-x])
- ([?\M-w] . [?\C-c])
- ([?\C-y] . [?\C-v])
- ([?\M-d] . [C-S-right ?\C-x])
- ([?\M-\d] . [C-S-left ?\C-x])
- ;; window
- ([?\s-w] . [?\C-w])
- ([?\s-q] . [?\C-q])
- ;; misc
- ([?\C-s] . [?\C-f])
- ([?\s-s] . [?\C-s])
- ([?\C-g] . [escape])))
+(setq
+ exwm-input-simulation-keys
+ '(;; movement
+ ([?\C-b] . [left])
+ ([?\M-b] . [C-left])
+ ([?\C-f] . [right])
+ ([?\M-f] . [C-right])
+ ([?\C-p] . [up])
+ ([?\C-n] . [down])
+ ([?\C-a] . [home])
+ ([?\C-e] . [end])
+ ([?\M-v] . [prior])
+ ([?\C-v] . [next])
+ ([?\C-d] . [delete])
+ ([?\C-k] . [S-end ?\C-x])
+ ([?\M-<] . C-home)
+ ([?\M->] . C-end)
+ ;; cut/copy/paste
+ ([?\C-w] . [?\C-x])
+ ([?\M-w] . [?\C-c])
+ ([?\C-y] . [?\C-v])
+ ([?\M-d] . [C-S-right ?\C-x])
+ ([?\M-\d] . [C-S-left ?\C-x])
+ ;; window
+ ([?\s-w] . [?\C-w])
+ ([?\s-q] . [?\C-q])
+ ;; misc
+ ([?\C-s] . [?\C-f])
+ ([?\s-s] . [?\C-s])
+ ([?\C-g] . [escape])))
(require 'exwm-manage)
-(csetq
+(setq
exwm-manage-configurations
'(((equal exwm-instance-name "floating")
floating t
([?\C-n] . [C-down]))))))))
(require 'exwm-randr)
-(csetq
+(setq
exwm-randr-workspace-monitor-plist
'(0 "eDP-1"
1 "eDP-1" 2 "eDP-1" 3 "eDP-1"
;;; bandali-gnus.el --- bandali's Gnus setup -*- lexical-binding: t; -*-
-;; Copyright (C) 2018-2021 Amin Bandali
+;; Copyright (C) 2018-2022 Amin Bandali
;; Author: Amin Bandali <bandali@gnu.org>
;; Keywords: mail, news
(declare-function article-make-date-line "gnus-art" (date type))
-(csetq
+(setq
mail-user-agent 'gnus-user-agent
read-mail-command 'gnus
(global-set-key (kbd "C-c M") #'gnus-unplugged)
(with-eval-after-load 'gnus-art
- (csetq
+ (setq
gnus-buttonized-mime-types '("multipart/\\(signed\\|encrypted\\)")
gnus-sorted-header-list '("^From:"
"^X-RT-Originator"
(define-key gnus-article-mode-map (kbd "M-L") #'org-store-link))
(with-eval-after-load 'gnus-sum
- (csetq gnus-thread-sort-functions '(gnus-thread-sort-by-number
- gnus-thread-sort-by-subject
- gnus-thread-sort-by-date))
+ (setq gnus-thread-sort-functions '(gnus-thread-sort-by-number
+ gnus-thread-sort-by-subject
+ gnus-thread-sort-by-date))
;; local key bindings
(define-key gnus-summary-mode-map (kbd "M-L") #'org-store-link)
;; (define-key gnus-summary-mode-map (kbd "r")
Free Software Consultant
Savoir-faire Linux
jami:bandali")
- (csetq
+ (setq
gnus-message-replysign t
gnus-posting-styles
'((".*"
;; (mml-secure-message-sign)))))
(with-eval-after-load 'gnus-topic
- (csetq
+ (setq
gnus-topic-line-format "%i[ %A: %(%{%n%}%) ]%v\n"
gnus-topic-topology
`(("Gnus" visible nil nil)
(("old-gnu" visible nil nil))))))))
(with-eval-after-load 'gnus-agent
- (csetq gnus-agent-synchronize-flags 'ask))
+ (setq gnus-agent-synchronize-flags 'ask))
(with-eval-after-load 'gnus-group
- (csetq gnus-permanently-visible-groups "\\(:INBOX$\\|:gnu$\\)"))
+ (setq gnus-permanently-visible-groups "\\(:INBOX$\\|:gnu$\\)"))
(with-eval-after-load 'gnus-win
- (csetq gnus-use-full-window nil))
+ (setq gnus-use-full-window nil))
(with-eval-after-load 'gnus-dired
(add-hook 'dired-mode-hook 'gnus-dired-mode))
(with-eval-after-load 'mm-decode
- (csetq ;; mm-attachment-override-types `("text/x-diff" "text/x-patch"
- ;; ,@mm-attachment-override-types)
- mm-discouraged-alternatives '("text/html" "text/richtext")
- mm-decrypt-option 'known
- mm-verify-option 'known))
+ (setq
+ ;; mm-attachment-override-types `("text/x-diff" "text/x-patch"
+ ;; ,@mm-attachment-override-types)
+ mm-discouraged-alternatives '("text/html" "text/richtext")
+ mm-decrypt-option 'known
+ mm-verify-option 'known))
(with-eval-after-load 'mm-uu
(when (version< "27" emacs-version)
(set-face-attribute 'mm-uu-extract nil :extend t))
(when (version< emacs-version "27")
- (csetq mm-uu-diff-groups-regexp ".")))
+ (setq mm-uu-diff-groups-regexp ".")))
(with-eval-after-load 'mml-sec
- (csetq mml-secure-openpgp-encrypt-to-self t
- mml-secure-openpgp-sign-with-sender t))
+ (setq mml-secure-openpgp-encrypt-to-self t
+ mml-secure-openpgp-sign-with-sender t))
(provide 'bandali-gnus)
;;; bandali-gnus.el ends here
;;; bandali-ibuffer.el --- bandali's Ibuffer setup -*- lexical-binding: t; -*-
-;; Copyright (C) 2018-2020 Amin Bandali
+;; Copyright (C) 2018-2022 Amin Bandali
;; Author: Amin Bandali <bandali@gnu.org>
;; Keywords: tools
;;; Code:
-(csetq
+(setq
ibuffer-saved-filter-groups
'(("default"
("dired" (mode . dired-mode))
;;; bandali-message.el --- bandali's message.el setup -*- lexical-binding: t; -*-
-;; Copyright (C) 2018-2020 Amin Bandali
+;; Copyright (C) 2018-2022 Amin Bandali
;; Author: Amin Bandali <bandali@gnu.org>
;; Keywords: mail, news
(concat "Hi %F,\n\n" b/message-cite-style-format)
b/message-cite-style-format)))
"Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
- (csetq
+ (setq
message-elide-ellipsis "[...]\n"
;; message-cite-style 'message-cite-style-bandali
message-citation-line-format "%N writes:\n"
;; footnote
;; (with-eval-after-load 'footnote
- ;; (csetq footnote-start-tag ""
- ;; footnote-end-tag ""
- ;; footnote-style 'unicode))
+ ;; (setq footnote-start-tag ""
+ ;; footnote-end-tag ""
+ ;; footnote-style 'unicode))
;; custom newline & reformat function
(defun b/message-newline-or-asterism (arg)
;;; bandali-org.el --- bandali's Org setup -*- lexical-binding: t; -*-
-;; Copyright (C) 2018-2020 Amin Bandali
+;; Copyright (C) 2018-2022 Amin Bandali
;; Author: Amin Bandali <bandali@gnu.org>
;; Keywords: calendar, data, docs, hypermedia, outlines
;;; Code:
(with-eval-after-load 'org
- (csetq org-src-tab-acts-natively t
- org-src-preserve-indentation nil
- org-edit-src-content-indentation 0
- org-id-locations-file (b/var "org/id-locations.el")
- org-link-email-description-format "Email %c: %s" ; %.30s
- org-highlight-latex-and-related '(entities)
- org-use-speed-commands t
- org-startup-folded 'content
- org-catch-invisible-edits 'show-and-error
- org-log-done 'time
- org-pretty-entities t
- org-agenda-files '("~/usr/org/todos/personal.org"
- "~/usr/org/todos/habits.org"
- "~/src/git/masters-thesis/todo.org")
- org-agenda-start-on-weekday 0
- org-agenda-time-leading-zero t
- org-habit-graph-column 44
- org-latex-packages-alist '(("" "listings") ("" "color")))
+ (setq
+ org-src-tab-acts-natively t
+ org-src-preserve-indentation nil
+ org-edit-src-content-indentation 0
+ org-id-locations-file (b/var "org/id-locations.el")
+ org-link-email-description-format "Email %c: %s" ; %.30s
+ org-highlight-latex-and-related '(entities)
+ org-use-speed-commands t
+ org-startup-folded 'content
+ org-catch-invisible-edits 'show-and-error
+ org-log-done 'time
+ org-pretty-entities t
+ org-agenda-files '("~/usr/org/todos/personal.org"
+ "~/usr/org/todos/habits.org"
+ "~/src/git/masters-thesis/todo.org")
+ org-agenda-start-on-weekday 0
+ org-agenda-time-leading-zero t
+ org-habit-graph-column 44
+ org-latex-packages-alist '(("" "listings") ("" "color")))
(add-to-list 'org-structure-template-alist '("L" . "src emacs-lisp") t)
(add-to-list 'org-modules 'org-habit)
(custom-set-faces
(global-set-key (kbd "C-c a o a") #'org-agenda)
(with-eval-after-load 'ox-latex
- (csetq org-latex-listings 'listings
- ;; org-latex-prefer-user-labels t
- )
+ (setq
+ org-latex-listings 'listings
+ ;; org-latex-prefer-user-labels t
+ )
(add-to-list 'org-latex-classes
'("IEEEtran" "\\documentclass[11pt]{IEEEtran}"
("\\section{%s}" . "\\section*{%s}")