Skip to content

Commit

Permalink
Adding my personal snippets and key bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeebswihart committed Jul 24, 2020
1 parent 3f3c15f commit bf12a9d
Show file tree
Hide file tree
Showing 43 changed files with 366 additions and 73 deletions.
76 changes: 34 additions & 42 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"taps": [
"buo/cask-upgrade",
"homebrew/cask-fonts",
"railwaycat/emacsmacport"
"d12frosted/emacs-plus"
],
"brew": [
"bash",
"cmake",
"coreutils",
"curl",
"direnv",
"emacs-mac",
"emacs-plus@27",
"fd",
"gawk",
"git",
Expand All @@ -21,16 +21,12 @@
"jq",
"libnotify",
"neovim",
"osquery",
"parallel",
"pkg-config",
"ripgrep",
"terminal-notifier",
"texinfo",
"the_silver_searcher",
"tmux",
"vim",
"watchman",
"wget",
"xsv",
"yarn",
Expand All @@ -41,69 +37,65 @@
"alfred",
{"name": "arq", "when": "home"},
"bettertouchtool",
"brave-browser",
"dash",
{"name": "epic-games", "when": "home"},
"fantastical",
"firefox",
"font-fira-code",
"font-fira-mono",
{"name": "gog-galaxy", "when": "home"},
"hammerspoon",
"iina",
{"name": "iridient-developer", "when": "home"},
{"name": "java8", "when": "home"},
"keka",
{"name": "keybase", "when": "home"},
"lunchy",
{"name": "openemu", "when": "home"},
"osxfuse",
"racket",
{"name": "signal", "when": "home"},
"skim",
{"name": "steam", "when": "home"},
{"name": "transmission", "when": "home"},
"virtualbox",
{"name": "vmware-fusion", "when": "home"},
"xquartz"
],
"mas": [
"Xcode",
"Paprika Recipe Manager 3",
"Pixelmator",
"Kindle",
"Time Out",
"1Password 7",
"Things"
],
"sources": {
"https://github.com/larkery/zsh-histdb.git": "~/.zsh-histdb/",
"https://github.com/asdf-vm/asdf.git": {
"destination": "~/.asdf",
"post-install": "cd ~/.asdf && git checkout \"$(git describe --abbrev=0 --tags)\""
},
"https://github.com/tarjoilija/zgen": {
"symlinks": {
"zgen.zsh": "~/.zgen.zsh",
"_zgen": "~/.zsh/_zgen"
}
},
"https://github.com/scottwhudson/Lunette.git": {
"symlinks": {
"Lunette.spoon": "~/.hammerspoon/Spoons/"
}
}
"https://github.com/plexus/chemacs.git": {
"destination": "~/Documents/Projects/chemacs",
"post-install": "cd ~/Documents/Projects/chemacs && ./install.sh"
},
"https://github.com/hlissner/doom-emacs.git": {
"destination": "~/Documents/Projects/doom-emacs"
},
"https://github.com/larkery/zsh-histdb.git": "~/.zsh-histdb/",
"https://github.com/asdf-vm/asdf.git": {
"destination": "~/.asdf",
"post-install": "cd ~/.asdf && git checkout \"$(git describe --abbrev=0 --tags)\""
},
"https://github.com/tarjoilija/zgen": {
"symlinks": {
"zgen.zsh": "~/.zgen.zsh",
"_zgen": "~/.zsh/_zgen"
}
},
"https://github.com/scottwhudson/Lunette.git": {
"symlinks": {
"Lunette.spoon": "~/.hammerspoon/Spoons/"
}
}
},
"symlinks": {
"dots/.*": "~/",
"zsh/*": "~/.config/zsh/config.sh",
"bin/*": "~/.local/bin/",
"config/*": "~/.config/",
"launchagents/*.plist":"~/Library/LaunchAgents/",
"hammerspoon/*": "~/.hammerspoon/"
"dots/.*": "~/",
"doom.d/*": "~/.doom.d/",
"zsh/*": "~/.config/zsh/config.sh",
"bin/*": "~/.local/bin/",
"config/*": "~/.config/",
"launchagents/*.plist":"~/Library/LaunchAgents/",
"hammerspoon/*": "~/.hammerspoon/"
},
"post-install": [
"brew cleanup",
"find ~/Library/LaunchAgents -name '*.plist' | xargs launchctl load"
"brew cleanup",
"find ~/Library/LaunchAgents -name '*.plist' | xargs launchctl load"
]
}
76 changes: 45 additions & 31 deletions doom.d/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,41 +53,44 @@
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.

