Lately I have been taking computer science/math class notes using vim. Since typing LaTeX is too cumbersome and not readily intuitive (you have to typeset it). I just use plain text. This is fine until I need to quickly type strange letters/symbols. I can do this in vim using digraphs. To see a list of available digraphs, in normal mode type:

:digraphs

To enter a digraph in insert mode simply hit <ctrl>+k then the two symbols to create the digraph. So to make the greek capital phi, Φ, you’d hit (in insert mode)

<ctrl>kF*

Below is a table of useful math and computer science digraphs.

symbol description symbol unicode (decimal) vim digraph (first type <ctrl>k) plus minus ± 177 +- squared (superscript 2) ² 178 2S coproduct (big, tall Pi) ∏ 8719 *P summation (big, tall Sigma) ∑ 8721 +Z bullet operator (dot product) ∙ 8729 Sb (square) root √ 8730 RT infinity ∞ 8734 00 Greek Letters Gamma Γ 915 G* Delta Δ 916 D* Theta Θ 920 H* Pi Π 928 P* Sigma Σ 931 S* Phi Φ 934 F* Psi Ψ 936 Q* Omega Ω 937 W* alpha α 945 a* beta β 946 b* gamma γ 947 g* delta δ 948 d* epsilon ε 949 e* eta η 951 y* theta θ 952 h* kappa κ 954 k* lambda λ 955 l* mu μ 956 m* pi π 960 p* rho ρ 961 r* sigma σ 963 s* sigma (alternative) ς 962 *s tau τ 964 t* phi* φ 966 f* psi* ψ 968 q* omega* ω 969 w* dagger (sword) † 8224 /- double dagger (double sword) ‡ 8225 /= left arrow* ← 8592 <- up arrow ↑ 8593 -! right arrow → 8594 -> down arrow ↓ 8595 -v Logic for all (for any) ∀ 8704 FA partial differential (curled little d) ∂ 8706 dP there exists (backwards capital E) ∃ 8707 TE logical and ∧ 8743 AN logical or ∨ 8744 OR therefore (triangle of dots) ∴ 8756 .: because (upside-down triangle of dots) ∵ 8757 :. Sets Null set, empty set, var nothing, capital O slash ∅ 8709 /0 Null set, empty set, var nothing, capital O slash Ø 216 O/ element of ∈ 8712 (- contains as member ∋ 8715 -) set intersect ∩ 8745 (U set union ∪ 8746 U) subset of (contained in) ⊂ 8834 (C superset of (contains) ⊃ 8835 )C subset of or equal to ⊆ 8838 (_ superset of or equal to ⊇ 8839 )_ concatenation, centered dot ∘ 8728 Ob Calculus integral S ∫ 8747 In double integral S ∬ 8748 DI line integral S with circle ∮ 8750 Io Delta ∆ 8710 DE Nabla ∇ 8711 NB Equalities, inequalities, et al. tilde operator (centered tilde, proportional) ∼ 8764 ?1 approximately equal to ≅ 8773 ?= almost equal to ≈ 8776 ?2 not equal to ≠ 8800 != less than or equal to ≤ 8804 =< greater than or equal to ≥ 8805 >=

* I avoid these because they are double-width characters. In the document they are technically only one character put displayed they take up two character positions resulting in overlap in vim.

Note: Greek letters are usually their Latin alphabet “equivalent” then star, with capitals taking capital (uppercase) Latin letters, likewise for lowercase. I included some (what I use most) here.

Note:“Superscript” and “subscript” numbers are all [digit]S for Superscript and [digit]s for subscript.

Note: If you don’t find the character you want above, or by typing :digraphs and paging through supported digraphs, you can input a unicode character by its value in hex. Do this by typing <ctrl>v in insert mode then:

u[4-hex-digit value]

U[8-hex-digit value]

Leading zeros may be omitted.

Note: On some machines <ctrl>v means paste, in that case use <ctrl>q

source

Update: I found a useful list of unicodes for math symbols.

Tags: computer science, cs, digraph, math, symbol, unicode, vi, vim