commit ce7e84e566f500d90a6c2c0ca095e07b1bddec3c
parent 93caef8643e981f625918f1c697abc8e91833cb8
Author: Ryan Jeffrey <pwishie@gmail.com>
Date: Sun, 30 Jun 2019 15:17:41 -0700
dolist
Diffstat:
M | .econfig.org | | | 276 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------- |
M | .emacs | | | 2 | +- |
2 files changed, 230 insertions(+), 48 deletions(-)
diff --git a/.econfig.org b/.econfig.org
@@ -8,7 +8,9 @@
#+BEGIN_SRC emacs-lisp
(eval-when-compile
-(require 'use-package))
+ (require 'use-package))
+
+(defalias 'yes-or-no-p 'y-or-n-p)
#+END_SRC
** font and theme
@@ -17,33 +19,34 @@
(add-to-list 'default-frame-alist
'(font . "DejaVu Sans Mono:antialias=true:size=16:style=Regular"))
- (load-theme 'seti t)
+
+(add-to-list 'load-path "~/.emacs.d/themes/")
+
+;; fav themes: aanila, grandshell, manoj-dark
+(load-theme 'aanila t)
#+END_SRC
** Ivy-mode
-
-
#+BEGIN_SRC emacs-lisp
-(ivy-mode 1)
-(setq ivy-use-virtual-buffers t)
-(setq enable-recursive-minibuffers t)
-;; enable this if you want `swiper' to use it
-;; (setq search-default-mode #'char-fold-to-regexp)
-(global-set-key "\C-s" 'swiper)
-(global-set-key (kbd "<f6>") 'ivy-resume)
-(global-set-key (kbd "M-x") 'counsel-M-x)
-(global-set-key (kbd "<f5> f") 'counsel-describe-function)
-(global-set-key (kbd "<f5> v") 'counsel-describe-variable)
-(global-set-key (kbd "<f5> l") 'counsel-find-library)
-(global-set-key (kbd "<f5> i") 'counsel-info-lookup-symbol)
-(global-set-key (kbd "<f5> u") 'counsel-unicode-char)
-(global-set-key (kbd "s-c g") 'counsel-git)
-(global-set-key (kbd "s-c j") 'counsel-git-grep)
-(global-set-key (kbd "s-c k") 'counsel-ag)
-(global-set-key (kbd "s-x l") 'counsel-locate)
-(global-set-key (kbd "s-S-o") 'counsel-rhythmbox)
-(define-key minibuffer-local-map (kbd "s-r") 'counsel-minibuffer-history)
-
+ (ivy-mode 1)
+ (setq ivy-use-virtual-buffers t)
+ (setq enable-recursive-minibuffers t)
+ ;; enable this if you want `swiper' to use it
+ ;; (setq search-default-mode #'char-fold-to-regexp)
+ (global-set-key "\C-s" 'swiper)
+ (global-set-key (kbd "<f6>") 'ivy-resume)
+ (global-set-key (kbd "M-x") 'counsel-M-x)
+ (global-set-key (kbd "<f5> f") 'counsel-describe-function)
+ (global-set-key (kbd "<f5> v") 'counsel-describe-variable)
+ (global-set-key (kbd "<f5> l") 'counsel-find-library)
+ (global-set-key (kbd "<f5> i") 'counsel-info-lookup-symbol)
+ (global-set-key (kbd "<f5> u") 'counsel-unicode-char)
+ (global-set-key (kbd "s-c g") 'counsel-git)
+ (global-set-key (kbd "s-c j") 'counsel-git-grep)
+ (global-set-key (kbd "s-c k") 'counsel-ag)
+ (global-set-key (kbd "s-x l") 'counsel-locate)
+ (global-set-key (kbd "s-S-o") 'counsel-rhythmbox)
+ (define-key minibuffer-local-map (kbd "s-r") 'counsel-minibuffer-history)
#+END_SRC
** Misc
@@ -51,7 +54,6 @@
(put 'upcase-region 'disabled nil)
(electric-pair-mode t)
-(desktop-save-mode 1)
(show-paren-mode 1)
(setq-default indent-tabs-mode nil)
(setq-default tab-width 4)
@@ -61,7 +63,7 @@
(scroll-bar-mode -1)
(setq ring-bell-function 'ignore)
(blink-cursor-mode 0)
-
+(set-language-environment "UTF-8")
#+END_SRC
** Filename-mode associations
@@ -76,12 +78,35 @@
#+BEGIN_SRC emacs-lisp
(use-package joestar
+ :init
+ (progn
+ (defvar undo-tree-map
+ (let ((map (make-sparse-keymap)))
+ ;; remap `undo' and `undo-only' to `undo-tree-undo'
+ (define-key map [remap undo] 'undo-tree-undo)
+ (define-key map [remap undo-only] 'undo-tree-undo)
+ ;; bind standard undo bindings (since these match redo counterparts)
+ (define-key map (kbd "C-/") 'undo-tree-undo)
+ (define-key map "\C-_" 'undo-tree-undo)
+ ;; redo doesn't exist normally, so define our own keybindings
+ (define-key map (kbd "C-?") 'undo-tree-redo)
+ (define-key map (kbd "M-_") 'undo-tree-redo)
+ ;; just in case something has defined `redo'...
+ (define-key map [remap redo] 'undo-tree-redo)
+ ;; we use "C-x u" for the undo-tree visualizer
+ (define-key map (kbd "s-x u") 'undo-tree-visualize)
+ ;; bind register commands
+ (define-key map (kbd "s-x r u") 'undo-tree-save-state-to-register)
+ (define-key map (kbd "s-x r U") 'undo-tree-restore-state-from-register)
+ ;; set keymap
+ (setq undo-tree-map map))))
:load-path
"~/.emacs.d/joestar/"
:config
- (joestar-mode t)
- (add-hook 'text-mode-hook 'joestar-mode)
- (add-hook 'prog-mode-hook 'joestar-mode))
+ (joestar-mode t))
+
+(dolist (hook '(prog-mode-hook text-mode-hook help-mode-hook))
+ (add-hook hook #'joestar-mode))
#+END_SRC
** org
@@ -96,19 +121,16 @@
* IDE
** company-mode and flycheck
#+BEGIN_SRC emacs-lisp
- ;; (use-package company
- ;; :init
- ;; (progn
- ;; (setq company-idle-delay 0.5)
- ;; (setq company-minimum-prefix-length 1)
- ;; (setq company-selection-wrap-around t))
- ;; :config
- ;; (progn
- ;; (global-company-mode t)))
(use-package flycheck-mode
:config
+
(flycheck-mode t)
+ (define-key flycheck-mode-map flycheck-keymap-prefix nil)
+ (setq flycheck-keymap-prefix (kbd \"s-s f\"))
+ (define-key flycheck-mode-map flycheck-keymap-prefix
+ flycheck-command-map)
+
:hook (prog-mode))
@@ -210,11 +232,14 @@
** lisp
#+BEGIN_SRC emacs-lisp
-(setq inferior-lisp-program "/opt/sbcl/bin/sbcl")
-(setq slime-contribs '(slime-fancy))
-(load (expand-file-name "~/quicklisp/slime-helper.el"))
-;; Replace "sbcl" with the path to your implementation
-(setq inferior-lisp-program "sbcl")
+(use-package slime
+:init
+ (setq inferior-lisp-program "/opt/sbcl/bin/sbcl")
+ (setq slime-contribs '(slime-fancy))
+ (load (expand-file-name "~/quicklisp/slime-helper.el"))
+ ;; Replace "sbcl" with the path to your implementation
+ (setq inferior-lisp-program "sbcl"))
+
(setq geiser-active-implementations '(guile))
#+END_SRC
@@ -249,7 +274,111 @@
(add-hook 'robe-mode-hook 'ac-robe-setup)
#+END_SRC
+** golang
+#+BEGIN_SRC emacs-lisp
+
+(defun set-exec-path-from-shell-PATH ()
+ (let ((path-from-shell (replace-regexp-in-string
+ "[ \t\n]*$"
+ ""
+ (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
+ (setenv "PATH" path-from-shell)
+ (setq eshell-path-env path-from-shell) ; for eshell users
+ (setq exec-path (split-string path-from-shell path-separator))))
+
+(when window-system (set-exec-path-from-shell-PATH))
+
+(setenv "GOPATH" "/home/ryan/CSProjects/goproj/")
+
+(add-to-list 'exec-path "/home/ryan/CSProjects/goproj/bin/")
+(add-hook 'before-save-hook 'gofmt-before-save)
+
+(defun my-go-mode-hook ()
+ ; Call Gofmt before saving
+ (add-hook 'before-save-hook 'gofmt-before-save)
+ ; Godef jump key binding
+ (local-set-key (kbd "M-.") 'godef-jump)
+ (local-set-key (kbd "M-*") 'pop-tag-mark)
+ )
+ (add-hook 'go-mode-hook 'my-go-mode-hook)
+
+(defun auto-complete-for-go ()
+ (auto-complete-mode 1))
+(add-hook 'go-mode-hook 'auto-complete-for-go)
+
+(with-eval-after-load 'go-mode
+ (require 'go-autocomplete))
+
+(defun my-go-mode-hook ()
+ ; Call Gofmt before saving
+ (add-hook 'before-save-hook 'gofmt-before-save)
+ ; Customize compile command to run go build
+ (if (not (string-match "go" compile-command))
+ (set (make-local-variable 'compile-command)
+ "go build -v && go test -v && go vet"))
+ ; Godef jump key binding
+ (local-set-key (kbd "M-.") 'godef-jump)
+ (local-set-key (kbd "M-*") 'pop-tag-mark)
+)
+(add-hook 'go-mode-hook 'my-go-mode-hook)
+
+(defun my-go-mode-hook ()
+ ; Use goimports instead of go-fmt
+ (setq gofmt-command "goimports")
+ ; Call Gofmt before saving
+ (add-hook 'before-save-hook 'gofmt-before-save)
+ ; Customize compile command to run go build
+ (if (not (string-match "go" compile-command))
+ (set (make-local-variable 'compile-command)
+ "go build -v && go test -v && go vet"))
+ ; Godef jump key binding
+ (local-set-key (kbd "M-.") 'godef-jump)
+ (local-set-key (kbd "M-*") 'pop-tag-mark)
+)
+(add-hook 'go-mode-hook 'my-go-mode-hook)
+
+#+END_SRC
+** rust
+#+BEGIN_SRC emacs-lisp
+
+ (require 'rust-mode)
+ (define-key rust-mode-map (kbd "TAB") #'company-indent-or-complete-common)
+ (setq company-tooltip-align-annotations t)
+
+ (add-hook 'rust-mode-hook 'cargo-minor-mode)
+
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;; (use-package racer-mode ;;
+ ;; :init ;;
+ ;; (setq racer-cmd "~/.cargo/bin/racer") ;;
+ ;; (setq racer-rust-src-path "/home/ryan/CSProjects/rust/src/") ;;
+ ;; ;;
+ ;; :config ;;
+ ;; (racer-mode t) ;;
+ ;; (define-key racer-mode-map (kbd "C-x 5 .") nil) ;;
+ ;; (define-key racer-mode-map (kbd "C-x 4 .") nil) ;;
+ ;; ;;
+ ;; :hook ;;
+ ;; (rust-mode)) ;;
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ (add-hook 'rust-mode-hook #'eldoc-mode)
+ (add-hook 'rust-mode-hook #'company-mode)
+
+ (add-hook 'flycheck-mode-hook #'flycheck-rust-setup)
+
+#+END_SRC
+** web
+#+BEGIN_SRC emacs-lisp
+
+(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes
+(add-hook 'css-mode-hook 'emmet-mode) ;; enable Emmet's css abbreviation.
+(add-hook 'emmet-mode-hook (lambda () (setq emmet-indentation 4))) ;; indent 2 spaces.
+(setq emmet-self-closing-tag-style "/") ;; default "/"
+
+
+#+END_SRC
* Text-editor
** spellcheck
#+BEGIN_SRC emacs-lisp
@@ -334,6 +463,43 @@
;(setq x-select-enable-clipboard nil)
#+END_SRC
+** latex
+#+BEGIN_SRC emacs-lisp
+
+(setq auto-revert-interval 0.5)
+
+(require 'company-auctex)
+(company-auctex-init)
+
+(add-hook 'TeX-after-compilation-finished-functions #'TeX-revert-document-buffer)
+
+(setq auctex-latexmk-inherit-TeX-PDF-mode t)
+(require 'auctex-latexmk)
+(auctex-latexmk-setup)
+
+#+END_SRC
+** highlighting
+#+BEGIN_SRC emacs-lisp
+
+ (defface font-lock-control-face
+ '((t :foreground "#FF0000"))
+ "Font Lock mode face used for function calls."
+ :group 'font-lock-highlighting-faces)
+
+ ;; (font-lock-add-keywords
+ ;; 'c-mode
+ ;; '(("\\<{}\\>"
+ ;; 1 'font-lock-control-face)))
+
+ (defun ctr-chars-hl ()
+ font-lock-add-keywords nil
+ '(("[-+*/=<>,;:(){}]" (0 font-lock-control-face))))
+
+ (dolist (hook '(python-mode-hook fortran-mode-hook c-mode-common-hook))
+ (add-hook hook #'ctr-chars-hl))
+
+
+#+END_SRC
* emacs-os
** email
#+BEGIN_SRC emacs-lisp
@@ -528,6 +694,20 @@
(setq rmh-elfeed-org-files (list "~/.emacs.d/elfeed.org"))
#+END_SRC
+** pdf
+#+BEGIN_SRC emacs-lisp
+
+(pdf-tools-install)
+
+#+END_SRC
+** filesystem
+#+BEGIN_SRC emacs-lisp
+(add-to-list 'load-path "~/.emacs.d/lisp/")
+(require 'dired-details)
+(setq-default dired-details-hidden-string "[-]")
+(dired-details-install)
+
+#+END_SRC
* Misc
** Terminal stuff
#+BEGIN_SRC emacs-lisp
@@ -539,12 +719,14 @@
#+END_SRC
*** vterm
-#+BEGIN_SRC emacs-lisp
-(add-to-list 'load-path "/home/ryan/CSProjects/emacs-libvterm/")
-(let (vterm-install)
- (require 'vterm))
+#+BEGIN_SRC emacs-lisp
+(use-package vterm
+:load-path "/home/ryan/CSProjects/emacs-libvterm/"
+:config
+ (let (vterm-install)
+ (require 'vterm)))
#+END_SRC
** ssh
diff --git a/.emacs b/.emacs
@@ -22,7 +22,7 @@
("/usr/include/" "/usr/local/include/" "/usr/include/c++/8.3.0/")))
'(package-selected-packages
(quote
- (impatient-mode xah-css-mode psgml emmet-mode web-mode auctex-latexmk company-auctex pdf-view-restore fic-mode seti-theme vimrc-mode use-package-hydra use-package-ensure-system-package use-package-el-get use-package-chords telephone-line ssh spacemacs-theme soothe-theme smooth-scrolling smooth-scroll slime scroll-restore robe req-package rebox2 rainbow-mode racer projectile pretty-mode php-mode pdf-tools org-mime org-babel-eval-in-repl night-owl-theme neotree multi-term modern-cpp-font-lock magit linum-relative klere-theme ivy-rtags iedit hydra hungry-delete hlinum highlight-indentation highlight-indent-guides helm grandshell-theme ggtags geiser flycheck-rust flycheck-perl6 fish-mode evil elfeed-org cyberpunk-theme counsel company-rtags company-irony-c-headers company-c-headers cmake-mode cmake-ide clojure-mode-extra-font-locking cider chess cargo auto-complete-clang auto-complete-c-headers auctex ample-theme)))
+ (flycheck go-mode impatient-mode xah-css-mode psgml emmet-mode web-mode auctex-latexmk company-auctex pdf-view-restore fic-mode seti-theme vimrc-mode use-package-hydra use-package-ensure-system-package use-package-el-get use-package-chords telephone-line ssh spacemacs-theme soothe-theme smooth-scrolling smooth-scroll slime scroll-restore robe req-package rebox2 rainbow-mode racer projectile pretty-mode php-mode pdf-tools org-mime org-babel-eval-in-repl night-owl-theme neotree multi-term modern-cpp-font-lock magit linum-relative klere-theme ivy-rtags iedit hydra hungry-delete hlinum highlight-indentation highlight-indent-guides helm grandshell-theme ggtags geiser flycheck-rust flycheck-perl6 fish-mode evil elfeed-org cyberpunk-theme counsel company-rtags company-irony-c-headers company-c-headers cmake-mode cmake-ide clojure-mode-extra-font-locking cider chess cargo auto-complete-clang auto-complete-c-headers auctex ample-theme)))
'(pdf-view-continuous nil)
'(safe-local-variable-values
(quote