Remove diacritics in selections with iconv transliteration

While working on French documents, I sometimes need to extract some parts to turn them in a more neutral form. Like turning an article title with accents into a filename or a slug for a URL.

So to remove diacritics from a selection le garçon hérétiquele garcon heretique, I use the filter command | with iconv

define-command to-ascii %{
  execute-keys '|iconv -f utf8 -t ascii//TRANSLIT<ret>'

Beware, for some characters it can expand selections, like in German with ß replaced by ss.


Another quick command also related to codepoints:

map global user -docstring 'codepoint' i ': echo %sh{ printf "codepoint: U+%04x" "$kak_cursor_char_value" }<ret>'

found in maximbaz kakrc: