;;(require 'src-loaddefs)
-(setenv "EMACS" "")
+
+(setenv "EMACS" "") ;; I should have wrote why i did this :(
+
;; generally unnecessary, but why not
(setq explicit-shell-file-name "bash"
explicit-bash-args nil
(disable-theme (car custom-enabled-themes)))
(load-theme arg t))
-;; not a real var? remove when I see this again
-;;(setq color-theme-is-global t)
-
-;; temporary, make night be default
+;; toggle night theme.
(defun toggle-night ()
(interactive)
(cond ((equal (car custom-enabled-themes) 'naquadah)
;; (when (and (boundp 'global-hide-mode-line-mode) global-hide-mode-line-mode)
;; (global-hide-mode-line-mode -1))
- (override-theme 'ef-light))
+ (override-theme 'modus-operandi))
(t
(override-theme 'naquadah))))
+;; per https://protesilaos.com/emacs/modus-themes.
+(require-theme 'modus-themes)
+(setq modus-themes-disable-other-themes t)
+(modus-themes-load-theme 'modus-operandi)
-(setq ef-themes-mixed-fonts t
- ef-themes-variable-pitch-ui t)
+
+;;; Notes on past color themes and theme investigations ;;;
+;; used this for a long time
+;; (override-theme 'ef-light)
+;;
+;; This looks like it could be a nice change of pace
+;; (override-theme 'modus-operandi-tinted)
+;; I used this for a long time.
+;;(override-theme 'leuven)
;; in the leuven theme file, i made this change. will need to remake it
;; on package updates. I could fork, but its a pretty simple change
;; < `(default ((,class (:foreground "#333333" :background "#FFFFFF"))))
;; < `(font-lock-comment-face ((,class (:slant italic :foreground "#8D8D84")))) ; #696969
;; > `(font-lock-comment-face ((,class (:slant italic :foreground "#484848")))) ; #696969
-;;(override-theme 'leuven)
-;; based on ef-themes README.org
-(mapc #'disable-theme custom-enabled-themes)
+;; I used ef-light for a long time.
+;; based on ef-themes README.org:
+;;(mapc #'disable-theme custom-enabled-themes)
+;; (setq ef-themes-mixed-fonts t
+;; ef-themes-variable-pitch-ui t)
;; the default blue is too dark and messes with erc colors
-(setq ef-light-palette-overrides
- '((bg-mode-line "#efefef")))
-(ef-themes-select 'ef-light)
-;;(load-theme 'ef-light)
+;;(setq ef-light-palette-overrides
+;; '((bg-mo]de-line "#efefef")))
+;;(ef-themes-select 'ef-light) ;; note override-theme also works fine
;; for learning about faces, see
;;; cross session settings
-
+;; note: manual save/restore of open files:
+;; M-x desktop-save
+;; M-x desktop-read
(use-package recentf
;; defer & commands from jwiegley
;; save it every 2 minutes. https://www.emacswiki.org/emacs/RecentFiles
(run-at-time nil (* 2 60) 'recentf-save-list))
+
;; less strong conditional: :unless noninteractive
(use-package saveplace
:if (string= (daemonp) "server")
(add-to-list 'auto-mode-alist '("\\.curlrc\\'" . conf-mode))
-
+;; Note this is one of the hard-coded options. Note:
+;; sqlfluff will exit with failure due to linting violations,
+;; but it will still do the formatting. The best way
+;; I've found to deal with this so far is to just run
+;; the command on the file from the terminal. There are
+;; also some ideas in /a/c/subdir_files/.config/sqlfluff/.sqlfluff
(setq sqlformat-command 'sqlfluff)
(custom-set-variables
(load-file "/p/c/plisp/mymu4e.el")
(load-file "/p/c/plisp/help-fns+.el")
-(add-to-list 'load-path "/p/c/plisp")
-(use-package myidir
- :commands (myidir rthumb-new myidir-use-batch-input pg-idir))
+(when (file-exists-p "/r/b/myidir.el")
+ (load-file "/r/b/myidir.el"))
(when (file-exists-p "/a/h/iank-mod.el")
(load-file "/a/h/iank-mod.el"))
;; "remote-shell" "/bin/bash"))
;;(customize-set-variable 'tramp-encoding-shell "/bin/bash")
+;; normally, TERM is set to dumb, but this causes emacsclient launched
+;; from within emacs to fail with: "*ERROR*: Unknown terminal type"
+;; todo: something after this point is setting it back to DUMNB
+(setenv "TERM")
+
(setq
copy-region-blink-delay 0.3
;; be more consistent
;; remove ugly 3d box feature
(set-face-attribute 'mode-line nil :box nil)
-(add-to-list 'default-frame-alist
- '(font . "DejaVu Sans Mono-11"))
- ; the default will jump 2 sizes.
+;; This seems to fix my problem of the font being too small by default.
+;; I've read that height is 1/10 pt.
+(set-face-attribute 'default nil
+ :height 120)
+;;
(setq text-scale-mode-step 1.1)
(setq font-lock-maximum-decoration t
inhibit-startup-message t
imenu-auto-rescan t
indicate-empty-lines t) ; mark end of buffer
-
(blink-cursor-mode 0)
(menu-bar-mode -1)
(tool-bar-mode -1)
(cond ((derived-mode-p 'org-mode)
(org-indent-region (point-min) (point-max)))
((derived-mode-p 'sql-mode)
- (message "iank body")
+ ;;(message "iank sql format debug")
;; fixes parsing errors for the perl i've been writing.
(replace-regexp-in-buffer "?" "'?'")
(sqlformat-buffer)
;; org-roam install message said this should be in my config. but if fails. meh.
;; (org-roam-db-autosync-mode)
+;; prevent accidental horizontal scroll left, which I never want.
+(global-unset-key (kbd "C-x <"))
+
(define-prefix-command 'terminal-key-map)
(global-set-key (kbd "\e[") 'terminal-key-map)
(isearch-toggle-regexp)
(cond (isearch-regexp
(global-set-key (kbd "C-r") 'isearch-backward-regexp)
- (define-key global-map (kbd "<f12>") 'isearch-forward-regexp))
+ (define-key global-map (kbd "C-f") 'isearch-forward-regexp))
(t
(global-set-key (kbd "C-r") 'isearch-backward)
- (define-key global-map (kbd "<f12>") 'isearch-forward))))
+ (define-key global-map (kbd "C-f") 'isearch-forward))))
(define-key isearch-mode-map (kbd "M-r") 'my-isearch-toggle-regexp)
+(define-key isearch-mode-map (kbd "C-e") 'my-isearch-toggle-regexp)
(define-key Info-mode-map "x" 'Info-follow-nearest-node)
;; todo: this doesnt work. needs <tab>, which doesnt work in terminal. fix that.
(define-key isearch-mode-map (kbd "TAB") 'isearch-query-replace)
-;;;;; f12 - isearch-forward
-;; explained in http://stackoverflow.com/questions/7411920/how-to-bind-search-and-search-repeat-to-c-f-in-emacs
-(global-set-key (kbd "<kp-add>") 'isearch-forward)
-(global-set-key (kbd "<f12>") 'isearch-forward)
-(define-key isearch-mode-map (kbd "<kp-add>") 'isearch-repeat-forward)
-(define-key isearch-mode-map (kbd "<f12>") 'isearch-repeat-forward)
-;; get rid of the standard completion binding, always use auto-complete
-;; this didn't work very well
-;;(global-set-key (kbd "TAB") 'auto-complete)
-(define-key global-map [remap completion-at-point] 'auto-complete)
+;;;;; f12 - tbd
;;;;; end - move-end-of-line
;; taken from emacs wiki, along with home function
;; http://www.emacswiki.org/emacs/BackToIndentationOrBeginning
-(defun point-in-comment ()
- "Determine if the point is inside a comment"
- (interactive)
- (let ((syn (syntax-ppss)))
- (and (nth 8 syn)
- (not (nth 3 syn)))))
-(defun end-of-code-or-line (arg)
- "Move to end of line, or before start of comments depending on situation.
- Toggle back and forth positions if we are already at one.
- Comments are recognized in any mode that sets syntax-ppss
- properly."
- (interactive "P")
- (when (catch 'bol
- (let ((start (point))
- (bol (save-excursion
- (beginning-of-line)
- (point)))
- (eol (progn (move-end-of-line arg) (point))))
- (while (point-in-comment)
- (backward-char)
- (when (= (point) bol)
- (throw 'bol t)))
- (throw 'bol (and (not (= eol start)) (>= start (point))))))
- (move-end-of-line arg)))
-
-(global-set-key (kbd "<end>") 'end-of-code-or-line)(add-hook 'org-mode-hook (lambda () (define-key org-mode-map (kbd "<end>") 'org-end-of-line)))
+;;; doing a test without this set: june 2026
+
+;; (defun point-in-comment ()
+;; "Determine if the point is inside a comment"
+;; (interactive)
+;; (let ((syn (syntax-ppss)))
+;; (and (nth 8 syn)
+;; (not (nth 3 syn)))))
+;; (defun end-of-code-or-line (arg)
+;; "Move to end of line, or before start of comments depending on situation.
+;; Toggle back and forth positions if we are already at one.
+;; Comments are recognized in any mode that sets syntax-ppss
+;; properly."
+;; (interactive "P")
+;; (when (catch 'bol
+;; (let ((start (point))
+;; (bol (save-excursion
+;; (beginning-of-line)
+;; (point)))
+;; (eol (progn (move-end-of-line arg) (point))))
+;; (while (point-in-comment)
+;; (backward-char)
+;; (when (= (point) bol)
+;; (throw 'bol t)))
+;; (throw 'bol (and (not (= eol start)) (>= start (point))))))
+;; (move-end-of-line arg)))
+;;(global-set-key (kbd "<end>") 'end-of-code-or-line)
+;;; orig key for testing
+;;(global-set-key (kbd "<end>") 'move-end-of-line)
+(add-hook 'org-mode-hook (lambda () (define-key org-mode-map (kbd "<end>") 'org-end-of-line)))
;;;;; home - back-to-indentation
-(defun back-to-indentation-or-beginning ()
- (interactive)
- (if (= (point) (progn (back-to-indentation) (point)))
- (if (derived-mode-p 'org-mode)
- (org-beginning-of-line)
- (beginning-of-line))))
+
+(defun back-to-indentation-or-beginning (&optional arg)
+ (interactive "^p")
+ (when (= (point) (progn (back-to-indentation) (point)))
+ (move-beginning-of-line arg)))
(global-set-key (kbd "<home>") 'back-to-indentation-or-beginning)
+;;; test stardard keybind:
+;; (global-set-key (kbd "<home>") 'move-beginning-of-line)
;;;;; s-tab - indent-buffer
;; This is translated from S-<iso-lefttab> in graphicsal mode. previously, I had
(add-hook 'org-mode-hook
(lambda ()
(define-key org-mode-map (kbd "M-q") 'org-shifttab)))
+;; default is prog-fill-reindent-defun
+(add-hook 'prog-mode-hook
+ (lambda () (define-key prog-mode-map (kbd "M-q") nil)))
+
(global-set-key (kbd "M-q") 'bicycle-cycle-global)
;;;;; C-M-q quoted-insert
;;;;; M-r sql-up
(global-set-key (kbd "M-r") 'sqlformat-region)
-;;;;; C-a copy buffer
+;;;;; C-a kill-whole-line
+
+(global-set-key (kbd "C-a") 'kill-whole-line)
+(defun kill-whole-line-wrapper (&optional arg)
+ "If we are at the end of the file, kill backwards instead of doing nothing."
+ (interactive "P")
+ (if (= (point) (point-max))
+ (kill-whole-line -1)
+ (kill-whole-line arg)))
+
-(defun copy-all ()
- "Copy entire buffer to clipboard"
- (interactive)
- (clipboard-kill-ring-save (point-min) (point-max)))
-(global-set-key (kbd "C-a") 'copy-all)
;;;;; C-s - c-x prefix
;; prefix key binds.
(global-set-key (kbd "C-M-d") 'split-window-horizontally)
-;;;;; C-f - kill-whole-line
+;;;;; C-f - isearch-forward
+;; explained in http://stackoverflow.com/questions/7411920/how-to-bind-search-and-search-repeat-to-c-f-in-emacs
+
+;; not my normal keyboard.
+(global-set-key (kbd "C-f") 'isearch-forward)
+(define-key isearch-mode-map (kbd "C-f") 'isearch-repeat-forward)
+;; get rid of the standard completion binding, always use auto-complete
+;; this didn't work very well
+;;(global-set-key (kbd "TAB") 'auto-complete)
+(define-key global-map [remap completion-at-point] 'auto-complete)
-(global-set-key (kbd "C-f") 'kill-whole-line-wrapper)
-(setq-default
- kill-whole-line-accumulate nil
- kill-whole-line-accumulate-engage nil
- )
-(defun kill-whole-line-wrapper (&optional arg)
- "If we are at the end of the file, kill backwards instead of doing nothing."
- (interactive "P")
- (when kill-whole-line-accumulate
- ;; set last-command the 2nd time we run this function with
- ;; accumulate on.
- (if kill-whole-line-accumulate-engage
- (setq last-command 'kill-region)
- (setq kill-whole-line-accumulate-engage t))
- )
- (if (= (point) (point-max))
- (kill-whole-line -1)
- (kill-whole-line arg)))
;;;;; M-f - print-var-at-point
(global-set-key (kbd "C-d") 'kill-ring-save)
+(add-hook 'php-mode-hook
+ (lambda ()
+ (define-key php-mode-map (kbd "C-d") nil)))
(add-hook 'c-mode-common-hook
(lambda ()
(global-set-key (kbd "C-v") 'yank-better)
-
-
(defun yank-better (arg)
"Paste, linewise if our kill ends with a newline.
I change the behavior of plain prefix. It makes it not do linewise paste,
(interactive "*P")
(if (and (not (equal arg '(4))) (string-suffix-p "\n" (current-kill 0 t)))
(beginning-of-line))
- (if (and (stringp mode-name) (string= mode-name "Org"))
- (call-interactively 'org-yank)
- (setq this-command 'yank)
- (call-interactively 'yank (and (not (equal arg '(4)))))))
+ (cond ((and (stringp mode-name) (string= mode-name "Org"))
+ (call-interactively 'org-yank))
+ (t
+ (setq this-command 'yank)
+ (call-interactively 'yank (and (not (equal arg '(4))))))))
(put 'yank-better 'delete-selection 'yank)
(global-set-key (kbd "C-p") 'move-mouse-to-point)
+;;;;; M-p copy-all
+(defun copy-all ()
+ "Copy entire buffer to clipboard"
+ (interactive)
+ (clipboard-kill-ring-save (point-min) (point-max)))
+(global-set-key (kbd "M-p") 'copy-all)
+
;;;;; C-M-p - delete-horizontal-space
(global-set-key (kbd "C-M-p") 'delete-horizontal-space)
;;;;; C-t - org cycle todo / toggle comint motion
+
(add-hook 'org-mode-hook
(lambda ()
(define-key org-mode-map (kbd "C-t") 'org-todo)))
(eval-after-load "message"
'(define-key message-mode-map (kbd "C-t") 'mail-signature))
-(defun kill-whole-line-toggle-accumulate ()
- (interactive)
- (setq kill-whole-line-accumulate-engage nil)
- (message "c-t %s" (setq kill-whole-line-accumulate (not kill-whole-line-accumulate)))
- )
-
-(global-set-key (kbd "C-t") 'kill-whole-line-toggle-accumulate)
-
(defun my-ansi-color-file ()
(interactive)
(when (string= (buffer-file-name) "/home/iank/tmp-fs.log")