Compare commits
4 Commits
60e8b7607d
...
050091fed2
Author | SHA1 | Date | |
---|---|---|---|
|
050091fed2 | ||
|
f88496cf58 | ||
|
13a3837f45 | ||
|
6d0b0c6bd9 |
@ -1,16 +1,17 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
;; Fix Emacs' bad defaults
|
||||
|
||||
;; Save backups and autosaves in a centralized place
|
||||
(defvar autosave-directory (expand-file-name "autosaves" user-emacs-directory))
|
||||
(defvar backup-directory (expand-file-name "backups" user-emacs-directory))
|
||||
(make-directory autosave-directory t)
|
||||
(setq auto-save-file-name-transforms `((".*" ,autosave-directory t))
|
||||
(use-package emacs
|
||||
:init
|
||||
;; Save backups and autosaves in a centralized place
|
||||
(defvar autosave-directory (expand-file-name "autosaves" user-emacs-directory))
|
||||
(defvar backup-directory (expand-file-name "backups" user-emacs-directory))
|
||||
(make-directory autosave-directory t)
|
||||
(setq auto-save-file-name-transforms `((".*" ,autosave-directory t))
|
||||
backup-directory-alist `(("." . ,backup-directory)))
|
||||
|
||||
;; Sensible variable defaults
|
||||
(setq ring-bell-function nil
|
||||
;; Sensible variable defaults
|
||||
(setq ring-bell-function 'ignore
|
||||
enable-recursive-minibuffers t
|
||||
read-process-output-max (* 1024 1024)
|
||||
vc-follow-symlinks t
|
||||
@ -19,10 +20,21 @@
|
||||
(display-buffer-reuse-window display-buffer-same-window)
|
||||
(reusable-frames . t)))
|
||||
even-window-sizes nil)
|
||||
(setq-default indent-tabs-mode nil)
|
||||
(setq-default indent-tabs-mode nil)
|
||||
|
||||
;; Always display line numbers in text/programming modes
|
||||
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
|
||||
(add-hook 'text-mode-hook #'display-line-numbers-mode)
|
||||
;; default to utf-8 for all the things
|
||||
(set-charset-priority 'unicode)
|
||||
(setq locale-coding-system 'utf-8
|
||||
coding-system-for-read 'utf-8
|
||||
coding-system-for-write 'utf-8)
|
||||
(set-terminal-coding-system 'utf-8)
|
||||
(set-keyboard-coding-system 'utf-8)
|
||||
(set-selection-coding-system 'utf-8)
|
||||
(prefer-coding-system 'utf-8)
|
||||
(setq default-process-coding-system '(utf-8-unix . utf-8-unix))
|
||||
|
||||
;; Always display line numbers in text/programming modes
|
||||
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
|
||||
(add-hook 'text-mode-hook #'display-line-numbers-mode))
|
||||
|
||||
(provide 'init-defaults)
|
||||
|
@ -176,6 +176,26 @@
|
||||
"::"
|
||||
(python-info-current-defun)))))))))
|
||||
|
||||
(defun run-command-recipe-nosetests()
|
||||
(when (and (derived-mode-p 'python-mode)
|
||||
(= 0 (call-process "python" nil nil nil "-c" "import nose")))
|
||||
(let ((test-file-p (string-match-p "test" (or (buffer-file-name) ""))))
|
||||
(list
|
||||
(when (and (projectile-project-root)
|
||||
(file-exists-p (concat (file-name-as-directory (projectile-project-root))
|
||||
"tests")))
|
||||
(list :command-name "test all"
|
||||
:command-line "nosetests -w tests"
|
||||
:working-dir (projectile-project-root)))
|
||||
(when test-file-p
|
||||
(list :command-name "test this file"
|
||||
:command-line (format "nosetests %s" (buffer-file-name))))
|
||||
(when (and test-file-p (python-info-current-defun))
|
||||
(list :command-name "test this function"
|
||||
:command-line (format "nosetests %s:%s"
|
||||
(buffer-file-name)
|
||||
(python-info-current-defun))))))))
|
||||
|
||||
(defun run-command-recipe-web-ext ()
|
||||
(when-let* ((_ (executable-find "web-ext"))
|
||||
(manifest (locate-dominating-file default-directory "manifest.json"))
|
||||
@ -210,6 +230,7 @@
|
||||
run-command-recipe-kustomize
|
||||
run-command-recipe-sops
|
||||
run-command-recipe-pytest
|
||||
run-command-recipe-nosetests
|
||||
run-command-recipe-web-ext
|
||||
run-command-recipe-pip)))
|
||||
|
||||
|
@ -24,13 +24,12 @@
|
||||
"7" #'winum-select-window-7
|
||||
"8" #'winum-select-window-8
|
||||
"9" #'winum-select-window-9
|
||||
"w" '(nil :which-key "window")
|
||||
"w/" #'split-window-horizontally
|
||||
"w-" #'split-window-vertically
|
||||
"wm" #'delete-other-windows
|
||||
"wd" #'delete-window
|
||||
"wp" #'winner-undo
|
||||
"wn" #'winner-redo)
|
||||
"w" '(evil-window-map :which-key "window"))
|
||||
|
||||
(general-def evil-window-map
|
||||
"m" #'delete-other-windows
|
||||
"u" #'winner-undo
|
||||
"C-r" #'winner-redo)
|
||||
|
||||
;; Condense the which-key display for window selection bindings
|
||||
(push '(("\\(.*\\) 0" . "select-window-0") . ("\\1 0..9" . "window 0..9"))
|
||||
|
5
emacs/.emacs.d/early-init.el
Normal file
5
emacs/.emacs.d/early-init.el
Normal file
@ -0,0 +1,5 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
;; Some startup time optimizations stolen from Doom emacs
|
||||
(setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes
|
||||
gc-cons-percentage 0.6)
|
@ -1,8 +1,6 @@
|
||||
;; -*- lexical-binding: t; -*-
|
||||
|
||||
;; Some startup time optimizations stolen from Doom emacs
|
||||
(setq gc-cons-threshold most-positive-fixnum ; 2^61 bytes
|
||||
gc-cons-percentage 0.6)
|
||||
(defvar file-name-handler-alist-backup file-name-handler-alist)
|
||||
(setq file-name-handler-alist nil)
|
||||
(add-hook 'emacs-startup-hook
|
||||
@ -37,6 +35,12 @@
|
||||
(straight-use-package 'use-package)
|
||||
(setq straight-use-package-by-default t)
|
||||
|
||||
;; "Garbage Collection Magic Hack"
|
||||
(use-package gcmh
|
||||
:demand t
|
||||
:config
|
||||
(gcmh-mode 1))
|
||||
|
||||
;; Fix $PATH
|
||||
(use-package exec-path-from-shell
|
||||
:hook (after-init . exec-path-from-shell-initialize)
|
||||
|
Loading…
Reference in New Issue
Block a user