(setq lsp-file-watch-ignored
'(
"[/\\\\]\\.direnv$"
"[/\\\\]\\.gems$"
(after! lsp
(setq lsp-file-watch-ignored
'(
"[/\\\\]\\.direnv$"
"[/\\\\]\\.gems$"
; SCM tools
"[/\\\\]\\.git$"
"[/\\\\]\\.hg$"
"[/\\\\]\\.bzr$"
"[/\\\\]_darcs$"
"[/\\\\]\\.svn$"
"[/\\\\]_FOSSIL_$"
"[/\\\\]\\.git$"
"[/\\\\]\\.hg$"
"[/\\\\]\\.bzr$"
"[/\\\\]_darcs$"
"[/\\\\]\\.svn$"
"[/\\\\]_FOSSIL_$"
; IDE tools
"[/\\\\]\\.idea$"
"[/\\\\]\\.vscode$"
"[/\\\\]\\.ensime_cache$"
"[/\\\\]\\.eunit$"
"[/\\\\]node_modules$"
"[/\\\\]\\.fslckout$"
"[/\\\\]\\.tox$"
"[/\\\\]\\.stack-work$"
"[/\\\\]\\.bloop$"
"[/\\\\]\\.metals$"
"[/\\\\]target$"
"[/\\\\]dist$"
"[/\\\\]\\.idea$"
"[/\\\\]\\.vscode$"
"[/\\\\]\\.ensime_cache$"
"[/\\\\]\\.eunit$"
"[/\\\\]node_modules$"
"[/\\\\]\\.fslckout$"
"[/\\\\]\\.tox$"
"[/\\\\]\\.stack-work$"
"[/\\\\]\\.bloop$"
"[/\\\\]\\.metals$"
"[/\\\\]target$"
"[/\\\\]dist$"
; Autotools output
"[/\\\\]\\.deps$"
"[/\\\\]build-aux$"
"[/\\\\]autom4te.cache$"
"[/\\\\]\\.reference$"
"[/\\\\]\\.deps$"
"[/\\\\]build-aux$"
"[/\\\\]autom4te.cache$"
"[/\\\\]\\.reference$"

; Assorted state dirs
"[/\\\\]\\.terraform$"
"[/\\\\]\\.vagrant$"
"[/\\\\]vendor$"
))
"[/\\\\]\\.terraform$"
"[/\\\\]\\.vagrant$"
"[/\\\\]vendor$"
))
)


