feat(aspen/emacs): Begin a complete emacs config revamp
I'm still on doom, but without all the cruft I've accumulated over the last ~6 years it's actually good and fast and nice. Also, the config is literate now! The old emacs is still in .emacs.d, since occasionally I want to reference it, but eventually I'll just get rid of it Change-Id: Icda840d798594f7e6b188dba044494597d5f6043 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10999 Reviewed-by: aspen <root@gws.fyi> Tested-by: BuildkiteCI
This commit is contained in:
parent
7ecf43a1bd
commit
acc2433b65
66 changed files with 2245 additions and 0 deletions
5
users/aspen/emacs/snippets/haskell-mode/annotation
Normal file
5
users/aspen/emacs/snippets/haskell-mode/annotation
Normal file
|
@ -0,0 +1,5 @@
|
|||
# key: ann
|
||||
# name: annotation
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# ANN ${1:module} ("${2:HLint: ignore ${3:Reduce duplication}}" :: String) #-}
|
26
users/aspen/emacs/snippets/haskell-mode/benchmark-module
Normal file
26
users/aspen/emacs/snippets/haskell-mode/benchmark-module
Normal file
|
@ -0,0 +1,26 @@
|
|||
# key: bench
|
||||
# name: benchmark-module
|
||||
# expand-env: ((yas-indent-line (quote fixed)))
|
||||
# --
|
||||
--------------------------------------------------------------------------------
|
||||
module ${1:`(if (not buffer-file-name) "Module"
|
||||
(let ((name (file-name-sans-extension (buffer-file-name)))
|
||||
(case-fold-search nil))
|
||||
(if (cl-search "bench/" name)
|
||||
(replace-regexp-in-string "/" "."
|
||||
(replace-regexp-in-string "^\/[^A-Z]*" ""
|
||||
(car (last (split-string name "src")))))
|
||||
(file-name-nondirectory name))))`} ( benchmark, main ) where
|
||||
--------------------------------------------------------------------------------
|
||||
import Bench.Prelude
|
||||
--------------------------------------------------------------------------------
|
||||
import ${1:$(s-chop-suffix "Bench" yas-text)}
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain [benchmark]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
benchmark :: Benchmark
|
||||
benchmark = bgroup "${1:$(->> yas-text (s-chop-suffix "Bench") (s-split ".") -last-item)}" [bench "something dumb" $ nf (1 +) (1 :: Int)]
|
5
users/aspen/emacs/snippets/haskell-mode/header
Normal file
5
users/aspen/emacs/snippets/haskell-mode/header
Normal file
|
@ -0,0 +1,5 @@
|
|||
# key: hh
|
||||
# name: header
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
--------------------------------------------------------------------------------$2
|
|
@ -0,0 +1,8 @@
|
|||
# key: gen
|
||||
# name: Hedgehog Generator
|
||||
# expand-env: ((yas-indent-line (quote fixed)))
|
||||
# --
|
||||
gen${1:Foo} :: Gen $1
|
||||
gen$1 = do
|
||||
$2
|
||||
pure $1{..}
|
|
@ -0,0 +1,9 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: Hedgehog Property
|
||||
# key: hprop
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
hprop_${1:somethingIsAlwaysTrue} :: Property
|
||||
hprop_$1 = property $ do
|
||||
${2:x} <- forAll ${3:Gen.int $ Range.linear 1 100}
|
||||
${4:x === x}
|
8
users/aspen/emacs/snippets/haskell-mode/hlint
Normal file
8
users/aspen/emacs/snippets/haskell-mode/hlint
Normal file
|
@ -0,0 +1,8 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: hlint
|
||||
# uuid: hlint
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# key: hlint
|
||||
# condition: t
|
||||
# --
|
||||
{-# ANN module ("Hlint: ignore $1" :: String) #- }
|
4
users/aspen/emacs/snippets/haskell-mode/import-i
Normal file
4
users/aspen/emacs/snippets/haskell-mode/import-i
Normal file
|
@ -0,0 +1,4 @@
|
|||
# key: i
|
||||
# name: import-i
|
||||
# --
|
||||
import ${1:Prelude}
|
6
users/aspen/emacs/snippets/haskell-mode/inl
Normal file
6
users/aspen/emacs/snippets/haskell-mode/inl
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: inl
|
||||
# key: inl
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# INLINE $1 #-}
|
5
users/aspen/emacs/snippets/haskell-mode/inline
Normal file
5
users/aspen/emacs/snippets/haskell-mode/inline
Normal file
|
@ -0,0 +1,5 @@
|
|||
# key: inline
|
||||
# name: inline
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# INLINE $1 #-}
|
6
users/aspen/emacs/snippets/haskell-mode/language pragma
Normal file
6
users/aspen/emacs/snippets/haskell-mode/language pragma
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: language pragma
|
||||
# key: lang
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# LANGUAGE $1 #-}
|
7
users/aspen/emacs/snippets/haskell-mode/lens.field
Normal file
7
users/aspen/emacs/snippets/haskell-mode/lens.field
Normal file
|
@ -0,0 +1,7 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: lens.field
|
||||
# key: lens
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
${1:field} :: Lens' ${2:Source} ${3:Target}
|
||||
$1 = lens _${4:sourceField} $ \\${2:$(-> yas-text s-word-initials s-downcase)} ${4:$(-> yas-text s-word-initials s-downcase)} -> ${2:$(-> yas-text s-word-initials s-downcase)} { _$4 = ${4:$(-> yas-text s-word-initials s-downcase)} }
|
32
users/aspen/emacs/snippets/haskell-mode/module
Normal file
32
users/aspen/emacs/snippets/haskell-mode/module
Normal file
|
@ -0,0 +1,32 @@
|
|||
# -*- mode: snippet -*-
|
||||
# key: module
|
||||
# name: module
|
||||
# condition: (= (length "module") (current-column))
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# contributor: Luke Hoersten <luke@hoersten.org>
|
||||
# --
|
||||
--------------------------------------------------------------------------------
|
||||
-- |
|
||||
-- Module : $1
|
||||
-- Description : $2
|
||||
-- Maintainer : Griffin Smith <grfn@urbint.com>
|
||||
-- Maturity : ${3:Draft, Usable, Maintained, OR MatureAF}
|
||||
--
|
||||
-- $4
|
||||
--------------------------------------------------------------------------------
|
||||
module ${1:`(if (not buffer-file-name) "Module"
|
||||
(let ((name (file-name-sans-extension (buffer-file-name)))
|
||||
(case-fold-search nil))
|
||||
(if (or (cl-search "src/" name)
|
||||
(cl-search "test/" name))
|
||||
(replace-regexp-in-string "/" "."
|
||||
(replace-regexp-in-string "^\/[^A-Z]*" ""
|
||||
(car (last (split-string name "src")))))
|
||||
(file-name-nondirectory name))))`}
|
||||
(
|
||||
) where
|
||||
--------------------------------------------------------------------------------
|
||||
import Prelude
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
$0
|
6
users/aspen/emacs/snippets/haskell-mode/shut up, hlint
Normal file
6
users/aspen/emacs/snippets/haskell-mode/shut up, hlint
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: shut up, hlint
|
||||
# key: dupl
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
{-# ANN module ("HLint: ignore Reduce duplication" :: String) #-}
|
9
users/aspen/emacs/snippets/haskell-mode/test-group
Normal file
9
users/aspen/emacs/snippets/haskell-mode/test-group
Normal file
|
@ -0,0 +1,9 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: test-group
|
||||
# uuid: test-group
|
||||
# key: testGroup
|
||||
# condition: t
|
||||
# --
|
||||
testGroup "${1:name}"
|
||||
[ $0
|
||||
]
|
27
users/aspen/emacs/snippets/haskell-mode/test-module
Normal file
27
users/aspen/emacs/snippets/haskell-mode/test-module
Normal file
|
@ -0,0 +1,27 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: test-module
|
||||
# key: test
|
||||
# expand-env: ((yas-indent-line 'fixed))
|
||||
# --
|
||||
--------------------------------------------------------------------------------
|
||||
module ${1:`(if (not buffer-file-name) "Module"
|
||||
(let ((name (file-name-sans-extension (buffer-file-name)))
|
||||
(case-fold-search nil))
|
||||
(if (cl-search "test/" name)
|
||||
(replace-regexp-in-string "/" "."
|
||||
(replace-regexp-in-string "^\/[^A-Z]*" ""
|
||||
(car (last (split-string name "src")))))
|
||||
(file-name-nondirectory name))))`} (main, test) where
|
||||
--------------------------------------------------------------------------------
|
||||
import Test.Prelude
|
||||
--------------------------------------------------------------------------------
|
||||
import ${1:$(s-chop-suffix "Spec" yas-text)}
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
main :: IO ()
|
||||
main = defaultMain test
|
||||
|
||||
test :: TestTree
|
||||
test = testGroup "$1"
|
||||
[ $0
|
||||
]
|
6
users/aspen/emacs/snippets/haskell-mode/undefined
Normal file
6
users/aspen/emacs/snippets/haskell-mode/undefined
Normal file
|
@ -0,0 +1,6 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: undefined
|
||||
# key: u
|
||||
# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))
|
||||
# --
|
||||
undefined$1
|
Loading…
Add table
Add a link
Reference in a new issue