Kakoune: Underscrore as word boundary

Created on 26 Nov 2018  路  7Comments  路  Source: mawww/kakoune

Simply, I'm missing a feature from Emacs: underscores are word boundaries, so it is extremely helpful when editing code for snake_case languages. <a-i>_ is good, but it would be better to support an option in config to work with _ like with -, where w and e related workflow works fine.

Most helpful comment

I think the solution would be to change extra_word_chars to default to _, and remove the hardcoded underscore-is-a-word-char behaviour. That way its just a matter of overriding that option.

All 7 comments

Luckily there's already an option for that, with extra_word_chars you can control if characters are considered to be part of a word.

@occivink thank you, could you give more details? I'm new to Kakoune.

What exactly should I put into my .kakrc to unset _ from word chars?

Oh I misunderstood, unfortunately extra_word_chars only supports adding characters, not removing some.

@fominok try this: https://github.com/mawww/kakoune/wiki/Selections#how-to-make-word-keys-discern-camelcase-or-snake_case-parts

@maximbaz thank you, it works. Not sure if I need to close this issue now: maybe having an opposite for extra_word_chars could be useful.

I think the solution would be to change extra_word_chars to default to _, and remove the hardcoded underscore-is-a-word-char behaviour. That way its just a matter of overriding that option.

This is a neat idea

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lenormf picture lenormf  路  4Comments

valerdi picture valerdi  路  4Comments

radare picture radare  路  3Comments

fennewald picture fennewald  路  3Comments

vbauerster picture vbauerster  路  3Comments