nushell / nushell/nushell

vi edit mode: the dot `.` character should not be part of the same set of characters as letters for describing a word

Open
#17,286 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:needs-triage
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 14h
Merged PRs (30d)
79

Description

Bug report form
  • I have done a basic search of the issue tracker to find any existing issues that are similar.
  • I have checked that my version is at least the latest stable release available via my installation method.
Describe the bug

In Vi edit mode, if the cursor of the user is aligned on the letter a in the following example:

a.b.c

Pressing e will bring the user's cursor to the end of the word. Since Nushell's knowledge of a word is wrong, it will move the cursor to the letter c as if the user pressed E rather than e.

I think it is because the implementation of the Vi mode's concept of a "word" is not correct regarding the dot character.

Also, an interesting thing is that if the user's cursor is on the letter c and he then presses b to go to the beginning of the previous word, then he'll end up on the previous dot (one character to the left of c), which is correct.

There seems to be inconsistencies.

How to reproduce

N/A

Expected behavior

When in VI mode, using w, e, ge or b should jump between words relative to the cursor.

According to the Vim documentation,

A word consists of a sequence of letters, digits and underscores, or a
sequence of other non-blank characters, separated with white space (spaces,
tabs, ). This can be changed with the 'iskeyword' option. An empty line
is also considered to be a word.

The relevant part of the definition here is "other non-blank characters".

For e.g.,

a b c

This is 3 words while

a.b.c

this is 5 words as the two dots each count as a word. However,

...

This is a single word consisting of 3 times the character ..

Regarding the example given earlier with a.b.c. Pressing initially e when the cursor of the user is on letter a should bring the user's cursor to the first character ..

Configuration
key value
version 0.109.1
major 0
minor 109
patch 1
branch makepkg
commit_hash cde5f7be8c813173e95ea65f96e79a133f587de7
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.91.1 (ed61e7d7e 2025-11-07) (Arch Linux rust 1:1.91.1-2)
cargo_version cargo 1.91.1 (ea2d97820 2025-10-10) (Arch Linux rust 1:1.91.1-2)
build_time 2025-12-03 07:57:38 +00:00
build_rust_channel release
allocator standard
features default, network, plugin, rustls-tls, sqlite, trash-support
installed_plugins port_extension 0.109.1, secret 0.4.0
experimental_options example=false, reorder-cell-paths=true, pipefail=false, enforce-runtime-annotations=false

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating Nushell's Vi edit-mode word-motion implementation and its existing tests, then reproduce the a.b.c cases for w, e, ge, and b. Done means motions follow Vim's word rules: dots are separate words between letters, while consecutive dots remain one word.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.