# Purpose of non-extending selection commands, like 'e'?

**URL:** <https://discuss.kakoune.com/t/purpose-of-non-extending-selection-commands-like-e/2613>\
**Category:** Uncategorized\
**Created:** [December 30, 2024, 9:43pm UTC](https://discuss.kakoune.com/t/purpose-of-non-extending-selection-commands-like-e/2613 "2024-12-30T21:43:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GavinSmith0123](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/gavinsmith0123/32/1112_2.png) [@GavinSmith0123](https://discuss.kakoune.com/u/GavinSmith0123)\
**Post date:** [December 30, 2024, 9:43pm UTC](https://discuss.kakoune.com/t/purpose-of-non-extending-selection-commands-like-e/2613/1 "2024-12-30T21:43:21Z")

</div>

There are several Kakoune keys that I don’t really understand the purpose of. For example, `e` extends the selection until the next end-of-word. It does exactly the same thing that `E` does if you only press it once. It seems like you don’t need to have `e` as a command and it would be more useful if it meant to move to the next end of the word without extending the selection. Then `e`/`E` would be analogous to `l`/`L` and other pairs of movement/selection commands.

The behaviour of `e` to extend the selection seems like a hang-over from Vim, so that you can say in Kakoune you type `ed` to delete until the end of the word whereas in Vim you type `de`.

It would be useful for navigating with `f` and `t` to go forward on a line without extending the selection.

---

<div class="post-metadata">

**Author:** ![GavinSmith0123](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/gavinsmith0123/32/1112_2.png) [@GavinSmith0123](https://discuss.kakoune.com/u/GavinSmith0123)\
**Post date:** [December 31, 2024, 9:23pm UTC](https://discuss.kakoune.com/t/purpose-of-non-extending-selection-commands-like-e/2613/2 "2024-12-31T21:23:33Z")

</div>

Thanks to Reddit user “ftonneau” I was able to redefine `f` and `t` not to extend the selection:

```auto
define-command -params 1 find-character %{
  # Args: 1 = count
  on-key %{
  exec %arg(1) f %val(key)
  exec <semicolon>
  }
}
map global normal f ':find-character %val(count) <ret>'

define-command -params 1 to-character %{
  # Args: 1 = count
  on-key %{
  exec %arg(1) t %val(key)
  exec <semicolon>
  }
}
map global normal t ':to-character %val(count) <ret>'

```

[https://old.reddit.com/r/kakoune/comments/1gw3mbq/basic\_movement\_question\_from\_new\_user/m0fuswt/](https://old.reddit.com/r/kakoune/comments/1gw3mbq/basic_movement_question_from_new_user/m0fuswt/)

---

<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:** [January 2, 2025, 12:50am UTC](https://discuss.kakoune.com/t/purpose-of-non-extending-selection-commands-like-e/2613/3 "2025-01-02T00:50:26Z")

</div>

I do not think `e` and `E` are equivalent if pressed only once. `E` extends whereas `e` does not. Admittedly, you won’t see any difference if the current selection consists of only 1 character. Try it with a selection that is more than 1-character wide, however, and you’ll see the difference between extending (E) versus merely selecting (e), even if e/E is pressed only once.

---

<div class="post-metadata">

**Author:** ![GavinSmith0123](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/gavinsmith0123/32/1112_2.png) [@GavinSmith0123](https://discuss.kakoune.com/u/GavinSmith0123)\
**Post date:** [January 2, 2025, 4:21pm UTC](https://discuss.kakoune.com/t/purpose-of-non-extending-selection-commands-like-e/2613/4 "2025-01-02T16:21:13Z")

</div>

You are right. `e` creates a selection from the current cursor position to the end of the word, while `E` extends the selection until the end of the word.

I suppose `e` /`b` is a quick way to select an entire word at once to do something with that word, but it is not as useful as a quick way of moving through text because of leaving a word selected.
