diff options
author | Marvin Borner | 2022-09-10 11:49:31 +0200 |
---|---|---|
committer | Marvin Borner | 2022-09-10 11:49:31 +0200 |
commit | acc17930827cacfca9102c893764f9871b23d25a (patch) | |
tree | f4e3836d9c652b5e043ec71442fd430c0b71b05c /editors/vim | |
parent | 336a1b4426713bd1c74e16f6a2af5c08d48f6f22 (diff) |
Switched to abbreviations
Diffstat (limited to 'editors/vim')
-rw-r--r-- | editors/vim/README.md | 9 | ||||
-rw-r--r-- | editors/vim/bruijn.snippets | 426 | ||||
-rw-r--r-- | editors/vim/syntax/bruijn.vim | 108 |
3 files changed, 111 insertions, 432 deletions
diff --git a/editors/vim/README.md b/editors/vim/README.md index c10e69d..d1a0b0e 100644 --- a/editors/vim/README.md +++ b/editors/vim/README.md @@ -16,10 +16,7 @@ In this example using vim-plug (others should work similarly): `.vimrc` 2. Run `:PlugInstall` -# Snippets +# Autocompletion -Snippets requires UltiSnips or a similar (compatible) alternative. You -can then install the snippets using something like this (depends on your -path setup): - - ln -s $PWD/bruijn.snippets $HOME/.vim/plugged/vim-snippets/UltiSnips/bruijn.snippets +This plugin uses vim’s `abbreviation`s for autocompletion. You can +complete them using `space` or `C-]` diff --git a/editors/vim/bruijn.snippets b/editors/vim/bruijn.snippets deleted file mode 100644 index b5b30ed..0000000 --- a/editors/vim/bruijn.snippets +++ /dev/null @@ -1,426 +0,0 @@ -# MIT License, Copyright (c) 2022 Marvin Borner -# don't worry, this is mostly automatically generated - -priority 0 - -# === Definition snippets === - -snippet "(.+)>" "" r -`!p snip.rv = match.group(1)`‣$0 -endsnippet - -snippet "(.*)\?" "" r -`!p snip.rv = match.group(1)`…$0 -endsnippet - -# === Operators === - -snippet "(.*)&&" "" r -`!p snip.rv = match.group(1)`⋀$0 -endsnippet - -snippet "(.*)\|\|" "" r -`!p snip.rv = match.group(1)`⋁$0 -endsnippet - -snippet "(.*)sum" "" r -`!p snip.rv = match.group(1)`∑$0 -endsnippet - -snippet "(.*)prod" "" r -`!p snip.rv = match.group(1)`∏$0 -endsnippet - -snippet "(.*)rprod" "" r -`!p snip.rv = match.group(1)`∐$0 -endsnippet - -snippet "(.*)infty" "" r -`!p snip.rv = match.group(1)`∞$0 -endsnippet - -snippet "(.*)\." "" r -`!p snip.rv = match.group(1)`∘$0 -endsnippet - -snippet "(.*)\*" "" r -`!p snip.rv = match.group(1)`⋅$0 -endsnippet - -snippet "(.*)\*\*" "" r -`!p snip.rv = match.group(1)`⋆$0 -endsnippet - -snippet "(.*)=>" "" r -`!p snip.rv = match.group(1)`⇒$0 -endsnippet - -snippet "(.*)<=>" "" r -`!p snip.rv = match.group(1)`⇔$0 -endsnippet - -snippet "(.*)->" "" r -`!p snip.rv = match.group(1)`→$0 -endsnippet - -snippet "(.*)<->" "" r -`!p snip.rv = match.group(1)`↔$0 -endsnippet - -snippet "(.*)-\^" "" r -`!p snip.rv = match.group(1)`↑$0 -endsnippet - -snippet "(.*)::" "" r -`!p snip.rv = match.group(1)`∷$0 -endsnippet - -snippet "(.*)bra" "" r -`!p snip.rv = match.group(1)`⟨$0 -endsnippet - -snippet "(.*)ket" "" r -`!p snip.rv = match.group(1)`⟩$0 -endsnippet - -snippet "(.*)bbra" "" r -`!p snip.rv = match.group(1)`⟪$0 -endsnippet - -snippet "(.*)kket" "" r -`!p snip.rv = match.group(1)`⟫$0 -endsnippet - -snippet "(.*)<=" "" r -`!p snip.rv = match.group(1)`≤$0 -endsnippet - -snippet "(.*)>=" "" r -`!p snip.rv = match.group(1)`≥$0 -endsnippet - -snippet "(.*)!" "" r -`!p snip.rv = match.group(1)`¬$0 -endsnippet - -snippet "(.*)_0" "" r -`!p snip.rv = match.group(1)`₀$0 -endsnippet - -snippet "(.*)_1" "" r -`!p snip.rv = match.group(1)`₁$0 -endsnippet - -snippet "(.*)_2" "" r -`!p snip.rv = match.group(1)`₂$0 -endsnippet - -snippet "(.*)_3" "" r -`!p snip.rv = match.group(1)`₃$0 -endsnippet - -snippet "(.*)_4" "" r -`!p snip.rv = match.group(1)`₄$0 -endsnippet - -snippet "(.*)_5" "" r -`!p snip.rv = match.group(1)`₅$0 -endsnippet - -snippet "(.*)_6" "" r -`!p snip.rv = match.group(1)`₆$0 -endsnippet - -snippet "(.*)_7" "" r -`!p snip.rv = match.group(1)`₇$0 -endsnippet - -snippet "(.*)_8" "" r -`!p snip.rv = match.group(1)`₈$0 -endsnippet - -snippet "(.*)_9" "" r -`!p snip.rv = match.group(1)`₉$0 -endsnippet - -snippet "(.*)_+" "" r -`!p snip.rv = match.group(1)`₊$0 -endsnippet - -snippet "(.*)_-" "" r -`!p snip.rv = match.group(1)`₋$0 -endsnippet - -snippet "(.*)_=" "" r -`!p snip.rv = match.group(1)`₌$0 -endsnippet - -snippet "(.*)_\(" "" r -`!p snip.rv = match.group(1)`₍$0 -endsnippet - -snippet "(.*)_\)" "" r -`!p snip.rv = match.group(1)`₎$0 -endsnippet - -snippet "(.*)\^0" "" r -`!p snip.rv = match.group(1)`⁰$0 -endsnippet - -snippet "(.*)\^1" "" r -`!p snip.rv = match.group(1)`¹$0 -endsnippet - -snippet "(.*)\^2" "" r -`!p snip.rv = match.group(1)`²$0 -endsnippet - -snippet "(.*)\^3" "" r -`!p snip.rv = match.group(1)`³$0 -endsnippet - -snippet "(.*)\^4" "" r -`!p snip.rv = match.group(1)`⁴$0 -endsnippet - -snippet "(.*)\^5" "" r -`!p snip.rv = match.group(1)`⁵$0 -endsnippet - -snippet "(.*)\^6" "" r -`!p snip.rv = match.group(1)`⁶$0 -endsnippet - -snippet "(.*)\^7" "" r -`!p snip.rv = match.group(1)`⁷$0 -endsnippet - -snippet "(.*)\^8" "" r -`!p snip.rv = match.group(1)`⁸$0 -endsnippet - -snippet "(.*)\^9" "" r -`!p snip.rv = match.group(1)`⁹$0 -endsnippet - -snippet "(.*)\^\+" "" r -`!p snip.rv = match.group(1)`⁺$0 -endsnippet - -snippet "(.*)\^-" "" r -`!p snip.rv = match.group(1)`⁻$0 -endsnippet - -snippet "(.*)\^=" "" r -`!p snip.rv = match.group(1)`⁼$0 -endsnippet - -snippet "(.*)\^\(" "" r -`!p snip.rv = match.group(1)`⁽$0 -endsnippet - -snippet "(.*)\^\)" "" r -`!p snip.rv = match.group(1)`⁾$0 -endsnippet - -# === Greek letters === - -snippet "(.*)Alpha" "" r -`!p snip.rv = match.group(1)`Α$0 -endsnippet - -snippet "(.*)alpha" "" r -`!p snip.rv = match.group(1)`α$0 -endsnippet - -snippet "(.*)Beta" "" r -`!p snip.rv = match.group(1)`Β$0 -endsnippet - -snippet "(.*)beta" "" r -`!p snip.rv = match.group(1)`β$0 -endsnippet - -snippet "(.*)Gamma" "" r -`!p snip.rv = match.group(1)`Γ$0 -endsnippet - -snippet "(.*)gamma" "" r -`!p snip.rv = match.group(1)`γ$0 -endsnippet - -snippet "(.*)Delta" "" r -`!p snip.rv = match.group(1)`Δ$0 -endsnippet - -snippet "(.*)delta" "" r -`!p snip.rv = match.group(1)`δ$0 -endsnippet - -snippet "(.*)Epsilon" "" r -`!p snip.rv = match.group(1)`Ε$0 -endsnippet - -snippet "(.*)epsilon" "" r -`!p snip.rv = match.group(1)`ε$0 -endsnippet - -snippet "(.*)varepsilon" "" r -`!p snip.rv = match.group(1)`ϵ$0 -endsnippet - -snippet "(.*)Zeta" "" r -`!p snip.rv = match.group(1)`Ζ$0 -endsnippet - -snippet "(.*)zeta" "" r -`!p snip.rv = match.group(1)`ζ$0 -endsnippet - -snippet "(.*)Eta" "" r -`!p snip.rv = match.group(1)`Η$0 -endsnippet - -snippet "(.*)eta" "" r -`!p snip.rv = match.group(1)`η$0 -endsnippet - -snippet "(.*)Theta" "" r -`!p snip.rv = match.group(1)`Θ$0 -endsnippet - -snippet "(.*)theta" "" r -`!p snip.rv = match.group(1)`θ$0 -endsnippet - -snippet "(.*)Iota" "" r -`!p snip.rv = match.group(1)`Ι$0 -endsnippet - -snippet "(.*)iota" "" r -`!p snip.rv = match.group(1)`ι$0 -endsnippet - -snippet "(.*)Kappa" "" r -`!p snip.rv = match.group(1)`Κ$0 -endsnippet - -snippet "(.*)kappa" "" r -`!p snip.rv = match.group(1)`κ$0 -endsnippet - -snippet "(.*)Lambda" "" r -`!p snip.rv = match.group(1)`Λ$0 -endsnippet - -snippet "(.*)lambda" "" r -`!p snip.rv = match.group(1)`λ$0 -endsnippet - -snippet "(.*)Mu" "" r -`!p snip.rv = match.group(1)`Μ$0 -endsnippet - -snippet "(.*)mu" "" r -`!p snip.rv = match.group(1)`μ$0 -endsnippet - -snippet "(.*)Nu" "" r -`!p snip.rv = match.group(1)`Ν$0 -endsnippet - -snippet "(.*)nu" "" r -`!p snip.rv = match.group(1)`ν$0 -endsnippet - -snippet "(.*)Xi" "" r -`!p snip.rv = match.group(1)`Ξ$0 -endsnippet - -snippet "(.*)xi" "" r -`!p snip.rv = match.group(1)`ξ$0 -endsnippet - -snippet "(.*)Omicron" "" r -`!p snip.rv = match.group(1)`Ο$0 -endsnippet - -snippet "(.*)omicron" "" r -`!p snip.rv = match.group(1)`ο$0 -endsnippet - -snippet "(.*)Pi" "" r -`!p snip.rv = match.group(1)`Π$0 -endsnippet - -snippet "(.*)pi" "" r -`!p snip.rv = match.group(1)`π$0 -endsnippet - -snippet "(.*)Rho" "" r -`!p snip.rv = match.group(1)`Ρ$0 -endsnippet - -snippet "(.*)rho" "" r -`!p snip.rv = match.group(1)`ρ$0 -endsnippet - -snippet "(.*)Sigma" "" r -`!p snip.rv = match.group(1)`Σ$0 -endsnippet - -snippet "(.*)sigma" "" r -`!p snip.rv = match.group(1)`σ$0 -endsnippet - -snippet "(.*)Tau" "" r -`!p snip.rv = match.group(1)`Τ$0 -endsnippet - -snippet "(.*)tau" "" r -`!p snip.rv = match.group(1)`τ$0 -endsnippet - -snippet "(.*)Upsilon" "" r -`!p snip.rv = match.group(1)`Υ$0 -endsnippet - -snippet "(.*)upsilon" "" r -`!p snip.rv = match.group(1)`υ$0 -endsnippet - -snippet "(.*)Phi" "" r -`!p snip.rv = match.group(1)`Φ$0 -endsnippet - -snippet "(.*)phi" "" r -`!p snip.rv = match.group(1)`φ$0 -endsnippet - -snippet "(.*)varphi" "" r -`!p snip.rv = match.group(1)`ϕ$0 -endsnippet - -snippet "(.*)Chi" "" r -`!p snip.rv = match.group(1)`Χ$0 -endsnippet - -snippet "(.*)chi" "" r -`!p snip.rv = match.group(1)`χ$0 -endsnippet - -snippet "(.*)Psi" "" r -`!p snip.rv = match.group(1)`Ψ$0 -endsnippet - -snippet "(.*)psi" "" r -`!p snip.rv = match.group(1)`ψ$0 -endsnippet - -snippet "(.*)Omega" "" r -`!p snip.rv = match.group(1)`Ω$0 -endsnippet - -snippet "(.*)omega" "" r -`!p snip.rv = match.group(1)`ω$0 -endsnippet diff --git a/editors/vim/syntax/bruijn.vim b/editors/vim/syntax/bruijn.vim index 309fbe1..9fdf7ae 100644 --- a/editors/vim/syntax/bruijn.vim +++ b/editors/vim/syntax/bruijn.vim @@ -31,3 +31,111 @@ hi def link bruijnApplication Statement hi def link bruijnCommentLine Comment let b:current_syntax = "bruijn" + +" complete using space or C-] +abbreviate > ‣ +abbreviate ? … +abbreviate && ⋀ +abbreviate \|\| ⋁ +abbreviate sum ∑ +abbreviate prod ∏ +abbreviate rprod ∐ +abbreviate infty ∞ +abbreviate . ∘ +abbreviate * ⋅ +abbreviate ** ⋆ +abbreviate => ⇒ +abbreviate <=> ⇔ +abbreviate -> → +abbreviate <-> ↔ +abbreviate -^ ↑ +abbreviate :: ∷ +abbreviate bra ⟨ +abbreviate ket ⟩ +abbreviate bbra ⟪ +abbreviate kket ⟫ +abbreviate <=? ≤ +abbreviate >=? ≥ +abbreviate ! ¬ +abbreviate _0 ₀ +abbreviate _1 ₁ +abbreviate _2 ₂ +abbreviate _3 ₃ +abbreviate _4 ₄ +abbreviate _5 ₅ +abbreviate _6 ₆ +abbreviate _7 ₇ +abbreviate _8 ₈ +abbreviate _9 ₉ +abbreviate _+ ₊ +abbreviate _- ₋ +abbreviate _= ₌ +abbreviate _( ₍ +abbreviate _) ₎ +abbreviate ^0 ⁰ +abbreviate ^1 ¹ +abbreviate ^2 ² +abbreviate ^3 ³ +abbreviate ^4 ⁴ +abbreviate ^5 ⁵ +abbreviate ^6 ⁶ +abbreviate ^7 ⁷ +abbreviate ^8 ⁸ +abbreviate ^9 ⁹ +abbreviate ^\+ ⁺ +abbreviate ^- ⁻ +abbreviate ^= ⁼ +abbreviate ^\( ⁽ +abbreviate ^\) ⁾ + +" === Greek letters === +abbreviate Alpha Α +abbreviate alpha α +abbreviate Beta Β +abbreviate beta β +abbreviate Gamma Γ +abbreviate gamma γ +abbreviate Delta Δ +abbreviate delta δ +abbreviate Epsilon Ε +abbreviate epsilon ε +abbreviate varepsilon ϵ +abbreviate Zeta Ζ +abbreviate zeta ζ +abbreviate Eta Η +abbreviate eta η +abbreviate Theta Θ +abbreviate theta θ +abbreviate Iota Ι +abbreviate iota ι +abbreviate Kappa Κ +abbreviate kappa κ +abbreviate Lambda Λ +abbreviate lambda λ +abbreviate Mu Μ +abbreviate mu μ +abbreviate Nu Ν +abbreviate nu ν +abbreviate Xi Ξ +abbreviate xi ξ +abbreviate Omicron Ο +abbreviate omicron ο +abbreviate Pi Π +abbreviate pi π +abbreviate Rho Ρ +abbreviate rho ρ +abbreviate Sigma Σ +abbreviate sigma σ +abbreviate Tau Τ +abbreviate tau τ +abbreviate Upsilon Υ +abbreviate upsilon υ +abbreviate Phi Φ +abbreviate phi φ +abbreviate varphi ϕ +abbreviate Chi Χ +abbreviate chi χ +abbreviate Psi Ψ +abbreviate psi ψ +abbreviate Omega Ω +abbreviate omega ω |