{"id":13961844,"url":"https://github.com/otherjoel/vim-pollen","last_synced_at":"2025-04-21T07:32:45.719Z","repository":{"id":87472277,"uuid":"115215644","full_name":"otherjoel/vim-pollen","owner":"otherjoel","description":"⌨️🌼 Syntax highlighting for Pollen (a Racket language)","archived":false,"fork":false,"pushed_at":"2020-01-18T18:45:58.000Z","size":130,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-09T17:30:38.491Z","etag":null,"topics":["pollen","racket","vim"],"latest_commit_sha":null,"homepage":"","language":"Vim script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/otherjoel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-12-23T18:56:47.000Z","updated_at":"2023-07-12T06:12:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b6fc575-efca-47cf-a644-4c37e58bb03b","html_url":"https://github.com/otherjoel/vim-pollen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otherjoel%2Fvim-pollen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otherjoel%2Fvim-pollen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otherjoel%2Fvim-pollen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otherjoel%2Fvim-pollen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otherjoel","download_url":"https://codeload.github.com/otherjoel/vim-pollen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250014785,"owners_count":21361009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pollen","racket","vim"],"created_at":"2024-08-08T17:01:31.832Z","updated_at":"2025-04-21T07:32:45.470Z","avatar_url":"https://github.com/otherjoel.png","language":"Vim script","funding_links":[],"categories":["Vim script"],"sub_categories":[],"readme":"# vim-pollen\n\n![Example highlighting](example1.png)\n\nSyntax highlighting for [Pollen](http://docs.racket-lang.org/pollen/), a Racket language by Matthew Butterick for making books.\n\nSupports:\n\n * Highlighting `#lang pollen` and `#lang pollen/mode \u003creader\u003e`\n * Spell checking (when enabled separately): will only spell check the non-code regions\n * Full highlighting of Racket and Pollen functions/keywords\n * Nested Racket `◊(tag …)` and Pollen `◊tag{…}` forms\n * Variables: `◊foo` or `◊|foo|`\n * String literals: `◊\"text\"` (can be used for `◊\"◊\"`)\n * Single-line `◊; …` and multiline `◊;{ … }` comments\n\nOverall I have kept this plugin very simple, with no fancy tricks and no treatment for special edge-cases. It supplies syntax highlighting only: no indentation or special macros.\n\n## Installation\n\nAs Pollen is a Racket language, this plugin depends quite a bit on [`vim-racket`](https://github.com/wlangstroth/vim-racket) for correct syntax highlighting. Install that first. \n\nThe most basic way to install _this_ plugin is to save the `syntax/pollen.vim` file into your `~/.vim/syntax` folder.\n\nIf you use [pathogen.vim](https://github.com/tpope/vim-pathogen), do it this way:\n\n    cd ~/.vim/bundle\n    git clone https://github.com/otherjoel/vim-pollen.git\n\nOr, if you prefer submodules:\n\n    cd ~/.vim\n    git submodule add https://github.com/otherjoel/vim-pollen.git bundle/vim-pollen\n\n## Use\n\nTo turn on Pollen syntax highlighting manually, do `:set filetype=pollen`.\n\nTo turn it on automatically for Pollen’s default file extensions, add these lines to your `.vimrc`:\n    \n    \" Create an augroup if you don’t already have one\n    augroup configgroup\n        autocmd!\n        \n        \"Set Pollen syntax for files with these extensions:\n        au! BufRead,BufNewFile *.pm set filetype=pollen\n        au! BufRead,BufNewFile *.pp set filetype=pollen\n        au! BufRead,BufNewFile *.ptree set filetype=pollen\n        \n        \" Suggested editor settings:\n        autocmd FileType pollen setlocal wrap      \" Soft wrap (don't affect buffer)\n        autocmd FileType pollen setlocal linebreak \" Wrap on word-breaks only\n    augroup END\n    \nFor now, this plugin doesn’t come with any automatic file-typing; you need to know how to turn Pollen syntax on in a way that fits with your workflow. This is for a few reasons:\n\n* Pollen doesn’t have its own set of file extensions, strictly speaking.\n* Any Racket module can use `#lang pollen` or one of its variants.\n* Some of Pollen’s default file extensions (`.p` and `.pm`) are also used by Python and Perl.\n\nIf you use Pollen Markdown files (`.pmd`) it might be more appropriate to use Markdown highlighting for those.\n\n### Potential conflicts with other plugins\n\n_(NB: What follows is hard-won knowledge about the solution to a potentially very strange problem)_\n\nIf you use the `vim-pencil` plugin and have it “turned on” for Pollen files, it will break parts of Pollen syntax highlighting because it changes the `iskeyword` setting (the set of characters that Vim considers to be part of a keyword).\n\nThe same holds true for any other plugin that changes the `iskeyword` value. If you suspect this is happening, you can run `:verbose setlocal iskeyword?` and it will tell you the current value as well as the path/filename of the script that last changed it.\n\n[What I do](https://github.com/otherjoel/vim/blob/master/vimrc), for now, is to leave `pencil#init()` out of my auto-commands for Pollen files, and just enable it manually with `:Pencil` after the file is open. Another remedy is to make sure that, _after_ the call to `pencil#init()`, `iskeyword` gets reset to the value used for Racket code (i.e., [this value](https://github.com/wlangstroth/vim-racket/blob/f76fde9afbc008b7468c9ea026cbe3840af5f5ef/syntax/racket.vim#L22) as of the time I write this).\n\n### Syntax edge cases\n\nThis plugin **is** opinionated about using the default command character `◊`. If you [change the command character in your project](http://docs.racket-lang.org/pollen/Setup.html#%28part._setup-overrides%29), you’ll need to replace it everywhere in this plugin’s `syntax/pollen.vim` file as well.\n\nThere’s also currently no support for `◊tag|{...}|` or `◊tag|\u003c\u003c\u003c{...}\u003e\u003e\u003e|`. These forms aren’t even covered in Pollen’s documentation, but Pollen can use them by virtue of its Scribble heritage.\n\nFinally: in any form `◊func[…]{…}`, the symbol `func` will always be highlighted in the same way, even when it is a Racket keyword/function (e.g. `define`, `string=?`, `let`, etc). Pollen-provided functions _are_ highlighted differently in this form, however. Here’s an example to illustrate:\n\n![](example2.png)\n\n## Misc\n\nThe font used in the screenshots is [IBM Plex Mono Light](https://ibm.github.io/type/). The color scheme is [One Dark](https://github.com/joshdick/onedark.vim).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotherjoel%2Fvim-pollen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotherjoel%2Fvim-pollen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotherjoel%2Fvim-pollen/lists"}