;; Yank-pop
(after! hydra
Expand Down Expand Up @@ -257,4 +260,15 @@ _s-k_: Kill all buffers _p_: sw
(after! envrc
(envrc-global-mode))

(map!)
(setq avy-keys '(?a ?o ?e ?u ?i ?d ?h ?t ?n ?s))

; Some handy leader bindings from my old custom config
(map! :leader
:desc "Switch to buffer" "d" #'switch-to-buffer
:desc "Find file" "e" #'counsel-find-file
:desc "Window controls" "t" #'hydra-windows/body
:desc "Resume last ivy search" "r" #'ivy-resume
)

(provide 'config.el)
;;; config.el ends here
4 changes: 4 additions & 0 deletions doom.d/snippets/go-mode/apn
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# name: append
# key: apn
# --
$1 = append($1, $2)
7 changes: 7 additions & 0 deletions doom.d/snippets/go-mode/cdif
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: cmp.Diff
# key: cdif
# --
if diff := cmp.Diff($1, $2); diff != "" {
t.Errorf("$3() mismatch (-want +got):\n%s", diff)
}
9 changes: 9 additions & 0 deletions doom.d/snippets/go-mode/elerr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# name: log an error using logrus
# key: elerr
# group: logrus
# --
if err != nil {
${1:log}.WithFields(log.Fields{
"err": err,
}).Error("$2")
}
6 changes: 6 additions & 0 deletions doom.d/snippets/go-mode/elfat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# name: log a fatal error using logrus
# key: elfat
# --
if $1 != nil {
${2:log}.WithError($1).Fatal("$3")
}
6 changes: 6 additions & 0 deletions doom.d/snippets/go-mode/erc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# name: check for an error
# key: erc
# --
if err != nil {
$0
}
7 changes: 7 additions & 0 deletions doom.d/snippets/go-mode/ginkgo-after
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: ginkgo after
# key: gaft
# --
AfterEach(func(){
$0
})
7 changes: 7 additions & 0 deletions doom.d/snippets/go-mode/ginkgo-before
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: ginkgo before
# key: gb4
# --
BeforeEach(func(){
$0
})
8 changes: 8 additions & 0 deletions doom.d/snippets/go-mode/ginkgo-context
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: ginkgo Context
# key: gct
# --

Context("$1", func() {
$0
})
20 changes: 20 additions & 0 deletions doom.d/snippets/go-mode/ginkgo-scaffold
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- mode: snippet -*-
# name: ginkgo scaffolding
# key: gscaf
# --

var _ = Describe("$1", func() {
var (
ctrl *gomock.Controller
$2
)
BeforeEach(func() {
ctrl = gomock.NewController(GinkgoT())
$3
})

AfterEach(func() {
ctrl.Finish()
})
$0
})
6 changes: 6 additions & 0 deletions doom.d/snippets/go-mode/gmock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: new go mock
# key: gmock
# --

//go:generate mockgen -self_package github.com/BishopFox/`(directory-file-name (file-relative-name (file-name-directory (buffer-file-name)) "/Users/tdeeb-swihart/Documents/Projects/mss"))` -package `(file-name-nondirectory (directory-file-name (file-name-directory (buffer-file-name)) ))` -destination `(file-name-base (buffer-file-name))`_mock.go github.com/BishopFox/`(directory-file-name (file-relative-name (file-name-directory (buffer-file-name)) "/Users/tdeeb-swihart/Documents/Projects/mss/") )` $1
8 changes: 8 additions & 0 deletions doom.d/snippets/go-mode/goblin-describe
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: goblin describe
# key: gdesc
# --

Describe("$1", func() {
$0
})
8 changes: 8 additions & 0 deletions doom.d/snippets/go-mode/goblin-it
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: goblin It
# key: gi
# --

It("should $1", func() {
$0
})
5 changes: 5 additions & 0 deletions doom.d/snippets/go-mode/gomega-expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: gomega expect
# key: gexp
# --
Expect($1).Should($0)
4 changes: 4 additions & 0 deletions doom.d/snippets/go-mode/ibf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# name: import bishopfox pkg
# key: ibf
# --
"github.com/BishopFox/$1/$2"
8 changes: 8 additions & 0 deletions doom.d/snippets/go-mode/iferr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# name: run a function and check for an error
# key: iferr
# --
if ${1:err} = $2; err != nil {
$3
} else {
$4
}
4 changes: 4 additions & 0 deletions doom.d/snippets/go-mode/json-tag
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# name: json tag
# key: jj
# --
\`json:"$1"\`
7 changes: 7 additions & 0 deletions doom.d/snippets/go-mode/logwf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# name: log(rus) with fields
# key: lwf
# group: logrus
# --
${1:log}.WithFields(log.Fields{
"$2": $3,
}).${4:Info}($5)
10 changes: 10 additions & 0 deletions doom.d/snippets/go-mode/megamock
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: wrap a gomega matcher for use with gomock
# key: megamock
# --

func WrapGomega(m types.GomegaMatcher) interface{} {
return mock.MatchedBy(func(actual interface{}) bool {
return Expect(actual).To(m)
})
}
Loading

0 comments on commit bf12a9d

Please sign in to comment.