Select a word and replace it with new one. CLI

My goal is to replace a specific word on a known line in a config file with a new word from CLI. Now i open kakoune on that point and replace the word manually.

Pseudo command:
kak +100:20 ~/.config/cfg.yml select_a_word_statement 'new_word_string'

I would be grateful if you point me to a way how to accomplish it.

kak ~/.config/cfg.yml -f '100Xsfoo<ret>cbar'

to replace foo with bar.
See kak -h.

If you want arguments you will have to create a wrapping CLI for this.

2 Likes

This is what i need. Thank you for the example.