Browse Source

Agressing re-organizing of dotfiles.

master
Josh Wolfe 3 years ago
parent
commit
7f17acbc73
1 changed files with 163 additions and 61 deletions
  1. 163
    61
      emacs/.emacs.d/README.org

+ 163
- 61
emacs/.emacs.d/README.org View File

@@ -25,17 +25,23 @@ I'm using, [[https://raw.githubusercontent.com/WolfeCub/dotfiles/master/emacs/.e

* Startup

Runs a different function on startup depending on display mode.
My graphical settings change

** Common Code

This should be run regardless of whether I'm in terminal or GUI.

#+BEGIN_SRC emacs-lisp :tangle yes
(setq custom-theme-directory "~/.emacs.d/themes")
(use-package base16-theme
:config
(load-theme 'base16-default-dark t)
#+END_SRC

** Terminal

#+BEGIN_SRC emacs-lisp :tangle yes
(defun wolfe/term-setup ()
(use-package base16-theme
:config
(load-theme 'base16-default-dark t))
(setq nlinum-format "%d ")
;;(global-hl-line-mode 1)
;;(add-to-list 'default-frame-alist '(background-color . "color-16"))
@@ -49,11 +55,10 @@ Runs a different function on startup depending on display mode.
((t (:background "color-18" :foreground "color-244"))))))
#+END_SRC

** Graphical

#+BEGIN_SRC emacs-lisp :tangle yes
(defun wolfe/gui-setup ()
(use-package base16-theme
:config
(load-theme 'base16-default-dark t)
(defvar my/base16-colors base16-default-dark-colors)
(setq evil-emacs-state-cursor `(,(plist-get my/base16-colors :base0D) box)
evil-insert-state-cursor `(,(plist-get my/base16-colors :base0D) bar)
@@ -71,8 +76,11 @@ Runs a different function on startup depending on display mode.
'(org-todo ((t (:box (:line-width 1) :weight bold))))))
#+END_SRC

** Display check

This checks which setup we're in and calls the appropriate function above.

#+BEGIN_SRC emacs-lisp :tangle yes
;; Not a function but it needs to be after the 2 setup functions
(if (display-graphic-p)
(wolfe/gui-setup)
(wolfe/term-setup))
@@ -82,37 +90,72 @@ Runs a different function on startup depending on display mode.

Basic settings I can't really live without.

** Splash and Startup

#+BEGIN_SRC emacs-lisp :tangle yes
(setq inhibit-splash-screen t
inhibit-startup-message t
inhibit-startup-echo-area-message "wolfe")
inhibit-startup-echo-area-message "wolfe"
initial-scratch-message "") ; No scratch text
#+END_SRC

** Graphics
*** Bars

#+BEGIN_SRC emacs-lisp :tangle yes
(tool-bar-mode -1) ; No toolbar
(scroll-bar-mode -1) ; Hide scrollbars
(menu-bar-mode -1) ; No menubar
#+END_SRC

*** Fonts

#+BEGIN_SRC emacs-lisp :tangle yes
(when (member "Inconsolata" (font-family-list)) ; Set default font
(add-to-list 'default-frame-alist '(font . "Inconsolata-15" ))
(set-face-attribute 'default t :font "Inconsolata-15"))
#+END_SRC

*** Column Marker

#+BEGIN_SRC emacs-lisp :tangle yes
(load-file "~/.emacs.d/lisp/column-marker.el")
(add-hook 'prog-mode-hook (lambda () (interactive) (column-marker-1 81)))
(custom-set-faces
'(column-marker-1 ((t (:background "dim gray")))))
#+END_SRC

** Personal Deafaults

#+BEGIN_SRC emacs-lisp :tangle yes
(show-paren-mode t) ; Highlights matching parens
(setq initial-scratch-message "") ; No scratch text
(fset 'yes-or-no-p 'y-or-n-p) ; y/n instead of yes/no
(setq-default indent-tabs-mode nil)
(column-number-mode t)
(delete-selection-mode 1) ; Replace selection on insert
(setq-default truncate-lines t) ; Don't wrap
(setq vc-follow-symlinks t) ; Always follow symlinks
(when (member "Inconsolata" (font-family-list)) ; Set default font
(add-to-list 'default-frame-alist '(font . "Inconsolata-15" ))
(set-face-attribute 'default t :font "Inconsolata-15"))
(setq-default indent-tabs-mode nil)
(setq custom-file "~/.emacs.d/custom.el") ; Set custom file & don't load it
(setq tags-revert-without-query t) ; Don't ask to reload TAGS file
(setq source-directory "~/Projects/emacs/")
#+END_SRC

** Misc

*** Vim Scrolloff

#+BEGIN_SRC emacs-lisp :tangle yes
(setq scroll-margin 10
scroll-step 1
scroll-conservatively 10000
scroll-preserve-screen-position 1)
(setq-default truncate-lines t)
(load-file "~/.emacs.d/lisp/column-marker.el")
(add-hook 'prog-mode-hook (lambda () (interactive) (column-marker-1 81)))
(custom-set-faces
'(column-marker-1 ((t (:background "dim gray")))))
#+END_SRC
*** Shell Teaks
#+BEGIN_SRC emacs-lisp :tangle yes
(setq explicit-shell-file-name
(if (file-readable-p "/usr/bin/zsh") "/usr/bin/zsh" "/bin/bash"))
(setq source-directory "~/Projects/emacs/")
(when (eq system-type 'windows-nt)
(setq explicit-shell-file-name "cmdproxy.exe"))
#+END_SRC
@@ -532,6 +575,62 @@ Customizable popup menus.
(use-package hydra)
#+END_SRC

** Major Modes
*** C#

#+BEGIN_SRC emacs-lisp :tangle yes
(setq wolfe/hydra-csharp
(defhydra hydra-csharp (:color blue)
"Omnisharp"
("d" omnisharp-go-to-definition "Goto definition")
("D" omnisharp-go-to-definition-other-window "Pop-open definition")
("u" omnisharp-find-usages "Find usages")
("r" omnisharp-rename "Rename symbol")
("R" omnisharp-reload-solution "Reload solution")
("i" omnisharp-code-format-region "Indent region")
("I" omnisharp-code-format-entire-file "Indent entire file")
))
#+END_SRC

*** Org Mode

#+BEGIN_SRC emacs-lisp :tangle yes
(setq wolfe/hydra-org
(defhydra hydra-org (:color blue)
"Org Mode"
("t" (funcall wolfe/hydra-org-expand) "Expand template")))
#+END_SRC

*** Org Templates

#+BEGIN_SRC emacs-lisp :tangle yes
(setq wolfe/hydra-org-expand
(defhydra hydra-org-template (:color blue :hint nil)
"
_c_enter _q_uote _L_aTeX:
_l_atex _e_xample _i_ndex:
_a_scii _v_erse _I_NCLUDE:
_s_rc ^ ^ _H_TML:
_h_tml ^ ^ _A_SCII:
"
("s" (hot-expand "<s"))
("e" (hot-expand "<e"))
("q" (hot-expand "<q"))
("v" (hot-expand "<v"))
("c" (hot-expand "<c"))
("l" (hot-expand "<l"))
("h" (hot-expand "<h"))
("a" (hot-expand "<a"))
("L" (hot-expand "<L"))
("i" (hot-expand "<i"))
("I" (hot-expand "<I"))
("H" (hot-expand "<H"))
("A" (hot-expand "<A"))))
#+END_SRC

** Minor Modes
*** Projectile

#+BEGIN_SRC emacs-lisp :tangle yes
(setq wolfe/hydra-projectile
(defhydra hydra-projectile (:color blue :columns 4)
@@ -546,7 +645,11 @@ Customizable popup menus.
("P" projectile-clear-known-projects "Clear Projects")
("C" wolfe/projectile-invalidate-list "Clear A Cache")
))
#+END_SRC

*** Jira

#+BEGIN_SRC emacs-lisp :tangle yes
(setq wolfe/hydra-jira
(defhydra hydra-jira (:color blue :columns 4)
"Jira"
@@ -568,47 +671,11 @@ Customizable popup menus.
("U" org-jira-update-comment "Update Comment")
("t" org-jira-todo-to-jira "Todo to Jira")
("O" (funcall wolfe/hydra-org-expand) "Org Hydra")))
#+END_SRC

(setq wolfe/hydra-csharp
(defhydra hydra-csharp (:color blue)
"Omnisharp"
("d" omnisharp-go-to-definition "Goto definition")
("D" omnisharp-go-to-definition-other-window "Pop-open definition")
("u" omnisharp-find-usages "Find usages")
("r" omnisharp-rename "Rename symbol")
("R" omnisharp-reload-solution "Reload solution")
("i" omnisharp-code-format-region "Indent region")
("I" omnisharp-code-format-entire-file "Indent entire file")
))

(setq wolfe/hydra-org-expand
(defhydra hydra-org-template (:color blue :hint nil)
"
_c_enter _q_uote _L_aTeX:
_l_atex _e_xample _i_ndex:
_a_scii _v_erse _I_NCLUDE:
_s_rc ^ ^ _H_TML:
_h_tml ^ ^ _A_SCII:
"
("s" (hot-expand "<s"))
("e" (hot-expand "<e"))
("q" (hot-expand "<q"))
("v" (hot-expand "<v"))
("c" (hot-expand "<c"))
("l" (hot-expand "<l"))
("h" (hot-expand "<h"))
("a" (hot-expand "<a"))
("L" (hot-expand "<L"))
("i" (hot-expand "<i"))
("I" (hot-expand "<I"))
("H" (hot-expand "<H"))
("A" (hot-expand "<A"))))

(setq wolfe/hydra-org
(defhydra hydra-org (:color blue)
"Org Mode"
("t" (funcall wolfe/hydra-org-expand) "Expand template")))
** Default

#+BEGIN_SRC emacs-lisp :tangle yes
(setq wolfe/hydra-default
(defhydra hydra-default (:color blue)
"Default"
@@ -616,6 +683,8 @@ Customizable popup menus.
("#" (funcall wolfe/hydra-csharp) "C# Mode")))
#+END_SRC

** Selector

#+BEGIN_SRC emacs-lisp :tangle yes
(defun wolfe/hydra-selector ()
(cond
@@ -626,9 +695,15 @@ Customizable popup menus.
#+END_SRC

* Evil & General
** General

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package general)
#+END_SRC

** Evil

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package evil
:demand
:init
@@ -699,14 +774,27 @@ Customizable popup menus.
"init" (lambda() (interactive) (evil-buffer-new nil "~/.emacs.d/README.org"))
)
)
#+END_SRC

** Evil Surround

;; Tpope's surround
Tpope's surround

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package evil-surround
:config
(global-evil-surround-mode 1))
#+END_SRC

** Evil Magit

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package evil-magit)
#+END_SRC

** Evil Machit

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package evil-matchit
:config
(global-evil-matchit-mode 1))
@@ -714,6 +802,7 @@ Customizable popup menus.
#+END_SRC

* Ivy, Counsel and Swiper
** Ivy & CounseL

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package ivy
@@ -734,6 +823,8 @@ Customizable popup menus.
(eval-after-load "hydra" (use-package ivy-hydra)))
#+END_SRC

** Swiper

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package swiper
:bind (("C-s" . swiper)))
@@ -1000,20 +1091,31 @@ Autocomplete engine
#+END_SRC

* Misc
** GDB

#+BEGIN_SRC emacs-lisp :tangle yes
(setq gdb-many-windows t ;; use gdb-many-windows by default
gdb-show-main t
;; Non-nil means display source file containing the main routine at startup
)
#+END_SRC

** Help Fns+

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package help-fns+)
#+END_SRC

** Org Jira

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package org-jira
:config
(setq jiralib-url "https://indigoca.atlassian.net"))

#+END_SRC

** Circe

#+BEGIN_SRC emacs-lisp :tangle yes
(use-package circe
:config

Loading…
Cancel
Save