|
|
@ -6,19 +6,19 @@ Wrappers around functions and lambdas so I don't have to type
|
|
|
|
|
|
|
|
|
|
|
|
I have ~prettify-symbols-mode~ set ~lambdainteractive~ to Λ (capital lambda) because it's cute.
|
|
|
|
I have ~prettify-symbols-mode~ set ~lambdainteractive~ to Λ (capital lambda) because it's cute.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(defmacro definteractive (name &rest body)
|
|
|
|
(defmacro definteractive (name &rest body)
|
|
|
|
`(defun ,name ,(car body)
|
|
|
|
`(defun ,name ,(car body)
|
|
|
|
(interactive)
|
|
|
|
(interactive)
|
|
|
|
,@(cdr body)))
|
|
|
|
,@(cdr body)))
|
|
|
|
|
|
|
|
|
|
|
|
(defmacro lambdainteractive (&rest body)
|
|
|
|
(defmacro lambdainteractive (&rest body)
|
|
|
|
`(lambda ,(car body) (interactive) ,@(cdr body)))
|
|
|
|
`(lambda ,(car body) (interactive) ,@(cdr body)))
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** local-keybind
|
|
|
|
** local-keybind
|
|
|
|
Hide unecessary lambda when calling (local-set-key) for org-mode
|
|
|
|
Hide unecessary lambda when calling (local-set-key) for org-mode
|
|
|
|
functions
|
|
|
|
functions
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(defmacro local-keybind (key value)
|
|
|
|
(defmacro local-keybind (key value)
|
|
|
|
`(lambda () (local-set-key (kbd ,key) (quote ,value))))
|
|
|
|
`(lambda () (local-set-key (kbd ,key) (quote ,value))))
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
* use-package
|
|
|
|
* use-package
|
|
|
@ -30,7 +30,7 @@ Always ensure packages are installed. Log to ~*Messages*~.
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** keychain-environment
|
|
|
|
** keychain-environment
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(use-package keychain-environment
|
|
|
|
(use-package keychain-environment
|
|
|
|
:bind ("C-c r e" . 'keychain-refresh-environment)
|
|
|
|
:bind ("C-c r e" . 'keychain-refresh-environment)
|
|
|
|
:init (keychain-refresh-environment))
|
|
|
|
:init (keychain-refresh-environment))
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
@ -40,11 +40,11 @@ Always ensure packages are installed. Log to ~*Messages*~.
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** diminish
|
|
|
|
** diminish
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(use-package diminish)
|
|
|
|
(use-package diminish)
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** company
|
|
|
|
** company
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(use-package company
|
|
|
|
(use-package company
|
|
|
|
:diminish 'company-mode
|
|
|
|
:diminish 'company-mode
|
|
|
|
:bind (:map company-mode-map
|
|
|
|
:bind (:map company-mode-map
|
|
|
|
("C-c /" . 'yas-expand))
|
|
|
|
("C-c /" . 'yas-expand))
|
|
|
@ -56,7 +56,7 @@ Always ensure packages are installed. Log to ~*Messages*~.
|
|
|
|
** prog
|
|
|
|
** prog
|
|
|
|
*** c#
|
|
|
|
*** c#
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(use-package csharp-mode
|
|
|
|
(use-package csharp-mode
|
|
|
|
:defer t
|
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
:config
|
|
|
|
(use-package omnisharp
|
|
|
|
(use-package omnisharp
|
|
|
@ -67,7 +67,7 @@ Always ensure packages are installed. Log to ~*Messages*~.
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
*** elixir
|
|
|
|
*** elixir
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(use-package elixir-mode
|
|
|
|
(use-package elixir-mode
|
|
|
|
:defer t
|
|
|
|
:defer t
|
|
|
|
:config (use-package alchemist))
|
|
|
|
:config (use-package alchemist))
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
@ -82,7 +82,7 @@ Always ensure packages are installed. Log to ~*Messages*~.
|
|
|
|
*** slime
|
|
|
|
*** slime
|
|
|
|
sbcl is in a werid place on Gentoo.
|
|
|
|
sbcl is in a werid place on Gentoo.
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(use-package slime
|
|
|
|
(use-package slime
|
|
|
|
:defer t
|
|
|
|
:defer t
|
|
|
|
:custom
|
|
|
|
:custom
|
|
|
|
(slime-lisp-implementations
|
|
|
|
(slime-lisp-implementations
|
|
|
@ -96,7 +96,7 @@ sbcl is in a werid place on Gentoo.
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
*** htmlize
|
|
|
|
*** htmlize
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(use-package htmlize)
|
|
|
|
(use-package htmlize)
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** yasnippet
|
|
|
|
** yasnippet
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
@ -113,7 +113,7 @@ sbcl is in a werid place on Gentoo.
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** dashboard
|
|
|
|
** dashboard
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(use-package dashboard
|
|
|
|
(use-package dashboard
|
|
|
|
:diminish (dashboard-mode page-break-lines-mode)
|
|
|
|
:diminish (dashboard-mode page-break-lines-mode)
|
|
|
|
:custom
|
|
|
|
:custom
|
|
|
|
(dashboard-center-content t)
|
|
|
|
(dashboard-center-content t)
|
|
|
@ -124,7 +124,7 @@ sbcl is in a werid place on Gentoo.
|
|
|
|
(dashboard-items '((recents . 5)))
|
|
|
|
(dashboard-items '((recents . 5)))
|
|
|
|
:config (dashboard-setup-startup-hook))
|
|
|
|
:config (dashboard-setup-startup-hook))
|
|
|
|
|
|
|
|
|
|
|
|
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
|
|
|
|
(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** windows and frames
|
|
|
|
** windows and frames
|
|
|
|
*** transpose-frame
|
|
|
|
*** transpose-frame
|
|
|
@ -137,7 +137,7 @@ sbcl is in a werid place on Gentoo.
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
*** switch window
|
|
|
|
*** switch window
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(use-package switch-window
|
|
|
|
(use-package switch-window
|
|
|
|
:custom
|
|
|
|
:custom
|
|
|
|
(switch-window-input-style 'minibuffer)
|
|
|
|
(switch-window-input-style 'minibuffer)
|
|
|
|
(switch-window-increase 4)
|
|
|
|
(switch-window-increase 4)
|
|
|
@ -146,11 +146,11 @@ sbcl is in a werid place on Gentoo.
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
*** ido
|
|
|
|
*** ido
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq ido-enable-flex-matching t
|
|
|
|
(setq ido-enable-flex-matching t
|
|
|
|
ido-create-new-buffer 'always
|
|
|
|
ido-create-new-buffer 'always
|
|
|
|
ido-everywhere 1)
|
|
|
|
ido-everywhere 1)
|
|
|
|
|
|
|
|
|
|
|
|
(use-package ido-vertical-mode
|
|
|
|
(use-package ido-vertical-mode
|
|
|
|
:bind ("C-l" . 'ido-reread-directory)
|
|
|
|
:bind ("C-l" . 'ido-reread-directory)
|
|
|
|
:custom (ido-vertical-define-keys 'C-n-and-C-p-only)
|
|
|
|
:custom (ido-vertical-define-keys 'C-n-and-C-p-only)
|
|
|
|
:config
|
|
|
|
:config
|
|
|
@ -223,18 +223,20 @@ Also saves config if open. manx/emacs-org is defined in [[./init.el][init.el]]
|
|
|
|
(add-to-list 'org-structure-template-alist '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))
|
|
|
|
(add-to-list 'org-structure-template-alist '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))
|
|
|
|
|
|
|
|
|
|
|
|
(setq org-src-tab-acts-natively t
|
|
|
|
(setq org-src-tab-acts-natively t
|
|
|
|
org-edit-src-content-indentation 0)
|
|
|
|
org-edit-src-content-indentation 0
|
|
|
|
|
|
|
|
org-src-preserve-indentation nil
|
|
|
|
|
|
|
|
org-agenda-files '("~/todo.org"))
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** html export
|
|
|
|
** html export
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq org-html-doctype "html5")
|
|
|
|
(setq org-html-doctype "html5")
|
|
|
|
|
|
|
|
|
|
|
|
(definteractive manx/save-org-to-html()
|
|
|
|
(definteractive manx/save-org-to-html()
|
|
|
|
(when (equal major-mode 'org-mode)
|
|
|
|
(when (equal major-mode 'org-mode)
|
|
|
|
(save-buffer)
|
|
|
|
(save-buffer)
|
|
|
|
(org-html-export-to-html)))
|
|
|
|
(org-html-export-to-html)))
|
|
|
|
|
|
|
|
|
|
|
|
(add-hook 'org-mode-hook
|
|
|
|
(add-hook 'org-mode-hook
|
|
|
|
(local-keybind "C-c s h" manx/save-org-to-html))
|
|
|
|
(local-keybind "C-c s h" manx/save-org-to-html))
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** Links
|
|
|
|
** Links
|
|
|
@ -277,12 +279,13 @@ Also saves config if open. manx/emacs-org is defined in [[./init.el][init.el]]
|
|
|
|
(switch-to-buffer (get-buffer-create "*scratch*"))
|
|
|
|
(switch-to-buffer (get-buffer-create "*scratch*"))
|
|
|
|
(lisp-interaction-mode))
|
|
|
|
(lisp-interaction-mode))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(definteractive manx/kill-all ()
|
|
|
|
|
|
|
|
(mapc 'kill-buffer (buffer-list))
|
|
|
|
|
|
|
|
(manx/scratch-buffer))
|
|
|
|
|
|
|
|
|
|
|
|
(global-set-key (kbd "C-c s b") 'manx/scratch-buffer)
|
|
|
|
(global-set-key (kbd "C-c s b") 'manx/scratch-buffer)
|
|
|
|
(global-set-key (kbd "C-x k") (lambdainteractive () (kill-buffer (current-buffer))))
|
|
|
|
(global-set-key (kbd "C-x k") (lambdainteractive () (kill-buffer (current-buffer))))
|
|
|
|
(global-set-key (kbd "C-M-s-k")
|
|
|
|
(global-set-key (kbd "C-M-s-k") 'manx/kill-all)
|
|
|
|
(lambdainteractive ()
|
|
|
|
|
|
|
|
(mapc 'kill-buffer (buffer-list))
|
|
|
|
|
|
|
|
(manx/scratch-buffer)))
|
|
|
|
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** frames
|
|
|
|
** frames
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
@ -297,25 +300,32 @@ Also saves config if open. manx/emacs-org is defined in [[./init.el][init.el]]
|
|
|
|
(global-set-key (kbd "C-x 2")
|
|
|
|
(global-set-key (kbd "C-x 2")
|
|
|
|
(lambdainteractive () (manx/split-and-follow (split-window-horizontally))))
|
|
|
|
(lambdainteractive () (manx/split-and-follow (split-window-horizontally))))
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
** windows
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
|
|
|
(definteractive manx/theme ()
|
|
|
|
|
|
|
|
"Themes don't load properly when using emacsclient"
|
|
|
|
|
|
|
|
(load-theme 'spacemacs-dark)
|
|
|
|
|
|
|
|
(spaceline-compile))
|
|
|
|
|
|
|
|
#+END_SRC
|
|
|
|
* misc
|
|
|
|
* misc
|
|
|
|
** unix line endings
|
|
|
|
** unix line endings
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(defun unix-line-ends ()
|
|
|
|
(defun unix-line-ends ()
|
|
|
|
(when (string-match
|
|
|
|
(when (string-match
|
|
|
|
"-\\(?:dos\\|mac\\)$"
|
|
|
|
"-\\(?:dos\\|mac\\)$"
|
|
|
|
(symbol-name buffer-file-coding-system))
|
|
|
|
(symbol-name buffer-file-coding-system))
|
|
|
|
(set-buffer-file-coding-system 'unix)))
|
|
|
|
(set-buffer-file-coding-system 'unix)))
|
|
|
|
|
|
|
|
|
|
|
|
(add-hook 'find-file-hooks 'unix-line-ends)
|
|
|
|
(add-hook 'find-file-hooks 'unix-line-ends)
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** UTF8
|
|
|
|
** UTF8
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(setq locale-coding-system 'utf-8)
|
|
|
|
(setq locale-coding-system 'utf-8)
|
|
|
|
(set-terminal-coding-system 'utf-8)
|
|
|
|
(set-terminal-coding-system 'utf-8)
|
|
|
|
(set-keyboard-coding-system 'utf-8)
|
|
|
|
(set-keyboard-coding-system 'utf-8)
|
|
|
|
(set-selection-coding-system 'utf-8)
|
|
|
|
(set-selection-coding-system 'utf-8)
|
|
|
|
(prefer-coding-system 'utf-8)
|
|
|
|
(prefer-coding-system 'utf-8)
|
|
|
|
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
|
|
|
|
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
** minor things
|
|
|
|
** minor things
|
|
|
|
Things for GUI and basic config, like electric pairs and highlighting
|
|
|
|
Things for GUI and basic config, like electric pairs and highlighting
|
|
|
@ -390,13 +400,13 @@ tabs > spaces. Except in Lisp.
|
|
|
|
#+END_SRC
|
|
|
|
#+END_SRC
|
|
|
|
* sensitive-minor-mode
|
|
|
|
* sensitive-minor-mode
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
(define-minor-mode sensitive-minor-mode
|
|
|
|
(define-minor-mode sensitive-minor-mode
|
|
|
|
"For sensitive files like password lists.
|
|
|
|
"For sensitive files like password lists.
|
|
|
|
It disables backup creation and auto saving.
|
|
|
|
It disables backup creation and auto saving.
|
|
|
|
|
|
|
|
|
|
|
|
With no argument, this command toggles the mode.
|
|
|
|
With no argument, this command toggles the mode.
|
|
|
|
Non-null prefix argument turns on the mode.
|
|
|
|
Non-null prefix argument turns on the mode.
|
|
|
|
Null prefix argument turns off the mode."
|
|
|
|
Null prefix argument turns off the mode."
|
|
|
|
:init-value nil
|
|
|
|
:init-value nil
|
|
|
|
:lighter " Sensitive"
|
|
|
|
:lighter " Sensitive"
|
|
|
|
:keymap nil
|
|
|
|
:keymap nil
|
|
|
@ -408,8 +418,8 @@ tabs > spaces. Except in Lisp.
|
|
|
|
(auto-save-mode 1)))
|
|
|
|
(auto-save-mode 1)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; Regexps of sensitive files.
|
|
|
|
;; Regexps of sensitive files.
|
|
|
|
(setq auto-minor-mode-alist
|
|
|
|
(setq auto-minor-mode-alist
|
|
|
|
(append
|
|
|
|
(append
|
|
|
|
'(("stream/manifest/.*\\.json$" . sensitive-minor-mode)
|
|
|
|
'(("stream/manifest/.*\\.json$" . sensitive-minor-mode)
|
|
|
|
(".emacs.d/snippets/\\*$" . sensitive-minor-mode)
|
|
|
|
(".emacs.d/snippets/\\*$" . sensitive-minor-mode)
|
|
|
|