Move things around in org mode file
This commit is contained in:
parent
095fec1364
commit
0c60b9346c
@ -1,10 +1,10 @@
|
|||||||
;;; init.el -- EMACS -*- lexical-binding: t -*-
|
;;; init.el -*- lexical-binding: t -*-
|
||||||
;;;
|
;;;
|
||||||
;;; Author: James Dixon <notjamesdixon@gmail.com>
|
;;; Author: James Dixon <notjamesdixon@gmail.com>
|
||||||
;;; Maintainer: James Dixon <notjamesdixon@gmail.com>
|
;;; Maintainer: James Dixon <notjamesdixon@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;; My Literate Emacs Config
|
;;; My Emacs Config
|
||||||
;;;
|
;;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
@ -110,34 +110,6 @@
|
|||||||
;; Auto-refresh buffers when files on disk change.
|
;; Auto-refresh buffers when files on disk change.
|
||||||
(global-auto-revert-mode t)
|
(global-auto-revert-mode t)
|
||||||
|
|
||||||
(define-minor-mode clean-trailing-whitespace-mode
|
|
||||||
"Tidy up trailing whitespace with `delete-trailing-whitespace' before saving."
|
|
||||||
:lighter " ctsv"
|
|
||||||
(if clean-trailing-whitespace-mode
|
|
||||||
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t)
|
|
||||||
(remove-hook 'before-save-hook #'delete-trailing-whitespace t)))
|
|
||||||
|
|
||||||
(define-minor-mode clean-all-whitespace-mode
|
|
||||||
"Tidy up *all* whitespace with `whitespace-cleanup' before saving."
|
|
||||||
:lighter " casv"
|
|
||||||
(if clean-trailing-whitespace-mode
|
|
||||||
(add-hook 'before-save-hook #'whitespace-cleanup nil t)
|
|
||||||
(remove-hook 'before-save-hook #'whitespace-cleanup t)))
|
|
||||||
|
|
||||||
(define-minor-mode check-parens-save-mode
|
|
||||||
"Check the balance of parens with `check-parens' before saving."
|
|
||||||
:lighter " cpns"
|
|
||||||
(if check-parens-save-mode
|
|
||||||
(add-hook 'before-save-mode #'check-parens nil t)
|
|
||||||
(remove-hook 'before-save-mode #'check-parens t)))
|
|
||||||
|
|
||||||
;;; Minor Mode Hooks
|
|
||||||
;; (add-hook 'prog-mode #'clean-all-whitespace-mode)
|
|
||||||
;; (add-hook 'org-mode #'clean-all-whitespace-mode)
|
|
||||||
;;
|
|
||||||
;; (add-hook 'emacs-lisp-mode #'check-parens-save-mode)
|
|
||||||
;; (add-hook 'emacs-lisp-mode #'outline-minor-mode)
|
|
||||||
|
|
||||||
;;; Custom Tab Settings
|
;;; Custom Tab Settings
|
||||||
;; https://dougie.io/emacs/indentation/
|
;; https://dougie.io/emacs/indentation/
|
||||||
;; Create a variable for our preferred tab width
|
;; Create a variable for our preferred tab width
|
||||||
@ -180,6 +152,34 @@
|
|||||||
;; Make the backspace properly erase the tab instead of removing 1 space at a time.
|
;; Make the backspace properly erase the tab instead of removing 1 space at a time.
|
||||||
(setq backward-delete-char-untabify-method 'hungry)
|
(setq backward-delete-char-untabify-method 'hungry)
|
||||||
|
|
||||||
|
(define-minor-mode clean-trailing-whitespace-mode
|
||||||
|
"Tidy up trailing whitespace with `delete-trailing-whitespace' before saving."
|
||||||
|
:lighter " ctsv"
|
||||||
|
(if clean-trailing-whitespace-mode
|
||||||
|
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t)
|
||||||
|
(remove-hook 'before-save-hook #'delete-trailing-whitespace t)))
|
||||||
|
|
||||||
|
(define-minor-mode clean-all-whitespace-mode
|
||||||
|
"Tidy up *all* whitespace with `whitespace-cleanup' before saving."
|
||||||
|
:lighter " casv"
|
||||||
|
(if clean-trailing-whitespace-mode
|
||||||
|
(add-hook 'before-save-hook #'whitespace-cleanup nil t)
|
||||||
|
(remove-hook 'before-save-hook #'whitespace-cleanup t)))
|
||||||
|
|
||||||
|
(define-minor-mode check-parens-save-mode
|
||||||
|
"Check the balance of parens with `check-parens' before saving."
|
||||||
|
:lighter " cpns"
|
||||||
|
(if check-parens-save-mode
|
||||||
|
(add-hook 'before-save-mode #'check-parens nil t)
|
||||||
|
(remove-hook 'before-save-mode #'check-parens t)))
|
||||||
|
|
||||||
|
;;; Minor Mode Hooks
|
||||||
|
;; (add-hook 'prog-mode #'clean-all-whitespace-mode)
|
||||||
|
;; (add-hook 'org-mode #'clean-all-whitespace-mode)
|
||||||
|
;;
|
||||||
|
;; (add-hook 'emacs-lisp-mode #'check-parens-save-mode)
|
||||||
|
;; (add-hook 'emacs-lisp-mode #'outline-minor-mode)
|
||||||
|
|
||||||
;; https://stackoverflow.com/questions/6286579/emacs-shell-mode-how-to-send-region-to-shell/7053298#7053298
|
;; https://stackoverflow.com/questions/6286579/emacs-shell-mode-how-to-send-region-to-shell/7053298#7053298
|
||||||
(defun shell-region (start end)
|
(defun shell-region (start end)
|
||||||
"Execute region START to END in an inferior shell."
|
"Execute region START to END in an inferior shell."
|
||||||
@ -432,21 +432,27 @@
|
|||||||
;;; Vanilla Emacs Keybinds
|
;;; Vanilla Emacs Keybinds
|
||||||
(global-set-key (kbd "C-c i") (lambda () (interactive) (find-file (concat user-emacs-directory "/init.org"))))
|
(global-set-key (kbd "C-c i") (lambda () (interactive) (find-file (concat user-emacs-directory "/init.org"))))
|
||||||
(global-set-key (kbd "C-c d") (lambda () (interactive) (find-file (getenv "DOTFILES"))))
|
(global-set-key (kbd "C-c d") (lambda () (interactive) (find-file (getenv "DOTFILES"))))
|
||||||
(global-set-key (kbd "C-c g") (lambda () (interactive) (find-file (concat (getenv "DOTFILES") "/config/emacs/.config/emacs/init.el"))))
|
|
||||||
|
|
||||||
;; more ergo keybind for switching to normal<->emacs state
|
;; more ergo keybind for switching to normal<->emacs state
|
||||||
(global-set-key (kbd "C-;") (kbd "C-z"))
|
(global-set-key (kbd "C-;") (kbd "C-z"))
|
||||||
|
|
||||||
(add-hook 'python-mode-hook
|
;;; Better discoverability for key mappings (which-key)
|
||||||
(lambda () (set (make-local-variable 'compile-command)
|
;; https://github.com/justbur/emacs-which-key
|
||||||
(format "python3 %s" (file-name-nondirectory buffer-file-name)))))
|
;; builtin to emacs > 30.1
|
||||||
|
(use-package which-key
|
||||||
|
:straight t
|
||||||
|
:init (which-key-mode 1))
|
||||||
|
|
||||||
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html
|
;;; Better help menus (helpful)
|
||||||
(use-package dired
|
;; https://github.com/Wilfred/helpful
|
||||||
:straight nil
|
(use-package helpful
|
||||||
:commands (dired dired-jump)
|
:straight t
|
||||||
:config
|
:bind
|
||||||
(setq dired-dwim-target t))
|
(("C-c C-d" . helpful-at-point) ; Lookup the symbol at point
|
||||||
|
("C-h f" . helpful-callable) ; Describe a function
|
||||||
|
("C-h v" . helpful-variable) ; Describe a variable
|
||||||
|
("C-h k" . helpful-key) ; Describe a key binding
|
||||||
|
("C-h x" . helpful-command))) ; Describe a command
|
||||||
|
|
||||||
;; Org mode (organization outline framework)
|
;; Org mode (organization outline framework)
|
||||||
(straight-use-package '(org :type built-in)) ;; use builtin org
|
(straight-use-package '(org :type built-in)) ;; use builtin org
|
||||||
@ -497,6 +503,13 @@
|
|||||||
(use-package magit
|
(use-package magit
|
||||||
:straight t)
|
:straight t)
|
||||||
|
|
||||||
|
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html
|
||||||
|
(use-package dired
|
||||||
|
:straight nil
|
||||||
|
:commands (dired dired-jump)
|
||||||
|
:config
|
||||||
|
(setq dired-dwim-target t))
|
||||||
|
|
||||||
;; Fancy, polished and modernized dired
|
;; Fancy, polished and modernized dired
|
||||||
;; https://github.com/alexluigit/dirvish
|
;; https://github.com/alexluigit/dirvish
|
||||||
;; https://github.com/alexluigit/dirvish/blob/main/docs/CUSTOMIZING.org#sample-config
|
;; https://github.com/alexluigit/dirvish/blob/main/docs/CUSTOMIZING.org#sample-config
|
||||||
@ -603,6 +616,11 @@
|
|||||||
(goggles-define yank evil-paste-after) ; make pasting from evil mode highlighted
|
(goggles-define yank evil-paste-after) ; make pasting from evil mode highlighted
|
||||||
(setq-default goggles-pulse t))
|
(setq-default goggles-pulse t))
|
||||||
|
|
||||||
|
;; NYAN x inf
|
||||||
|
;; https://github.com/TeMPOraL/nyan-mode
|
||||||
|
(use-package nyan-mode
|
||||||
|
:straight t)
|
||||||
|
|
||||||
;;; Mini-buffer improvements (fido, orderless, marginalia)
|
;;; Mini-buffer improvements (fido, orderless, marginalia)
|
||||||
;; Let's try [icomplete / fido / ido] mode for a while.
|
;; Let's try [icomplete / fido / ido] mode for a while.
|
||||||
;; (icomplete-vertical-mode)
|
;; (icomplete-vertical-mode)
|
||||||
@ -701,30 +719,12 @@
|
|||||||
;; useful beyond Corfu.
|
;; useful beyond Corfu.
|
||||||
(read-extended-command-predicate #'command-completion-default-include-p))
|
(read-extended-command-predicate #'command-completion-default-include-p))
|
||||||
|
|
||||||
;;; Better discoverability for key mappings (which-key)
|
|
||||||
;; https://github.com/justbur/emacs-which-key
|
|
||||||
;; builtin to emacs > 30.1
|
|
||||||
(use-package which-key
|
|
||||||
:straight t
|
|
||||||
:init (which-key-mode 1))
|
|
||||||
|
|
||||||
;;; Better help menus (helpful)
|
|
||||||
;; https://github.com/Wilfred/helpful
|
|
||||||
(use-package helpful
|
|
||||||
:straight t
|
|
||||||
:bind
|
|
||||||
(("C-c C-d" . helpful-at-point) ; Lookup the symbol at point
|
|
||||||
("C-h f" . helpful-callable) ; Describe a function
|
|
||||||
("C-h v" . helpful-variable) ; Describe a variable
|
|
||||||
("C-h k" . helpful-key) ; Describe a key binding
|
|
||||||
("C-h x" . helpful-command))) ; Describe a command
|
|
||||||
|
|
||||||
;; Syntax checking
|
;; Syntax checking
|
||||||
;; https://www.flycheck.org/en/latest/languages.html
|
;; https://www.flycheck.org/en/latest/languages.html
|
||||||
;; https://github.com/flycheck/flycheck
|
;; https://github.com/flycheck/flycheck
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:straight t
|
:straight t
|
||||||
:init (add-hook 'after-init-hook #'global-flycheck-mode))
|
:init (global-flycheck-mode))
|
||||||
|
|
||||||
;;; External code formatting tool integration (format-all)
|
;;; External code formatting tool integration (format-all)
|
||||||
;; https://github.com/lassik/emacs-format-all-the-code
|
;; https://github.com/lassik/emacs-format-all-the-code
|
||||||
@ -743,6 +743,15 @@
|
|||||||
:config
|
:config
|
||||||
(global-whitespace-cleanup-mode))
|
(global-whitespace-cleanup-mode))
|
||||||
|
|
||||||
|
(use-package compile
|
||||||
|
:straight nil
|
||||||
|
:config
|
||||||
|
(setq compilation-scroll-output t))
|
||||||
|
|
||||||
|
(add-hook 'python-mode-hook
|
||||||
|
(lambda () (set (make-local-variable 'compile-command)
|
||||||
|
(format "python3 %s" (file-name-nondirectory buffer-file-name)))))
|
||||||
|
|
||||||
;; Abbrevs and Snippets
|
;; Abbrevs and Snippets
|
||||||
;; URLs
|
;; URLs
|
||||||
(define-abbrev global-abbrev-table "mygh" "https://github.com/lemonase")
|
(define-abbrev global-abbrev-table "mygh" "https://github.com/lemonase")
|
||||||
@ -773,30 +782,25 @@
|
|||||||
:straight t
|
:straight t
|
||||||
:init)
|
:init)
|
||||||
|
|
||||||
|
;; LSP Modes
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:straight nil
|
:straight nil
|
||||||
:defer t
|
:defer t
|
||||||
:hook ((python-mode . eglot-ensure)
|
:hook ((python-mode . eglot-ensure)
|
||||||
(go-mode . eglot-ensure)))
|
(go-mode . eglot-ensure)))
|
||||||
|
|
||||||
;;; Extra Language Modes
|
;; Allow flycheck errors to show with eglot
|
||||||
|
;;https://github.com/flycheck/flycheck-eglot
|
||||||
|
;; (use-package flycheck-eglot
|
||||||
|
;; :straight t
|
||||||
|
;; :after (flycheck eglot)
|
||||||
|
;; :config
|
||||||
|
;; (global-flycheck-eglot-mode 1))
|
||||||
|
|
||||||
;; Lua mode
|
;; Lua mode
|
||||||
(use-package lua-mode
|
(use-package lua-mode
|
||||||
:straight t)
|
:straight t)
|
||||||
|
|
||||||
;;; Other misc modes (docker, gptel, load-env-vars, csv-mode)
|
|
||||||
(use-package docker
|
|
||||||
:straight t
|
|
||||||
:defer t)
|
|
||||||
|
|
||||||
(use-package dockerfile-mode
|
|
||||||
:straight t
|
|
||||||
:defer t)
|
|
||||||
|
|
||||||
(use-package csv-mode
|
|
||||||
:straight t
|
|
||||||
:defer t)
|
|
||||||
|
|
||||||
;; JavaScript
|
;; JavaScript
|
||||||
(use-package js
|
(use-package js
|
||||||
:defer t
|
:defer t
|
||||||
@ -839,6 +843,24 @@
|
|||||||
(let ((buffer-file-name (buffer-name)))
|
(let ((buffer-file-name (buffer-name)))
|
||||||
(set-auto-mode)))))
|
(set-auto-mode)))))
|
||||||
|
|
||||||
|
;;; Extra Language Modes
|
||||||
|
;; docker
|
||||||
|
(use-package docker
|
||||||
|
:straight t
|
||||||
|
:defer t)
|
||||||
|
(use-package dockerfile-mode
|
||||||
|
:straight t
|
||||||
|
:defer t)
|
||||||
|
|
||||||
|
;; csv
|
||||||
|
(use-package csv-mode
|
||||||
|
:straight t
|
||||||
|
:defer t)
|
||||||
|
|
||||||
|
;; vimrc
|
||||||
|
(use-package vimrc-mode
|
||||||
|
:straight t)
|
||||||
|
|
||||||
;; Local Environment File
|
;; Local Environment File
|
||||||
(use-package load-env-vars
|
(use-package load-env-vars
|
||||||
:straight t)
|
:straight t)
|
||||||
@ -897,7 +919,7 @@
|
|||||||
;; xah-lee functions
|
;; xah-lee functions
|
||||||
;; http://xahlee.info/index.html
|
;; http://xahlee.info/index.html
|
||||||
|
|
||||||
(defun x-open-in-vscode ()
|
(defun open-in-vscode ()
|
||||||
"Open current file or dir in vscode."
|
"Open current file or dir in vscode."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((xpath (if buffer-file-name buffer-file-name (expand-file-name default-directory))))
|
(let ((xpath (if buffer-file-name buffer-file-name (expand-file-name default-directory))))
|
||||||
@ -910,19 +932,6 @@
|
|||||||
((eq system-type 'gnu/linux)
|
((eq system-type 'gnu/linux)
|
||||||
(shell-command (format "code %s" (shell-quote-argument xpath)))))))
|
(shell-command (format "code %s" (shell-quote-argument xpath)))))))
|
||||||
|
|
||||||
(defun x-open-in-terminal ()
|
|
||||||
"Open the current dir in a new terminal window."
|
|
||||||
(interactive)
|
|
||||||
(cond
|
|
||||||
((eq system-type 'windows-nt)
|
|
||||||
(shell-command (concat "wt -d " (shell-quote-argument (expand-file-name default-directory)))))
|
|
||||||
((eq system-type 'darwin)
|
|
||||||
(shell-command (concat "open -a iTerm " (shell-quote-argument (expand-file-name default-directory)))))
|
|
||||||
((eq system-type 'gnu/linux)
|
|
||||||
(let ((process-connection-type nil)) (start-process "" nil "x-terminal-emulator" (concat "--working-directory=" default-directory))))
|
|
||||||
((eq system-type 'berkeley-unix)
|
|
||||||
(let ((process-connection-type nil)) (start-process "" nil "x-terminal-emulator" (concat "--working-directory=" default-directory))))))
|
|
||||||
|
|
||||||
;;; Buffer local variables - ask to save/tangle.
|
;;; Buffer local variables - ask to save/tangle.
|
||||||
;; Local Variables:
|
;; Local Variables:
|
||||||
;; eval: (add-hook 'after-save-hook (lambda ()(if (y-or-n-p "Reload?")(load-file user-init-file))) nil t)
|
;; eval: (add-hook 'after-save-hook (lambda ()(if (y-or-n-p "Reload?")(load-file user-init-file))) nil t)
|
||||||
|
|||||||
@ -1,37 +1,36 @@
|
|||||||
#+TITLE: Emacs Literate Config
|
#+TITLE: Emacs Literate Config
|
||||||
#+AUTHOR: James Dixon
|
#+AUTHOR: James Dixon
|
||||||
|
|
||||||
* My Literate Emacs with EVIL
|
* Emacs Config
|
||||||
|
|
||||||
|
Made with +evil+ love
|
||||||
|
|
||||||
** Prelude and Initial Comments
|
** Prelude and Initial Comments
|
||||||
|
|
||||||
Initial comment prelude to appease the commnent gods.
|
Initial comment prelude to appease the commnent gods.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;;; init.el -- EMACS -*- lexical-binding: t -*-
|
;;; init.el -*- lexical-binding: t -*-
|
||||||
;;;
|
;;;
|
||||||
;;; Author: James Dixon <notjamesdixon@gmail.com>
|
;;; Author: James Dixon <notjamesdixon@gmail.com>
|
||||||
;;; Maintainer: James Dixon <notjamesdixon@gmail.com>
|
;;; Maintainer: James Dixon <notjamesdixon@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;; My Literate Emacs Config
|
;;; My Emacs Config
|
||||||
;;;
|
;;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Setting User and Email
|
** Setting User and Email
|
||||||
|
|
||||||
We set this for use later on with email and other packages.
|
We set this for later use with git, email and other misc. packages.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
(setq user-full-name "James Dixon")
|
(setq user-full-name "James Dixon")
|
||||||
(setq user-mail-address "notjamesdixon@gmail.com")
|
(setq user-mail-address "notjamesdixon@gmail.com")
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Sensible Defaults
|
** More Sensible Defaults
|
||||||
|
|
||||||
These are things what I would consider more sensible defaults for emacs.
|
|
||||||
|
|
||||||
*** UI Settings
|
*** UI Settings
|
||||||
|
|
||||||
- Setting UTF-8 encoding for language
|
- Setting UTF-8 encoding for language
|
||||||
@ -107,7 +106,7 @@ Undo and Garbage Collection Limits Upgrade
|
|||||||
(setq read-extended-command-predicate #'command-completion-default-include-p)
|
(setq read-extended-command-predicate #'command-completion-default-include-p)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Theme and Font
|
*** Set Default Theme and Font
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;;; Theme (Default)
|
;;; Theme (Default)
|
||||||
@ -118,7 +117,7 @@ Undo and Garbage Collection Limits Upgrade
|
|||||||
;; (load-theme 'modus-operandi t)
|
;; (load-theme 'modus-operandi t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** File History, Saving, Reverting and Backups
|
*** File History, Saving, Reverting and Backups
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;;; File History, Saving and Reverting
|
;;; File History, Saving and Reverting
|
||||||
@ -161,48 +160,13 @@ Undo and Garbage Collection Limits Upgrade
|
|||||||
(global-auto-revert-mode t)
|
(global-auto-revert-mode t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Basic Minor Modes and Hooks
|
*** Tab and Indent Settings
|
||||||
|
|
||||||
Adding some basic minor modes for ease of adding as hooks.
|
|
||||||
|
|
||||||
*** Whitespace and Parens
|
|
||||||
|
|
||||||
Cleaning up whitespace and checking balanced parens are something that should be handled automatically.
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
|
||||||
(define-minor-mode clean-trailing-whitespace-mode
|
|
||||||
"Tidy up trailing whitespace with `delete-trailing-whitespace' before saving."
|
|
||||||
:lighter " ctsv"
|
|
||||||
(if clean-trailing-whitespace-mode
|
|
||||||
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t)
|
|
||||||
(remove-hook 'before-save-hook #'delete-trailing-whitespace t)))
|
|
||||||
|
|
||||||
(define-minor-mode clean-all-whitespace-mode
|
|
||||||
"Tidy up *all* whitespace with `whitespace-cleanup' before saving."
|
|
||||||
:lighter " casv"
|
|
||||||
(if clean-trailing-whitespace-mode
|
|
||||||
(add-hook 'before-save-hook #'whitespace-cleanup nil t)
|
|
||||||
(remove-hook 'before-save-hook #'whitespace-cleanup t)))
|
|
||||||
|
|
||||||
(define-minor-mode check-parens-save-mode
|
|
||||||
"Check the balance of parens with `check-parens' before saving."
|
|
||||||
:lighter " cpns"
|
|
||||||
(if check-parens-save-mode
|
|
||||||
(add-hook 'before-save-mode #'check-parens nil t)
|
|
||||||
(remove-hook 'before-save-mode #'check-parens t)))
|
|
||||||
|
|
||||||
;;; Minor Mode Hooks
|
|
||||||
;; (add-hook 'prog-mode #'clean-all-whitespace-mode)
|
|
||||||
;; (add-hook 'org-mode #'clean-all-whitespace-mode)
|
|
||||||
;;
|
|
||||||
;; (add-hook 'emacs-lisp-mode #'check-parens-save-mode)
|
|
||||||
;; (add-hook 'emacs-lisp-mode #'outline-minor-mode)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
** Tab and Indent Settings
|
|
||||||
|
|
||||||
Tabs are horribly confusing to deal with in Emacs and some programming minor modes
|
Tabs are horribly confusing to deal with in Emacs and some programming minor modes
|
||||||
really do not help simplify the situation. This is what works for now...
|
really do not help simplify the situation.
|
||||||
|
This works somewhat, but need a quick way to change indent/tab settings in a buffer.
|
||||||
|
|
||||||
|
**** Custom Tab Settings
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;;; Custom Tab Settings
|
;;; Custom Tab Settings
|
||||||
@ -248,11 +212,44 @@ really do not help simplify the situation. This is what works for now...
|
|||||||
(setq backward-delete-char-untabify-method 'hungry)
|
(setq backward-delete-char-untabify-method 'hungry)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Custom Enhanced Defuns
|
*** Whitespace and Parens
|
||||||
|
|
||||||
Better functions for some of the defaults.
|
Cleaning up whitespace and checking balanced parens are something that should be handled automatically.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
|
(define-minor-mode clean-trailing-whitespace-mode
|
||||||
|
"Tidy up trailing whitespace with `delete-trailing-whitespace' before saving."
|
||||||
|
:lighter " ctsv"
|
||||||
|
(if clean-trailing-whitespace-mode
|
||||||
|
(add-hook 'before-save-hook #'delete-trailing-whitespace nil t)
|
||||||
|
(remove-hook 'before-save-hook #'delete-trailing-whitespace t)))
|
||||||
|
|
||||||
|
(define-minor-mode clean-all-whitespace-mode
|
||||||
|
"Tidy up *all* whitespace with `whitespace-cleanup' before saving."
|
||||||
|
:lighter " casv"
|
||||||
|
(if clean-trailing-whitespace-mode
|
||||||
|
(add-hook 'before-save-hook #'whitespace-cleanup nil t)
|
||||||
|
(remove-hook 'before-save-hook #'whitespace-cleanup t)))
|
||||||
|
|
||||||
|
(define-minor-mode check-parens-save-mode
|
||||||
|
"Check the balance of parens with `check-parens' before saving."
|
||||||
|
:lighter " cpns"
|
||||||
|
(if check-parens-save-mode
|
||||||
|
(add-hook 'before-save-mode #'check-parens nil t)
|
||||||
|
(remove-hook 'before-save-mode #'check-parens t)))
|
||||||
|
|
||||||
|
;;; Minor Mode Hooks
|
||||||
|
;; (add-hook 'prog-mode #'clean-all-whitespace-mode)
|
||||||
|
;; (add-hook 'org-mode #'clean-all-whitespace-mode)
|
||||||
|
;;
|
||||||
|
;; (add-hook 'emacs-lisp-mode #'check-parens-save-mode)
|
||||||
|
;; (add-hook 'emacs-lisp-mode #'outline-minor-mode)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** Better Builtin Functions
|
||||||
|
|
||||||
|
=Enhanced= functions for some of the defaults.
|
||||||
|
|
||||||
*** Vanilla Emacs Improvements
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; https://stackoverflow.com/questions/6286579/emacs-shell-mode-how-to-send-region-to-shell/7053298#7053298
|
;; https://stackoverflow.com/questions/6286579/emacs-shell-mode-how-to-send-region-to-shell/7053298#7053298
|
||||||
@ -328,7 +325,7 @@ Better functions for some of the defaults.
|
|||||||
(advice-add 'evil-yank :around 'hl-yank-advice)
|
(advice-add 'evil-yank :around 'hl-yank-advice)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Here be Packages
|
** Emacs lisp packages
|
||||||
*** Bootstrap straight.el
|
*** Bootstrap straight.el
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
@ -355,7 +352,7 @@ Better functions for some of the defaults.
|
|||||||
|
|
||||||
*** Use PATH from shell environment
|
*** Use PATH from shell environment
|
||||||
|
|
||||||
Emacs does not properly pick up PATH from shell environment.
|
Emacs does not properly pick up PATH from shell environment on macOS (or Windows).
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;;; Set Emacs path == shell path (exec-path-from-shell)
|
;;; Set Emacs path == shell path (exec-path-from-shell)
|
||||||
@ -367,9 +364,10 @@ Emacs does not properly pick up PATH from shell environment.
|
|||||||
(exec-path-from-shell-initialize))
|
(exec-path-from-shell-initialize))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Use EVIL
|
*** Setup Keybinds
|
||||||
|
**** Evil
|
||||||
|
|
||||||
Set settings as well as load EVIL and complementary packages.
|
Set initial evil settings as well as adding complementary evil packages.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;;; EVIL Config :: Vi/Vim Emulation++ (evil-mode)
|
;;; EVIL Config :: Vi/Vim Emulation++ (evil-mode)
|
||||||
@ -439,7 +437,11 @@ Set settings as well as load EVIL and complementary packages.
|
|||||||
(evil-define-key '(normal visual) 'global (kbd "C-a C--") 'evil-numbers/dec-at-pt-incremental))
|
(evil-define-key '(normal visual) 'global (kbd "C-a C--") 'evil-numbers/dec-at-pt-incremental))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** General Prefix/Leader Keybinds
|
**** Evil Keybinds : General
|
||||||
|
|
||||||
|
Keybinds grouped varying degrees of organization.
|
||||||
|
|
||||||
|
Prefix / leader key of <SPC>.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; Custom Evil Keybinds
|
;; Custom Evil Keybinds
|
||||||
@ -524,38 +526,51 @@ Set settings as well as load EVIL and complementary packages.
|
|||||||
|
|
||||||
;; Custom Ex commands
|
;; Custom Ex commands
|
||||||
(evil-ex-define-cmd "Format" 'format-all-region-or-buffer) ;; format-all-code
|
(evil-ex-define-cmd "Format" 'format-all-region-or-buffer) ;; format-all-code
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
**** Emacs Global Keybinds
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;;; Vanilla Emacs Keybinds
|
;;; Vanilla Emacs Keybinds
|
||||||
(global-set-key (kbd "C-c i") (lambda () (interactive) (find-file (concat user-emacs-directory "/init.org"))))
|
(global-set-key (kbd "C-c i") (lambda () (interactive) (find-file (concat user-emacs-directory "/init.org"))))
|
||||||
(global-set-key (kbd "C-c d") (lambda () (interactive) (find-file (getenv "DOTFILES"))))
|
(global-set-key (kbd "C-c d") (lambda () (interactive) (find-file (getenv "DOTFILES"))))
|
||||||
(global-set-key (kbd "C-c g") (lambda () (interactive) (find-file (concat (getenv "DOTFILES") "/config/emacs/.config/emacs/init.el"))))
|
|
||||||
|
|
||||||
;; more ergo keybind for switching to normal<->emacs state
|
;; more ergo keybind for switching to normal<->emacs state
|
||||||
(global-set-key (kbd "C-;") (kbd "C-z"))
|
(global-set-key (kbd "C-;") (kbd "C-z"))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Compile Mode
|
**** More helpful Help and Key Menus
|
||||||
|
|
||||||
|
It can be difficult to memorize key binds... `which-key` helps greatly by giving a transient pop-up buffer.
|
||||||
|
|
||||||
|
`helpful` is also a great package that changes the look and layout of the interactive help buffers in Emacs
|
||||||
|
as well as adding supplemental information. The result is a better experience with help menus all around.
|
||||||
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
(add-hook 'python-mode-hook
|
;;; Better discoverability for key mappings (which-key)
|
||||||
(lambda () (set (make-local-variable 'compile-command)
|
;; https://github.com/justbur/emacs-which-key
|
||||||
(format "python3 %s" (file-name-nondirectory buffer-file-name)))))
|
;; builtin to emacs > 30.1
|
||||||
|
(use-package which-key
|
||||||
|
:straight t
|
||||||
|
:init (which-key-mode 1))
|
||||||
|
|
||||||
|
;;; Better help menus (helpful)
|
||||||
|
;; https://github.com/Wilfred/helpful
|
||||||
|
(use-package helpful
|
||||||
|
:straight t
|
||||||
|
:bind
|
||||||
|
(("C-c C-d" . helpful-at-point) ; Lookup the symbol at point
|
||||||
|
("C-h f" . helpful-callable) ; Describe a function
|
||||||
|
("C-h v" . helpful-variable) ; Describe a variable
|
||||||
|
("C-h k" . helpful-key) ; Describe a key binding
|
||||||
|
("C-h x" . helpful-command))) ; Describe a command
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Dired
|
*** Configure Modes
|
||||||
|
**** Org Mode (org-mode)
|
||||||
|
|
||||||
Builtin Emacs directory editor
|
Org mode. Cut my life into pizzas. This is my plastic fork!1 |dmb|
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
|
||||||
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html
|
|
||||||
(use-package dired
|
|
||||||
:straight nil
|
|
||||||
:commands (dired dired-jump)
|
|
||||||
:config
|
|
||||||
(setq dired-dwim-target t))
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
*** Org (org-mode)
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; Org mode (organization outline framework)
|
;; Org mode (organization outline framework)
|
||||||
@ -593,7 +608,9 @@ Builtin Emacs directory editor
|
|||||||
;; :straight t)
|
;; :straight t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Markdown Mode (markdown-mode)
|
**** Markdown Mode (markdown-mode)
|
||||||
|
|
||||||
|
Markdown is not supported filetype with Emacs, must use package.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;;; Markdown support for emacs
|
;;; Markdown support for emacs
|
||||||
@ -607,7 +624,9 @@ Builtin Emacs directory editor
|
|||||||
("C-c C-e" . markdown-do)))
|
("C-c C-e" . markdown-do)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Magit (git mode)
|
**** Magit (git)
|
||||||
|
|
||||||
|
It is magit. Git UI in Emacs.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; Magit (intuitive git interface)
|
;; Magit (intuitive git interface)
|
||||||
@ -616,7 +635,22 @@ Builtin Emacs directory editor
|
|||||||
:straight t)
|
:straight t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Dirvish (fancy/modern dired)
|
**** Dired Mode
|
||||||
|
|
||||||
|
Builtin Emacs directory editor
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
|
;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html
|
||||||
|
(use-package dired
|
||||||
|
:straight nil
|
||||||
|
:commands (dired dired-jump)
|
||||||
|
:config
|
||||||
|
(setq dired-dwim-target t))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
**** Dirvish (fancy/modern dired)
|
||||||
|
|
||||||
|
This package makes `dired` look completely different (in a good way).
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; Fancy, polished and modernized dired
|
;; Fancy, polished and modernized dired
|
||||||
@ -662,7 +696,9 @@ Builtin Emacs directory editor
|
|||||||
("M-e" . dirvish-emerge-menu)))
|
("M-e" . dirvish-emerge-menu)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Theme and Highlight (doom-themes)
|
**** Extra Themes, Colorschemes, Highlight and Random Effects
|
||||||
|
|
||||||
|
Change the look and feel of Emacs.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; https://github.com/doomemacs/themes
|
;; https://github.com/doomemacs/themes
|
||||||
@ -728,9 +764,19 @@ Builtin Emacs directory editor
|
|||||||
:config
|
:config
|
||||||
(goggles-define yank evil-paste-after) ; make pasting from evil mode highlighted
|
(goggles-define yank evil-paste-after) ; make pasting from evil mode highlighted
|
||||||
(setq-default goggles-pulse t))
|
(setq-default goggles-pulse t))
|
||||||
|
|
||||||
|
;; NYAN x inf
|
||||||
|
;; https://github.com/TeMPOraL/nyan-mode
|
||||||
|
(use-package nyan-mode
|
||||||
|
:straight t)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Minibuffer Completion
|
*** Completion
|
||||||
|
**** Minibuffer Completion Packages
|
||||||
|
|
||||||
|
Minibuffer defaults are pretty rough out of the box. Completion is there, but the UX is pretty bad...
|
||||||
|
|
||||||
|
These packages (vertico, orderless, marginalia) give better UX for minibuffer as well as ease of customization.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;;; Mini-buffer improvements (fido, orderless, marginalia)
|
;;; Mini-buffer improvements (fido, orderless, marginalia)
|
||||||
@ -793,7 +839,10 @@ Builtin Emacs directory editor
|
|||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Completion At Point (in main buffers)
|
**** Completion At Point (in main buffers)
|
||||||
|
|
||||||
|
Completion at point usually happens in main buffers, the main concern of `corfu` and `cape` is providing the UI elements.
|
||||||
|
Most of the functionality for completion comes from other functions within Emacs as far as I understand.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; corfu: mini completion ui
|
;; corfu: mini completion ui
|
||||||
@ -837,29 +886,10 @@ Builtin Emacs directory editor
|
|||||||
(read-extended-command-predicate #'command-completion-default-include-p))
|
(read-extended-command-predicate #'command-completion-default-include-p))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Better and More Helpful Menus
|
*** Programming Languages
|
||||||
|
**** Syntax Checking and Formatting
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
Basic syntax checking and formatting.
|
||||||
;;; Better discoverability for key mappings (which-key)
|
|
||||||
;; https://github.com/justbur/emacs-which-key
|
|
||||||
;; builtin to emacs > 30.1
|
|
||||||
(use-package which-key
|
|
||||||
:straight t
|
|
||||||
:init (which-key-mode 1))
|
|
||||||
|
|
||||||
;;; Better help menus (helpful)
|
|
||||||
;; https://github.com/Wilfred/helpful
|
|
||||||
(use-package helpful
|
|
||||||
:straight t
|
|
||||||
:bind
|
|
||||||
(("C-c C-d" . helpful-at-point) ; Lookup the symbol at point
|
|
||||||
("C-h f" . helpful-callable) ; Describe a function
|
|
||||||
("C-h v" . helpful-variable) ; Describe a variable
|
|
||||||
("C-h k" . helpful-key) ; Describe a key binding
|
|
||||||
("C-h x" . helpful-command))) ; Describe a command
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
*** Syntax Checking and Formatting
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; Syntax checking
|
;; Syntax checking
|
||||||
@ -867,7 +897,7 @@ Builtin Emacs directory editor
|
|||||||
;; https://github.com/flycheck/flycheck
|
;; https://github.com/flycheck/flycheck
|
||||||
(use-package flycheck
|
(use-package flycheck
|
||||||
:straight t
|
:straight t
|
||||||
:init (add-hook 'after-init-hook #'global-flycheck-mode))
|
:init (global-flycheck-mode))
|
||||||
|
|
||||||
;;; External code formatting tool integration (format-all)
|
;;; External code formatting tool integration (format-all)
|
||||||
;; https://github.com/lassik/emacs-format-all-the-code
|
;; https://github.com/lassik/emacs-format-all-the-code
|
||||||
@ -887,7 +917,24 @@ Builtin Emacs directory editor
|
|||||||
(global-whitespace-cleanup-mode))
|
(global-whitespace-cleanup-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Abbrevs and Snippets
|
**** Compile Mode
|
||||||
|
|
||||||
|
Compile the interpreters and interpret the compilers.
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
|
(use-package compile
|
||||||
|
:straight nil
|
||||||
|
:config
|
||||||
|
(setq compilation-scroll-output t))
|
||||||
|
|
||||||
|
(add-hook 'python-mode-hook
|
||||||
|
(lambda () (set (make-local-variable 'compile-command)
|
||||||
|
(format "python3 %s" (file-name-nondirectory buffer-file-name)))))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
**** Abbrevs and Snippets
|
||||||
|
|
||||||
|
Abbreviations and Snippets simply allow for less typing and more output.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; Abbrevs and Snippets
|
;; Abbrevs and Snippets
|
||||||
@ -921,37 +968,36 @@ Builtin Emacs directory editor
|
|||||||
:init)
|
:init)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Extra Language Modes
|
**** LSP
|
||||||
|
|
||||||
|
Add language server protocol using eglot. Installing LSP servers is a separate process.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
|
;; LSP Modes
|
||||||
(use-package eglot
|
(use-package eglot
|
||||||
:straight nil
|
:straight nil
|
||||||
:defer t
|
:defer t
|
||||||
:hook ((python-mode . eglot-ensure)
|
:hook ((python-mode . eglot-ensure)
|
||||||
(go-mode . eglot-ensure)))
|
(go-mode . eglot-ensure)))
|
||||||
|
|
||||||
;;; Extra Language Modes
|
;; Allow flycheck errors to show with eglot
|
||||||
|
;;https://github.com/flycheck/flycheck-eglot
|
||||||
|
;; (use-package flycheck-eglot
|
||||||
|
;; :straight t
|
||||||
|
;; :after (flycheck eglot)
|
||||||
|
;; :config
|
||||||
|
;; (global-flycheck-eglot-mode 1))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
**** Additional Language Settings
|
||||||
|
|
||||||
|
More setup for languages beyond LSP
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; Lua mode
|
;; Lua mode
|
||||||
(use-package lua-mode
|
(use-package lua-mode
|
||||||
:straight t)
|
:straight t)
|
||||||
|
|
||||||
;;; Other misc modes (docker, gptel, load-env-vars, csv-mode)
|
|
||||||
(use-package docker
|
|
||||||
:straight t
|
|
||||||
:defer t)
|
|
||||||
|
|
||||||
(use-package dockerfile-mode
|
|
||||||
:straight t
|
|
||||||
:defer t)
|
|
||||||
|
|
||||||
(use-package csv-mode
|
|
||||||
:straight t
|
|
||||||
:defer t)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
*** Additional Language Settings
|
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
|
||||||
;; JavaScript
|
;; JavaScript
|
||||||
(use-package js
|
(use-package js
|
||||||
:defer t
|
:defer t
|
||||||
@ -995,7 +1041,34 @@ Builtin Emacs directory editor
|
|||||||
(set-auto-mode)))))
|
(set-auto-mode)))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Local Environment Variables
|
**** Misc Config Language Settings
|
||||||
|
|
||||||
|
More obscure langauges (or configuration modes)
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
|
;;; Extra Language Modes
|
||||||
|
;; docker
|
||||||
|
(use-package docker
|
||||||
|
:straight t
|
||||||
|
:defer t)
|
||||||
|
(use-package dockerfile-mode
|
||||||
|
:straight t
|
||||||
|
:defer t)
|
||||||
|
|
||||||
|
;; csv
|
||||||
|
(use-package csv-mode
|
||||||
|
:straight t
|
||||||
|
:defer t)
|
||||||
|
|
||||||
|
;; vimrc
|
||||||
|
(use-package vimrc-mode
|
||||||
|
:straight t)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
*** Integrate External Tools
|
||||||
|
**** Local Environment Variables
|
||||||
|
|
||||||
|
Pick up local environment variables (if that file exists)
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; Local Environment File
|
;; Local Environment File
|
||||||
@ -1008,7 +1081,9 @@ Builtin Emacs directory editor
|
|||||||
(load-env-vars my-env-file)))
|
(load-env-vars my-env-file)))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** LLM Support
|
**** LLM Support
|
||||||
|
|
||||||
|
Setup LLMs here (at some point)
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; LLM support (must configure with api keys)
|
;; LLM support (must configure with api keys)
|
||||||
@ -1021,8 +1096,11 @@ Builtin Emacs directory editor
|
|||||||
;; (gptel-make-openai "OpenAI" :stream t :key gptel-api-key)
|
;; (gptel-make-openai "OpenAI" :stream t :key gptel-api-key)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
** Windows (win32)
|
||||||
*** Windows / Win32 Specifics
|
*** Windows / Win32 Specifics
|
||||||
|
|
||||||
|
Those things that are just for Windows, specially for Windows operating systems.
|
||||||
|
|
||||||
#+begin_src emacs-lisp :tangle "init.el"
|
#+begin_src emacs-lisp :tangle "init.el"
|
||||||
;; for Win32
|
;; for Win32
|
||||||
(when (eq system-type 'windows-nt)
|
(when (eq system-type 'windows-nt)
|
||||||
@ -1064,7 +1142,7 @@ Builtin Emacs directory editor
|
|||||||
;; xah-lee functions
|
;; xah-lee functions
|
||||||
;; http://xahlee.info/index.html
|
;; http://xahlee.info/index.html
|
||||||
|
|
||||||
(defun x-open-in-vscode ()
|
(defun open-in-vscode ()
|
||||||
"Open current file or dir in vscode."
|
"Open current file or dir in vscode."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let ((xpath (if buffer-file-name buffer-file-name (expand-file-name default-directory))))
|
(let ((xpath (if buffer-file-name buffer-file-name (expand-file-name default-directory))))
|
||||||
@ -1076,19 +1154,6 @@ Builtin Emacs directory editor
|
|||||||
(shell-command (format "code.cmd %s" (shell-quote-argument xpath))))
|
(shell-command (format "code.cmd %s" (shell-quote-argument xpath))))
|
||||||
((eq system-type 'gnu/linux)
|
((eq system-type 'gnu/linux)
|
||||||
(shell-command (format "code %s" (shell-quote-argument xpath)))))))
|
(shell-command (format "code %s" (shell-quote-argument xpath)))))))
|
||||||
|
|
||||||
(defun x-open-in-terminal ()
|
|
||||||
"Open the current dir in a new terminal window."
|
|
||||||
(interactive)
|
|
||||||
(cond
|
|
||||||
((eq system-type 'windows-nt)
|
|
||||||
(shell-command (concat "wt -d " (shell-quote-argument (expand-file-name default-directory)))))
|
|
||||||
((eq system-type 'darwin)
|
|
||||||
(shell-command (concat "open -a iTerm " (shell-quote-argument (expand-file-name default-directory)))))
|
|
||||||
((eq system-type 'gnu/linux)
|
|
||||||
(let ((process-connection-type nil)) (start-process "" nil "x-terminal-emulator" (concat "--working-directory=" default-directory))))
|
|
||||||
((eq system-type 'berkeley-unix)
|
|
||||||
(let ((process-connection-type nil)) (start-process "" nil "x-terminal-emulator" (concat "--working-directory=" default-directory))))))
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Misc Windows Dotfiles Setup
|
*** Misc Windows Dotfiles Setup
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user