# Repeat-char: inserting a character n times in Insert mode

**URL:** <https://discuss.kakoune.com/t/repeat-char-inserting-a-character-n-times-in-insert-mode/2774>\
**Category:** Plugins\
**Created:** [October 21, 2025, 2:42pm UTC](https://discuss.kakoune.com/t/repeat-char-inserting-a-character-n-times-in-insert-mode/2774 "2025-10-21T14:42:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ftonneau](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ftonneau/32/295_2.png) [@ftonneau](https://discuss.kakoune.com/u/ftonneau)\
**Post date:** [October 21, 2025, 2:42pm UTC](https://discuss.kakoune.com/t/repeat-char-inserting-a-character-n-times-in-insert-mode/2774/1 "2025-10-21T14:42:59Z")

</div>

This plugin is a resurrection of the first plugin/recipe I ever wrote for Kakoune.

I deleted the original repository and created a new one:

> **[GitHub - ftonneau/repeat-char.kak: A Kakoune plugin to repeat a character n times in...](https://github.com/ftonneau/repeat-char.kak)**
>
> A Kakoune plugin to repeat a character n times in Insert mode

The new version has been improved by the inclusion of a default character and a default count, which can be updated along the current editing session.

This makes the insertion of repeated characters (for example, ASCII horizontal rulers) very fast and hassle-free.

**EDIT**  
The plugin has been further improved by giving it the capacity to “underline” the string on the preceding line, as in this screenshot.

 ![heading](https://discuss.kakoune.com/uploads/default/original/2X/1/10bd44540782c135998510769a681f23c12d50b9.png)

---

<div class="post-metadata">

**Author:** ![ftonneau](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/ftonneau/32/295_2.png) [@ftonneau](https://discuss.kakoune.com/u/ftonneau)\
**Post date:** [October 24, 2025, 9:28am UTC](https://discuss.kakoune.com/t/repeat-char-inserting-a-character-n-times-in-insert-mode/2774/2 "2025-10-24T09:28:13Z")

</div>

Last note: the length of the underlining will be correct even if the heading above it includes double-width, CJK characters.

 ![cjk](https://discuss.kakoune.com/uploads/default/original/2X/a/a4b5680fe2c90073c619d2ca420bc70b037d56fa.png)
