Commit 14ee183a authored by case's avatar case 🤠

init

parents
Pipeline #4 failed with stages
in 14 seconds
alias x exit
alias la ls -aF
alias jl journalctl --follow --output=short --all --no-pager
alias sl systemctl list --all --no-pager
alias bup brew update && brew upgrade
alias c cat
alias l ls -a
alias ll ls -laF
.DS_Store
epkgs
ido.last
.backups
auto-save-list
elpa
eshell
smex-items
tramp
tutorial
#*#
*.fasl
irony
cookies
recentf
network-security.data
nrepl-history
projectile-bookmarks.eld
custom
request
#!/bin/sh
# .emacs.d customizations
MX=$HOME/.emacs.d
EMACS=/usr/local/emacs
osx() {
if [[ $(uname) = 'Darwin' ]]; then
return 1
else
return 0
fi
}
dlMx() {
git clone https://github.com/emacs-mirror/emacs.git $EMACS
}
# add all patches here
patchMx() {
pushd $EMACS/src
patch < $MX/patch/mask.patch
popd
}
# custom icons pkg for osx
corporatize() {
cp $MX/icon/Emacs.icns $EMACS/nextstep/Emacs.app/Contents/Resources/Emacs.icns
}
# symlink to /usr/local
sym() {
link $EMACS/nextstep/Emacs.app/Contents/MacOS/Emacs /usr/local/bin/emacs
pushd $EMACS/nextstep/Emacs.app/Contents/MacOS/bin
for f in $(ls ./)
do
link ./$f /usr/local/bin/$f
done
popd
}
mkconf() {
pushd $EMACS
sh autogen.sh
if [ osx ]; then
sh configure --disable-dependency-tracking --disable-silent-rules --without-x
else
sh configure
fi
make install
popd
}
#dlMx
#patchMx
mkconf
if [ osx ]; then
corporatize
# todo: add systemd later
if [ -d "$HOME/Library/LaunchAgents" ]; then
cp $MX/misc/case.emacsdaemon.plist $HOME/Library/LaunchAgents/
else
mkdir $HOME/Library/LaunchAgents
cp $MX/misc/case.emacsdaemon.plist $HOME/Library/LaunchAgents/
fi
fi
File added
;;; init --- bootstraps the configuration
;;; commentary:
;;; init is parsed out into several configuration files (rc-files) for easier management.
;;; code:
(require 'nsm)
(setq network-security-level 'low)
(add-to-list 'load-path "~/.emacs.d/util/")
(setq package-archives '(("melpa" . "http://melpa.milkbox.net/packages/")
("gnu" . "https://elpa.gnu.org/packages/")))
(defconst req-pkg 'use-package)
(unless package-archive-contents
(package-refresh-contents))
(unless (package-installed-p req-pkg)
(package-install req-pkg))
(setq
backup-by-copying t
default-directory "/Users/u560061/"
backup-directory-alist
'(("." . "~/.emacs.d/.backups"))
delete-old-versions t
kept-new-versions 6
kept-old-versions 2
version-control t)
(defvar-local init/work "~/.work/priv.el")
(if (file-exists-p init/work)
(load-file init/work))
(require 'misc-rc)
(require 'eshell-rc)
(require 'clojure-rc)
(require 'company-rc)
(require 'go-rc)
(require 'evil-rc)
(require 'fly-rc)
(require 'js-rc)
(require 'nasm-rc)
(require 'os-rc)
(require 'popwin-rc)
(require 'visual-rc)
(require 'ivy-rc)
(require 'rust-rc)
(require 'org-rc)
(provide 'init)
;;; init.el ends here
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>case.emacsdaemon</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/emacs</string>
<string>--daemon</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/> <!-- run the program again if it terminates -->
</dict>
</plist>
\ No newline at end of file
diff --git a/src/nsterm.m b/src/nsterm.m
index 7e6ec85abf..c0ae905ce6 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -6778,9 +6778,6 @@ - (BOOL)isOpaque
win = [[EmacsWindow alloc]
initWithContentRect: r
styleMask: (NSWindowStyleMaskResizable |
-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
- NSWindowStyleMaskTitled |
-#endif
NSWindowStyleMaskMiniaturizable |
NSWindowStyleMaskClosable)
backing: NSBackingStoreBuffered
;;; clojure-rc --- rc configuration for clojure components
;;; -*- lexical-binding: t -*-
;;; commentary:
;;; code:
(use-package clojure-mode
:ensure t
:pin melpa
:after evil
:mode (("\\.edn$" . clojure-mode))
:config
(progn
(setq clojure-align-forms-automatically t)
(define-clojure-indent
(defroutes 'defun)
(GET 2)
(POST 2)
(PUT 2)
(DELETE 2)
(HEAD 2)
(ANY 2)
(context 2)
(let-routes 1))
(define-clojure-indent
(form-to 1))
(define-clojure-indent
(match 1)
(are 2)
(checking 2)
(async 1))
(define-clojure-indent
(select 1)
(insert 1)
(update 1)
(delete 1))
(define-clojure-indent
(run* 1)
(fresh 1))
(define-clojure-indent
(extend-freeze 2)
(extend-thaw 1))
(define-clojure-indent
(go-loop 1))
(define-clojure-indent
(this-as 1)
(specify 1)
(specify! 1))
(define-clojure-indent
(s/fdef 1))
(setq clojure--prettify-symbols-alist
'(("fn" . ?λ)))
(defun toggle-nrepl-buffer ()
"Toggle the nREPL REPL on and off"
(interactive)
(if (string-match "cider-repl" (buffer-name (current-buffer)))
(delete-window)
(cider-switch-to-repl-buffer)))
(defun cider-save-and-refresh ()
(interactive)
(save-buffer)
(call-interactively 'cider-refresh))
(defun cider-eval-last-sexp-and-append ()
(interactive)
(cider-eval-last-sexp '(1)))
(evil-leader/set-key "eb" 'cider-eval-buffer)
(evil-leader/set-key "ee" 'cider-eval-last-sexp)
(evil-leader/set-key "er" 'cider-eval-region)
(evil-leader/set-key "ef" 'cider-eval-defun-at-point)
(evil-leader/set-key "ea" 'cider-eval-last-sexp-and-append)
(evil-leader/set-key "ec" 'cider-eval-last-sexp-and-replace)
(evil-leader/set-key "es" 'cider-eval-sexp-at-point)
(evil-leader/set-key "cd" 'cider-doc)
(evil-leader/set-key "cc" 'cider-connect)
(evil-leader/set-key "cj" 'cider-jack-in)
(evil-leader/set-key "cJ" 'cider-jack-in-clojurescript)
(evil-leader/set-key "ct" 'cider-test-run-ns-tests)
(evil-leader/set-key "cT" 'cider-test-run-project-tests)
(evil-leader/set-key "cn" 'cider-repl-set-ns)
(evil-leader/set-key "cr" 'toggle-nrepl-buffer)
(evil-leader/set-key "cf" 'cider-save-and-refresh)
(global-set-key (kbd "s-r") 'cider-save-and-refresh)))
(use-package cider
:ensure t
:pin melpa
:config
(progn
(setq nrepl-hide-special-buffers t)
(setq cider-popup-stacktraces-in-repl t)
(setq cider-repl-history-file "~/.emacs.d/nrepl-history")
(setq cider-repl-pop-to-buffer-on-connect nil)
(setq cider-auto-select-error-buffer nil)
(setq cider-prompt-save-file-on-load nil)
(setq cider-repl-display-help-banner nil)
(setq cider-repl-use-pretty-printing t)
(setq cider-refresh-before-fn "reloaded.repl/suspend")
(setq cider-refresh-after-fn "reloaded.repl/resume")
(setq cider-cljs-lein-repl "(do (reloaded.repl/go) (user/cljs-repl))")))
(use-package clj-refactor
:ensure t
:pin melpa
:after evil
:init
(add-hook 'clojure-mode-hook (lambda () (clj-refactor-mode 1)))
:config
(progn
(evil-leader/set-key "rai" 'cljr-add-import-to-ns)
(evil-leader/set-key "rar" 'cljr-add-require-to-ns)
(evil-leader/set-key "rau" 'cljr-add-use-to-ns)
(evil-leader/set-key "rrr" 'cljr-remove-unused-requires)
(evil-leader/set-key "rcn" 'cljr-clean-ns)
(evil-leader/set-key "rtf" 'cljr-thread-first-all)
(evil-leader/set-key "rtl" 'cljr-thread-last-all)
(evil-leader/set-key "rcc" 'cljr-cycle-coll)
(evil-leader/set-key "rcp" 'cljr-cycle-privacy)
(evil-leader/set-key "rcs" 'clojure-toggle-keyword-string)
(evil-leader/set-key "rfe" 'cljr-create-fn-from-example)
(evil-leader/set-key "rrs" 'cljr-rename-symbol)))
(provide 'clojure-rc)
;;; clojure-rc.el ends here
;;; company-rc --- rc file for company
;; -*- lexical-binding: t -*-
;;; commentary:
;;; code:
(use-package eglot
:ensure t
:pin melpa
:config
(add-hook 'sh-mode-hook 'eglot-ensure)
(add-hook 'go-mode-hook 'eglot-ensure)
(add-hook 'js2-mode-hook 'eglot-ensure))
(use-package company
:ensure t
:config
(use-package company-tern
:ensure t)
(use-package company-irony
:ensure t)
(require 'company)
(declare-function company-abort 'company)
(add-hook 'after-init-hook 'global-company-mode)
(setq company-global-modes '(not eshell-mode term-mode org-mode shell-mode shx-mode))
(setq company-idle-delay 0)
(setq company-echo-delay 0)
(setq company-tooltip-align-annotations t)
(setq company-begin-commands '(self-insert-command))
(defun abort-company-on-insert-state-exit ()
(company-abort))
(add-hook 'evil-insert-state-exit-hook 'abort-company-on-insert-state-exit)
(defun company-complete-common-or-previous-cycle ()
"Insert the common part of all candidates, or select the next one."
(interactive)
(when (company-manual-begin)
(let ((tick (buffer-chars-modified-tick)))
(call-interactively 'company-complete-common)
(when (eq tick (buffer-chars-modified-tick))
(let ((company-selection-wrap-around t))
(call-interactively 'company-select-previous))))))
(with-eval-after-load 'company
(setq company-backends (remove 'company-clang company-backends))
(if (window-system)
(if (eq system-type 'gnu/linux)
(define-key company-active-map (kbd "TAB") 'company-complete-common-or-cycle)
(define-key company-active-map (kbd "<tab>") 'company-complete-common-or-cycle))
(define-key company-active-map (kbd "TAB") 'company-complete-common-or-cycle))
(define-key company-active-map (kbd "<backtab>") 'company-complete-common-or-previous-cycle)))
(provide 'company-rc)
;;; company-rc.el ends here
;;; eshell-rc --- rc configuration for eshell components
;;; -*- lexical-binding: t -*-
;;; commentary:
;;; code:
(use-package popwin
:ensure t)
(use-package company
:ensure t)
(use-package eshell-bookmark
:ensure t
:config
(add-hook 'eshell-mode-hook 'eshell-bookmark-setup))
(require 'subr-x)
(require 'company)
(require 'tramp)
(require 'eshell)
(require 'em-glob)
(require 'em-alias)
(require 'em-hist)
(require 'em-cmpl)
(require 'popwin)
(require 'dired)
(eval-when-compile '(require 'cl-lib))
(setf confirm-kill-processes nil)
;; when in tramp, make sure C-x d opens local buffer to tramp
;; connection
(setq dired-dwim-target t)
(setenv "CURL_CA_BUNDLE" (concat (getenv "HOME") "/csi/server/etc/ssl/wf_roots.pem"))
(setenv "LEIN_JVM_OPTS" "-Dmaven.wagon.rto=1800000 -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Djavax.net.ssl.trustStore=$HOME/.keystore -Djavax.net.ssl.trustStorePassword=320739casey")
(setenv "OPENSSL_LIB_DIR" (concat (getenv "HOME") "/brew/opt/openssl/lib"))
(setenv "OPENSSL_INCLUDE_DIR" (concat (getenv "HOME") "/brew/opt/openssl/include"))
(setenv "PAGER" "cat")
(setenv "GOPATH" (concat (getenv "HOME") "/go"))
(setenv "GOBIN" (concat (getenv "HOME") "/go/bin"))
(setenv "BREW" (concat (getenv "HOME") "/brew"))
(setenv "PATH" "/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/Users/u560061/go/bin:/Users/u560061/brew/bin:/Users/.cargo/bin")
(setenv "XDG_CONFIG_HOME" (concat (getenv "HOME") "/.config"))
(eshell/addpath "/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/Users/u560061/brew/bin:/Users/u560061/.cargo/bin")
(add-hook 'eshell-mode-hook #'set-alias)
(add-hook 'eshell-mode-hook #'set-visual)
;;(add-hook 'eshell-mode-hook #'(lambda () (company-mode)))
(defun set-visual ()
(defvar eshell-visual-commands '())
(add-to-list 'eshell-visual-commands "ssh")
(add-to-list 'eshell-visual-commands "tail")
(add-to-list 'eshell-visual-commands "mongo")
(add-to-list 'eshell-visual-commands "top"))
(defun set-alias ()
"Set aliases upon execution of eshell."
(eshell/alias "ll" "ls -laF")
(eshell/alias "l" "ls -a")
(eshell/alias "c" "cat")
(eshell/alias "bup" "brew update && brew upgrade")
;; systemctl
(eshell/alias "sl" "systemctl list --all --no-pager")
(eshell/alias "jl" "journalctl --follow --output=short --all --no-pager")
(eshell/alias "la" "ls -aF")
(eshell/alias "x" "exit"))
(setq eshell-buffer-maximum-lines 20000)
(setq eshell-aliases-file (concat user-emacs-directory ".eshell-aliases"))
(setq eshell-glob-case-insensitive t)
(setq eshell-error-if-no-glob t)
(setq eshell-hist-ignoredups t)
(setq eshell-cmpl-ignore-case t)
(when (executable-find "cat")
(setenv "PAGER" "cat"))
(defalias 'e 'find-file-other-window)
(setq-default eshell-prompt-function
(lambda () "> "))
(setq-default eshell-prompt-regexp "^> ")
(add-to-list 'tramp-remote-path
'tramp-own-remote-path)
(defun eshell-here ()
"Opens up a new shell in the directory associated with the
current buffer's file. The eshell is renamed to match that
directory to make multiple eshell windows easier."
(interactive)
(let* ((parent (if (buffer-file-name)
(file-name-directory (buffer-file-name))
default-directory))
(height (/ (window-total-height) 3))
(name (car (last (split-string parent "/" t)))))
(split-window-vertically (- height))
(other-window 1)
(eshell "new")
(rename-buffer (concat "*eshell: " name "*"))
(insert (concat "ls"))
(eshell-send-input)))
(global-set-key (kbd "C-!") 'eshell-here)
(defun eshell/clear ()
(let ((inhibit-read-only t))
(erase-buffer)))
(defun eshell/f (filename &optional dir)
"Searches in the current directory for files that match the
given pattern. A simple wrapper around the standard 'find'
function."
(let ((cmd (concat
"find " (or dir ".")
" -not -path '*/.git*'"
" -and -not -path '*node_modules*'"
" -and -not -path '*classes*'"
" -and "
" -type f -and "
"-iname '" filename "'")))
(message cmd)
(shell-command-to-string cmd)))
(defun eshell/find (&rest args)
"Wrapper around the ‘find’ executable."
(let ((cmd (concat "find " (string-join args))))
(shell-command-to-string cmd)))
(defun eshell/oz ()
(interactive)
(insert "cd /sshx:case@oz:~")
(eshell-send-input))
(defun eshell/corp ()
(interactive)
(insert "cd /sshx:case@corp:~")
(eshell-send-input))
(defun eshell/sedit (fp)
"Edit files via tramp with sudo, must contain full-path"
(interactive)
(insert (format "ff /sudo:root@localhost:%s" fp))
(eshell-send-input))
(defun eshell/redit (user rhost fp)
"Edit files via root on remote host"
(interactive)
(insert (format "ff /sshx:%s@%s\\|sudo:root@%s:%s" user rhost rhost fp))
(eshell-send-input))
(provide 'eshell-rc)
;;; eshell-rc.el ends here
;;; evil-rc --- rc configuration for evil components
;;; -*- lexical-binding: t -*-
;;; commentary:
;;; code:
(use-package evil
:ensure t
:pin melpa
:init
(setq evil-want-integration nil)
(setq evil-want-keybinding nil)
:config
(evil-mode 1)
(declare-function evil-delay 'evil)
(declare-function evil-make-overriding-map 'evil)
(setq evil-esc-delay 0)
(define-key evil-normal-state-map ";" 'counsel-M-x)
(define-key evil-normal-state-map "\C-j" 'evil-window-down)
(define-key evil-normal-state-map "\C-k" 'evil-window-up)
(define-key evil-normal-state-map "\C-h" 'evil-window-left)
(define-key evil-normal-state-map "\C-l" 'evil-window-right))
(use-package evil-leader
:ensure t
:after evil
:pin melpa
:config
(evil-leader/set-leader ",")
(global-evil-leader-mode)
(evil-leader/set-key
"s" 'eshell
"d" 'delete-window
"b" 'switch-to-buffer
"k" 'kill-buffer
"f" 'find-file
"t" 'popwin-term:term
"o" 'ace-window
"l" 'load-file
"m" 'compile
))
(use-package evil-collection
:ensure t
:after evil
:pin melpa
:config
(evil-collection-init))
(use-package evil-surround
:ensure t
:after evil
:pin melpa
:config
(global-evil-surround-mode 1))
(use-package evil-visualstar
:ensure t
:after evil
:pin melpa
:config
(global-evil-visualstar-mode))
(use-package evil-magit
:ensure t
:after evil
:pin melpa)
(use-package expand-region
:ensure t
:after evil
:pin melpa
:config
(define-key evil-visual-state-map (kbd "v") 'er/expand-region))
(provide 'evil-rc)
;;; evil-rc.el ends here
;;; fly-rc --- rc configuration file for flycheck and related components
;;; -*- lexical-binding: t -*-
;;; commentary:
;;; code:
(use-package flycheck
:ensure t
:pin melpa
:config
(setq-default flycheck-emacs-lisp-initialize-packages t)
(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc))
(global-flycheck-mode))
(provide 'fly-rc)
;;; fly-rc.el ends here
;;; go-rc --- rc configuration for go and related components
;;; -*- lexical-binding: t -*-
;;; commentary:
;;; code:
(use-package go-mode
:ensure company-go
:defer t
:config
(use-package go-guru
:ensure t)
(use-package go-add-tags
:ensure t)
(use-package go-eldoc
:ensure t)
(use-package company
:ensure t)
(use-package flycheck-gometalinter
:ensure t
:config
(progn
(flycheck-gometalinter-setup)
(setq flycheck-gometalinter-errors-only t)
(setq flycheck-gometalinter-fast t)
(setq flycheck-gometalinter-disable-linters '("gotype" "gocyclo"))
;; Only enable selected linters
(setq flycheck-gometalinter-disable-all t)
(setq flycheck-gometalinter-enable-linters '("golint"))
;; use in tests files
(defvar flycheck-gometalinter-test)
(setq flycheck-gometalinter-test t)
(setq flycheck-gometalinter-deadline "5s")))
(require 'go-guru)
(require 'company)
(require 'company-go)
;; make these bad boys known
(declare-function go-complete 'go-mode)
(declare-function go-get-tools 'go-mode)
(declare-function go-install-tools 'go-mode)
(declare-function go-keys 'go-mode)
(declare-function go-hook 'go-mode)
(declare-function go-build 'go-mode)
(defvar go-tools
'((asmfmt . "github.com/klauspost/asmfmt/cmd/asmfmt")
(dlv . "github.com/derekparker/delve/cmd/dlv")
(errcheck . "github.com/kisielk/errcheck")
(fillstruct . "github.com/davidrjenni/reftools/cmd/fillstruct")
(gocode . "github.com/nsf/gocode")
(godef . "github.com/rogpeppe/godef")
(gogetdoc . "github.com/zmb3/gogetdoc")
(goimports . "golang.org/x/tools/cmd/goimports")
(golint . "github.com/golang/lint/golint")
(gometalinter . "github.com/alecthomas/gometalinter")
(gomodifytags . "github.com/fatih/gomodifytags")
(gorename . "golang.org/x/tools/cmd/gorename")
(gotags . "github.com/jstemmer/gotags")
(guru . "golang.org/x/tools/cmd/guru")
(impl . "github.com/josharian/impl")
(keyify . "honnef.co/go/tools/cmd/keyify")
(motion . "github.com/fatih/motion")
(iferr . "github.com/koron/iferr"))
"Import paths for Go tools.")
(defun go-complete ()
(company-mode)
(progn
(defvar company-backends '())
(setq-local company-backends '(company-go))))
(defun go-get-tools (&optional flag)
"Install go related tools via go get. Optional FLAG to update."
(let ((env (getenv "GOPATH")))
(dolist (tool go-tools)
(let* ((url (cdr tool))
(cmd (concat "go get -insecure " (if flag (concat flag " ")) url)))
(shell-command cmd "*go-get*" "*go-get-error*")))
(setenv "GOPATH" env)))
(defun go-install-tools ()
"Install go related tools."
(interactive)
(go-get-tools))
(defun go-update-tools ()
"Update go related tools."
(interactive)
(go-get-tools "-u"))
(defun go-build ()
"customize compile command to run go build"
(if (not (string-match "go" compile-command))
(setq-local compile-command
"go build -v && go test -v && go vet")))
(defun go-keys ()
"in order, sets up go keys"
(progn
(local-set-key (kbd "M-.") 'godef-jump)))
(defun go-hook ()
"in order, sets up go environment"
;; You want to set the path variable on boot of the GUI