commit 6c9aff9181d8c3619c071eebcc419ca00206819a parent 79dedd83d498656128f4738e16cb0f3142d20785 Author: mtmn <miro@haravara.org> Date: Sun, 26 Apr 2026 12:39:29 +0200 chore: clean up `ad` editor cfgs Diffstat:
46 files changed, 0 insertions(+), 4104 deletions(-)
diff --git a/modules/mixins/dotfiles/home/ad/bin/G b/modules/mixins/dotfiles/home/ad/bin/G @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# "grep open" -# -# Run ripgrep to search for a pattern with the current git repo if the -# current file is inside of one, otherwise the current directory. -source "$HOME/.ad/lib/ad.sh" - -requireAd -pat="$*" -if [[ -z "$*" ]]; then - adCtl "expand-dot" - pat="$(bufRead "$AD_BUFID" dot)" -fi - -dirname="$(git rev-parse --show-toplevel)" -if [[ ! -d "$dirname" ]]; then - fname="$(bufRead "$AD_BUFID" filename)" - if [[ -d "$fname" ]]; then - dirname="$fname" - else - dirname="$(dirname "$fname")" - fi -fi - -rg "$pat" "$dirname" \ - --column \ - --line-number \ - --no-heading - -#cd "$dirname" || exit -#rg "$pat" \ -# --column \ -# --line-number \ -# --no-heading | -# sed 's/\(.\+\):\([0-9]\+\):\([0-9]\+\):/\1:\2:\3 /g' diff --git a/modules/mixins/dotfiles/home/ad/bin/NextSlide b/modules/mixins/dotfiles/home/ad/bin/NextSlide @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -# Advance to the next slide in a 'Slide' presentation -Slide next diff --git a/modules/mixins/dotfiles/home/ad/bin/PrevSlide b/modules/mixins/dotfiles/home/ad/bin/PrevSlide @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -# Return to the previous slide in a 'Slide' presentation -Slide prev diff --git a/modules/mixins/dotfiles/home/ad/bin/Slide b/modules/mixins/dotfiles/home/ad/bin/Slide @@ -1,52 +0,0 @@ -#!/usr/bin/env bash -# A simple control program for running text based presentations within ad -# via an index file. -# -# To run the presentation within ad, execute 'Slide' in a directory with the -# structure shown below. From there the NextSlide and PrevSlide commands can -# be used to move between the slides. -# -# > Example directory structure: -# . -# body -# conclusion -# index -# intro -# -# > Example index content: -# intro -# body -# conclusion - -. "$HOME/.ad/lib/ad.sh" - -requireAd - -fname="$(bufRead "$AD_BUFID" filename)" -f="$(basename "$fname")" -d="$(dirname "$fname")" - -[ ! -f "$d/index" ] && adError "not in a slideshow directory" -toLoad="$(head -n1 "$d/index")" - -case "$1" in - next) - i="$(grep -n "^$f\$" "$d/index" | cut -d: -f1)" - j="$(( "$i" + 1 ))" - toLoad="$(nl "$d/index" | grep "\s$j\s" | cut -f2)" - [ -z "$toLoad" ] && adError "This is the last slide" - ;; - - prev) - i="$(grep -n "^$f\$" "$d/index" | cut -d: -f1)" - j="$(( "$i" - 1 ))" - toLoad="$(nl "$d/index" | grep "\s$j\s" | cut -f2)" - [ -z "$toLoad" ] && adError "This is first slide" - ;; -esac - -echo "$d/$toLoad" | bufWrite "$AD_BUFID" filename -adCtl "Get" -adEdit "0 i/[PrevSlide] [NextSlide]\n\n/" -curToBof "$AD_BUFID" -markClean "$AD_BUFID" diff --git a/modules/mixins/dotfiles/home/ad/bin/cs b/modules/mixins/dotfiles/home/ad/bin/cs @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -# Set the colorscheme to either a light or dark theme -source "$HOME/.ad/lib/ad.sh" - -lightTheme="\ -set bg-color=#EBDBB2 -set fg-color=#282828 -set dot-bg-color=#d5C4A1 -set load-bg-color=#957FB8 -set exec-bg-color=#BF616A -set bar-bg-color=#83a598 -set signcol-fg-color=#458488 -set minibuffer-hl-color=#458488 -set comment-color=#624354 -set keyword-color=#BF616A -set control-flow-color=#7E9CD8 -set definition-color=#957FB8 -set punctuation-color=#DCA561 -set string-color=#61DCA5" - -darkTheme="\ -set bg-color=#1B1720 -set fg-color=#E6D29E -set dot-bg-color=#336677 -set load-bg-color=#957FB8 -set exec-bg-color=#BF616A -set bar-bg-color=#4E415C -set signcol-fg-color=#544863 -set minibuffer-hl-color=#3E3549 -set comment-color=#624354 -set keyword-color=#BF616A -set control-flow-color=#7E9CD8 -set definition-color=#957FB8 -set punctuation-color=#DCA561 -set string-color=#61DCA5" - - -case "${1:-dark}" in - "light") adCtl "$lightTheme" ;; - "dark") adCtl "$darkTheme" ;; - *) adError "invalid theme name" ;; -esac diff --git a/modules/mixins/dotfiles/home/ad/bin/fmt b/modules/mixins/dotfiles/home/ad/bin/fmt @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# Attempt to format the current buffer based on the filetype -source "$HOME/.ad/lib/ad.sh" - -requireAd -fname=$(bufRead "$AD_BUFID" filename) -addr=$(bufRead "$AD_BUFID" addr) -maybext="${fname##*.}" - -case $maybext in - dart) formatted=$(bufRead "$AD_BUFID" body | dart format) ;; - json) formatted=$(bufRead "$AD_BUFID" body | jq) ;; - rs) formatted=$(bufRead "$AD_BUFID" body | rustfmt --edition 2021) ;; - *) adError "no format rules found for '$maybext'" ;; -esac - -if [[ -n "$formatted" ]]; then - echo -n "," | bufWrite "$AD_BUFID" xaddr - echo -n "$formatted" | bufWrite "$AD_BUFID" xdot - echo -n "$addr" | bufWrite "$AD_BUFID" addr - adCtl "viewport-center" -fi diff --git a/modules/mixins/dotfiles/home/ad/bin/indent b/modules/mixins/dotfiles/home/ad/bin/indent @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -source "$HOME/.ad/lib/ad.sh" - -requireAd -addr="$(bufRead "$AD_BUFID" addr | sed -E 's/(.+):.+,(.+):.+/\1,\2/')" -adEdit '. x/.+/ i/ /' -echo "$addr" | bufWrite "$AD_BUFID" addr diff --git a/modules/mixins/dotfiles/home/ad/bin/lint b/modules/mixins/dotfiles/home/ad/bin/lint @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# Run lint for the current project and show the results so errors can be jumped to -set -eou pipefail - -. "$HOME/.ad/lib/ad.sh" - -root="$(git rev-parse --show-toplevel)" - -# Determine project type -if [ -e "$root/Cargo.toml" ]; then - adCtl "echo running 'cargo clippy'..." - cmd="cd $root && cargo clippy -q --message-format=short --color=never --all-targets 2>&1" - line="$(tmux-select -c "$cmd" | cut -d' ' -f1)" - if [ -z "$line" ]; then - exit 0 - fi - fname="$(echo "$line" | cut -d':' -f1)" - lnum="$(echo "$line" | cut -d':' -f2)" - col="$(echo "$line" | cut -d':' -f3)" - adCtl "open $root/$fname" - bufid="$(currentBufferId)" - echo -n "$lnum:$col" | bufWrite "$bufid" "addr" - adCtl "viewport-center" -else - adCtl "echo not linters configured for this file/project type" - exit 1 -fi diff --git a/modules/mixins/dotfiles/home/ad/bin/mount-ad b/modules/mixins/dotfiles/home/ad/bin/mount-ad @@ -1,6 +0,0 @@ -#!/usr/bin/env bash -# mount the ad virtual filesystem using 9pfuse -source "$HOME/.ad/lib/ad.sh" - -9pfuse "/tmp/ns.$USER.:0/ad" "$HOME/.ad/mnt" -adCtl "echo mounted ad filesystem to $HOME/.ad/mnt" diff --git a/modules/mixins/dotfiles/home/ad/bin/rust-check b/modules/mixins/dotfiles/home/ad/bin/rust-check @@ -1,98 +0,0 @@ -#!/usr/bin/env bash -# A simple ad helper script to lint Rust files on change and support checking -# details of errors that are reported. - -. "$HOME/.ad/lib/ad.sh" - -CARGO_FORMAT="short" -WATCH_TESTS="WatchTests" -STOP_TESTS="StopTests" -TEST_BUTTON="$WATCH_TESTS" -ARGS="" - -header() { - [[ -z "$ARGS" ]] || s=" args='$ARGS'" - echo -e "(Clear) (SetCargoFormat) ($TEST_BUTTON$s)\n" -} - -clearOutput() { adEdit "x/\n>>>@*/ c/\n>>>/"; } - -updateTestOutput() { - clearOutput - cargo test "$ARGS" | bufWrite "$1" body -} - -updateCargoOutput() { - clearBuffer "$1" - header | bufWrite "$1" body - # ensure that the output from cargo streams rather than buffering - cargo clippy --all-targets --workspace --message-format="$CARGO_FORMAT" 2>&1 | bufWrite "$1" body - echo -en "\n\n>>>" | bufWrite "$1" body - content="$(bufRead "$1" body)" - if [[ "$content" =~ error|warning ]]; then - focusBuffer "$1" - adEdit 'x/(.+):(\d+):(\d+):/ c/$1:$2:$3/' - elif [[ "$TEST_BUTTON" = "$STOP_TESTS" ]]; then - updateTestOutput "$1" - fi - curToBof "$1" - markClean "$1" -} - -handleEvents() { - bufRead "$1" event | while read -r line; do - kind="$(echo "$line" | jq -r '.kind')" - target="$(echo "$line" | jq -r '.txt')" - - case "$kind" in - "L") - if [[ "$target" =~ E.... ]]; then - output="$(cargo --explain "$target")" - curToBof "$1" - adEdit "x/\n>>>@*/ d" - echo -en "\n>>> Explanation for error[$target] (Clear)\n$output" | bufWrite "$1" body - markClean "$1" - else - echo -n "$line" | bufWrite "$1" event - fi - ;; - "X") - if [[ "$target" = "SetCargoFormat" ]]; then - raw="$(echo -en "human\nshort" | minibufferSelect "output format> ")" - if [[ "$raw" =~ human|short ]]; then - CARGO_FORMAT="$raw" - updateCargoOutput "$1" - fi - elif [[ "$target" = "$WATCH_TESTS" ]]; then - ARGS="$(echo -n "$ARGS" | minibufferSelect "args> ")" - TEST_BUTTON="$STOP_TESTS" - updateCargoOutput "$1" - elif [[ "$target" = "$STOP_TESTS" ]]; then - TEST_BUTTON="$WATCH_TESTS" - ARGS="" - updateCargoOutput "$1" - elif [[ "$target" = "Clear" ]]; then - clearOutput - markClean "$1" - else - echo -n "$line" | bufWrite "$1" event - fi - ;; - esac - done -} - -currentId="$(currentBufferId)" -root="$(git rev-parse --show-toplevel)" -adCtl "open-in-new-window $root/+cargo" -id="$(adIndex | grep "+cargo" | cut -f1)" -focusBuffer "$currentId" -updateCargoOutput "$id" -handleEvents "$id" & - -adLog | while read -r line; do - action="$(echo "$line" | cut -d' ' -f2)" - if [ "$action" = "save" ]; then - updateCargoOutput "$id" - fi -done diff --git a/modules/mixins/dotfiles/home/ad/bin/toggle-comment b/modules/mixins/dotfiles/home/ad/bin/toggle-comment @@ -1,45 +0,0 @@ -#!/usr/bin/env bash -# Toggle line commenting for the lines within dot based on the filetype. -# -# This script requires a data file containing mappings between ad filetype -# names and the comment string that should be used for adding and removing -# line comments. -# -# Each line in the file should be of the form "$filetype $comment_str". e.g. -# bash # -# rust // -# toml # - -source "$HOME/.ad/lib/ad.sh" - -FTYPE_COMMENT_STRS="$HOME/.ad/lib/ftype-comment-chars.txt" - -requireAd -addr="$(bufRead "$AD_BUFID" addr | sed -E 's/(.+):.+,(.+):.+/\1,\2/')" -ftype="$(bufRead "$AD_BUFID" filetype)" -comment_str="$(grep "$ftype" "$FTYPE_COMMENT_STRS" | cut -d' ' -f2)" - -if [ -z "$comment_str" ]; then - adCtl "echo no configured comment string for $ftype" - exit 1 -fi - -echo '-,/\n/' | bufWrite "$AD_BUFID" xaddr # expand xdot to full lines - -# If every line starts with the comment string then we're uncommenting otherwise -# we're commenting out everything, even lines that already start with the comment -# string -xdot="$(bufRead "$AD_BUFID" xdot)" -n_lines="$(echo "$xdot" | wc -l)" -n_comment_lines="$(echo "$xdot" | grep "^\\s*$comment_str" | wc -l)" - -if [ "$n_lines" != "$n_comment_lines" ]; then - # expand to lines -> for each line -> insert comment_str at the start - adEdit "-,/\\n/ x/.*\\n/ i:$comment_str :" -else - # expand to lines -> for each line start up to comment_str -> remove comment_str - adEdit "-,/\\n/ x/.+\\n/ n:^(\\s*?)$comment_str ?: c/{1}/" -fi - -echo "$addr" | bufWrite "$AD_BUFID" addr -adCtl "echo addr was '$addr'" diff --git a/modules/mixins/dotfiles/home/ad/bin/unindent b/modules/mixins/dotfiles/home/ad/bin/unindent @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -source "$HOME/.ad/lib/ad.sh" - -requireAd -addr="$(bufRead "$AD_BUFID" addr | sed -E 's/(.+):.+,(.+):.+/\1,\2/')" -adEdit '. x/.+/ n/^ / d' -echo "$addr" | bufWrite "$AD_BUFID" addr diff --git a/modules/mixins/dotfiles/home/ad/bin/wd b/modules/mixins/dotfiles/home/ad/bin/wd @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -# Use the users warprc to navigate to files in known projects - -. "$HOME/.ad/lib/ad.sh" - -requireAd - -opt="$(cat "$HOME/.warprc" | cut -d: -f1 | sort | minibufferSelect "project> ")" -if [[ -n "$opt" ]]; then - dirname=$(cat "$HOME/.warprc" | grep "^$opt" | cut -d: -f2 | sed "s:~/:$HOME/:g") - fname="$(cd "$dirname" && fd | minibufferSelect "file> ")" - if [[ -n "$fname" ]]; then - adCtl "open $dirname/$fname" - fi -fi diff --git a/modules/mixins/dotfiles/home/ad/colorschemes/default_dark.toml b/modules/mixins/dotfiles/home/ad/colorschemes/default_dark.toml @@ -1,71 +0,0 @@ -fg = "fg" -bg = "bg" -bar_bg = "#4E415C" -signcol_fg = "#544863" -minibuffer_hl = "#3E3549" - -[palette] -fg = "#E6D29E" -bg = "#1B1720" -bg2 = "#292532" -blue = "#8793B5" -brown = "#624354" -cyan = "#7AA89F" -dark-blue = "#2D4F67" -dark-yellow = "#DCA561" -gray = "#716E77" -green = "#76946A" -light-blue = "#9CABCA" -light-gray = "#908D96" -light-red = "#D27E99" -magenta = "#A292E8" -mint = "#61DCA5" -orange = "#FFA066" -pink = "#D27E99" -purple = "#957FB8" -red = "#C34043" -sage = "#9AB292" -salmon = "#Bf616A" -sea-blue = "#336677" -yellow = "#E6C384" - -[syntax] -default = { fg = "fg", bg = "bg" } -dot = { bg = "sea-blue" } -load = { bg = "purple" } -exec = { bg = "salmon" } - -boolean = { fg = "dark-yellow", bold = true } -character = { fg = "mint", italic = true } -comment = { fg = "brown", italic = true } -constant = { fg = "orange", bold = true } -function = { fg = "blue" } -keyword = { fg = "salmon" } -module = { fg = "dark-blue" } -number = { fg = "light-red" } -operator = { fg = "dark-yellow" } -punctuation = { fg = "light-blue" } -string = { fg = "mint" } -type = { fg = "sage" } -variable = { } - -# Specialisations - -"function.macro" = { fg = "orange", italic = true } -"function.operator" = { fg = "light-gray" } - -"markup.italic" = { italic = true } -"markup.bold" = { bold = true } -"markup.heading" = { fg = "blue", bold = true } -"markup.raw" = { fg = "brown", italic = true } -"markup.quote" = { fg = "purple", italic = true } -"markup.link.url" = { fg = "light-blue", underline = true } -"markup.link.label" = { fg = "dark-blue", bold = true } -"markup.list.unchecked" = { fg = "dark-yellow", bold = true } -"markup.list.checked" = { fg = "sage", bold = true } -"markup.list" = { fg = "light-blue", bold = true } - -"string.template" = { fg = "mint", bg = "bg2", bold = true } -"string.regex" = { fg = "sea-blue", bg = "bg", italic = true } - -label = { fg = "yellow" } diff --git a/modules/mixins/dotfiles/home/ad/colorschemes/default_light.toml b/modules/mixins/dotfiles/home/ad/colorschemes/default_light.toml @@ -1,71 +0,0 @@ -fg = "fg" -bg = "bg" -bar_bg = "#83A598" -signcol_fg = "#458488" -minibuffer_hl = "#8fafa2" - -[palette] -fg = "#644855" -bg = "#EBDBB2" -bg2 = "#DED0A4" -blue = "#4685c0" -brown = "#9b8391" -cyan = "#2D8A7A" -dark-blue = "#726a98" -dark-yellow = "#DCA561" -gray = "#7C7976" -green = "#5F8A3B" -light-blue = "#6B9BC3" -light-gray = "#9A9895" -light-red = "#D27E99" -magenta = "#8A6DB8" -mint = "#347e73" -orange = "#ce752c" -pink = "#D27E99" -purple = "#957FB8" -red = "#C34043" -sage = "#6A8A62" -salmon = "#a44860" -sea-blue = "#458488" -yellow = "#B8960C" - -[syntax] -default = { fg = "fg", bg = "bg" } -dot = { bg = "bg2" } -load = { bg = "purple" } -exec = { bg = "salmon" } - -boolean = { fg = "dark-yellow", bold = true } -character = { fg = "mint", italic = true } -comment = { fg = "brown", italic = true } -constant = { fg = "orange", bold = true } -function = { fg = "blue" } -keyword = { fg = "salmon" } -module = { fg = "dark-blue" } -number = { fg = "light-red" } -operator = { fg = "dark-yellow" } -punctuation = { fg = "light-blue" } -string = { fg = "mint" } -type = { fg = "sage" } -variable = { } - -# Specialisations - -"function.macro" = { fg = "orange", italic = true } -"function.operator" = { fg = "light-gray" } - -"markup.italic" = { italic = true } -"markup.bold" = { bold = true } -"markup.heading" = { fg = "blue", bold = true } -"markup.raw" = { fg = "brown", italic = true } -"markup.quote" = { fg = "purple", italic = true } -"markup.link.url" = { fg = "light-blue", underline = true } -"markup.link.label" = { fg = "dark-blue", bold = true } -"markup.list.unchecked" = { fg = "dark-yellow", bold = true } -"markup.list.checked" = { fg = "sage", bold = true } -"markup.list" = { fg = "light-blue", bold = true } - -"string.template" = { fg = "mint", bg = "bg2", bold = true } -"string.regex" = { fg = "sea-blue", bg = "bg", italic = true } - -label = { fg = "yellow" } diff --git a/modules/mixins/dotfiles/home/ad/colorschemes/doric_dark.toml b/modules/mixins/dotfiles/home/ad/colorschemes/doric_dark.toml @@ -1,49 +0,0 @@ -# Color scheme based on doric-dark Emacs theme -# For details of the TOML file format see https://toml.io/en/v1.0.0 - -# Global color scheme settings -[colorscheme] -# The default background color for all UI elements -bg = "#000000" -# The default foreground color for all UI elements -fg = "#ffffff" -# The background color for the status bar -bar_bg = "#43404c" -# The foreground color for the sign / number column -signcol_fg = "#707070" -# The background highlight color for the selected line in the mini-buffer -minibuffer_hl = "#50447f" - -# Syntax highlighting settings for tree-sitter query captures -[colorscheme.syntax] -# Required styling for default text and selections -default = { fg = "#ffffff", bg = "#000000" } -dot = { fg = "#ffffff", bg = "#603254" } -load = { fg = "#ffffff", bg = "#223567" } -exec = { fg = "#ffffff", bg = "#4d1f20" } -# Styling for tree-sitter query captures -boolean = { fg = "#c0b080", bold = true } -character = { fg = "#eca28f", italic = true } -comment = { fg = "#a2a0b2", italic = true } -constant = { fg = "#a0c0d0" } -function = { fg = "#9fbfe7" } -"function.macro" = { fg = "#a0c0d0" } -keyword = { fg = "#cda4df" } -module = { fg = "#43404c" } -number = { fg = "#e9acbf" } -operator = { fg = "#c0b080" } -punctuation = { fg = "#c5c7d4" } -string = { fg = "#b9d0aa" } -type = { fg = "#cfcff8" } -variable = { fg = "#ffffff" } -"markup.italic" = { fg = "#ffffff", bg = "#000000", italic = true } -"markup.bold" = { fg = "#ffffff", bg = "#000000", bold = true } -"markup.heading" = { fg = "#9fbfe7", bold = true } -"markup.raw" = { fg = "#a2a0b2", italic = true } -"markup.quote" = { fg = "#cfcff8", italic = true } -"markup.link.url" = { fg = "#c5c7d4", underline = true } -"markup.link.label" = { fg = "#43404c", bold = true } -"markup.list.unchecked" = { fg = "#c0b080", bold = true } -"markup.list.checked" = { fg = "#cfcff8", bold = true } -"markup.list" = { fg = "#c5c7d4", bg = "#000000", bold = true } -label = { fg = "#ccaaff" } diff --git a/modules/mixins/dotfiles/home/ad/config.toml b/modules/mixins/dotfiles/home/ad/config.toml @@ -1,194 +0,0 @@ -[editor] -show_splash = false -expand_tab = true -tabstop = 4 -match_indent = true -status_timeout = 3 -double_click_ms = 200 -minibuffer_lines = 8 -find_command = "fd --hidden" - - -[filesystem] -enabled = true -auto_mount = false - - -[tree_sitter] -# The directory to search for compiled *.so files for parsing each language. -parser_dir = "~/.ad/tree-sitter/parsers" -# The directory to search for syntax highlighting queries. -syntax_query_dir = "~/.ad/tree-sitter/queries" - - -# Global color scheme settings -# -# It is also possible to specify an absolute path to a colorscheme TOML file containing this section of the config -# like so: -[colorscheme] -fg = "fg" -bg = "bg" -bar_bg = "neutral-bg" -signcol_fg = "border" -minibuffer_hl = "subtle-bg" - -[colorscheme.palette] -fg = "#ffffff" -bg = "#000000" -border = "#707070" -cursor = "#ccaaee" - -subtle-bg = "#332d38" -subtle-fg = "#a2a0b2" -neutral-bg = "#43404c" -neutral-fg = "#c5c7d4" -intense-bg = "#50447f" -intense-fg = "#cfcff8" -accent-bg = "#521e40" -accent-fg = "#cda4df" - -red = "#eca28f" -red-bg = "#4d1f20" -green = "#b9d0aa" -green-bg = "#1f402e" -yellow = "#c0b080" -yellow-bg = "#504432" -blue = "#9fbfe7" -blue-bg = "#223567" -magenta = "#e9acbf" -magenta-bg = "#603254" -cyan = "#a0c0d0" -cyan-bg = "#2f4f54" - -[colorscheme.syntax] -default = { fg = "fg", bg = "bg" } -dot = { bg = "cyan-bg" } -load = { bg = "magenta-bg" } -exec = { bg = "red-bg" } - -boolean = { fg = "yellow", bold = true } -character = { fg = "green", italic = true } -comment = { fg = "neutral-fg", italic = true } -constant = { fg = "accent-fg", bold = true } -function = { fg = "blue" } -keyword = { fg = "magenta" } -module = { fg = "blue-bg" } -number = { fg = "red" } -operator = { fg = "yellow" } -punctuation = { fg = "cyan" } -string = { fg = "green" } -type = { fg = "cyan" } -variable = { } - -# Specialisations -"function.macro" = { fg = "accent-fg", italic = true } -"function.operator" = { fg = "neutral-fg" } - -"markup.italic" = { italic = true } -"markup.bold" = { bold = true } -"markup.heading" = { fg = "blue", bold = true } -"markup.raw" = { fg = "yellow", italic = true } -"markup.quote" = { fg = "magenta", italic = true } -"markup.link.url" = { fg = "cyan", underline = true } -"markup.link.label" = { fg = "blue-bg", bold = true } -"markup.list.unchecked" = { fg = "yellow", bold = true } -"markup.list.checked" = { fg = "green", bold = true } -"markup.list" = { fg = "cyan", bold = true } - -"string.template" = { fg = "green", bg = "subtle-bg", bold = true } -"string.regex" = { fg = "cyan", bg = "bg", italic = true } - -label = { fg = "yellow" } - -# Key mappings to programs that must be available on $PATH or commands. -# ~/.ad/bin is auto-added to the path -[keys.normal] -"<space> F" = { run = "fmt" } -">" = { run = "indent" } -"<" = { run = "unindent" } -# Window & Column management -"<space> w /" = { run = "new-column" } -"<space> w -" = { run = "new-window" } -"<space> w h" = { run = "prev-column" } -"<space> w j" = { run = "next-window" } -"<space> w k" = { run = "prev-window" } -"<space> w l" = { run = "next-column" } - - -# Filetype configuration - -[filetypes.awk] -extensions = ["awk"] -first_lines = ["#!/usr/bin/awk -f", "#!/usr/bin/env -S awk -f"] - -[filetypes.bash] -extensions = ["sh", "bash"] -first_lines = ["#!/usr/bin/bash", "#!/usr/bin/sh", "#!/usr/bin/env bash", "#!/usr/bin/env sh"] -lsp.command = "bash-language-server" -lsp.args = ["start"] -lsp.roots = [".git"] - -[filetypes.c] -extensions = ["c", "h"] - -[filetypes.dart] -extensions = ["dart"] -lsp.command = "dart" -lsp.args = ["language-server", "--protocol=lsp"] -lsp.roots = ["melos.yaml", "pubspec.yaml"] - -[filetypes.graphql] -extensions = ["graphql"] - -[filetypes.json] -extensions = ["json"] - -[filetypes.just] -filenames = ["justfile"] - -[filetypes.make] -filenames = ["Makefile"] - -[filetypes.markdown] -extensions = ["md"] - -[filetypes.plumbing_rules] -filenames = ["plumbing.rules"] - -[filetypes.proto] -extensions = ["proto"] - -[filetypes.python] -extensions = ["py"] -lsp.command = "pylsp" -lsp.roots = ["dummy.py"] - -[filetypes.r] -extensions = ["R"] -lsp.command = "R" -lsp.args = ["--slave", "-e", "languageserver::run()"] -lsp.roots = ["dummy.R"] - -[filetypes.rust] -extensions = ["rs"] -lsp.command = "rust-analyzer" -lsp.roots = ["Cargo.toml"] - -[filetypes.scheme] -extensions = ["scm"] - -[filetypes.sql] -extensions = ["sql"] - -[filetypes.swift] -extensions = ["swift"] - -[filetypes.toml] -extensions = ["toml"] - -# [filetypes.txtar] -# extensions = ["txtar"] -# re_syntax = "~/.ad/syntax/txtar.toml" - -[filetypes.yaml] -extensions = ["yaml", "yml"] diff --git a/modules/mixins/dotfiles/home/ad/lib/ad.sh b/modules/mixins/dotfiles/home/ad/lib/ad.sh @@ -1,65 +0,0 @@ -#!/usr/bin/env bash -# Helper functions for writing scripts to interact with ad - -[ -e "$HOME/.profile" ] && source ~/.profile - -# Write a control message to ad. -# The format accepted is the same as when using the internal command line -adCtl() { echo -n "$*" | ad -9p write ad/ctl; } - -# Execute an Edit script within the current buffer -adEdit() { adCtl "Edit $*"; } - -# Read the contents of the index file -adIndex() { ad -9p read ad/buffers/index; } - -# Display an error in the editor status line and exit -adError() { - adCtl "echo $*" - exit 1 -} - -# Exit with an error message if this script was not launched from ad itself -requireAd() { - [[ -z "$AD_PID" ]] && adError "need to be run from inside of ad" -} - -# Read the contents of an fsys file for the specified buffer -bufRead() { ad -9p read "ad/buffers/$1/$2"; } - -# Write a string to the specified buffer file -bufWrite() { ad -9p write "ad/buffers/$1/$2"; } - -# Follow the ad log stream of ongoing buffer events -adLog() { ad -9p read ad/log; } - -# Fetch the id of the currently focused buffer -currentBufferId() { ad -9p read ad/buffers/current; } - -# Set focus to the buffer with the specified id -focusBuffer() { echo "$1" | ad -9p write ad/buffers/current; } - -# Clear the contents of the current buffer -clearBuffer() { - echo -n "," | bufWrite "$1" xaddr - echo -n "" | bufWrite "$1" xdot -} - -# Mark the buffer with the specified id as clean -markClean() { adCtl "mark-clean $1"; } - -# Set the cursor position for the specified buffer to the beginning of the file -curToBof() { echo -n 0 | bufWrite "$1" addr; } - -# Set the cursor position for the specified buffer to the end of the file -curToEof() { echo -n '$' | bufWrite "$1" addr; } - -# dmenu style selection from newline delimited input on stdin -minibufferSelect() { - ad -9p write ad/minibuffer - [ -n "$1" ] && adCtl "minibuffer-prompt $1" - ad -9p read ad/minibuffer -} - -# Prompt the user for input -minibufferPrompt() { echo '' | minibufferSelect "$@"; } diff --git a/modules/mixins/dotfiles/home/ad/lib/ftype-comment-chars.txt b/modules/mixins/dotfiles/home/ad/lib/ftype-comment-chars.txt @@ -1,15 +0,0 @@ -bash # -c // -dart // -graphql # -just # -make # -plumbingrules # -proto // -python # -rust // -scheme ; -sql -- -swift // -toml # -yaml # diff --git a/modules/mixins/dotfiles/home/ad/plumbing.rules b/modules/mixins/dotfiles/home/ad/plumbing.rules @@ -1,45 +0,0 @@ -# These are the default plumbing rules for ad - -editor = ad -addrelem = ((#?[0-9]+)|(/[A-Za-z0-9_\^]+/?)|[.$]) -addr = :($addrelem([,;+\-]$addrelem)*) - -# git commits, inspired by https://alexkarle.com/blog/plan9-acme-git-gui.html -data matches [a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]+ -data from git -C $wdir show $0 -attr add action=showdata filename=/git/$0 -plumb to edit - -# urls go to a web browser -data matches https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*) -plumb to web -plumb start xdg-open $0 - -# image files go an image viewer -data matches [a-zA-Z¡-￿0-9_\-./@]+ -data matches ([a-zA-Z¡-￿0-9_\-./@]+)\.(jpe?g|JPE?G|gif|GIF|tiff?|TIFF?|ppm|bit|png|PNG) -arg isfile $0 -plumb to image -plumb start xdg-open $0 - -# pdfs go to a pdf viewer -data matches [a-zA-Z¡-￿0-9_\-./@]+ -data matches ([a-zA-Z¡-￿0-9_\-./@]+)\.[Pp][Dd][Ff] -arg isfile $0 -plumb to pdf -plumb start zathura $0 -plumb start xdg-open $0 - -# existing files tagged by line number:columnumber, go to editor -# data matches ([.a-zA-Z¡-￿0-9_/\-@]*[a-zA-Z¡-￿0-9_/\-]):([0-9]+):([0-9]+):? -data matches (.+):([0-9]+):([0-9]+):? -arg isfile $1 -data set $file -attr add addr=$2:$3 -plumb to edit - -# man index entries are synthesized -data matches ([a-zA-Z¡-￿0-9_\-./]+)\(([1-8])\) -data from man $2 $1 -attr add action=showdata filename=/man/$1($2) -plumb to edit diff --git a/modules/mixins/dotfiles/home/ad/syntax/ad.toml b/modules/mixins/dotfiles/home/ad/syntax/ad.toml @@ -1,2 +0,0 @@ -comment = "\\b#.*" -keyword = "\\b(x|y|g|v|p)/.+/\\b" diff --git a/modules/mixins/dotfiles/home/ad/syntax/plumbing-rules.toml b/modules/mixins/dotfiles/home/ad/syntax/plumbing-rules.toml @@ -1,3 +0,0 @@ -comment = "\\b#.*" -keyword = "\\b(data|attr|plumb|arg)\\b" -function = "\\b(matches|narrows|from|add|to|set|start|isfile|isdir)\\b" diff --git a/modules/mixins/dotfiles/home/ad/syntax/txtar.toml b/modules/mixins/dotfiles/home/ad/syntax/txtar.toml @@ -1 +0,0 @@ -"keyword" = "^-- .+ --$" diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/parsers/rust.so b/modules/mixins/dotfiles/home/ad/tree-sitter/parsers/rust.so Binary files differ. diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/awk/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/awk/highlights.scm @@ -1,199 +0,0 @@ -; adapted from https://github.com/Beaglefoot/tree-sitter-awk -[ - (identifier) - (field_ref) -] @variable - -(field_ref - (_) @variable) - -; https://www.gnu.org/software/gawk/manual/html_node/Auto_002dset.html -((identifier) @constant.builtin - (#any-of? @constant.builtin - "ARGC" "ARGV" "ARGIND" "ENVIRON" "ERRNO" "FILENAME" "FNR" "NF" "FUNCTAB" "NR" "PROCINFO" - "RLENGTH" "RSTART" "RT" "SYMTAB")) - -; https://www.gnu.org/software/gawk/manual/html_node/User_002dmodified.html -((identifier) @variable.builtin - (#any-of? @variable.builtin - "BINMODE" "CONVFMT" "FIELDWIDTHS" "FPAT" "FS" "IGNORECASE" "LINT" "OFMT" "OFS" "ORS" "PREC" - "ROUNDMODE" "RS" "SUBSEP" "TEXTDOMAIN")) - -(number) @number - -(string) @string - -(regex) @string.regexp - -(escape_sequence) @string.escape - -(comment) @comment - -((program - . - (comment) @keyword.directive) - (#match? @keyword.directive "^#!/")) - -(ns_qualified_name - (namespace) @module) - -(ns_qualified_name - "::" @punctuation.delimiter) - -(func_def - name: (_ - (identifier) @function) @function) - -(func_call - name: (_ - (identifier) @function) @function) - -(func_def - (param_list - (identifier) @variable.parameter)) - -[ - "print" - "printf" - "getline" -] @function.builtin - -[ - (delete_statement) - (break_statement) - (continue_statement) - (next_statement) - (nextfile_statement) -] @keyword - -[ - "func" - "function" -] @keyword.function - -[ - "return" - "exit" -] @keyword.return - -[ - "do" - "while" - "for" - "in" -] @keyword.repeat - -[ - "if" - "else" - "switch" - "case" - "default" -] @keyword.conditional - -[ - "@include" - "@load" -] @keyword.import - -"@namespace" @keyword.directive - -[ - "BEGIN" - "END" - "BEGINFILE" - "ENDFILE" -] @label - -(binary_exp - [ - "^" - "**" - "*" - "/" - "%" - "+" - "-" - "<" - ">" - "<=" - ">=" - "==" - "!=" - "~" - "!~" - "in" - "&&" - "||" - ] @operator) - -(unary_exp - [ - "!" - "+" - "-" - ] @operator) - -(assignment_exp - [ - "=" - "+=" - "-=" - "*=" - "/=" - "%=" - "^=" - ] @operator) - -(ternary_exp - [ - "?" - ":" - ] @keyword.conditional.ternary) - -(update_exp - [ - "++" - "--" - ] @operator) - -(redirected_io_statement - [ - ">" - ">>" - ] @operator) - -(piped_io_statement - [ - "|" - "|&" - ] @operator) - -(piped_io_exp - [ - "|" - "|&" - ] @operator) - -(field_ref - "$" @punctuation.delimiter) - -(regex - "/" @punctuation.delimiter) - -(regex_constant - "@" @punctuation.delimiter) - -[ - ";" - "," -] @punctuation.delimiter - -[ - "(" - ")" - "[" - "]" - "{" - "}" -] @punctuation.bracket diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/bash/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/bash/highlights.scm @@ -1,253 +0,0 @@ -[ - "(" - ")" - "{" - "}" - "[" - "]" - "[[" - "]]" - "((" - "))" -] @punctuation.bracket - -[ - ";" - ";;" - ";&" - ";;&" - "&" -] @punctuation.delimiter - -[ - ">" - ">>" - "<" - "<<" - "&&" - "|" - "|&" - "||" - "=" - "+=" - "=~" - "==" - "!=" - "&>" - "&>>" - "<&" - ">&" - ">|" - "<&-" - ">&-" - "<<-" - "<<<" - ".." - "!" -] @operator - -[ - (string) - (raw_string) - (ansi_c_string) - (heredoc_body) -] @string - -[ - (heredoc_start) - (heredoc_end) -] @string - -(variable_assignment - (word) @string) - -(command argument: "$" @string) ; bare dollar - -(concatenation (word) @string) - -[ - "if" - "then" - "else" - "elif" - "fi" - "case" - "in" - "esac" -] @keyword.conditional - -[ - "for" - "do" - "done" - "select" - "until" - "while" -] @keyword.repeat - -[ - "declare" - "typeset" - "readonly" - "local" - "unset" - "unsetenv" -] @keyword - -"export" @keyword.import - -"function" @keyword.function - -(special_variable_name) @constant - -; trap -l -((word) @constant.builtin - (#any-of? @constant.builtin - "SIGHUP" "SIGINT" "SIGQUIT" "SIGILL" "SIGTRAP" "SIGABRT" "SIGBUS" "SIGFPE" "SIGKILL" "SIGUSR1" - "SIGSEGV" "SIGUSR2" "SIGPIPE" "SIGALRM" "SIGTERM" "SIGSTKFLT" "SIGCHLD" "SIGCONT" "SIGSTOP" - "SIGTSTP" "SIGTTIN" "SIGTTOU" "SIGURG" "SIGXCPU" "SIGXFSZ" "SIGVTALRM" "SIGPROF" "SIGWINCH" - "SIGIO" "SIGPWR" "SIGSYS" "SIGRTMIN" "SIGRTMIN+1" "SIGRTMIN+2" "SIGRTMIN+3" "SIGRTMIN+4" - "SIGRTMIN+5" "SIGRTMIN+6" "SIGRTMIN+7" "SIGRTMIN+8" "SIGRTMIN+9" "SIGRTMIN+10" "SIGRTMIN+11" - "SIGRTMIN+12" "SIGRTMIN+13" "SIGRTMIN+14" "SIGRTMIN+15" "SIGRTMAX-14" "SIGRTMAX-13" - "SIGRTMAX-12" "SIGRTMAX-11" "SIGRTMAX-10" "SIGRTMAX-9" "SIGRTMAX-8" "SIGRTMAX-7" "SIGRTMAX-6" - "SIGRTMAX-5" "SIGRTMAX-4" "SIGRTMAX-3" "SIGRTMAX-2" "SIGRTMAX-1" "SIGRTMAX")) - -((word) @boolean - (#any-of? @boolean "true" "false")) - -(comment) @comment - -(test_operator) @operator - -(command_substitution - "$(" @punctuation.special - ")" @punctuation.special) - -(process_substitution - [ - "<(" - ">(" - ] @punctuation.special - ")" @punctuation.special) - -(arithmetic_expansion - [ - "$((" - "((" - ] @punctuation.special - "))" @punctuation.special) - -(arithmetic_expansion - "," @punctuation.delimiter) - -(ternary_expression - [ - "?" - ":" - ] @keyword.conditional.ternary) - -(binary_expression - operator: _ @operator) - -(unary_expression - operator: _ @operator) - -(postfix_expression - operator: _ @operator) - -(function_definition - name: (word) @function) - -(command_name - (word) @function.call) - -(command_name - (word) @function.builtin - (#any-of? @function.builtin - "." ":" "alias" "bg" "bind" "break" "builtin" "caller" "cd" "command" "compgen" "complete" - "compopt" "continue" "coproc" "dirs" "disown" "echo" "enable" "eval" "exec" "exit" "false" "fc" - "fg" "getopts" "hash" "help" "history" "jobs" "kill" "let" "logout" "mapfile" "popd" "printf" - "pushd" "pwd" "read" "readarray" "return" "set" "shift" "shopt" "source" "suspend" "test" "time" - "times" "trap" "true" "type" "typeset" "ulimit" "umask" "unalias" "wait")) - -(command - argument: [ - (word) @variable.parameter - (concatenation - (word) @variable.parameter) - ]) - -(declaration_command - (word) @variable.parameter) - -(unset_command - (word) @variable.parameter) - -(number) @number - -((word) @number - (#match? @number "^[0-9]+$")) - -(file_redirect - destination: (word) @variable.parameter) - -(file_descriptor) @operator - -(simple_expansion - "$" @punctuation.special) @none - -(expansion - "${" @punctuation.special - "}" @punctuation.special) @none - -(expansion - operator: _ @punctuation.special) - -(expansion - "@" - . - operator: _ @character.special) - -((expansion - (subscript - index: (word) @character.special)) - (#any-of? @character.special "@" "*")) - -"``" @punctuation.special - -(variable_name) @variable - -((variable_name) @constant - (#match? @constant "^[A-Z][A-Z_0-9]*$")) - -((variable_name) @variable.builtin - (#any-of? @variable.builtin - ; https://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Variables.html - "CDPATH" "HOME" "IFS" "MAIL" "MAILPATH" "OPTARG" "OPTIND" "PATH" "PS1" "PS2" - ; https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html - "_" "BASH" "BASHOPTS" "BASHPID" "BASH_ALIASES" "BASH_ARGC" "BASH_ARGV" "BASH_ARGV0" "BASH_CMDS" - "BASH_COMMAND" "BASH_COMPAT" "BASH_ENV" "BASH_EXECUTION_STRING" "BASH_LINENO" - "BASH_LOADABLES_PATH" "BASH_REMATCH" "BASH_SOURCE" "BASH_SUBSHELL" "BASH_VERSINFO" - "BASH_VERSION" "BASH_XTRACEFD" "CHILD_MAX" "COLUMNS" "COMP_CWORD" "COMP_LINE" "COMP_POINT" - "COMP_TYPE" "COMP_KEY" "COMP_WORDBREAKS" "COMP_WORDS" "COMPREPLY" "COPROC" "DIRSTACK" "EMACS" - "ENV" "EPOCHREALTIME" "EPOCHSECONDS" "EUID" "EXECIGNORE" "FCEDIT" "FIGNORE" "FUNCNAME" - "FUNCNEST" "GLOBIGNORE" "GROUPS" "histchars" "HISTCMD" "HISTCONTROL" "HISTFILE" "HISTFILESIZE" - "HISTIGNORE" "HISTSIZE" "HISTTIMEFORMAT" "HOSTFILE" "HOSTNAME" "HOSTTYPE" "IGNOREEOF" "INPUTRC" - "INSIDE_EMACS" "LANG" "LC_ALL" "LC_COLLATE" "LC_CTYPE" "LC_MESSAGES" "LC_NUMERIC" "LC_TIME" - "LINENO" "LINES" "MACHTYPE" "MAILCHECK" "MAPFILE" "OLDPWD" "OPTERR" "OSTYPE" "PIPESTATUS" - "POSIXLY_CORRECT" "PPID" "PROMPT_COMMAND" "PROMPT_DIRTRIM" "PS0" "PS3" "PS4" "PWD" "RANDOM" - "READLINE_ARGUMENT" "READLINE_LINE" "READLINE_MARK" "READLINE_POINT" "REPLY" "SECONDS" "SHELL" - "SHELLOPTS" "SHLVL" "SRANDOM" "TIMEFORMAT" "TMOUT" "TMPDIR" "UID")) - -(case_item - value: (word) @variable.parameter) - -[ - (regex) - (extglob_pattern) -] @string.regexp - -((program - . - (comment) @keyword.directive) - (#match? @keyword.directive "^#!/")) diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/c/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/c/highlights.scm @@ -1,329 +0,0 @@ -; Lower priority to prefer @variable.parameter when identifier appears in parameter_declaration. -((identifier) @variable - (#set! priority 95)) - -(preproc_def - (preproc_arg) @variable) - -[ - "default" - "goto" - "asm" - "__asm__" -] @keyword - -[ - "enum" - "struct" - "union" - "typedef" -] @keyword.type - -[ - "sizeof" - "offsetof" -] @keyword.operator - -(alignof_expression - . - _ @keyword.operator) - -"return" @keyword.return - -[ - "while" - "for" - "do" - "continue" - "break" -] @keyword.repeat - -[ - "if" - "else" - "case" - "switch" -] @keyword.conditional - -[ - "#if" - "#ifdef" - "#ifndef" - "#else" - "#elif" - "#endif" - "#elifdef" - "#elifndef" - (preproc_directive) -] @keyword.directive - -"#define" @keyword.directive.define - -"#include" @keyword.import - -[ - ";" - ":" - "," - "::" -] @punctuation.delimiter - -"..." @punctuation.special - -[ - "(" - ")" - "[" - "]" - "{" - "}" -] @punctuation.bracket - -[ - "=" - "-" - "*" - "/" - "+" - "%" - "~" - "|" - "&" - "^" - "<<" - ">>" - "->" - "." - "<" - "<=" - ">=" - ">" - "==" - "!=" - "!" - "&&" - "||" - "-=" - "+=" - "*=" - "/=" - "%=" - "|=" - "&=" - "^=" - ">>=" - "<<=" - "--" - "++" -] @operator - -; Make sure the comma operator is given a highlight group after the comma -; punctuator so the operator is highlighted properly. -(comma_expression - "," @operator) - -[ - (true) - (false) -] @boolean - -(conditional_expression - [ - "?" - ":" - ] @keyword.conditional.ternary) - -(string_literal) @string - -(system_lib_string) @string - -(escape_sequence) @string.escape - -(null) @constant.builtin - -(number_literal) @number - -(char_literal) @character - -(preproc_defined) @function.macro - -(field_designator) @property - -(statement_identifier) @label - -(declaration - type: (type_identifier) @_type - declarator: (identifier) @label - (#eq? @_type "__label__")) - -[ - (type_identifier) - (type_descriptor) -] @type - -(storage_class_specifier) @keyword.modifier - -[ - (type_qualifier) - (gnu_asm_qualifier) - "__extension__" -] @keyword.modifier - -(linkage_specification - "extern" @keyword.modifier) - -(type_definition - declarator: (type_identifier) @type.definition) - -(primitive_type) @type.builtin - -(sized_type_specifier - _ @type.builtin - type: _?) - -((identifier) @constant - (#match? @constant "^[A-Z][A-Z0-9_]+$")) - -(preproc_def - (preproc_arg) @constant - (#match? @constant "^[A-Z][A-Z0-9_]+$")) - -(enumerator - name: (identifier) @constant) - -(case_statement - value: (identifier) @constant) - -((identifier) @constant.builtin - ; format-ignore - (#any-of? @constant.builtin - "stderr" "stdin" "stdout" - "__FILE__" "__LINE__" "__DATE__" "__TIME__" - "__STDC__" "__STDC_VERSION__" "__STDC_HOSTED__" - "__cplusplus" "__OBJC__" "__ASSEMBLER__" - "__BASE_FILE__" "__FILE_NAME__" "__INCLUDE_LEVEL__" - "__TIMESTAMP__" "__clang__" "__clang_major__" - "__clang_minor__" "__clang_patchlevel__" - "__clang_version__" "__clang_literal_encoding__" - "__clang_wide_literal_encoding__" - "__FUNCTION__" "__func__" "__PRETTY_FUNCTION__" - "__VA_ARGS__" "__VA_OPT__")) - -(preproc_def - (preproc_arg) @constant.builtin - ; format-ignore - (#any-of? @constant.builtin - "stderr" "stdin" "stdout" - "__FILE__" "__LINE__" "__DATE__" "__TIME__" - "__STDC__" "__STDC_VERSION__" "__STDC_HOSTED__" - "__cplusplus" "__OBJC__" "__ASSEMBLER__" - "__BASE_FILE__" "__FILE_NAME__" "__INCLUDE_LEVEL__" - "__TIMESTAMP__" "__clang__" "__clang_major__" - "__clang_minor__" "__clang_patchlevel__" - "__clang_version__" "__clang_literal_encoding__" - "__clang_wide_literal_encoding__" - "__FUNCTION__" "__func__" "__PRETTY_FUNCTION__" - "__VA_ARGS__" "__VA_OPT__")) - -(attribute_specifier - (argument_list - (identifier) @variable.builtin)) - -(attribute_specifier - (argument_list - (call_expression - function: (identifier) @variable.builtin))) - -((call_expression - function: (identifier) @function.builtin) - (#match? @function.builtin "^__builtin_")) - -; Preproc def / undef -(preproc_def - name: (_) @constant.macro) - -(preproc_call - directive: (preproc_directive) @_u - argument: (_) @constant.macro - (#eq? @_u "#undef")) - -(preproc_ifdef - name: (identifier) @constant.macro) - -(preproc_elifdef - name: (identifier) @constant.macro) - -(preproc_defined - (identifier) @constant.macro) - -(call_expression - function: (identifier) @function.call) - -(call_expression - function: (field_expression - field: (field_identifier) @function.call)) - -(function_declarator - declarator: (identifier) @function) - -(function_declarator - declarator: (parenthesized_declarator - (pointer_declarator - declarator: (field_identifier) @function))) - -(preproc_function_def - name: (identifier) @function.macro) - -(comment) @comment - -((comment) @comment.documentation - (#match? @comment.documentation "^/[*][*][^*].*[*]/$")) - -; Parameters -(parameter_declaration - declarator: (identifier) @variable.parameter) - -(parameter_declaration - declarator: (array_declarator) @variable.parameter) - -(parameter_declaration - declarator: (pointer_declarator) @variable.parameter) - -; K&R functions -; To enable support for K&R functions, -; add the following lines to your own query config and uncomment them. -; They are commented out as they'll conflict with C++ -; Note that you'll need to have `; extends` at the top of your query file. -; -; (parameter_list (identifier) @variable.parameter) -; -; (function_definition -; declarator: _ -; (declaration -; declarator: (identifier) @variable.parameter)) -; -; (function_definition -; declarator: _ -; (declaration -; declarator: (array_declarator) @variable.parameter)) -; -; (function_definition -; declarator: _ -; (declaration -; declarator: (pointer_declarator) @variable.parameter)) -(preproc_params - (identifier) @variable.parameter) - -[ - "__attribute__" - "__declspec" - "__based" - "__cdecl" - "__clrcall" - "__stdcall" - "__fastcall" - "__thiscall" - "__vectorcall" - (ms_pointer_modifier) - (attribute_declaration) -] @attribute diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/dart/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/dart/highlights.scm @@ -1,212 +0,0 @@ -[ - "import" - "library" - "export" - "as" - "show" - "hide" -] @keyword.import - -[ - (case_builtin) - "late" - "required" - "on" - "extends" - "in" - "is" - "new" - "super" - "with" -] @keyword - -[ - "class" - "enum" - "extension" -] @keyword.type - -"return" @keyword.return - -[ - "deferred" - "factory" - "get" - "implements" - "interface" - "library" - "operator" - "mixin" - "part" - "set" - "typedef" -] @keyword - -[ - "async" - "async*" - "sync*" - "await" - "yield" -] @keyword.coroutine - -[ - (const_builtin) - (final_builtin) - "abstract" - "covariant" - "external" - "static" - "final" - "base" - "sealed" -] @keyword.modifier - -[ - "if" - "else" - "switch" - "default" -] @keyword.conditional - -(conditional_expression - [ - "?" - ":" - ] @keyword.conditional.ternary) - -[ - "try" - "throw" - "catch" - "finally" - (break_statement) -] @keyword.exception - -[ - "do" - "while" - "continue" - "for" -] @keyword.repeat - -(class_definition - name: (identifier) @type) - -(constructor_signature - name: (identifier) @type) - -(scoped_identifier - scope: (identifier) @type) - -(function_signature - name: (identifier) @function.method) - -(getter_signature - (identifier) @function.method) - -(setter_signature - name: (identifier) @function.method) - -(enum_declaration - name: (identifier) @type) - -(enum_constant - name: (identifier) @type) - -(void_type) @type - -(type_identifier) @type - -(type_alias - (type_identifier) @type.definition) - -(type_arguments - [ - "<" - ">" - ] @punctuation.bracket) - -(inferred_type) @keyword - - -(identifier) @variable -(this) @variable.builtin - -(dotted_identifier_list) @string -(string_literal) @string - -[ - (hex_integer_literal) - (decimal_integer_literal) - (decimal_floating_point_literal) -] @number - -(symbol_literal) @string.special.symbol -(string_literal) @string - -(true) @boolean -(false) @boolean - -(null_literal) @constant.builtin - -(comment) @comment -(documentation_comment) @comment.documentation - -(function_expression_body - (identifier) @function.call) - -[ - "=>" - ".." - "??" - "==" - "!" - "?" - "&&" - "%" - "<" - ">" - "=" - ">=" - "<=" - "||" - ">>>=" - ">>=" - "<<=" - "&=" - "|=" - "??=" - "%=" - "+=" - "-=" - "*=" - "/=" - "^=" - "~/=" - (shift_operator) - (multiplicative_operator) - (increment_operator) - (is_operator) - (prefix_operator) - (equality_operator) - (additive_operator) -] @operator - -[ - "(" - ")" - "[" - "]" - "{" - "}" -] @punctuation.bracket - -[ - ";" - "." - "," - ":" - "?." - "?" -] @punctuation.delimiter diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/graphql/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/graphql/highlights.scm @@ -1,92 +0,0 @@ -; Types -(scalar_type_definition (name) @type) -(object_type_definition (name) @type) -(interface_type_definition (name) @type) -(union_type_definition (name) @type) -(enum_type_definition (name) @type) -(input_object_type_definition (name) @type) -(scalar_type_extension (name) @type) -(object_type_extension (name) @type) -(interface_type_extension (name) @type) -(union_type_extension (name) @type) -(enum_type_extension (name) @type) -(input_object_type_extension (name) @type) -(named_type (name) @type) - -; Directives -(directive_definition "@" @attribute (name) @attribute) -(directive) @attribute - -; Properties -(field (name) @property) -(field (alias (name) @property)) -(field_definition (name) @property) -(object_value (object_field (name) @property)) -(enum_value (name) @property) - -; Variable Definitions and Arguments -(operation_definition (name) @variable) -(fragment_name (name) @variable) -(input_fields_definition (input_value_definition (name) @variable.parameter)) -(argument (name) @variable.parameter) -(arguments_definition (input_value_definition (name) @variable.parameter)) -(variable_definition (variable) @variable.parameter) -(argument (value (variable) @variable)) - -; Constants -(string_value) @string -(int_value) @number -(float_value) @number.float -(boolean_value) @boolean - -; Literals -(description (string_value) @string.documentation) -(comment) @comment -(directive_location (executable_directive_location) @type.builtin) -(directive_location (type_system_directive_location) @type.builtin) - -; Keywords -[ - "query" - "mutation" - "subscription" - "fragment" - "scalar" - "input" - "extend" - "directive" - "schema" - "on" - "repeatable" - "implements" -] @keyword - -[ - "enum" - "union" - "type" - "interface" -] @keyword.type - -; Punctuation -[ - "(" - ")" - "[" - "]" - "{" - "}" -] @punctuation.bracket - -"=" @operator - -[ - "|" - "&" - ":" -] @punctuation.delimiter - -[ - "..." - "!" -] @punctuation.special diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/ini/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/ini/highlights.scm @@ -1,16 +0,0 @@ -(section_name - (text) @markup.heading) - -(comment) @comment - -[ - "[" - "]" -] @punctuation.bracket - -"=" @operator - -(setting - (setting_name) @property) - -(setting_value) @string diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/json/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/json/highlights.scm @@ -1,24 +0,0 @@ -[ - (true) - (false) -] @boolean - -(null) @constant.builtin -(number) @number -(pair key: (string) @property) -(pair value: (string) @string) -(array (string) @string) - -[ - "," - ":" -] @punctuation.delimiter - -[ - "[" - "]" - "{" - "}" -] @punctuation.bracket - -(escape_sequence) @string.escape diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/just/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/just/highlights.scm @@ -1,133 +0,0 @@ -[ - "true" - "false" -] @boolean - -[ - "if" - "else" -] @keyword.conditional - -[ - "alias" - "set" - "shell" - "mod" -] @keyword - -[ - "import" - "export" -] @keyword.import - -[ - ":=" - "?" - "==" - "!=" - "=~" - "@" - "=" - "$" - "*" - "+" - "&&" - "@-" - "-@" - "-" - "/" - ":" -] @operator - -[ - "(" - ")" - "[" - "]" - "{{" - "}}" - "{" - "}" -] @punctuation.bracket - -[ - "`" - "```" -] @punctuation.special - -"," @punctuation.delimiter - -(shebang) @keyword.directive - -(comment) @comment - -[ - (string) - (external_command) -] @string - -(escape_sequence) @string.escape - -(module - (identifier) @module) - -(assignment - (identifier) @variable) - -(alias - (identifier) @variable) - -(value - (identifier) @variable) - -; Recipe definitions -(recipe_header - (identifier) @function) - -(dependency - (identifier) @function.call) - -(dependency_expression - (identifier) @function.call) - -(parameter - (identifier) @variable.parameter) - -(dependency_expression - (expression - (value - (identifier) @variable.parameter))) - -; Fallback highlighting for recipe bodies -(recipe - (recipe_body) @string - (#set! priority 90)) - -; Ref: https://just.systems/man/en/chapter_26.html -;(setting (identifier) @error) -(setting - (identifier) @constant.builtin - (#any-of? @constant.builtin - "allow-duplicate-recipes" "dotenv-filename" "dotenv-load" "dotenv-path" "export" "fallback" - "ignore-comments" "positional-arguments" "tempdir" "windows-powershell" "windows-shell")) - -; Ref: https://just.systems/man/en/chapter_32.html -;(recipe (attribute (identifier) @error)) -(recipe - (attribute - (identifier) @attribute) - (#any-of? @attribute - "confirm" "linux" "macos" "no-cd" "no-exit-message" "no-quiet" "private" "unix" "windows")) - -; Ref: https://just.systems/man/en/chapter_31.html -;(function_call (identifier) @error) -(function_call - (identifier) @function.call - (#any-of? @function.call - "arch" "num_cpus" "os" "os_family" "env_var" "env_var_or_default" "env" "invocation_directory" - "invocation_directory_native" "justfile" "justfile_directory" "just_executable" "quote" - "replace" "replace_regex" "trim" "trim_end" "trim_end_match" "trim_end_matches" "trim_start" - "trim_start_match" "trim_start_matches" "capitalize" "kebabcase" "lowercamelcase" "lowercase" - "shoutykebabcase" "shoutysnakecase" "snakecase" "titlecase" "uppercamelcase" "uppercase" - "absolute_path" "extension" "file_name" "file_stem" "parent_directory" "without_extension" - "clean" "join" "path_exists" "error" "sha256" "sha256_file" "uuid" "semver_matches")) diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/make/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/make/highlights.scm @@ -1,170 +0,0 @@ -(comment) @comment - -(conditional - (_ - [ - "ifeq" - "else" - "ifneq" - "ifdef" - "ifndef" - ] @keyword.conditional) - "endif" @keyword.conditional) - -(rule - (targets - (word) @function)) - -(rule - (targets) @_target - (prerequisites - (word) @function - (#eq? @_target ".PHONY"))) - -(rule - (targets - (word) @function.builtin - (#any-of? @function.builtin - ".DEFAULT" ".SUFFIXES" ".DELETE_ON_ERROR" ".EXPORT_ALL_VARIABLES" ".IGNORE" ".INTERMEDIATE" - ".LOW_RESOLUTION_TIME" ".NOTPARALLEL" ".ONESHELL" ".PHONY" ".POSIX" ".PRECIOUS" ".SECONDARY" - ".SECONDEXPANSION" ".SILENT" ".SUFFIXES"))) - -(rule - [ - "&:" - ":" - "::" - "|" - ] @operator) - -[ - "export" - "unexport" -] @keyword.import - -(override_directive - "override" @keyword) - -(include_directive - [ - "include" - "-include" - ] @keyword.import - filenames: (list - (word) @string.special.path)) - -(variable_assignment - name: (word) @string.special.symbol - [ - "?=" - ":=" - "::=" - ; ":::=" - "+=" - "=" - ] @operator) - -(shell_assignment - name: (word) @string.special.symbol - "!=" @operator) - -(define_directive - "define" @keyword - name: (word) @string.special.symbol - [ - "=" - ":=" - "::=" - ; ":::=" - "?=" - "!=" - ]? @operator - "endef" @keyword) - -(variable_assignment - (word) @variable.builtin - (#any-of? @variable.builtin - ".DEFAULT_GOAL" ".EXTRA_PREREQS" ".FEATURES" ".INCLUDE_DIRS" ".RECIPEPREFIX" ".SHELLFLAGS" - ".VARIABLES" "MAKEARGS" "MAKEFILE_LIST" "MAKEFLAGS" "MAKE_RESTARTS" "MAKE_TERMERR" - "MAKE_TERMOUT" "SHELL")) - -; Use string to match bash -(variable_reference - (word) @string) @operator - -(shell_function - [ - "$" - "(" - ")" - ] @operator - "shell" @function.builtin) - -(function_call - [ - "$" - "(" - ")" - ] @operator) - -(substitution_reference - [ - "$" - "(" - ")" - ] @operator) - -(automatic_variable - "$" - _ @character.special - (#set! priority 105)) - -(automatic_variable - [ - "$" - "(" - ")" - ] @operator - (#set! priority 105)) - -(recipe_line - "@" @character.special) - -(function_call - [ - "subst" - "patsubst" - "strip" - "findstring" - "filter" - "filter-out" - "sort" - "word" - "words" - "wordlist" - "firstword" - "lastword" - "dir" - "notdir" - "suffix" - "basename" - "addsuffix" - "addprefix" - "join" - "wildcard" - "realpath" - "abspath" - "error" - "warning" - "info" - "origin" - "flavor" - "foreach" - "if" - "or" - "and" - "call" - "eval" - "file" - "value" - ] @function.builtin) diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/markdown/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/markdown/highlights.scm @@ -1,99 +0,0 @@ -(setext_heading - (paragraph) @markup.heading.1 - (setext_h1_underline) @markup.heading.1) - -(setext_heading - (paragraph) @markup.heading.2 - (setext_h2_underline) @markup.heading.2) - -(atx_heading (atx_h1_marker)) @markup.heading.1 -(atx_heading (atx_h2_marker)) @markup.heading.2 -(atx_heading (atx_h3_marker)) @markup.heading.3 -(atx_heading (atx_h4_marker)) @markup.heading.4 -(atx_heading (atx_h5_marker)) @markup.heading.5 -(atx_heading (atx_h6_marker)) @markup.heading.6 - -(info_string) @label - -(pipe_table_header (pipe_table_cell) @markup.heading) -(pipe_table_header "|" @punctuation.special) -(pipe_table_row "|" @punctuation.special) -(pipe_table_delimiter_row "|" @punctuation.special) -(pipe_table_delimiter_cell) @punctuation.special - -(indented_code_block) @markup.raw.block -(fenced_code_block) @markup.raw.block - -(fenced_code_block - (fenced_code_block_delimiter) @markup.raw.block) - -(fenced_code_block - (info_string - (language) @label)) - -[ - (link_destination) -] @markup.link.url - -[ - (link_title) - (link_label) -] @markup.link.label - -((link_label) - . - ":" @punctuation.delimiter) - -[ - (list_marker_plus) - (list_marker_minus) - (list_marker_star) - (list_marker_dot) - (list_marker_parenthesis) -] @markup.list - -(thematic_break) @punctuation.special - -(task_list_marker_unchecked) @markup.list.unchecked -(task_list_marker_checked) @markup.list.checked - -(block_quote) @markup.quote - -[ - (plus_metadata) - (minus_metadata) -] @keyword.directive - -[ - (block_continuation) - (block_quote_marker) -] @punctuation.special - -(backslash_escape) @string.escape - -; From MDeiml/tree-sitter-markdown -; (code_span) @markup.raw - -; (emphasis) @markup.italic - -; (strong_emphasis) @markup.bold - -; (strikethrough) @markup.strikethrough - -; [ -; (backslash_escape) -; (hard_line_break) -; ] @string.escape - -; [ -; (link_label) -; (link_text) -; (link_title) -; (image_description) -; ] @markup.link.label - -; [ -; (link_destination) -; (uri_autolink) -; (email_autolink) -; ] @markup.link.url diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/plumbing_rules/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/plumbing_rules/highlights.scm @@ -1,16 +0,0 @@ -(comment) @comment - -(variable_declaration - name: (identifier) @constant - value: (variable_value) @string) - -["data" "src" "dst" "wdir" "arg" "attr" "plumb"] @keyword -["matches" "narrows" "set" "from" "is" "isfile" "isdir" "add" "delete" "to" "start"] @function -["="] @punctuation - -(regex) @string.regex -(value_content) @character -(variable_reference) @string.template - -(plumb_to port: (identifier) @number) -(attr_pair attr: (identifier) @boolean) diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/proto/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/proto/highlights.scm @@ -1,79 +0,0 @@ -[ - "extend" - "extensions" - "oneof" - "option" - "reserved" - "syntax" - "to" -] @keyword - -[ - "enum" - "service" - "message" -] @keyword.type - -"rpc" @keyword.function -"returns" @keyword.return - -[ - "optional" - "repeated" - "required" -] @keyword.modifier - -[ - "package" - "import" -] @keyword.import - -[ - (key_type) - (type) - (message_name) - (enum_name) - (service_name) - (rpc_name) - (message_or_enum_type) -] @type - -(enum_field (identifier) @constant) - -(string) @string - -[ - "\"proto3\"" - "\"proto2\"" -] @string.special - -(int_lit) @number -(float_lit) @number.float - -[ - (true) - (false) -] @boolean - -(comment) @comment - -((comment) @comment.documentation - (#match? @comment.documentation "^/[*][*][^*].*[*]/$")) - -[ - "(" - ")" - "[" - "]" - "{" - "}" - "<" - ">" -] @punctuation.bracket - -[ - ";" - "," -] @punctuation.delimiter - -"=" @operator diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/python/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/python/highlights.scm @@ -1,418 +0,0 @@ -; From tree-sitter-python licensed under MIT License -; Copyright (c) 2016 Max Brunsfeld -; Variables -(identifier) @variable - -; Reset highlighting in f-string interpolations -(interpolation) @none - -((identifier) @constant.builtin - (#any-of? @constant.builtin - ; https://docs.python.org/3/library/constants.html - "NotImplemented" "Ellipsis" "quit" "exit" "copyright" "credits" "license")) - -"_" @character.special ; match wildcard - - -((assignment - left: (identifier) @type.definition - (type - (identifier) @_annotation)) - (#eq? @_annotation "TypeAlias")) - -((assignment - left: (identifier) @type.definition - right: (call - function: (identifier) @_func)) - (#any-of? @_func "TypeVar" "NewType")) - -; Function calls -(call - function: (identifier) @function.call) - -(call - function: (attribute - attribute: (identifier) @function.method.call)) - -; Decorators -((decorator - "@" @attribute) - (#set! priority 101)) - -(decorator - (identifier) @attribute) - -(decorator - (attribute - attribute: (identifier) @attribute)) - -(decorator - (call - (identifier) @attribute)) - -(decorator - (call - (attribute - attribute: (identifier) @attribute))) - -((decorator - (identifier) @attribute.builtin) - (#any-of? @attribute.builtin "classmethod" "property" "staticmethod")) - -; Builtin functions -((call - function: (identifier) @function.builtin) - (#any-of? @function.builtin - "abs" "all" "any" "ascii" "bin" "bool" "breakpoint" "bytearray" "bytes" "callable" "chr" - "classmethod" "compile" "complex" "delattr" "dict" "dir" "divmod" "enumerate" "eval" "exec" - "filter" "float" "format" "frozenset" "getattr" "globals" "hasattr" "hash" "help" "hex" "id" - "input" "int" "isinstance" "issubclass" "iter" "len" "list" "locals" "map" "max" "memoryview" - "min" "next" "object" "oct" "open" "ord" "pow" "print" "property" "range" "repr" "reversed" - "round" "set" "setattr" "slice" "sorted" "staticmethod" "str" "sum" "super" "tuple" "type" - "vars" "zip" "__import__")) - -; Function definitions -(function_definition - name: (identifier) @function) - -(type - (identifier) @type) - -(type - (subscript - (identifier) @type)) ; type subscript: Tuple[int] - -((call - function: (identifier) @_isinstance - arguments: (argument_list - (_) - (identifier) @type)) - (#eq? @_isinstance "isinstance")) - -; Normal parameters -(parameters - (identifier) @variable.parameter) - -; Lambda parameters -(lambda_parameters - (identifier) @variable.parameter) - -(lambda_parameters - (tuple_pattern - (identifier) @variable.parameter)) - -; Default parameters -(keyword_argument - name: (identifier) @variable.parameter) - -; Naming parameters on call-site -(default_parameter - name: (identifier) @variable.parameter) - -(typed_parameter - (identifier) @variable.parameter) - -(typed_default_parameter - name: (identifier) @variable.parameter) - -; Variadic parameters *args, **kwargs -(parameters - (list_splat_pattern ; *args - (identifier) @variable.parameter)) - -(parameters - (dictionary_splat_pattern ; **kwargs - (identifier) @variable.parameter)) - -; Typed variadic parameters -(parameters - (typed_parameter - (list_splat_pattern ; *args: type - (identifier) @variable.parameter))) - -(parameters - (typed_parameter - (dictionary_splat_pattern ; *kwargs: type - (identifier) @variable.parameter))) - -; Lambda parameters -(lambda_parameters - (list_splat_pattern - (identifier) @variable.parameter)) - -(lambda_parameters - (dictionary_splat_pattern - (identifier) @variable.parameter)) - -; Literals -(none) @constant.builtin - -[ - (true) - (false) -] @boolean - -((identifier) @variable.builtin - (#eq? @variable.builtin "self")) - -((identifier) @variable.builtin - (#eq? @variable.builtin "cls")) - -(integer) @number - -(float) @number.float - -(comment) @comment - -(string) @string - -[ - (escape_sequence) - (escape_interpolation) -] @string.escape - -; doc-strings -(module - . - (comment)* - . - (expression_statement - (string - (string_content)) @string.documentation)) - -(class_definition - body: (block - . - (expression_statement - (string - (string_content)) @string.documentation))) - -(function_definition - body: (block - . - (expression_statement - (string - (string_content)) @string.documentation))) - -; Tokens -[ - "-" - "-=" - ":=" - "!=" - "*" - "**" - "**=" - "*=" - "/" - "//" - "//=" - "/=" - "&" - "&=" - "%" - "%=" - "^" - "^=" - "+" - "+=" - "<" - "<<" - "<<=" - "<=" - "<>" - "=" - "==" - ">" - ">=" - ">>" - ">>=" - "@" - "@=" - "|" - "|=" - "~" - "->" -] @operator - -; Keywords -[ - "and" - "in" - "is" - "not" - "or" - "is not" - "not in" - "del" -] @keyword.operator - -[ - "def" - "lambda" -] @keyword.function - -[ - "assert" - "exec" - "global" - "nonlocal" - "pass" - "print" - "with" - "as" -] @keyword - -[ - "type" - "class" -] @keyword.type - -[ - "async" - "await" -] @keyword.coroutine - -[ - "return" - "yield" -] @keyword.return - -(yield - "from" @keyword.return) - -(future_import_statement - "from" @keyword.import - "__future__" @module.builtin) - -(import_from_statement - "from" @keyword.import) - -"import" @keyword.import - -(aliased_import - "as" @keyword.import) - -(wildcard_import - "*" @character.special) - -(import_statement - name: (dotted_name - (identifier) @module)) - -(import_statement - name: (aliased_import - name: (dotted_name - (identifier) @module) - alias: (identifier) @module)) - -(import_from_statement - module_name: (dotted_name - (identifier) @module)) - -(import_from_statement - module_name: (relative_import - (dotted_name - (identifier) @module))) - -[ - "if" - "elif" - "else" - "match" - "case" -] @keyword.conditional - -[ - "for" - "while" - "break" - "continue" -] @keyword.repeat - -[ - "try" - "except" - "except*" - "raise" - "finally" -] @keyword.exception - -(raise_statement - "from" @keyword.exception) - -(try_statement - (else_clause - "else" @keyword.exception)) - -[ - "(" - ")" - "[" - "]" - "{" - "}" -] @punctuation.bracket - -(interpolation - "{" @punctuation.special - "}" @punctuation.special) - -(type_conversion) @function.macro - -[ - "," - "." - ":" - ";" - (ellipsis) -] @punctuation.delimiter - -; Class definitions -(class_definition - name: (identifier) @type) - -(class_definition - body: (block - (function_definition - name: (identifier) @function.method))) - -(class_definition - superclasses: (argument_list - (identifier) @type)) - -((class_definition - (block - (function_definition - name: (identifier) @constructor))) - (#any-of? @constructor "__new__" "__init__")) - -((identifier) @type.builtin - (#any-of? @type.builtin - ; https://docs.python.org/3/library/exceptions.html - "BaseException" "Exception" "ArithmeticError" "BufferError" "LookupError" "AssertionError" - "AttributeError" "EOFError" "FloatingPointError" "GeneratorExit" "ImportError" - "ModuleNotFoundError" "IndexError" "KeyError" "KeyboardInterrupt" "MemoryError" "NameError" - "NotImplementedError" "OSError" "OverflowError" "RecursionError" "ReferenceError" "RuntimeError" - "StopIteration" "StopAsyncIteration" "SyntaxError" "IndentationError" "TabError" "SystemError" - "SystemExit" "TypeError" "UnboundLocalError" "UnicodeError" "UnicodeEncodeError" - "UnicodeDecodeError" "UnicodeTranslateError" "ValueError" "ZeroDivisionError" "EnvironmentError" - "IOError" "WindowsError" "BlockingIOError" "ChildProcessError" "ConnectionError" - "BrokenPipeError" "ConnectionAbortedError" "ConnectionRefusedError" "ConnectionResetError" - "FileExistsError" "FileNotFoundError" "InterruptedError" "IsADirectoryError" - "NotADirectoryError" "PermissionError" "ProcessLookupError" "TimeoutError" "Warning" - "UserWarning" "DeprecationWarning" "PendingDeprecationWarning" "SyntaxWarning" "RuntimeWarning" - "FutureWarning" "ImportWarning" "UnicodeWarning" "BytesWarning" "ResourceWarning" - ; https://docs.python.org/3/library/stdtypes.html - "bool" "int" "float" "complex" "list" "tuple" "range" "str" "bytes" "bytearray" "memoryview" - "set" "frozenset" "dict" "type" "object")) - -; Regex from the `re` module -(call - function: (attribute - object: (identifier) @_re) - arguments: (argument_list - . - (string - (string_content) @string.regexp)) - (#eq? @_re "re")) diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/r/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/r/highlights.scm @@ -1,143 +0,0 @@ -; Literals -(integer) @number - -(float) @number.float - -(complex) @number - -(string) @string - -(string - (string_content - (escape_sequence) @string.escape)) - -; Comments -(comment) @comment - -; Operators -[ - "?" - ":=" - "=" - "<-" - "<<-" - "->" - "->>" - "~" - "|>" - "||" - "|" - "&&" - "&" - "<" - "<=" - ">" - ">=" - "==" - "!=" - "+" - "-" - "*" - "/" - "::" - ":::" - "**" - "^" - "$" - "@" - ":" - "!" - "special" -] @operator - -; Punctuation -[ - "(" - ")" - "{" - "}" - "[" - "]" - "[[" - "]]" -] @punctuation.bracket - -(comma) @punctuation.delimiter - -; Variables -(identifier) @variable - -; Functions -(binary_operator - lhs: (identifier) @function - operator: "<-" - rhs: (function_definition)) - -(binary_operator - lhs: (identifier) @function - operator: "=" - rhs: (function_definition)) - -; Calls -(call - function: (identifier) @function.call) - -(extract_operator - rhs: (identifier) @variable.member) - -function: (extract_operator - rhs: (identifier) @function.method.call) - -; Parameters -(parameters - (parameter - name: (identifier) @variable.parameter)) - -(arguments - (argument - name: (identifier) @variable.parameter)) - -; Namespace -(namespace_operator - lhs: (identifier) @module) - -(call - function: (namespace_operator - rhs: (identifier) @function)) - -; Keywords -(function_definition - name: "function" @keyword.function) - -(function_definition - name: "\\" @operator) - -(return) @keyword.return - -[ - "if" - "else" -] @keyword.conditional - -[ - "while" - "repeat" - "for" - "in" - (break) - (next) -] @keyword.repeat - -[ - (true) - (false) -] @boolean - -[ - (null) - (inf) - (nan) - (na) - (dots) - (dot_dot_i) -] @constant.builtin diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/rust/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/rust/highlights.scm @@ -1,161 +0,0 @@ -; Identifiers - -(type_identifier) @type -(primitive_type) @type.builtin -(field_identifier) @property - -; Identifier conventions - -; Assume all-caps names are constants -((identifier) @constant - (#match? @constant "^[A-Z][A-Z\\d_]+$'")) - -; Assume uppercase names are enum constructors -((identifier) @constructor - (#match? @constructor "^[A-Z]")) - -; Assume that uppercase names in paths are types -((scoped_identifier - path: (identifier) @type) - (#match? @type "^[A-Z]")) -((scoped_identifier - path: (scoped_identifier - name: (identifier) @type)) - (#match? @type "^[A-Z]")) -((scoped_type_identifier - path: (identifier) @type) - (#match? @type "^[A-Z]")) -((scoped_type_identifier - path: (scoped_identifier - name: (identifier) @type)) - (#match? @type "^[A-Z]")) - -; Assume all qualified names in struct patterns are enum constructors. (They're -; either that, or struct names; highlighting both as constructors seems to be -; the less glaring choice of error, visually.) -(struct_pattern - type: (scoped_type_identifier - name: (type_identifier) @constructor)) - -; Function calls - -(call_expression - function: (identifier) @function) -(call_expression - function: (field_expression - field: (field_identifier) @function.method)) -(call_expression - function: (scoped_identifier - "::" - name: (identifier) @function)) - -(generic_function - function: (identifier) @function) -(generic_function - function: (scoped_identifier - name: (identifier) @function)) -(generic_function - function: (field_expression - field: (field_identifier) @function.method)) - -(macro_invocation - macro: (identifier) @function.macro - "!" @function.macro) - -; Function definitions - -(function_item (identifier) @function) -(function_signature_item (identifier) @function) - -(line_comment) @comment -(block_comment) @comment - -(line_comment (doc_comment)) @comment.documentation -(block_comment (doc_comment)) @comment.documentation - -"(" @punctuation.bracket -")" @punctuation.bracket -"[" @punctuation.bracket -"]" @punctuation.bracket -"{" @punctuation.bracket -"}" @punctuation.bracket - -(type_arguments - "<" @punctuation.bracket - ">" @punctuation.bracket) -(type_parameters - "<" @punctuation.bracket - ">" @punctuation.bracket) - -"::" @punctuation.delimiter -":" @punctuation.delimiter -"." @punctuation.delimiter -"," @punctuation.delimiter -";" @punctuation.delimiter - -(parameter (identifier) @variable.parameter) - -(lifetime (identifier) @label) - -"as" @keyword -"async" @keyword -"await" @keyword -"break" @keyword -"const" @keyword -"continue" @keyword -"default" @keyword -"dyn" @keyword -"else" @keyword -"enum" @keyword -"extern" @keyword -"fn" @keyword -"for" @keyword -"gen" @keyword -"if" @keyword -"impl" @keyword -"in" @keyword -"let" @keyword -"loop" @keyword -"macro_rules!" @keyword -"match" @keyword -"mod" @keyword -"move" @keyword -"pub" @keyword -"raw" @keyword -"ref" @keyword -"return" @keyword -"static" @keyword -"struct" @keyword -"trait" @keyword -"type" @keyword -"union" @keyword -"unsafe" @keyword -"use" @keyword -"where" @keyword -"while" @keyword -"yield" @keyword -(crate) @keyword -(mutable_specifier) @keyword -(use_list (self) @keyword) -(scoped_use_list (self) @keyword) -(scoped_identifier (self) @keyword) -(super) @keyword - -(self) @variable.builtin - -(char_literal) @string -(string_literal) @string -(raw_string_literal) @string - -(boolean_literal) @constant.builtin -(integer_literal) @constant.builtin -(float_literal) @constant.builtin - -(escape_sequence) @escape - -(attribute_item) @attribute -(inner_attribute_item) @attribute - -"*" @operator -"&" @operator -"'" @operator diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/rust/injections.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/rust/injections.scm @@ -1,9 +0,0 @@ -((macro_invocation - (token_tree) @injection.content) - (#set! injection.language "rust") - (#set! injection.include-children)) - -((macro_rule - (token_tree) @injection.content) - (#set! injection.language "rust") - (#set! injection.include-children)) diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/rust/tags.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/rust/tags.scm @@ -1,60 +0,0 @@ -; ADT definitions - -(struct_item - name: (type_identifier) @name) @definition.class - -(enum_item - name: (type_identifier) @name) @definition.class - -(union_item - name: (type_identifier) @name) @definition.class - -; type aliases - -(type_item - name: (type_identifier) @name) @definition.class - -; method definitions - -(declaration_list - (function_item - name: (identifier) @name) @definition.method) - -; function definitions - -(function_item - name: (identifier) @name) @definition.function - -; trait definitions -(trait_item - name: (type_identifier) @name) @definition.interface - -; module definitions -(mod_item - name: (identifier) @name) @definition.module - -; macro definitions - -(macro_definition - name: (identifier) @name) @definition.macro - -; references - -(call_expression - function: (identifier) @name) @reference.call - -(call_expression - function: (field_expression - field: (field_identifier) @name)) @reference.call - -(macro_invocation - macro: (identifier) @name) @reference.call - -; implementations - -(impl_item - trait: (type_identifier) @name) @reference.implementation - -(impl_item - type: (type_identifier) @name - !trait) @reference.implementation diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/scheme/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/scheme/highlights.scm @@ -1,22 +0,0 @@ -; A highlight query can override the highlights queries before it. -; So the order is important. -; We should highlight general rules, then highlight special forms. -(number) @number -(character) @character -(boolean) @boolean -(string) @string -(symbol) @variable - -[ - (comment) - (block_comment) -] @comment - -[ - "(" - ")" - "[" - "]" - "{" - "}" -] @punctuation diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/sql/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/sql/highlights.scm @@ -1,338 +0,0 @@ -(literal) @string -(comment) @comment - -[ - (keyword_true) - (keyword_false) -] @boolean - -[ - (keyword_asc) - (keyword_desc) - (keyword_terminated) - (keyword_escaped) - (keyword_unsigned) - (keyword_nulls) - (keyword_last) - (keyword_delimited) - (keyword_replication) - (keyword_auto_increment) - (keyword_default) - (keyword_collate) - (keyword_concurrently) - (keyword_engine) - (keyword_always) - (keyword_generated) - (keyword_preceding) - (keyword_following) - (keyword_first) - (keyword_current_timestamp) - (keyword_immutable) - (keyword_atomic) - (keyword_parallel) - (keyword_leakproof) - (keyword_safe) - (keyword_cost) - (keyword_strict) -] @keyword - -[ - (keyword_case) - (keyword_when) - (keyword_then) - (keyword_else) -] @keyword.conditional - -[ - (keyword_select) - (keyword_from) - (keyword_where) - (keyword_index) - (keyword_join) - (keyword_primary) - (keyword_delete) - (keyword_create) - (keyword_insert) - (keyword_merge) - (keyword_distinct) - (keyword_replace) - (keyword_update) - (keyword_into) - (keyword_overwrite) - (keyword_matched) - (keyword_values) - (keyword_value) - (keyword_attribute) - (keyword_set) - (keyword_left) - (keyword_right) - (keyword_outer) - (keyword_inner) - (keyword_full) - (keyword_order) - (keyword_partition) - (keyword_group) - (keyword_with) - (keyword_without) - (keyword_as) - (keyword_having) - (keyword_limit) - (keyword_offset) - (keyword_table) - (keyword_tables) - (keyword_key) - (keyword_references) - (keyword_foreign) - (keyword_constraint) - (keyword_force) - (keyword_use) - (keyword_for) - (keyword_if) - (keyword_exists) - (keyword_column) - (keyword_columns) - (keyword_cross) - (keyword_lateral) - (keyword_natural) - (keyword_alter) - (keyword_drop) - (keyword_add) - (keyword_view) - (keyword_end) - (keyword_is) - (keyword_using) - (keyword_between) - (keyword_window) - (keyword_no) - (keyword_data) - (keyword_type) - (keyword_rename) - (keyword_to) - (keyword_schema) - (keyword_owner) - (keyword_authorization) - (keyword_all) - (keyword_any) - (keyword_some) - (keyword_returning) - (keyword_begin) - (keyword_commit) - (keyword_rollback) - (keyword_transaction) - (keyword_only) - (keyword_like) - (keyword_similar) - (keyword_over) - (keyword_change) - (keyword_modify) - (keyword_after) - (keyword_before) - (keyword_range) - (keyword_rows) - (keyword_groups) - (keyword_exclude) - (keyword_current) - (keyword_ties) - (keyword_others) - (keyword_zerofill) - (keyword_format) - (keyword_fields) - (keyword_row) - (keyword_sort) - (keyword_compute) - (keyword_comment) - (keyword_location) - (keyword_cached) - (keyword_uncached) - (keyword_lines) - (keyword_stored) - (keyword_virtual) - (keyword_partitioned) - (keyword_analyze) - (keyword_explain) - (keyword_verbose) - (keyword_truncate) - (keyword_rewrite) - (keyword_optimize) - (keyword_vacuum) - (keyword_cache) - (keyword_language) - (keyword_called) - (keyword_conflict) - (keyword_declare) - (keyword_filter) - (keyword_function) - (keyword_input) - (keyword_name) - (keyword_oid) - (keyword_oids) - (keyword_precision) - (keyword_regclass) - (keyword_regnamespace) - (keyword_regproc) - (keyword_regtype) - (keyword_restricted) - (keyword_return) - (keyword_returns) - (keyword_separator) - (keyword_setof) - (keyword_stable) - (keyword_support) - (keyword_tblproperties) - (keyword_trigger) - (keyword_unsafe) - (keyword_admin) - (keyword_connection) - (keyword_cycle) - (keyword_database) - (keyword_encrypted) - (keyword_increment) - (keyword_logged) - (keyword_none) - (keyword_owned) - (keyword_password) - (keyword_reset) - (keyword_role) - (keyword_sequence) - (keyword_start) - (keyword_restart) - (keyword_tablespace) - (keyword_until) - (keyword_user) - (keyword_valid) - (keyword_action) - (keyword_definer) - (keyword_invoker) - (keyword_security) - (keyword_extension) - (keyword_version) - (keyword_out) - (keyword_inout) - (keyword_variadic) - (keyword_session) - (keyword_isolation) - (keyword_level) - (keyword_serializable) - (keyword_repeatable) - (keyword_read) - (keyword_write) - (keyword_committed) - (keyword_uncommitted) - (keyword_deferrable) - (keyword_names) - (keyword_zone) - (keyword_immediate) - (keyword_deferred) - (keyword_constraints) - (keyword_snapshot) - (keyword_characteristics) - (keyword_off) - (keyword_follows) - (keyword_precedes) - (keyword_each) - (keyword_instead) - (keyword_of) - (keyword_initially) - (keyword_old) - (keyword_new) - (keyword_referencing) - (keyword_statement) - (keyword_execute) - (keyword_procedure) -] @keyword - -[ - (keyword_int) - (keyword_null) - (keyword_boolean) - (keyword_binary) - (keyword_varbinary) - (keyword_image) - (keyword_bit) - (keyword_inet) - (keyword_character) - (keyword_smallserial) - (keyword_serial) - (keyword_bigserial) - (keyword_smallint) - (keyword_mediumint) - (keyword_bigint) - (keyword_tinyint) - (keyword_decimal) - (keyword_float) - (keyword_double) - (keyword_numeric) - (keyword_real) - (double) - (keyword_money) - (keyword_smallmoney) - (keyword_char) - (keyword_nchar) - (keyword_varchar) - (keyword_nvarchar) - (keyword_varying) - (keyword_text) - (keyword_string) - (keyword_uuid) - (keyword_json) - (keyword_jsonb) - (keyword_xml) - (keyword_bytea) - (keyword_enum) - (keyword_date) - (keyword_datetime) - (keyword_time) - (keyword_datetime2) - (keyword_datetimeoffset) - (keyword_smalldatetime) - (keyword_timestamp) - (keyword_timestamptz) - (keyword_geometry) - (keyword_geography) - (keyword_box2d) - (keyword_box3d) - (keyword_interval) -] @type.builtin - -[ - (keyword_in) - (keyword_and) - (keyword_or) - (keyword_not) - (keyword_by) - (keyword_on) - (keyword_do) - (keyword_union) - (keyword_except) - (keyword_intersect) -] @operator - -[ - "+" - "-" - "*" - "/" - "%" - "^" - ":=" - "=" - "<" - "<=" - "!=" - ">=" - ">" - "<>" - (op_other) - (op_unary_other) -] @operator - -[ - "(" - ")" -] @punctuation.bracket - -[ - ";" - "," - "." -] @punctuation.delimiter diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/swift/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/swift/highlights.scm @@ -1,347 +0,0 @@ -[ - "." - ";" - ":" - "," -] @punctuation.delimiter - -[ - "(" - ")" - "[" - "]" - "{" - "}" -] @punctuation.bracket - -; Identifiers -(type_identifier) @type - -[ - (self_expression) - (super_expression) -] @variable.builtin - -; Declarations -[ - "func" - "deinit" -] @keyword.function - -[ - (visibility_modifier) - (member_modifier) - (function_modifier) - (property_modifier) - (parameter_modifier) - (inheritance_modifier) - (mutation_modifier) -] @keyword.modifier - -(simple_identifier) @variable - -(function_declaration - (simple_identifier) @function.method) - -(protocol_function_declaration - name: (simple_identifier) @function.method) - -(init_declaration - "init" @constructor) - -(parameter - external_name: (simple_identifier) @variable.parameter) - -(parameter - name: (simple_identifier) @variable.parameter) - -(type_parameter - (type_identifier) @variable.parameter) - -(inheritance_constraint - (identifier - (simple_identifier) @variable.parameter)) - -(equality_constraint - (identifier - (simple_identifier) @variable.parameter)) - -[ - "protocol" - "extension" - "indirect" - "nonisolated" - "override" - "convenience" - "required" - "some" - "any" - "weak" - "unowned" - "didSet" - "willSet" - "subscript" - "let" - "var" - (throws) - (where_keyword) - (getter_specifier) - (setter_specifier) - (modify_specifier) - (else) - (as_operator) -] @keyword - -[ - "enum" - "struct" - "class" - "typealias" -] @keyword.type - -[ - "async" - "await" -] @keyword.coroutine - -(shebang_line) @keyword.directive - -(class_body - (property_declaration - (pattern - (simple_identifier) @variable.member))) - -(protocol_property_declaration - (pattern - (simple_identifier) @variable.member)) - -(navigation_expression - (navigation_suffix - (simple_identifier) @variable.member)) - -(value_argument - name: (value_argument_label - (simple_identifier) @variable.member)) - -(import_declaration - "import" @keyword.import) - -(enum_entry - "case" @keyword) - -(modifiers - (attribute - "@" @attribute - (user_type - (type_identifier) @attribute))) - -; Function calls -(call_expression - (simple_identifier) @function.call) ; foo() - -(call_expression - ; foo.bar.baz(): highlight the baz() - (navigation_expression - (navigation_suffix - (simple_identifier) @function.call))) - -(call_expression - (prefix_expression - (simple_identifier) @function.call)) ; .foo() - -((navigation_expression - (simple_identifier) @type) ; SomeType.method(): highlight SomeType as a type - (#match? @type "^[A-Z]")) - -(directive) @keyword.directive - -; See https://docs.swift.org/swift-book/documentation/the-swift-programming-language/lexicalstructure/#Keywords-and-Punctuation -[ - (diagnostic) - "#available" - "#unavailable" - "#fileLiteral" - "#colorLiteral" - "#imageLiteral" - "#keyPath" - "#selector" - "#externalMacro" -] @function.macro - -[ - "#column" - "#dsohandle" - "#fileID" - "#filePath" - "#file" - "#function" - "#line" -] @constant.macro - -; Statements -(for_statement - "for" @keyword.repeat) - -(for_statement - "in" @keyword.repeat) - -[ - "while" - "repeat" - "continue" - "break" -] @keyword.repeat - -(guard_statement - "guard" @keyword.conditional) - -(if_statement - "if" @keyword.conditional) - -(switch_statement - "switch" @keyword.conditional) - -(switch_entry - "case" @keyword) - -(switch_entry - "fallthrough" @keyword) - -(switch_entry - (default_keyword) @keyword) - -"return" @keyword.return - -(ternary_expression - [ - "?" - ":" - ] @keyword.conditional.ternary) - -[ - (try_operator) - "do" - (throw_keyword) - (catch_keyword) -] @keyword.exception - -(statement_label) @label - -; Comments -[ - (comment) - (multiline_comment) -] @comment - -((comment) @comment.documentation - (#match? @comment.documentation "^///[^/]")) - -((comment) @comment.documentation - (#match? @comment.documentation "^///$")) - -((multiline_comment) @comment.documentation - (#match? @comment.documentation "^/[*][*][^*].*[*]/$")) - -; String literals -(line_str_text) @string - -(str_escaped_char) @string.escape - -(multi_line_str_text) @string - -(raw_str_part) @string - -(raw_str_end_part) @string - -(line_string_literal - [ - "\\(" - ")" - ] @punctuation.special) - -(multi_line_string_literal - [ - "\\(" - ")" - ] @punctuation.special) - -(raw_str_interpolation - [ - (raw_str_interpolation_start) - ")" - ] @punctuation.special) - -[ - "\"" - "\"\"\"" -] @string - -; Lambda literals -(lambda_literal - "in" @keyword.operator) - -; Basic literals -[ - (integer_literal) - (hex_literal) - (oct_literal) - (bin_literal) -] @number - -(real_literal) @number.float - -(boolean_literal) @boolean - -"nil" @constant.builtin - -(wildcard_pattern) @character.special - -; Regex literals -(regex_literal) @string.regexp - -; Operators -(custom_operator) @operator - -[ - "+" - "-" - "*" - "/" - "%" - "=" - "+=" - "-=" - "*=" - "/=" - "<" - ">" - "<<" - ">>" - "<=" - ">=" - "++" - "--" - "^" - "&" - "&&" - "|" - "||" - "~" - "%=" - "!=" - "!==" - "==" - "===" - "?" - "??" - "->" - "..<" - "..." - (bang) -] @operator - -(type_arguments - [ - "<" - ">" - ] @punctuation.bracket) diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/toml/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/toml/highlights.scm @@ -1,31 +0,0 @@ -(bare_key) @variable -(boolean) @boolean -(comment) @comment -(integer) @number -(float) @number - -[ - (string) - (quoted_key) - (escape_sequence) -] @string - -[ - (local_date) - (local_date_time) - (local_time) - (offset_date_time) -] @character - -"=" @operator - -[ - "." - "," - "[" - "]" - "[[" - "]]" - "{" - "}" -] @punctuation diff --git a/modules/mixins/dotfiles/home/ad/tree-sitter/queries/yaml/highlights.scm b/modules/mixins/dotfiles/home/ad/tree-sitter/queries/yaml/highlights.scm @@ -1,75 +0,0 @@ -(boolean_scalar) @boolean -(null_scalar) @constant.builtin -(double_quote_scalar) @string -(single_quote_scalar) @string - -((block_scalar) @string - (#set! priority 99)) - -(string_scalar) @string -(escape_sequence) @string.escape -(integer_scalar) @number -(float_scalar) @number -(comment) @comment - -[ - (anchor_name) - (alias_name) -] @label - -(tag) @type - -[ - (yaml_directive) - (tag_directive) - (reserved_directive) -] @keyword.directive - -(block_mapping_pair - key: (flow_node - [ - (double_quote_scalar) - (single_quote_scalar) - ] @property)) - -(block_mapping_pair - key: (flow_node - (plain_scalar - (string_scalar) @property))) - -(flow_mapping - (_ - key: (flow_node - [ - (double_quote_scalar) - (single_quote_scalar) - ] @property))) - -(flow_mapping - (_ - key: (flow_node - (plain_scalar - (string_scalar) @property)))) - -[ - "," - "-" - ":" - ">" - "?" - "|" -] @punctuation.delimiter - -[ - "[" - "]" - "{" - "}" -] @punctuation.bracket - -[ - "*" - "&" - "---" - "..." -] @punctuation.special