Toki Pona : syntax coloring and filetype settings for the Toki Pona minimalist conlang
| script karma
Downloaded by 6
Comments, bugs, improvements
script versions (upload new version)
|A syntax highlighting utilities for the minimalist conlang (a.k.a. planned language,
such as Esperanto). 
This plugin also performs a filetype detection and sets
the file with reasonable settings.
== Usage ==
Open or create a file with a .tokipona or .tp extension.
Write in toki pona, i.e. using toki pona words.
E.g. mi wile pana e ilo tawa sina.
The words should be colored according to the
classes prescribed in the official dictionary
and the (configurable) criteria described in .
You might change and tweak the color schemes
applied to the Toki Pona texts using commands
or using Realcolors  to fine-tune individual colors,
load experimental and cognitive color schemes,
scrutinize Vim's syntax association to token at window cursor,
== A minimalistic template for Vim plugins ==
Also, the plugin is proposed as a very simple model for plugins.
The template is in fact a complete filetype plugin,
which is a very general template.
Thus, variations and simpler plugin architectures
(e.g. for general search or indentation)
are obtained with relative ease.
The functionalities included, which might be associated to the main
components of a plugin, are:
- Filetype detection (in plugin/ftdetect/tokipona.vim)
- Filetype settings (in
- Filetype syntax (in syntax/tokipona.vim)
The syntax file is rendered by a Python script
though analysis of the official
Toki Pona dictionary in , and according to configurable routines
described in .
The workings of Vim syntax highlighting and color schemes
might be promptly grasped by consulting .
== Tweaking ==
One might obtain other syntax highlighting schemes
for Toki Pona by:
1. editing the file ~/.vim/syntax/tokipona.vim to change token
membership to syntax classes, association of syntax classes to visual
cues, and the comment format and visual characteristics.
(reloading a *.tokipona file with :e<cr> will apply the changes written)
2. Changing the configurations or routines
in the Python script tokipona/makeVimSyntax.py
found in https://github.com/ttm/tokipona
3. Tweaking the colorschemes might more what you are looking for.
Take a look at Realcolors .
== TODO ==
- Include POS tagging to achieve highlighting schemes that are
adequate to each sentence.
- Include a Fuzzy mode in which a token is colored
with respect to their fuzzy set membership ratios.
* Each POS tag might have a membership function.
* One trivial case is when the membership ratios to each of the tokens
are equal and proportional to the number of classes.
E.g. let 'ale' have membership 1/3 1/3 1/3 in the classes of adjective, noun
and number. If adjectives are associated with one color, nouns and
numbers with other two colors, the membership ratios yield
sound syntax coloring schemes in this very trivial sense.
It is a baseline.
- Shape the tokipona Python package in
into a package and integrate the
routines to be used (set, run, update files, update syntax and color
scheme being applied, etc) within Vim as functions, commands and
* This might require integration with Realcolors .
- Inclusion of non-official words and corpus statistics into the
syntax and coloring schemes.
- Include usage within Vim of the other resource in : toki pona
wordnets, statistics obtained from the official vocabulary,
synthesis of texts (poems, sentences, etc).
- Better relate this Vim plugin, the Python package, Realcolors
plugin, PRV and related endeavors.
This work is sponsored by FAPESP (project 2017/05838-3) in a project lead by
Profa. Dra. Maria Cristina Ferreira de Oliveira at VICG/ICMC/USP, São Carlos, Brazil.
: Basic concepts and tools for the Toki Pona minimalist and
constructed language: description of the language and main issues;
Wordnet synsets; analysis of the vocabulary; synthesis and syntax
highlighting of texts.
: Realcolors: Utilities for tweaking and creating 24-bit true color
schemes for Vim at runtime.
: Lang, Sonja. Toki Pona: The language of good. 2014.
: An anthropological account of the Vim text editor:
features and tweaks after 10 years of ouroboros.
|Download the Vimball.
$ vim tokipona.vmb
if inside Vim.
(it will place the files e.g. in .vim/plugins/
I am not shure if and when
you shout restart Vim)
You might also install Toki Pona syntax by visiting
and copying these files:
to your .vim/ or anywhere in you runtimepath.
Click on the package to download.
ip used for rating: 188.8.131.52