2021-03-02 22:26:47 +00:00
|
|
|
;;; jlj-generic.el --- generic changes that don't fit in a general category go here -*- lexical-binding: t -*-
|
|
|
|
;;; Commentary:
|
2020-01-04 22:53:01 +00:00
|
|
|
|
2021-03-02 22:26:47 +00:00
|
|
|
;; this file is messy by default, because its just a bucket
|
|
|
|
;; i.e. "this doesn't have a real category, so lets put it here."
|
|
|
|
|
|
|
|
;;; Code:
|
2020-01-04 22:53:01 +00:00
|
|
|
(global-visual-line-mode t) ; turn on word-wrap globally
|
|
|
|
(setq case-fold-search t) ; ignore case when searching
|
|
|
|
(fset 'yes-or-no-p 'y-or-n-p) ; make it easier to answer qs.
|
2021-03-02 22:26:47 +00:00
|
|
|
|
2021-03-03 23:41:39 +00:00
|
|
|
;; Preserve contents of system clipboard
|
|
|
|
(setq save-interprogram-paste-before-kill t)
|
|
|
|
|
2021-04-09 15:43:38 +00:00
|
|
|
;; Remove the FUCKING frustrating C-z mnimize. Change to undo.
|
|
|
|
(global-set-key (kbd "C-z") 'undo)
|
2021-03-03 18:51:08 +00:00
|
|
|
(show-paren-mode 1)
|
|
|
|
(setq show-paren-delay 0)
|
|
|
|
|
2021-08-14 20:16:59 +00:00
|
|
|
;; set default font for macos
|
|
|
|
(when (eq system-type 'darwin)
|
2021-08-17 23:40:44 +00:00
|
|
|
(use-package fira-code-mode
|
|
|
|
:custom (fira-code-mode-disabled-ligatures '("[]" "#{" "#(" "#_" "#_(" "x")) ;; List of ligatures to turn off
|
|
|
|
:config (global-fira-code-mode)) ;; Enables fira-code-mode globally
|
2021-08-14 20:16:59 +00:00
|
|
|
(set-frame-font "fira code 12")
|
|
|
|
(add-to-list 'default-frame-alist '(font . "fira code 12" ))
|
|
|
|
(set-face-attribute 'default t :font "fira code 12" ))
|
2020-01-04 22:53:01 +00:00
|
|
|
(transient-mark-mode 1) ; Enable transient mark mode (highlights)
|
2021-03-01 23:57:46 +00:00
|
|
|
|
2020-01-04 22:53:01 +00:00
|
|
|
(global-hl-line-mode t) ; highlights the line you're on
|
|
|
|
|
|
|
|
(setq indent-tabs-mode nil) ; always use spaces when indenting
|
|
|
|
(setq require-final-newline t)
|
2020-06-08 19:41:44 +00:00
|
|
|
(setq backup-directory-alist `(("." . "~/Sync/Documents/org/.saves")))
|
|
|
|
(find-file "~/Sync/Documents/org/personal.org") ;open primary org file on launch
|
2020-01-04 22:53:01 +00:00
|
|
|
(electric-pair-mode 1) ; create paired brackets.
|
|
|
|
|
2021-03-02 22:26:47 +00:00
|
|
|
;; themes
|
2021-03-01 23:57:46 +00:00
|
|
|
;; experiemtning with the modus themes that will be native come emacs 28
|
|
|
|
;; they are more acciessble for r/g color blind stuff
|
|
|
|
;; (load-theme 'manoj-dark) loads my favorite default theme
|
|
|
|
(use-package modus-themes
|
|
|
|
:ensure
|
|
|
|
:init
|
|
|
|
;; Add all your customizations prior to loading the themes
|
|
|
|
(setq modus-themes-slanted-constructs t
|
2021-03-03 18:51:08 +00:00
|
|
|
modus-themes-bold-constructs t
|
|
|
|
modus-themes-paren-match 'intense-bold)
|
2021-03-01 23:57:46 +00:00
|
|
|
|
|
|
|
;; Load the theme files before enabling a theme
|
|
|
|
(modus-themes-load-themes)
|
|
|
|
:config
|
|
|
|
;; Load the theme of your choice:
|
|
|
|
(modus-themes-load-vivendi) ;; (modus-themes-load-operandi)
|
|
|
|
:bind ("<f5>" . modus-themes-toggle))
|
|
|
|
|
2020-07-19 17:25:27 +00:00
|
|
|
|
|
|
|
(use-package yasnippet
|
|
|
|
:ensure t
|
|
|
|
:config
|
2021-05-25 16:41:59 +00:00
|
|
|
(yas-minor-mode-on)
|
|
|
|
(yas-global-mode 1))
|
2020-07-19 17:25:27 +00:00
|
|
|
|
2021-08-17 23:40:44 +00:00
|
|
|
|
2020-07-19 18:14:29 +00:00
|
|
|
|
2020-01-04 22:53:01 +00:00
|
|
|
;; lets you find all instance of string @ point with C-;
|
|
|
|
(use-package iedit
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
(when (eq system-type 'darwin)
|
|
|
|
(setq mac-command-modifier 'meta)
|
|
|
|
;; Make emacs use a different default than the OS
|
|
|
|
;; only really useful on work computers, but there we go.
|
|
|
|
(setq browse-url-browser-function #'browse-url-generic
|
|
|
|
browse-url-generic-program "open"
|
|
|
|
browse-url-generic-args '("-a" "Firefox")))
|
|
|
|
|
2020-04-26 02:34:24 +00:00
|
|
|
(use-package exec-path-from-shell
|
|
|
|
:ensure t
|
|
|
|
:config
|
2020-01-04 22:53:01 +00:00
|
|
|
(exec-path-from-shell-copy-env "PATH"))
|
|
|
|
|
|
|
|
;; (if (string-equal "darwin" (symbol-name system-type))
|
|
|
|
;; (setenv "PATH" (concat "/usr/local/bin:/usr/local/sbin:" (getenv "PATH"))))
|
|
|
|
|
|
|
|
(defun find-user-init-file ()
|
|
|
|
"Edit the `user-init-file', in another window."
|
|
|
|
(interactive)
|
|
|
|
(find-file-other-window user-init-file))
|
|
|
|
(global-set-key (kbd "C-c J") 'find-user-init-file)
|
|
|
|
|
2020-06-08 19:41:44 +00:00
|
|
|
(setq user-home-file "~/Sync/Documents/org/personal.org")
|
2020-01-04 22:53:01 +00:00
|
|
|
(defun find-user-home-file ()
|
2020-03-02 01:21:20 +00:00
|
|
|
"Edit the `user-home-file' in this window."
|
2020-01-04 22:53:01 +00:00
|
|
|
(interactive)
|
|
|
|
(find-file user-home-file))
|
|
|
|
(global-set-key (kbd "C-c C-j h") 'find-user-home-file)
|
|
|
|
|
|
|
|
;; Custom frame management chords
|
|
|
|
(global-set-key (kbd "C-x O") 'other-frame)
|
|
|
|
(global-set-key (kbd "C-x T") 'make-frame-command)
|
|
|
|
(global-set-key (kbd "C-x W") 'delete-frame)
|
|
|
|
(global-set-key "\M-`" 'other-frame) ; mimic the way macosx switches
|
|
|
|
|
2021-01-07 20:51:27 +00:00
|
|
|
;; experiment with mouse bindings
|
|
|
|
(global-set-key [mouse-8] 'yank)
|
|
|
|
|
2020-01-04 22:53:01 +00:00
|
|
|
(use-package helm
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(defun helm-surfraw-duck (x)
|
|
|
|
"Search duckduckgo in default browser"
|
|
|
|
(interactive "sSEARCH:")
|
|
|
|
(helm-surfraw x "duckduckgo" ))
|
|
|
|
(global-set-key (kbd "C-c s") 'helm-surfraw-duck)))
|
|
|
|
|
|
|
|
(use-package smex
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(defadvice smex (around space-inserts-hyphen activate compile)
|
2020-03-02 01:21:20 +00:00
|
|
|
(let ((ido-cannot-complete-command
|
2020-01-04 22:53:01 +00:00
|
|
|
`(lambda ()
|
|
|
|
(interactive)
|
|
|
|
(if (string= " " (this-command-keys))
|
|
|
|
(insert ?-)
|
|
|
|
(funcall ,ido-cannot-complete-command)))))
|
|
|
|
ad-do-it))
|
|
|
|
|
|
|
|
(global-set-key (kbd "M-x") 'smex)
|
|
|
|
(global-set-key (kbd "M-X") 'smex-major-mode-commands)
|
|
|
|
;; This is your old M-x.
|
|
|
|
(global-set-key (kbd "C-c C-c M-x") 'execute-extended-command)))
|
|
|
|
|
|
|
|
(use-package try
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
(use-package which-key
|
|
|
|
:ensure t
|
|
|
|
:config (which-key-mode))
|
|
|
|
|
|
|
|
(use-package ace-window
|
|
|
|
:ensure t
|
|
|
|
:init
|
|
|
|
(progn
|
|
|
|
(global-set-key [remap other-window] 'ace-window)))
|
|
|
|
|
|
|
|
|
|
|
|
;; I don't remember what this does or why i have it
|
|
|
|
;; an emacs story
|
|
|
|
(use-package outline-magic
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
|
|
|
|
(use-package multiple-cursors
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
|
|
|
|
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
|
|
|
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
|
|
|
|
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)))
|
|
|
|
|
|
|
|
(use-package flycheck
|
|
|
|
:ensure t
|
|
|
|
:init
|
|
|
|
(global-flycheck-mode t))
|
|
|
|
|
|
|
|
(use-package markdown-mode
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
(use-package pdf-tools
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(pdf-tools-install))
|
|
|
|
|
|
|
|
(use-package magit
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
(setq org-reveal-root "http://cdn.jsdelivr.net/reveal.js/3.0.0/")
|
|
|
|
(setq org-reveal-mathjax t)
|
|
|
|
|
|
|
|
(use-package ox-reveal
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
(use-package web-mode
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
|
|
|
|
(setq web-mode-engines-alist
|
|
|
|
'(("django" . "\\.html\\'")))
|
|
|
|
(setq web-mode-ac-sources-alist
|
|
|
|
'(("css" . (ac-source-css-property))
|
|
|
|
("html" . (ac-source-words-in-buffer ac-source-abbrev))))
|
|
|
|
|
|
|
|
(setq web-mode-enable-auto-closing t)
|
|
|
|
(setq web-mode-enable-auto-quoting t)) ; this fixes the quote problem I mentioned
|
|
|
|
|
2020-04-17 17:02:42 +00:00
|
|
|
|
|
|
|
(use-package projectile
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(projectile-mode +1)
|
|
|
|
(define-key projectile-mode-map (kbd "C-c p") 'projectile-command-map)
|
|
|
|
(projectile-register-project-type 'python '("pyproject.toml")
|
|
|
|
:test "python -m unittest -v"
|
|
|
|
:test-prefix "test_"))
|
|
|
|
|
2020-01-04 22:53:01 +00:00
|
|
|
(use-package powershell
|
|
|
|
:ensure t)
|
|
|
|
|
2020-01-25 20:46:38 +00:00
|
|
|
(use-package ansible
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
(use-package yaml-mode
|
|
|
|
:ensure t)
|
|
|
|
|
2020-01-04 22:53:01 +00:00
|
|
|
(use-package lua-mode
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
|
|
|
|
(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
|
|
|
|
(add-to-list 'interpreter-mode-alist '("lua" . lua-mode)))
|
|
|
|
|
2020-11-04 17:40:21 +00:00
|
|
|
(use-package json-mode
|
|
|
|
:ensure t)
|
|
|
|
|
|
|
|
(use-package nix-mode
|
|
|
|
:ensure t
|
|
|
|
:mode "\\.nix\\'")
|
|
|
|
|
2021-01-07 20:45:46 +00:00
|
|
|
(use-package neotree
|
|
|
|
:ensure t
|
|
|
|
:config
|
|
|
|
(progn
|
|
|
|
(global-set-key [f8] 'neotree-toggle)))
|
|
|
|
|
2021-03-04 15:47:55 +00:00
|
|
|
(use-package sudo-edit
|
|
|
|
:ensure t)
|
|
|
|
|
2021-08-14 20:16:59 +00:00
|
|
|
(use-package dockerfile-mode
|
|
|
|
:ensure t)
|
|
|
|
|
2020-01-04 22:53:01 +00:00
|
|
|
(server-start)
|
2021-03-02 22:26:47 +00:00
|
|
|
|
|
|
|
;;; jlj-generic.el ends here
|