[ESS] ess, noweb and polymode
Laurent ESS
|@urente@@ @end|ng |rom |ree@|r
Fri Nov 17 19:43:38 CET 2023
Hi Tyler,
Thank you for the idea, even if I would like to recover the
ess-noweb-goto-chunk.
I installed swiper, ivy and put the following lines in my .emacs.el:
(defun my-list-chunks()
(interactive)
(swiper "<<"))
(define-key polymode-map "g" #'my-list-chunks)
When I do M-n g I have the message:
my-list-chunks: Symbol’s function definition is void: swiper
On 15/11/2023 21:13, Tyler Smith via ESS-help wrote:
> Hi Laurent,
>
> I haven't used `ess-goto-chunk` before, but it sounds quite useful. I think you could get something similar with the `swiper` package. You can install `swiper` via `package-list-packages. It requires the `ivy` package, which should get installed automatically when you install `swiper`.
>
> Then you can define your own custom 'swipe'. For Rmd chunks, something like this:
>
> ```
> (defun my-list-chunks ()
> (interactive)
> (swiper "```{"))
>
> (define-key polymode-map "g" #'my-list-chunks)
> ```
>
> By default, `polymode-map` is bound to `M-n`, so this will call `my-list-chunks` when you hit `M-n g`.
>
> This displays all the matches in the minibuffer, and you can scroll through them with `C-n` and `C-p`, and hitting `enter` will take you to that chunk header. In my tests, there's something wrong with the text colours, but I don't have time to debug just now.
>
> Best,
>
> Tyler
>
More information about the ESS-help
mailing list