commit a582f4193ab689347a1e89c4bfb7c1c32423b2e0
parent 9823b4c3b2f98568b335be18158240099172e05d
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Tue, 3 Nov 2020 11:26:32 +0100
bat: config and syntax
Former-commit-id: 77d0ccde3305aa46c331a3354ccb9e54c1c3ebec
Diffstat:
4 files changed, 121 insertions(+), 1 deletion(-)
diff --git a/bat/config b/bat/config
@@ -0,0 +1,5 @@
+--italic-text=always
+--paging=auto
+--pager="less -Ri"
+--color=always
+# --theme set dynamically from ~/.dotfiles/shell/aliases
diff --git a/bat/syntaxes/lean.sublime-syntax b/bat/syntaxes/lean.sublime-syntax
@@ -0,0 +1,114 @@
+%YAML 1.2
+---
+# http://www.sublimetext.com/docs/3/syntax.html
+name: Lean
+file_extensions:
+ - lean
+scope: source.lean
+contexts:
+ main:
+ - include: comments
+ - match: '\b(?<!\.)(inductive|coinductive|structure|theorem|axiom|axioms|abbreviation|lemma|definition|def|instance|class|constant)\b\s+(\{[^}]*\})?'
+ captures:
+ 1: keyword.other.definitioncommand.lean
+ push:
+ - meta_scope: meta.definitioncommand.lean
+ - match: '(?=\bwith\b|\bextends\b|[:\|\(\[\{⦃<>])'
+ pop: true
+ - include: comments
+ - include: definitionName
+ - match: ","
+ - match: \b(Prop|Type|Sort)\b
+ scope: storage.type.lean
+ - match: '\battribute\b\s*\[[^\]]*\]'
+ scope: storage.modifier.lean
+ - match: '@\[[^\]]*\]'
+ scope: storage.modifier.lean
+ - match: \b(?<!\.)(private|meta|mutual|protected|noncomputable)\b
+ scope: keyword.control.definition.modifier.lean
+ - match: \b(sorry)\b
+ scope: invalid.illegal.lean
+ - match: '#print\s+(def|definition|inductive|instance|structure|axiom|axioms|class)\b'
+ scope: keyword.other.command.lean
+ - match: '#(print|eval|reduce|check|help|exit|find|where)\b'
+ scope: keyword.other.command.lean
+ - match: \b(?<!\.)(import|export|prelude|theory|definition|def|abbreviation|instance|renaming|hiding|exposing|parameter|parameters|begin|constant|constants|lemma|variable|variables|theorem|example|open|axiom|inductive|coinductive|with|structure|universe|universes|alias|precedence|reserve|postfix|prefix|infix|infixl|infixr|notation|end|using|namespace|section|local|set_option|extends|include|omit|class|classes|instances|raw|run_cmd|restate_axiom)(?!\.)\b
+ scope: keyword.other.lean
+ - match: \b(?<!\.)(calc|have|this|match|do|suffices|show|by|in|at|let|forall|fun|exists|assume|from|λ)(?!\.)\b
+ scope: keyword.other.lean
+ - match: «
+ push:
+ - meta_content_scope: entity.name.lean
+ - match: »
+ pop: true
+ - match: \b(?<!\.)(if|then|else)\b
+ scope: keyword.control.lean
+ - match: '"'
+ captures:
+ 0: punctuation.definition.string.begin.lean
+ push:
+ - meta_scope: string.quoted.double.lean
+ - match: '"'
+ captures:
+ 0: punctuation.definition.string.end.lean
+ pop: true
+ - match: '\\[\\"nt'']'
+ scope: constant.character.escape.lean
+ - match: '\\x[0-9A-Fa-f][0-9A-Fa-f]'
+ scope: constant.character.escape.lean
+ - match: '\\u[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]'
+ scope: constant.character.escape.lean
+ - match: '''[^\\'']'''
+ scope: string.quoted.single.lean
+ - match: '''(\\(x..|u....|.))'''
+ scope: string.quoted.single.lean
+ captures:
+ 1: constant.character.escape.lean
+ - match: '`+[^\[(]\S+'
+ scope: entity.name.lean
+ - match: '\b([0-9]+|0([xX][0-9a-fA-F]+))\b'
+ scope: constant.numeric.lean
+ blockComment:
+ - match: /-
+ push:
+ - meta_scope: comment.block.lean
+ - match: "-/"
+ pop: true
+ - include: blockComment
+ comments:
+ - include: dashComment
+ - include: docComment
+ - include: modDocComment
+ - include: blockComment
+ dashComment:
+ - match: (--)
+ captures:
+ 0: punctuation.definition.comment.lean
+ push:
+ - meta_scope: comment.line.double-dash.lean
+ - match: $
+ pop: true
+ definitionName:
+ - match: '\b[^:«»\(\)\{\}[:space:]=→λ∀?][^:«»\(\)\{\}[:space:]]*'
+ scope: entity.name.function.lean
+ - match: «
+ push:
+ - meta_content_scope: entity.name.function.lean
+ - match: »
+ pop: true
+ docComment:
+ - match: /--
+ push:
+ - meta_scope: comment.block.documentation.lean
+ - match: "-/"
+ pop: true
+ - include: scope:source.lean.markdown
+ - include: blockComment
+ modDocComment:
+ - match: /-!
+ push:
+ - meta_scope: comment.block.documentation.lean
+ - match: "-/"
+ pop: true
+ - include: scope:source.lean.markdown
+ - include: blockComment
diff --git a/dot.map b/dot.map
@@ -43,6 +43,7 @@ mutt: ~/.config/mutt
mbsync: ~/.config/mbsync
urlview/urlview: ~/.urlview
gnupg: ~/.config/gnupg
+bat: ~/.config/bat
# Config: X server (Linux)
xinitrc: ~/.xinitrc
diff --git a/shell/env b/shell/env
@@ -4,7 +4,7 @@ export DOTFILES="$HOME/.dotfiles"
EDITOR="$(command -v vim)"; export EDITOR
export MUSIC_DIR="/Volumes/HDD/Music/iTunes/iTunes Media/Music"
-if command -v bat 1>/dev/null 2>&1; then export PAGER="bat"; export BAT_PAGER="less -Ri"
+if command -v bat 1>/dev/null 2>&1; then export PAGER="bat"
else export PAGER="less -Ri"; fi
export LANG="en_US.UTF-8"