diff --git a/after/queries/bash/textobjects.scm b/after/queries/bash/textobjects.scm new file mode 100644 index 0000000..f96dc04 --- /dev/null +++ b/after/queries/bash/textobjects.scm @@ -0,0 +1,5 @@ +; extends +( + (comment) @codechunk.inner + (#eq? @codechunk.inner "#%%") +) diff --git a/after/queries/markdown/textobjects.scm b/after/queries/markdown/textobjects.scm new file mode 100644 index 0000000..3cf6cce --- /dev/null +++ b/after/queries/markdown/textobjects.scm @@ -0,0 +1,4 @@ +; extends +(code_fence_content) @codechunk.inner + +(fenced_code_block) @codechunk.outer diff --git a/after/queries/python/textobjects.scm b/after/queries/python/textobjects.scm new file mode 100644 index 0000000..f96dc04 --- /dev/null +++ b/after/queries/python/textobjects.scm @@ -0,0 +1,5 @@ +; extends +( + (comment) @codechunk.inner + (#eq? @codechunk.inner "#%%") +) diff --git a/after/queries/r/textobjects.scm b/after/queries/r/textobjects.scm new file mode 100644 index 0000000..f96dc04 --- /dev/null +++ b/after/queries/r/textobjects.scm @@ -0,0 +1,5 @@ +; extends +( + (comment) @codechunk.inner + (#eq? @codechunk.inner "#%%") +) diff --git a/examples/example.qmd b/examples/example.qmd index f79fbf8..60a3a66 100644 --- a/examples/example.qmd +++ b/examples/example.qmd @@ -12,19 +12,23 @@ def hello(): print("Hello") ``` +```bash +git clone +``` + This is how we call it: ```{python} hello() ``` -```{haskell} +```haskell xs = [x | x <- [1..10]] ``` We can press `gd` to go to its definition. -Let's demonstrate the autompletion: +Let's demonstrate the autocompletion: ```{python} import numpy as np @@ -54,4 +58,3 @@ hello_from_r() library(tidyverse) ``` - diff --git a/queries/bash/textobjects.scm b/queries/bash/textobjects.scm new file mode 100644 index 0000000..f5c9881 --- /dev/null +++ b/queries/bash/textobjects.scm @@ -0,0 +1,4 @@ +( + (comment) @codechunk + (#eq? @codechunk "#%%") +) diff --git a/queries/markdown/textobjects.scm b/queries/markdown/textobjects.scm new file mode 100644 index 0000000..0050f64 --- /dev/null +++ b/queries/markdown/textobjects.scm @@ -0,0 +1,2 @@ +(code_fence_content) @codechunk +(fenced_code_block) @codechunk.outer diff --git a/queries/python/textobjects.scm b/queries/python/textobjects.scm new file mode 100644 index 0000000..f5c9881 --- /dev/null +++ b/queries/python/textobjects.scm @@ -0,0 +1,4 @@ +( + (comment) @codechunk + (#eq? @codechunk "#%%") +) diff --git a/queries/r/textobjects.scm b/queries/r/textobjects.scm new file mode 100644 index 0000000..f5c9881 --- /dev/null +++ b/queries/r/textobjects.scm @@ -0,0 +1,4 @@ +( + (comment) @codechunk + (#eq? @codechunk "#%%") +)