commit 318e0ac40c38c2e8df14e2fe92d28f07e00dc790
parent 08e16ef3a978e3245e6d96b7e1da5edfbc896c81
Author: Mark Feller <mfeller@squareup.com>
Date: Sun, 19 Jun 2022 20:36:37 -0600
cleanup configuration for new square macbook
Diffstat:
18 files changed, 142 insertions(+), 121 deletions(-)
diff --git a/dots/.config/emacs/core/core-defuns.el b/dots/.config/emacs/core/core-defuns.el
@@ -193,6 +193,17 @@ is already narrowed."
(defun disable-line-numbers ()
(display-line-numbers-mode -1))
+(defun mjf/pash-copy ()
+ (interactive)
+ (let ((arg (ivy-completing-read "" (mjf/pash-list))))
+ (shell-command-to-string (format "pash copy %s" arg))))
+
+(defun mjf/pash-list ()
+ (split-string
+ (shell-command-to-string "pash list") "\n"))
+
+(bind-keys ("M-P" . mjf/pash-copy))
+
(provide 'core-defuns)
;;; core-defuns.el ends here
diff --git a/dots/.config/emacs/core/core-macos.el b/dots/.config/emacs/core/core-macos.el
@@ -42,7 +42,8 @@
:config
(exec-path-from-shell-initialize)
(exec-path-from-shell-copy-env "GNUPGHOME")
- (exec-path-from-shell-copy-env "NOTMUCH_CONFIG"))
+ (exec-path-from-shell-copy-env "NOTMUCH_CONFIG")
+ (exec-path-from-shell-copy-env "XDG_DOCUMENTS_DIR"))
(defun finder ()
"Opens file directory in Finder."
diff --git a/dots/.config/emacs/core/core-packages.el b/dots/.config/emacs/core/core-packages.el
@@ -157,10 +157,7 @@
" "
filename-and-process))))
-(use-package autopair
- :delight (autopair-mode)
- :config (autopair-global-mode))
-
+(electric-pair-mode t)
(global-auto-revert-mode t)
(use-package comment-dwim-2
@@ -252,6 +249,10 @@
(add-hook 'Man-mode-hook 'disable-line-numbers)
(add-hook 'compilation-mode-hook 'disable-line-numbers)
+(bind-keys
+ ("C-c C-j" . xref-show-definitions-function)
+ ("M-," . xref-go-back))
+
(require 'ansi-color)
(defun colorize-compilation-buffer ()
(ansi-color-apply-on-region compilation-filter-start (point)))
diff --git a/dots/.config/emacs/core/core-ui.el b/dots/.config/emacs/core/core-ui.el
@@ -76,8 +76,6 @@
(setq-default line-spacing 5)
-(global-display-line-numbers-mode)
-
;; add some padding around the entire frame and fringes
(set-fringe-mode 25)
(set-frame-parameter nil 'internal-border-width 0)
diff --git a/dots/.config/emacs/init.el b/dots/.config/emacs/init.el
@@ -106,8 +106,8 @@
(require 'module-evil)
(require 'module-git)
(require 'module-go)
-(require 'module-kubernetes)
(require 'module-ledger)
+(require 'module-lsp)
(require 'module-multiple-cursors)
(require 'module-notmuch)
(require 'module-org)
diff --git a/dots/.config/emacs/lisp/init-local.el b/dots/.config/emacs/lisp/init-local.el
@@ -3,22 +3,10 @@
(mjf/center-window)
(exec-path-from-shell-initialize))
-
-(setq-default mode-line-format
- '((:propertize " " face mode-line-height)
- "%e"
- evil-mode-line-tag
- mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " mode-line-position
- (vc-mode vc-mode)
- " " mode-line-modes mode-line-misc-info mode-line-end-spaces))
-
-(setq mode-line-format
- '((:propertize " " face mode-line-height)
- "%e"
- evil-mode-line-tag
- mode-line-front-space mode-line-mule-info mode-line-client mode-line-modified mode-line-remote mode-line-frame-identification mode-line-buffer-identification " " mode-line-position
- (vc-mode vc-mode)
- " " mode-line-modes mode-line-misc-info mode-line-end-spaces))
+(use-package modus-themes
+ :config
+ (setq modus-themes-mode-line '(4 borderless))
+ (load-theme 'modus-vivendi))
(setq elfeed-feeds
`("https://thume.ca/atom.xml"
@@ -41,4 +29,8 @@
(setq mml-secure-smime-sign-with-sender "mark@mfeller.io")
(setq message-signature-file "~/.local/share/emacs/signature")
+(when (eq system-type 'darwin)
+ (setq user-mail-address "mfeller@squareup.com")
+ (setq mml-secure-smime-sign-with-sender "mfeller@squareup.com"))
+
(provide 'init-local)
diff --git a/dots/.config/emacs/lisp/init-preload-local.el b/dots/.config/emacs/lisp/init-preload-local.el
@@ -1,6 +1,3 @@
(setq shell-file-name "/bin/zsh")
-(load-file (expand-file-name "lisp/acme/acme-theme.el" emacs-dir))
-(load-theme 'acme)
-
(provide 'init-preload-local)
diff --git a/dots/.config/emacs/modules/module-git.el b/dots/.config/emacs/modules/module-git.el
@@ -43,8 +43,6 @@
(setq magithub-api-timeout 5)
(setq magithub-dir "~/.cache/magithub"))
-(use-package gitignore-mode)
-
(use-package git-timemachine)
(provide 'module-git)
diff --git a/dots/.config/emacs/modules/module-go.el b/dots/.config/emacs/modules/module-go.el
@@ -30,15 +30,16 @@
(if (not (eq (executable-find "go") nil))
(progn
(mapcar (lambda (pkg)
- (let ((cmd (concat "go get -u " pkg)))
+ (let ((cmd (concat "go install " pkg)))
(call-process-shell-command cmd nil "*go-get-output*" t)))
- '("github.com/nsf/gocode"
- "golang.org/x/tools/cmd/goimports"
- "github.com/rogpeppe/godef"
- "github.com/golang/lint"
- "golang.org/x/tools/cmd/gorename"
- "golang.org/x/tools/cmd/guru"
- "github.com/kisielk/errcheck")))
+ '("github.com/nsf/gocode@latest"
+ "golang.org/x/tools/cmd/goimports@latest"
+ "github.com/rogpeppe/godef@latest"
+ "golang.org/x/lint@latest"
+ "golang.org/x/tools/cmd/gorename@latest"
+ "golang.org/x/tools/cmd/guru@latest"
+ "github.com/kisielk/errcheck@latest"
+ "golang.org/x/tools/gopls@latest")))
(message "go executable not found, install go from https://golang.org/download")))
(defun mjf/ginkgo-test (package)
@@ -70,6 +71,7 @@
(company-mode))
(use-package go-mode
+ :demand
:bind
(:map go-mode-map
("C-c C-g" . go-goto-imports)
@@ -79,7 +81,7 @@
:init
(unless (getenv "GOPATH")
- (setenv "GOPATH" (concat (getenv "HOME") "/prog/go")))
+ (setenv "GOPATH" (concat (getenv "HOME") "/Development/go")))
(setenv "PATH" (concat (getenv "PATH") ":"
(concat (getenv "GOPATH")"/bin")))
@@ -87,45 +89,48 @@
:config
(setq gofmt-command "goimports") ; use goimports instead of go-fmt
(setq godoc-command "godoc") ; use godoc instead of go doc
- (setq tab-width 8)
+ (setq tab-width 4)
- (add-hook 'go-mode-hook 'setup-go-mode-compile)
+ ;; (add-hook 'go-mode-hook 'eglot-ensure)
+ (add-hook 'go-mode-hook 'mjf/setup-go-mode-compile)
(add-hook 'go-mode-hook 'subword-mode)
- (add-hook 'before-save-hook 'gofmt-before-save))
-
-(use-package go-add-tags
- :after go-mode)
-
-(use-package go-errcheck
- :after go-mode)
-
-(use-package go-stacktracer)
-
-(use-package go-guru
- :after go-mode
- :bind
- (:map go-mode-map
- ("M-." . go-guru-definition)
- ("C-c d" . go-guru-describe)))
-
-(use-package company-go
- :after (go-mode company)
- :config
- (add-hook 'go-mode-hook 'mjf/go-init-company))
-
-(use-package go-eldoc
- :after (go-mode eldoc)
- :config
- (add-hook 'go-mode-hook 'go-eldoc-setup))
-
-(use-package flycheck-gometalinter
- :disabled
- :after (go-mode flycheck-mode)
- :config
- (flycheck-gometalinter-setup)
- (setq flycheck-gometalinter-deadline "10s")
- (setq flycheck-gometalinter-fast t)
- (setq flycheck-gometalinter-disable-linters '("gotype" "gocyclo")))
+ (add-hook 'go-mode-hook 'hs-minor-mode)
+ (add-hook 'before-save-hook 'gofmt-before-save)
+ )
+
+;; (use-package go-add-tags
+;; :after go-mode)
+
+;; (use-package go-errcheck
+;; :after go-mode)
+
+;; (use-package go-stacktracer)
+
+;; (use-package go-guru
+;; :after go-mode
+;; :bind
+;; (:map go-mode-map
+;; ("M-." . go-guru-definition)
+;; ("C-c d" . go-guru-describe)))
+
+;; (use-package company-go
+;; :demand
+;; :config
+;; (add-hook 'go-mode-hook 'mjf/go-init-company))
+
+;; (use-package go-eldoc
+;; :after (go-mode eldoc)
+;; :config
+;; (add-hook 'go-mode-hook 'go-eldoc-setup))
+
+;; (use-package flycheck-gometalinter
+;; :disabled
+;; :after (go-mode flycheck-mode)
+;; :config
+;; (flycheck-gometalinter-setup)
+;; (setq flycheck-gometalinter-deadline "10s")
+;; (setq flycheck-gometalinter-fast t)
+;; (setq flycheck-gometalinter-disable-linters '("gotype" "gocyclo")))
(provide 'module-go)
diff --git a/dots/.config/emacs/modules/module-lsp.el b/dots/.config/emacs/modules/module-lsp.el
@@ -1,9 +1,21 @@
-(use-package lsp-mode
- :commands lsp)
+(use-package eglot
+ :disabled
+ :bind
+ (:map eglot-mode-map
+ ("C-c r" . eglot-rename)
+ ("C-c o" . eglot-code-action-organize-imports)
+ ("C-c h" . eldoc)
+ ("M-." . xref-show-definitions-function))
+ :config
+ (add-hook 'go-mode-hook 'eglot-ensure)
+ (add-hook 'eglot--managed-mode (lambda () (flymake-mode -1))))
-(use-package lsp-ui :commands lsp-ui-mode)
-(use-package company-lsp :commands company-lsp)
+(use-package lsp-mode
+ :config
+ (setq lsp-keymap-prefix "H-l")
+ (add-hook 'go-mode-hook #'lsp))
+(use-package lsp-ivy
+ :commands lsp-ivy-workspace-symbol)
-(add-hook 'go-mode-hook #'lsp)
-(setq lsp-eldoc-render-all nil)
+(provide 'module-lsp)
diff --git a/dots/.config/emacs/modules/module-org.el b/dots/.config/emacs/modules/module-org.el
@@ -47,27 +47,25 @@
(add-hook 'org-mode-hook 'disable-line-numbers)
(add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
- ;; where I keep all my org files
- (setq org-agenda-files
- '("~/org/work.org"
- "~/org/life.org"))
+ (setq mjf/org-work-file (format "%s/work.org" (getenv "XDG_DOCUMENTS_DIR")))
+ (setq mjf/org-life-file (format "%s/life.org" (getenv "XDG_DOCUMENTS_DIR")))
;; personal capture templates
(setq org-capture-templates
'(
;; unfiled work items
- ("w" "Work" entry (file+headline "~/org/work.org" "Unread")
+ ("w" "Work" entry (file+headline mjf/org-work-file "Unread")
"* TODO %?\n %i\n")
;; random thoughts I'd like to capture
- ("t" "Thought" entry (file+headline "~/org/work.org" "Thoughts")
+ ("t" "Thought" entry (file+headline mjf/org-work-file "Thoughts")
"* %?\n %i\n")
;; unfiled work items in my life
- ("l" "Life" entry (file+headline "~/org/life.org" "Inbox")
+ ("l" "Life" entry (file+headline mjf/org-life-file "Inbox")
"* TODO %?\n %i\n")
- ("j" "Journal" entry (file+datetree "~/org/life.org")
+ ("j" "Journal" entry (file+datetree mjf/org-life-file)
"* TODO %?\n")))
;; when refiling an org header don't search more than 3 levels deep
diff --git a/dots/.config/git/config.macos b/dots/.config/git/config.macos
@@ -1,9 +1,9 @@
[user]
name = Mark Feller
- email = mark@getsunday.com
- signingkey = 95189B138B01C10DC955396A5AB4584E9FF44D46
+ email = mfeller@squareup.com
+ signingkey = AD1123AE40116CBA25464FA10B54905CC58C10EE
-[url "ssh://git@github.com/"]
+[url "git@github.com/"]
insteadOf = https://github.com/
[commit]
@@ -15,11 +15,8 @@
[tag]
forceSignAnnotated = true
-[filter "lfs"]
- clean = git-lfs clean -- %f
- smudge = git-lfs smudge -- %f
- process = git-lfs filter-process
- required = true
-
[github]
- user = mjf-sunday
-\ No newline at end of file
+ user = mfeller-square
+
+[include]
+ path = ~/Development/config_files/square/gitconfig
+\ No newline at end of file
diff --git a/dots/.config/zsh/.zshrc b/dots/.config/zsh/.zshrc
@@ -18,7 +18,7 @@ git_prompt() {
[ -z "$ref" ] || echo "%F{cyan}$ref%f "
}
kube_prompt() {
- ctx=$([ -z "$KUBECTX" ] && { grep -m1 "current-context" $HOME/.kube/config | cut -d' ' -f2 2> /dev/null; } || echo "$KUBECTX" )
+ ctx=$([ -z "$KUBECTX" ] && [ -d $HOME/.kube ] && { grep -m1 "current-context" $HOME/.kube/config | cut -d' ' -f2 2> /dev/null; } || echo "$KUBECTX" )
[ -z "$ctx" ] || echo -n "%F{green}$ctx%f "
[ -z "$KUBENS" ] || echo -n "%F{blue}$KUBENS%f "
}
diff --git a/dots/.local/share/emacs/signature b/dots/.local/share/emacs/signature
@@ -1,3 +0,0 @@
-Mark Feller
-mark@getsunday.com
-9518 9B13 8B01 C10D C955 396A 5AB4 584E 9FF4 4D46
-\ No newline at end of file
diff --git a/dots/.local/share/emacs/signature.macos b/dots/.local/share/emacs/signature.macos
@@ -0,0 +1,3 @@
+Mark Feller
+mfeller@squareup.com
+AD11 23AE 4011 6CBA 2546 4FA1 0B54 905C C58C 10EE
+\ No newline at end of file
diff --git a/dots/.local/share/gnupg/gpg-agent.conf.macos b/dots/.local/share/gnupg/gpg-agent.conf.macos
@@ -1 +1 @@
-pinentry-program /usr/local/bin/pinentry-mac
-\ No newline at end of file
+pinentry-program /opt/homebrew/bin/pinentry-mac
+\ No newline at end of file
diff --git a/dots/.zshenv b/dots/.zshenv
@@ -5,17 +5,21 @@
export XDG_CONFIG_HOME=$HOME/.config
export XDG_DATA_HOME=$HOME/.local/share
export XDG_CACHE_HOME=$HOME/.cache
+export XDG_DOWNLOADS_DIR=$HOME/Downloads
+export XDG_DOCUMENTS_DIR=$HOME/Documents
+export XDG_CODE_DIR=$HOME/Development
-export PATH=/usr/local/bin:$PATH
-export PATH=/usr/local/sbin:$PATH
-export PATH=$HOME/.local/bin/:$PATH
+export PATH=$PATH:/usr/local/bin
+export PATH=$PATH:/usr/local/sbin
+export PATH=$PATH:/opt/homebrew/bin
+export PATH=$PATH:/opt/homebrew/sbin
+export PATH=$PATH:$HOME/.local/bin
export EDITOR=vim
export SHELL=zsh
export TERMINAL=alacritty
export PAGER=less
-
export MANWIDTH=80
export LESSHISTFILE=-
export HISTFILE=$XDG_CACHE_HOME/bash_history
@@ -25,7 +29,7 @@ export ZDOTDIR=$XDG_CONFIG_HOME/zsh
export ZSHDDIR=$XDG_CONFIG_HOME/zsh
export ZSH=$XDG_CONFIG_HOME/oh-my-zsh
-export GOPATH=$HOME/prog/go
+export GOPATH=$XDG_CODE_DIR/go
export PATH=$GOPATH/bin:$PATH
export LS_COLORS="rs=0:di=36;36:ln=36;51:mh=00:pi=40;36;11:so=36;13:do=36;5:bd=48;236;36;11:cd=48;236;36;3:or=48;236;36;9:mi=01;36;41:su=48;196;36;15:sg=48;11;36;16:ca=48;196;36;226:tw=48;10;36;16:ow=48;10;36;21:st=48;21;36;15:ex=1:*.tar=36;9:*.tgz=36;9:*.arc=36;9:*.arj=36;9:*.taz=36;9:*.lha=36;9:*.lz4=36;9:*.lzh=36;9:*.lzma=36;9:*.tlz=36;9:*.txz=36;9:*.tzo=36;9:*.t7z=36;9:*.zip=36;9:*.z=36;9:*.dz=36;9:*.gz=36;9:*.lrz=36;9:*.lz=36;9:*.lzo=36;9:*.xz=36;9:*.zst=36;9:*.tzst=36;9:*.bz2=36;9:*.bz=36;9:*.tbz=36;9:*.tbz2=36;9:*.tz=36;9:*.deb=36;9:*.rpm=36;9:*.jar=36;9:*.war=36;9:*.ear=36;9:*.sar=36;9:*.rar=36;9:*.alz=36;9:*.ace=36;9:*.zoo=36;9:*.cpio=36;9:*.7z=36;9:*.rz=36;9:*.cab=36;9:*.wim=36;9:*.swm=36;9:*.dwm=36;9:*.esd=36;9:*.jpg=36;13:*.jpeg=36;13:*.mjpg=36;13:*.mjpeg=36;13:*.gif=36;13:*.bmp=36;13:*.pbm=36;13:*.pgm=36;13:*.ppm=36;13:*.tga=36;13:*.xbm=36;13:*.xpm=36;13:*.tif=36;13:*.tiff=36;13:*.png=36;13:*.svg=36;13:*.svgz=36;13:*.mng=36;13:*.pcx=36;13:*.mov=36;13:*.mpg=36;13:*.mpeg=36;13:*.m2v=36;13:*.mkv=36;13:*.webm=36;13:*.ogm=36;13:*.mp4=36;13:*.m4v=36;13:*.mp4v=36;13:*.vob=36;13:*.qt=36;13:*.nuv=36;13:*.wmv=36;13:*.asf=36;13:*.rm=36;13:*.rmvb=36;13:*.flc=36;13:*.avi=36;13:*.fli=36;13:*.flv=36;13:*.gl=36;13:*.dl=36;13:*.xcf=36;13:*.xwd=36;13:*.yuv=36;13:*.cgm=36;13:*.emf=36;13:*.ogv=36;13:*.ogx=36;13:*.aac=36;45:*.au=36;45:*.flac=36;45:*.m4a=36;45:*.mid=36;45:*.midi=36;45:*.mka=36;45:*.mp3=36;45:*.mpc=36;45:*.ogg=36;45:*.ra=36;45:*.wav=36;45:*.oga=36;45:*.opus=36;45:*.spx=36;45:*.xspf=36;45:"
@@ -35,10 +39,8 @@ export LC_ALL=C
export PASH_CLIP=pbcopy
export PASH_TIMEOUT=off
-export GNUPGHOME=$HOME/.local/share/gnupg
-
-export NOTMUCH_CONFIG=$HOME/.config/notmuch/config
+export GNUPGHOME=$XDG_DATA_HOME/gnupg
-export BOTO_CONFIG=$HOME/.config/gcloud/boto
+export NOTMUCH_CONFIG=$XDG_CONFIG_HOME/notmuch/config
-[ -d "$HOME/.cargo" ] && source "$HOME/.cargo/env"
+export BOTO_CONFIG=$XDG_CONFIG_HOME/gcloud/boto
diff --git a/install b/install
@@ -8,6 +8,12 @@ copy()
cp -r "$1" "$2"
}
+copy_file()
+{
+ printf "%-30s %s\n" "$1" "$2/$(basename $1)"
+ cp "$1" "$2"
+}
+
shared()
{
# Dotfiles used on all operating systems
@@ -16,7 +22,6 @@ shared()
copy dots/.config/zsh $HOME/.config
copy dots/.config/aliasrc $HOME/.config
copy dots/.local/bin $HOME/.local
- copy dots/.local/share/emacs $HOME/.local/share
}
linux()
@@ -33,7 +38,9 @@ linux()
copy dots/.config/mimeapps.list $HOME/.config
copy dots/.config/vis $HOME/.config
copy dots/.config/x11 $HOME/.config
- copy dots/.local/share/gnupg/gpg-agent.conf.linux $HOME/.local/share/gnupg/gpg-agent.conf
+
+ copy_file dots/.local/share/gnupg/gpg-agent.conf.linux $HOME/.local/share/gnupg/gpg-agent.conf
+ copy_file dots/.local/share/emacs/signature.linux $HOME/.local/share/emacs/signature
}
macos()
@@ -42,7 +49,9 @@ macos()
copy dots/.config/alacritty $HOME/.config
copy dots/.config/git/config.macos $HOME/.config/git/config
copy dots/.zshenv $HOME
- copy dots/.local/share/gnupg/gpg-agent.conf.macos $HOME/.local/share/gnupg/gpg-agent.conf
+
+ copy_file dots/.local/share/gnupg/gpg-agent.conf.macos $HOME/.local/share/gnupg/gpg-agent.conf
+ copy_file dots/.local/share/emacs/signature.macos $HOME/.local/share/emacs/signature
}
openbsd()
@@ -52,7 +61,7 @@ openbsd()
if [ -d "$rice_dir" ]; then
cd "$rice_dir"
- git pull --ff-only
+ # git pull --ff-only
else
mkdir -p ~/.config
git clone https://github.com/mjfeller/rice "$rice_dir"