dotfiles

My dotfiles.
Log | Files | Refs | LICENSE

commit 8c3c3802381e97adcb79ec72994ff931cc5d47cb
parent f4a48c56c2731fa5db2bfdd4d8111ca5c436c150
Author: Ryan Jeffrey <ryan@ryanmj.xyz>
Date:   Tue, 29 Sep 2020 02:12:18 -0700

New emacs.d system.

Diffstat:
D.emacs | 77-----------------------------------------------------------------------------
M.gitignore | 15+++++++++++++--
Mcrontab-ryan | 5++---
Ddwmbar.sh | 74--------------------------------------------------------------------------
Dryansleep.sh | 5-----
Dscripts/updot.zsh | 42------------------------------------------
Dspeconf.org | 695-------------------------------------------------------------------------------
7 files changed, 15 insertions(+), 898 deletions(-)

diff --git a/.emacs b/.emacs @@ -1,77 +0,0 @@ -;;; package --- Summary - -;;; Commentary: - - -;;; Code: -(package-initialize) - - -(add-to-list 'package-archives - '("melpa" . "https://melpa.org/packages/") t) - -(org-babel-load-file "~/.econfig.org") - -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(LaTeX-command "lualatex") - '(company-c-headers-path-system - (quote - ("/usr/include/" "/usr/local/include/" "/usr/include/c++/9.2.0/"))) - '(package-selected-packages - (quote - (emojify crontab-mode org-pdfview godot-gdscript js-comint toml toml-mode json-mode js2-mode dracula-theme go-snippets java-snippets yasnippet-snippets company-emacs-eclim gradle-mode eclim rainbow-delimiters 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 - ((flycheck-clang-include-path "/home/ryan/src/quidcity/head/") - (flycheck-include-path . "/home/rmj/src/cgol/head/") - (flycheck-include-path . "/home/rmj/src/misc-sdl-projects/cgol/head/") - (projectile-project-run-cmd . "mkdir -p build; cd build; cmake ..; make run") - (projectile-project-compilation-cmd . "mkdir -p build; cd build; cmake ..; make"))))) -;; (custom-set-faces -;; ;; custom-set-faces was added by Custom. -;; ;; If you edit it by hand, you could mess it up, so be careful. -;; ;; Your init file should contain only one such instance. -;; ;; If there is more than one, they won't work right. -;; '(company-preview ((t (:background "black" :foreground "red")))) -;; '(company-preview-common ((t (:foreground "red")))) -;; '(company-preview-search ((t (:inherit company-preview)))) -;; '(company-scrollbar-bg ((t (:background "brightwhite")))) -;; '(company-scrollbar-fg ((t (:background "red")))) -;; '(company-template-field ((t (:background "magenta" :foreground "black")))) -;; '(company-tooltip ((t (:background "brightwhite" :foreground "black")))) -;; '(company-tooltip-annotation ((t (:background "brightwhite" :foreground "black")))) -;; '(company-tooltip-annotation-selection ((t (:background "color-253")))) -;; '(company-tooltip-common ((t (:background "brightwhite" :foreground "red")))) -;; '(company-tooltip-common-selection ((t (:background "color-253" :foreground "red")))) -;; '(company-tooltip-mouse ((t (:foreground "black")))) -;; '(company-tooltip-search ((t (:background "brightwhite" :foreground "black")))) -;; '(company-tooltip-selection ((t (:background "color-253" :foreground "black"))))) - -(provide '.emacs) -;;; .emacs ends here -(put 'narrow-to-region 'disabled nil) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(company-scrollbar-bg ((t (:background "#199919991999")))) - '(company-scrollbar-fg ((t (:background "#0ccc0ccc0ccc")))) - '(company-tooltip ((t (:inherit default :background "#051e051e051e")))) - '(company-tooltip-common ((t (:inherit font-lock-constant-face)))) - '(company-tooltip-selection ((t (:inherit font-lock-function-name-face)))) - '(vterm-color-black ((t (:foreground "#3F3F3F" :background "#2B2B2B")))) - '(vterm-color-blue ((t (:foreground "#7CB8BB" :background "#4C7073")))) - '(vterm-color-cyan ((t (:foreground "#93E0E3" :background "#8CD0D3")))) - '(vterm-color-green ((t (:foreground "#7F9F7F" :background "#9FC59F")))) - '(vterm-color-magenta ((t (:foreground "#DC8CC3" :background "#CC9393")))) - '(vterm-color-red ((t (:foreground "#AC7373" :background "#8C5353")))) - '(vterm-color-white ((t (:foreground "#DCDCCC" :background "#656555")))) - '(vterm-color-yellow ((t (:foreground "#DFAF8F" :background "#9FC59F")))) - '(vterm-default-bg-color ((t (:inherit vterm-color-black)))) - '(vterm-default-fg-color ((t (:inherit vterm-color-white))))) diff --git a/.gitignore b/.gitignore @@ -75,4 +75,16 @@ flycheck_*.el .config/mpd/database .config/mpd/pid .config/mpd/state -.config/mpd/sticker.sql- \ No newline at end of file +.config/mpd/sticker.sql +.emacs.d/auto-save-list +.emacs.d/contacts.org +.emacs.d/elfeed.org +.emacs.d/elpa +.emacs.d/emojis +.emacs.d/joestar +.emacs.d/places +.emacs.d/quelpa +.emacs.d/recentf +.emacs.d/recentf~ +.emacs.d/transient +.emacs.d/lisp/ryan-os.el diff --git a/crontab-ryan b/crontab-ryan @@ -1,4 +1,3 @@ -* * * * * /usr/bin/pgrep Discord > /dev/null || DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/`id -u` /usr/bin/discord -* * * * * sleep 0.5m ; /usr/bin/pgrep Discord > /dev/null || DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/`id -u` /usr/bin/discord -*/15 * * * * /usr/bin/mpc update +0 */2 * * * DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/`id -u` /usr/bin/wal -i $(/home/ryan/src/scripts/ranwal) +0 */12 * * * /usr/local/bin/emacsclient -e '(elfeed-update)' diff --git a/dwmbar.sh b/dwmbar.sh @@ -1,74 +0,0 @@ -#!/usr/bin/env sh - -# Length of the song title mpd is playing -SONG_LEN=25 - -get_battery() { - cap=$(cat /sys/class/power_supply/BAT0/capacity) || return 1 - status=$(cat /sys/class/power_supply/BAT0/status) - emoji=πŸ”Œ - - [ "$status" = "Discharging" ] && [ "$cap" -le 25 ] && emoji=❗ - [ "$status" = "Discharging" ] && emoji=πŸ”‹ - - echo "$emoji $cap%" -} - -get_volume() { - volume=$(pamixer --get-volume) - emoji=πŸ”‰ # default is medium volume - - if [ "$volume" -eq 0 ]; then - emoji=πŸ”‡ - elif [ "$volume" -le 50 ]; then - emoji=πŸ”ˆ - elif [ "$volume" -ge 120 ]; then - emoji=πŸ”Š - fi - - echo "$emoji $volume%" - -} - -# Get the current song from mpd -get_song() { - song=$(mpc current) || return 1 - emoji=🎡 - - [ -z "$song" ] && emoji='' - - echo "$emoji $(echo $song | cut -c 1-$SONG_LEN)" -} - -get_cpu_usage() { - echo "πŸ’» $(top -bn1 | grep "Cpu(s)" | \ - sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | \ - awk '{print 100 - $1"%"}')" -} - -get_cpu_temp() { - temp=$(cat /sys/class/thermal/thermal_zone1/temp | cut -c 1-2) - emoji=🌑 - - [ temp -ge 60 ] && emoji=πŸ”₯ - - echo "$emoji $tempΒ°C" -} - -get_used_mem() { - total=$(cat /proc/meminfo | awk '{print $2}' | head -1) - free=$(cat /proc/meminfo | awk '{print $2}' | sed -n 2p) - emoji=🧠 - - used=$(expr $total / $free) - - [ used -ge 70 ] && emoji=🀯 - - echo "$emoji $used%" -} - -while true; do - xsetroot -name " $(get_song) | $(get_volume) | $(get_used_mem) | $(get_cpu_usage) | $(get_cpu_temp) | $(get_battery) | πŸ“… $(date +"%a, %b %d - %I:%M %p") | $(whoami)" - - /home/rmj/src/scripts/ryansleep.sh -done diff --git a/ryansleep.sh b/ryansleep.sh @@ -1,5 +0,0 @@ -#!/usr/bin/env sh - -# This script exists so it can be killed from scripts. - -sleep 20 diff --git a/scripts/updot.zsh b/scripts/updot.zsh @@ -1,42 +0,0 @@ -#!/usr/bin/env zsh - -# Takes all config files and places them into ~/src/dotfiles/ - -# location of all dotfiles -home_dir="/home/ryan/" - -# Non .config files -dotfile_locals=(".zshrc" ".emacs" ".econfig.org" ".ncmpcpp" "src/scripts") - -# The .config folder -config_dir="$home_dir/.config/" - -# Config files in .config -config_locals=("i3" "i3status" "mupen64plus" "m64py" "mpd" "polybar" "ranger") - -# The folder to place all dotfiles into -dest_dir="/home/ryan/src/dotfiles/" - - - -# folders to exclude from .config (if globbing) -exclude=("Brave") - -cd $dest_dir - -# Copy dotfiles -for config in $dotfile_locals; do - file=$(echo "$home_dir$config") - [[ ${exclude[(ie)$file]} -le ${#exclude} ]] || cp "$file" $config -r -done - -stat .config &>/dev/null || mkdir .config - -cd .config - -# Copy config files -for config in $config_locals; do - file=$(echo "$config_dir$config") - [[ ${exclude[(ie)$file]} -le ${#exclude} ]] || cp "$file" "$config" -r -done - diff --git a/speconf.org b/speconf.org @@ -1,695 +0,0 @@ -#+TITLE: Ryan Jeffrey's Emacs config -#+AUTHOR: Ryan Jeffrey -#+EMAIL: pwishie@gmail.com -#+OPTIONS: num:nil - -* Emacs -** init -#+BEGIN_SRC emacs-lisp - -(eval-when-compile - (require 'use-package)) - -(defalias 'yes-or-no-p 'y-or-n-p) - -#+END_SRC -** font and theme -#+BEGIN_SRC emacs-lisp - - (add-to-list 'default-frame-alist - '(font . "Hack:antialias=true:size=18:style=Regular")) - - (add-to-list 'load-path "~/.emacs.d/themes/") - - (load-theme 'modus-vivendi t) - (menu-bar-mode nil) - - (global-set-key (kbd "S-<right>") 'next-buffer) - (global-set-key (kbd "S-<left>") 'previous-buffer) - - (set-frame-parameter (selected-frame) 'alpha '(100 . 100)) - (add-to-list 'default-frame-alist '(alpha . (100 . 100))) - - ;; telephone-line - (setq telephone-line-primary-left-separator 'telephone-line-cubed-left - telephone-line-secondary-left-separator 'telephone-line-cubed-hollow-left - telephone-line-primary-right-separator 'telephone-line-cubed-right - telephone-line-secondary-right-separator 'telephone-line-cubed-hollow-right) - (setq telephone-line-height 24 - telephone-line-evil-use-short-tag t) - - ;(telephone-line-mode 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) -#+END_SRC - -** Misc -#+BEGIN_SRC emacs-lisp - -(put 'upcase-region 'disabled nil) -(electric-pair-mode t) -(show-paren-mode 1) -(setq-default indent-tabs-mode nil) -(setq-default tab-width 4) -(setq column-number-mode t) -(display-time-mode 1) -(tool-bar-mode -1) -(scroll-bar-mode -1) -(setq ring-bell-function 'ignore) -(blink-cursor-mode 0) -(set-language-environment "UTF-8") -(setq redisplay-dont-pause t) - - -(require 'neotree) -(global-set-key [f8] 'neotree-toggle) -(global-set-key (kbd "s-i") 'ido-switch-buffer) - -(global-set-key (kbd "s-+") 'text-scale-increase) -(global-set-key (kbd "s--") 'text-scale-decrease) - -#+END_SRC - -** Filename-mode associations -#+BEGIN_SRC emacs-lisp - -(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) -(add-to-list 'auto-mode-alist '("\\.fish\\'" . fish-mode)) -(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode)) - -#+END_SRC -** joestar -#+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 - (global-joestar-mode t)) - -#+END_SRC -** org -#+BEGIN_SRC emacs-lisp - -(use-package org-indent-mode - :config - (org-indent-mode t) - :hook org-mode) - -#+END_SRC -* IDE -** company-mode and flycheck -#+BEGIN_SRC emacs-lisp - - (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)) - - -; (use-package auto-complete -; :config (ac-config-default)) - - -(require 'company) - -(add-hook 'after-init-hook 'global-company-mode) - -(add-to-list 'company-backends 'company-c-headers) - - (require 'color) - -(let ((bg (face-attribute 'default :background))) -(custom-set-faces - `(company-tooltip ((t (:inherit default :background ,(color-lighten-name bg 2))))) - `(company-scrollbar-bg ((t (:background ,(color-lighten-name bg 10))))) - `(company-scrollbar-fg ((t (:background ,(color-lighten-name bg 5))))) - `(company-tooltip-selection ((t (:inherit font-lock-function-name-face)))) - `(company-tooltip-common ((t (:inherit font-lock-constant-face)))))) - -;(use-package company-quickhelp -; :ensure t -; :config -; (company-quickhelp-mode) -; -; :hook -; (company-mode)) - -#+END_SRC -** C# -#+BEGIN_SRC emacs-lisp - -(use-package omnisharp - :ensure t - :config - - (omnisharp-start-omnisharp-server) - (omnisharp-mode) - (eval-after-load - 'company - '(add-to-list 'company-backends 'company-omnisharp)) - - :hook (csharp-mode)) - - ;; (require 'omnisharp) - - - ;; (defun omnisharp-init () - ;; (omnisharp-start-omnisharp-server) - ;; (omnisharp-mode) - ;; (eval-after-load - ;; 'company - ;; '(add-to-list 'company-backends 'company-omnisharp)) - - ;; (add-hook 'csharp-mode-hook #'company-mode)) - - ;; (add-hook 'csharp-mode-hook #'omnisharp-init) - -#+END_SRC -** all programming languages -*** comments -#+BEGIN_SRC emacs-lisp - -(require 'rebox2) -(rebox-register-template - 75 - 999 - '("?*************?" - "?* box123456 *?" - "?*************?")) - -#+END_SRC -*** todos -#+BEGIN_SRC emacs-lisp - - (use-package fic-mode - :config - (fic-mode t) - :hook prog-mode) - -#+END_SRC -** C/C++ -*** style and font-lock -#+BEGIN_SRC emacs-lisp - -(setq c-default-style "bsd" - c-basic-offset 4) - -(require 'modern-cpp-font-lock) -(modern-c++-font-lock-global-mode t) - -(add-hook 'prog-mode-hook 'yas-minor-mode) -#+END_SRC -*** irony -#+BEGIN_SRC emacs-lisp - -(require 'irony) - -(add-hook 'c++-mode-hook 'irony-mode) -(add-hook 'c-mode-hook 'irony-mode) -(add-hook 'objc-mode-hook 'irony-mode) - -(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options) - -(eval-after-load 'flycheck - '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup)) - -(eval-after-load 'company - '(add-to-list 'company-backends 'company-irony)) - - -#+END_SRC -** lisp -#+BEGIN_SRC emacs-lisp - -(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)) - -(use-package miracle - ;:ensure t - :load-path "~/.emacs.d/miracle" - - :config - (clojure-enable-miracle) - (define-key clojure-mode-map (kbd "C-c C-k") 'miracle-eval-buffer) - (define-key clojure-mode-map (kbd "C-c C-e") 'miracle-eval-expression-at-point) - (define-key clojure-mode-map (kbd "C-c C-n") 'miracle-eval-namespace) - (define-key clojure-mode-map (kbd "C-c C-d") 'miracle-job) - (define-key clojure-mode-map (kbd "C-c C-g") 'miracle-eval-defun) - - - :hook clojure-mode) - - - #+END_SRC -** Misc -#+BEGIN_SRC emacs-lisp - -(add-to-list 'load-path "~/.emacs.d/i3wm-Config-Mode/") -(require 'i3wm-config-mode) - -(add-to-list 'auto-mode-alist '("~/.config/i3/config" . i3wm-config-mode)) - ;; (custom-set-faces - ;; ;; ... - ;; '(company-preview ((t (:background "black" :foreground "red")))) - ;; '(company-preview-common ((t (:foreground "red")))) - ;; '(company-preview-search ((t (:inherit company-preview)))) - ;; '(company-scrollbar-bg ((t (:background "brightwhite")))) - ;; '(company-scrollbar-fg ((t (:background "red")))) - ;; '(company-template-field ((t (:background "magenta" :foreground "black")))) - ;; '(company-tooltip ((t (:background "brightwhite" :foreground "black")))) - ;; '(company-tooltip-annotation ((t (:background "brightwhite" :foreground "black")))) - ;; '(company-tooltip-annotation-selection ((t (:background "color-253")))) - ;; '(company-tooltip-common ((t (:background "brightwhite" :foreground "red")))) - ;; '(company-tooltip-common-selection ((t (:background "color-253" :foreground "red")))) - ;; '(company-tooltip-mouse ((t (:foreground "black")))) - ;; '(company-tooltip-search ((t (:background "brightwhite" :foreground "black")))) - ;; '(company-tooltip-selection ((t (:background "color-253" :foreground - ;; "black")))) - ;; ;; ... - ;; ) - - -#+END_SRC -** scripts -*** Perl -#+BEGIN_SRC emacs-lisp - -(fset 'perl-mode 'cperl-mode) -(setq cperl-indent-level 4) -(setq cperl-extra-newline-before-brace t - cperl-brace-offset -2 - cperl-merge-trailing-else nil) - -(add-hook 'perl-mode-hook (lambda () - (set (make-local-variable 'rebox-style-loop) '(75 11)) - (set (make-local-variable 'rebox-min-fill-column) 79) - (rebox-mode 1))) - -#+END_SRC -*** Ruby -#+BEGIN_SRC emacs-lisp - -(add-hook 'ruby-mode-hook 'robe-mode) -(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 -** java -#+BEGIN_SRC emacs-lisp -(require 'eclim) -(require 'eclimd) -(require 'gradle-mode) -(require 'company-emacs-eclim) -(require 'company) - -(defun java-mode-init() - (auto-complete-mode nil) - (gradle-mode 1) - (setq c-default-style "bsd") - (eclim-mode 1) - (company-mode 1) - (company-emacs-eclim-setup)) - -(add-hook 'java-mode-hook 'java-mode-init) - -#+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 - - -(setq ispell-program-name "hunspell") -(setq ispell-local-dictionary "en_US") -(setq ispell-local-dictionary-alist - '(("en_US" "[[:alpha:]]" "[^[:alpha:]]" "[']" nil nil nil utf-8))) - - - -#+END_SRC -** line numbers -#+BEGIN_SRC emacs-lisp - -(setq linum-relative-backend 'display-line-numbers-mode) -(require 'linum-relative) -(linum-relative-on) - -#+END_SRC -** sudo edit -#+BEGIN_SRC emacs-lisp - -(defun er-sudo-edit (&optional arg) - "Edit currently visited file as root With a prefix ARG prompt for a file to visit. Will also prompt for a file to visit if current buffer is not visiting a file." - (interactive "P") - (if (or arg (not buffer-file-name)) - (find-file (concat "/sudo:root@localhost:" - (ido-read-file-name "Find file(as root): "))) - (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name)))) - -#+END_SRC -** ligatures -#+BEGIN_SRC emacs-lisp - -(defun pretty-greek () - "Prettify greek symbols." - (let ((greek '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta" "theta" "iota" "kappa" "lambda" "mu" "nu" "xi" "omicron" "pi" "rho" "sigma_final" "sigma" "tau" "upsilon" "phi" "chi" "psi" "omega"))) - (loop for word in greek - for code = 97 then (+ 1 code) - do (let ((greek-char (make-char 'greek-iso8859-7 code))) - (font-lock-add-keywords nil - `((,(concatenate 'string "\\(^\\|[^a-zA-Z0-9]\\)\\(" word "\\)[a-zA-Z]") - (0 (progn (decompose-region (match-beginning 2) (match-end 2)) - nil))))) - (font-lock-add-keywords nil - `((,(concatenate 'string "\\(^\\|[^a-zA-Z0-9]\\)\\(" word "\\)[^a-zA-Z]") - (0 (progn (compose-region (match-beginning 2) (match-end 2) - ,greek-char) - nil))))))))) -(add-hook 'lisp-mode-hook 'pretty-greek) -(add-hook 'emacs-lisp-mode-hook 'pretty-greek) - -(defun my/create-basic-ligatures () - "Create basic ligatures." - (prettify-symbols-mode t) - ;; boolean and math symbols - (push '(">=" . ?β‰₯) prettify-symbols-alist) - (push '("<=" . ?≀) prettify-symbols-alist) - (push '("!=" . ?β‰ ) prettify-symbols-alist) - - (pretty-greek)) - -(defun my/create-advanced-ligatures () - "Create more invasive ligatures." - (my/create-basic-ligatures) - (push '("<-" . ?←) prettify-symbols-alist) - (push '("->" . ?β†’) prettify-symbols-alist)) - -(setq backup-directory-alist `(("." . "~/.saves"))) - - -#+END_SRC -** misc -#+BEGIN_SRC emacs-lisp - -;; tell emacs not to use the clipboard -;(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 - -;; rainbow delimeters -(use-package rainbow-mode - :config (rainbow-mode t) - - :hook (lisp-mode c-mode-common web-mode ) -) - - -#+END_SRC -* emacs-os -** rss elfeed -#+BEGIN_SRC emacs-lisp - -(setq elfeed-db-directory (expand-file-name "~/.elrss")) - -(require 'elfeed) -(require 'elfeed-org) -(elfeed-org) -(setq rmh-elfeed-org-files (list (expand-file-name "~/.emacs.d/elfeed.org"))) - -(define-key elfeed-search-mode-map (kbd "u") '(lambda () - (interactive) - (message "Updating elfeed database.") - (elfeed-update))) - -(setq-default elfeed-search-filter "@6-months-ago +unread -reddit") -#+END_SRC -*** theme, colors, font settings -#+BEGIN_SRC emacs-lisp - (require 'color) - - (defface comics-tag - '((t :foreground "#AE6486")) - "Marks comic tags") - - - (defface podcast-tag - '((t :foreground "#6699CC")) - "Marks podcast tags") - - (push '(comics comics-tag) - elfeed-search-face-alist) - - (push '(podcast podcast-tag) - elfeed-search-face-alist) - - ;; from https://github.com/skeeto/elfeed/issues/190#issuecomment-384346895 - (setq elfeed-show-mode-hook - (lambda () - (set-face-attribute 'variable-pitch (selected-frame) :font (font-spec :family "Ubuntu" :size 22)) - (setq fill-column 120) - (setq elfeed-show-entry-switch #'my-show-elfeed))) - - (defun my-show-elfeed (buffer) - (with-current-buffer buffer - (setq buffer-read-only nil) - (goto-char (point-min)) - (re-search-forward "\n\n") - (fill-individual-paragraphs (point) (point-max)) - (setq buffer-read-only t)) - (switch-to-buffer buffer)) - - -#+END_SRC -* Misc -** Terminal stuff -#+BEGIN_SRC emacs-lisp - -(add-hook 'term-mode-hook - (defun my-term-mode-hook () - (setq bidi-paragraph-direction 'left-to-right))) - (setq-default term-suppress-hard-newline t) - -#+END_SRC -*** vterm -#+BEGIN_SRC emacs-lisp - -(require 'vterm) -(require 'color) - -(custom-set-faces - '(vterm-color-black ((t (:foreground "#3F3F3F" :background "#2B2B2B")))) - '(vterm-color-red ((t (:foreground "#AC7373" :background "#8C5353")))) - '(vterm-color-green ((t (:foreground "#7F9F7F" :background "#9FC59F")))) - '(vterm-color-yellow ((t (:foreground "#DFAF8F" :background "#9FC59F")))) - '(vterm-color-blue ((t (:foreground "#7CB8BB" :background "#4C7073")))) - '(vterm-color-magenta ((t (:foreground "#DC8CC3" :background "#CC9393")))) - '(vterm-color-cyan ((t (:foreground "#93E0E3" :background "#8CD0D3")))) - '(vterm-color-white ((t (:foreground "#DCDCCC" :background "#656555")))) - - '(vterm-default-fg-color ((t (:inherit vterm-color-white)))) - '(vterm-default-bg-color ((t (:inherit vterm-color-black))))) - -#+END_SRC -*** crontab -#+BEGIN_SRC emacs-lisp -(add-to-list 'auto-mode-alist '("crontab." . crontab-mode)) ; TEST -#+END_SRC -*** emojis -#+BEGIN_SRC emacs-lisp -(add-hook 'after-init-hook #'global-emojify-mode) - -#+END_SRC - -** ssh -#+BEGIN_SRC emacs-lisp - - (require 'ssh) - (add-hook 'ssh-mode-hook - (lambda () - (setq ssh-directory-tracking-mode t) - (shell-dirtrack-mode t) - (setq dirtrackp nil))) - -#+END_SRC -** misc -#+BEGIN_SRC emacs-lisp - -(require 'highlight-indentation) - -#+END_SRC