@ -1,3 +1,10 @@
* Benchmark
#+BEGIN_SRC emacs-lisp
(use-package benchmark-init
:ensure t
:config
(add-hook 'after-init-hook 'benchmark-init/deactivate))
#+END_SRC
* macros
* macros
** definteractive
** definteractive
Wrappers around functions and lambdas so I don't have to type
Wrappers around functions and lambdas so I don't have to type
@ -12,8 +19,8 @@ Wrappers around functions and lambdas so I don't have to type
`(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
functions
org-mode 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))))
@ -36,6 +43,9 @@ Saves config.org if it's open then reloads the file.
;; I read somewhere that Company breaks things?
;; I read somewhere that Company breaks things?
(add-hook 'org-mode-hook 'company-mode)
(add-hook 'org-mode-hook 'company-mode)
;; Don't indent whole file with org-mode
(eval-after-load "org-mode" (local-set-key (kbd "s-i") nil))
#+END_SRC
#+END_SRC
** Snippets
** Snippets
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
@ -77,7 +87,7 @@ Saves config.org if it's open then reloads the file.
#+END_SRC
#+END_SRC
* emacs gui
* emacs gui
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
(tool-bar-mode -1)
1 (tool-bar-mode -1)
(menu-bar-mode -1)
(menu-bar-mode -1)
(scroll-bar-mode -1)
(scroll-bar-mode -1)
(line-number-mode 1)
(line-number-mode 1)
@ -157,19 +167,25 @@ Saves config.org if it's open then reloads the file.
(setq use-package-always-ensure t
(setq use-package-always-ensure t
use-package-verbose t)
use-package-verbose t)
#+END_SRC
#+END_SRC
** diminish
#+BEGIN_SRC emacs-lisp
(use-package diminish)
#+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))
#+END_SRC
#+END_SRC
** exwm
** exwm
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
(unless (display-graphic-p)
(use-package exwm
(use-package exwm
:bind ("s-k" . 'exwm-workspace-delete)
:bind ("s-k" . 'exwm-workspace-delete)
:config
:config
(require 'exwm-config)
(require 'exwm-config)
(require 'exwm-systemtray)
(require 'exwm-systemtray)
(exwm-systemtray-enable))
(exwm-systemtray-enable) ))
#+END_SRC
#+END_SRC
** nginx
** nginx
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
@ -179,10 +195,6 @@ Saves config.org if it's open then reloads the file.
(nginx-indent-level 2)
(nginx-indent-level 2)
:config (add-to-list 'auto-mode-alist '("/nginx/sites-\\(?:available\\|enabled\\)/ " . nginx-mode)))
:config (add-to-list 'auto-mode-alist '("/nginx/sites-\\(?:available\\|enabled\\)/ " . nginx-mode)))
#+END_SRC
#+END_SRC
** diminish
#+BEGIN_SRC emacs-lisp
(use-package diminish)
#+END_SRC
** company
** company
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
(use-package company
(use-package company
@ -194,17 +206,17 @@ Saves config.org if it's open then reloads the file.
(company-minimum-prefix-length 3)
(company-minimum-prefix-length 3)
:init (add-hook 'after-init-hook 'global-company-mode))
:init (add-hook 'after-init-hook 'global-company-mode))
#+END_SRC
#+END_SRC
** omnisharp
** c#
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
(use-package csharp-mode
(use-package csharp-mode
:defer t
:defer t
:config ((use-package omnisharp
:config
:config (add-hook 'csharp-mode-hook 'omnisharp-mode))))
(use-package omnisharp
:defer t
(eval-after-load 'company
:config
'(add-to-list 'company-backends 'company-omnisharp))
(add-hook 'csharp-mode-hook 'omnisharp-mode)
(add-to-list 'company-backends 'company-omnisharp)))
(add-hook 'csharp-mode #'company-mode)
#+END_SRC
#+END_SRC
** spaceline
** spaceline
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
@ -214,7 +226,6 @@ Saves config.org if it's open then reloads the file.
(setq powerline-default-seperator (quote arrow))
(setq powerline-default-seperator (quote arrow))
(spaceline-spacemacs-theme)
(spaceline-spacemacs-theme)
:config (spaceline-toggle-buffer-size-off))
:config (spaceline-toggle-buffer-size-off))
#+END_SRC
#+END_SRC
** dashboard
** dashboard
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
@ -260,12 +271,25 @@ Saves config.org if it's open then reloads the file.
:defer t
:defer t
:config (use-package alchemist))
:config (use-package alchemist))
#+END_SRC
#+END_SRC
** yasnippet
#+BEGIN_SRC emacs-lisp
(use-package yasnippet
:diminish 'yas-minor-mode
:hook ((html-mode
LaTeX-mode
emacs-lisp-mode
lisp-mode)
. yas-minor-mode)
:init
(use-package yasnippet-snippets)
(yas-reload-all))
#+END_SRC
** minor modes
** minor modes
*** hungry delete
*** hungry delete
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
(use-package hungry-delete
(use-package hungry-delete
:diminish 'hungry-delete-mode
:diminish 'hungry-delete-mode
:config (global-hungry-delete-mode 1))2
:config (global-hungry-delete-mode 1))
#+END_SRC
#+END_SRC
*** which key
*** which key
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
@ -289,21 +313,6 @@ Saves config.org if it's open then reloads the file.
(use-package popup-kill-ring
(use-package popup-kill-ring
:bind ("M-y" . popup-kill-ring))
:bind ("M-y" . popup-kill-ring))
#+END_SRC
#+END_SRC
*** yasnippet
#+BEGIN_SRC emacs-lisp
(use-package yasnippet
:diminish 'yas-minor-mode
:bind
:init
(use-package yasnippet-snippets)
(yas-reload-all))
#+END_SRC
**** enable for major modes
#+BEGIN_SRC emacs-lisp
(add-hook 'html-mode-hook 'yas-minor-mode)
(add-hook 'LaTeX-mode-hook 'yas-minor-mode)
(add-hook 'emacs-lisp-mode 'yas-minor-mode)
#+END_SRC
* ido
* ido
#+BEGIN_SRC emacs-lisp
#+BEGIN_SRC emacs-lisp
(setq ido-enable-flex-matching t
(setq ido-enable-flex-matching t
@ -376,7 +385,7 @@ Saves config.org if it's open then reloads the file.
(defvaralias 'css-indent-offset 'tab-width)
(defvaralias 'css-indent-offset 'tab-width)
#+END_SRC
#+END_SRC
* auto-minor-mode
* auto-minor-mode
auto-mode-alist but for minor modes.
auto-mode-alist for minor modes.
For example, used with sensitive-mode to not create backups
For example, used with sensitive-mode to not create backups
(path/to/file~) when creating yasnippets
(path/to/file~) when creating yasnippets
@ -413,24 +422,16 @@ For example, used with sensitive-mode to not create backups
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."
;; The initial value.
nil ;; Initial
nil
"Sensitive" ;; Modeline
;; The indicator for the mode line.
nil ;; Bindings
" Sensitive"
;; The minor mode bindings.
nil
(if (symbol-value sensitive-minor-mode)
(if (symbol-value sensitive-minor-mode)
(progn
(progn
;; disable backups
(setq make-backup-files nil)
(set (make-local-variable 'backup-inhibited) t)
(auto-save-mode -1))
;; disable auto-save
(setq-local make-backup-files t)
(if auto-save-default
(auto-save-mode 1)))
(auto-save-mode -1)))
;resort to default value of backup-inhibited
(kill-local-variable 'backup-inhibited)
;resort to default auto save setting
(if auto-save-default
(auto-save-mode 1))))
;; Regexps of sensitive files.
;; Regexps of sensitive files.
(setq auto-minor-mode-alist
(setq auto-minor-mode-alist