Skip to content

Conversation

@adaschma
Copy link
Contributor

This extends the vi mode with a visual mode. Can be tested in the basic example: v to enter in normal mode. Regular movements (e.g. b,w) work and d or C to delete and reenter normal or invert mode.

@fdncred
Copy link
Contributor

fdncred commented Jun 20, 2024

we require cargo fmt --all to be run as well. also, how can i test this. I'm not familiar with the vi keybindings.

@adaschma
Copy link
Contributor Author

adaschma commented Jun 21, 2024

we require cargo fmt --all to be run as well.

fixed.

also, how can i test this. I'm not familiar with the vi keybindings.

$ cargo run --example demo -- --vi

type some text to test on.

Press "ESC" to switch into the vi normal mode and then press "v" to enter visual mode.

Now using the same keys as in vi normal mode moves the cursor while also selecting the text. These are "h" and "l" (lower case L) for moving a char left and right, or "b" and "w" for moving a word left and right, "B" and "W" for the big words, as well as "0" (zero) and "$" for the start and end of the line.

Once you have selected your text "d" deletes the selected text or "c" to delete the selected text and enter new text.

@fdncred
Copy link
Contributor

fdncred commented Jun 21, 2024

ah, ok. thanks for taking the time to explain it to me. that helps. we really need to make the colors configurable but that's not for this pr. It just looks a bit janky (not your fault).

image

@adaschma adaschma mentioned this pull request Jun 23, 2024
@fdncred fdncred merged commit 480059a into nushell:main Jul 6, 2024
@fdncred
Copy link
Contributor

fdncred commented Jul 6, 2024

Thanks

leftwo referenced this pull request in oxidecomputer/crucible Aug 17, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [reedline](https://github.com/nushell/reedline) |
workspace.dependencies | minor | `0.30.0` -> `0.33.0` |

---

### Release Notes

<details>
<summary>nushell/reedline (reedline)</summary>

###
[`v0.33.0`](https://github.com/nushell/reedline/releases/tag/v0.33.0)

[Compare
Source](https://github.com/nushell/reedline/compare/v0.32.0...v0.33.0)

#### What's Changed

- fix some new clippy warnings by
[@&#8203;fdncred](https://github.com/fdncred) in
[https://github.com/nushell/reedline/pull/790](https://github.com/nushell/reedline/pull/790)
- Add PWD to the `Reedline` state by
[@&#8203;YizhePKU](https://github.com/YizhePKU) in
[https://github.com/nushell/reedline/pull/796](https://github.com/nushell/reedline/pull/796)
- Fix [#&#8203;793](https://github.com/nushell/reedline/issues/793)
using width() for column menu alignements with special char by
[@&#8203;Jiogo18](https://github.com/Jiogo18) in
[https://github.com/nushell/reedline/pull/794](https://github.com/nushell/reedline/pull/794)
- Make menus process events before updating working details by
[@&#8203;ysthakur](https://github.com/ysthakur) in
[https://github.com/nushell/reedline/pull/799](https://github.com/nushell/reedline/pull/799)
- Feature: vi visual mode by
[@&#8203;adamschmalhofer](https://github.com/adamschmalhofer) in
[https://github.com/nushell/reedline/pull/800](https://github.com/nushell/reedline/pull/800)

#### New Contributors

- [@&#8203;YizhePKU](https://github.com/YizhePKU) made their first
contribution in
[https://github.com/nushell/reedline/pull/796](https://github.com/nushell/reedline/pull/796)
- [@&#8203;Jiogo18](https://github.com/Jiogo18) made their first
contribution in
[https://github.com/nushell/reedline/pull/794](https://github.com/nushell/reedline/pull/794)
- [@&#8203;adamschmalhofer](https://github.com/adamschmalhofer) made
their first contribution in
[https://github.com/nushell/reedline/pull/800](https://github.com/nushell/reedline/pull/800)

**Full Changelog**:
nushell/reedline@v0.32.0...v0.33.0

###
[`v0.32.0`](https://github.com/nushell/reedline/releases/tag/v0.32.0):
0.32.0

[Compare
Source](https://github.com/nushell/reedline/compare/v0.31.0...v0.32.0)

#### What's Changed

- add bashism `!term` to prefix search for last command beginning with
`term` by [@&#8203;fdncred](https://github.com/fdncred) in
[https://github.com/nushell/reedline/pull/779](https://github.com/nushell/reedline/pull/779)
- Remove debug print by
[@&#8203;sholderbach](https://github.com/sholderbach) in
[https://github.com/nushell/reedline/pull/784](https://github.com/nushell/reedline/pull/784)
- fix ide menu not reporting correct required_lines by
[@&#8203;maxomatic458](https://github.com/maxomatic458) in
[https://github.com/nushell/reedline/pull/781](https://github.com/nushell/reedline/pull/781)
- Fix (properly) the logic around prompt re-use & Host Command handling
by [@&#8203;bew](https://github.com/bew) in
[https://github.com/nushell/reedline/pull/770](https://github.com/nushell/reedline/pull/770)
- fix: unexpected spaces after large buffer input by
[@&#8203;sigoden](https://github.com/sigoden) in
[https://github.com/nushell/reedline/pull/783](https://github.com/nushell/reedline/pull/783)
- Bump version for `0.32.0` release by
[@&#8203;devyn](https://github.com/devyn) in
[https://github.com/nushell/reedline/pull/785](https://github.com/nushell/reedline/pull/785)

#### New Contributors

- [@&#8203;bew](https://github.com/bew) made their first contribution
in
[https://github.com/nushell/reedline/pull/770](https://github.com/nushell/reedline/pull/770)
- [@&#8203;sigoden](https://github.com/sigoden) made their first
contribution in
[https://github.com/nushell/reedline/pull/783](https://github.com/nushell/reedline/pull/783)
- [@&#8203;devyn](https://github.com/devyn) made their first
contribution in
[https://github.com/nushell/reedline/pull/785](https://github.com/nushell/reedline/pull/785)

**Full Changelog**:
nushell/reedline@v0.31.0...v0.32.0

###
[`v0.31.0`](https://github.com/nushell/reedline/releases/tag/v0.31.0):
0.31.0

[Compare
Source](https://github.com/nushell/reedline/compare/v0.30.0...v0.31.0)

New release for [Nushell](https://github.com/nushell/nushell) `0.92.0`

#### What's Changed

- Bump version of `strum`/`strum_macros` by
[@&#8203;sholderbach](https://github.com/sholderbach) in
[https://github.com/nushell/reedline/pull/768](https://github.com/nushell/reedline/pull/768)
- Use the OS clipboard only for explicit cut/copy/paste operations by
[@&#8203;Tastaturtaste](https://github.com/Tastaturtaste) in
[https://github.com/nushell/reedline/pull/761](https://github.com/nushell/reedline/pull/761)
- Revert "Move left when exiting insert mode" by
[@&#8203;fdncred](https://github.com/fdncred) in
[https://github.com/nushell/reedline/pull/773](https://github.com/nushell/reedline/pull/773)
- Fix `OpenOptions` clippy by
[@&#8203;sholderbach](https://github.com/sholderbach) in
[https://github.com/nushell/reedline/pull/776](https://github.com/nushell/reedline/pull/776)
- Bump `fd-lock` requirement and locked deps by
[@&#8203;sholderbach](https://github.com/sholderbach) in
[https://github.com/nushell/reedline/pull/775](https://github.com/nushell/reedline/pull/775)
- Fix case-consistency searching sqlite history by
[@&#8203;sholderbach](https://github.com/sholderbach) in
[https://github.com/nushell/reedline/pull/777](https://github.com/nushell/reedline/pull/777)
- Bump version for `0.31.0` release by
[@&#8203;sholderbach](https://github.com/sholderbach) in
[https://github.com/nushell/reedline/pull/780](https://github.com/nushell/reedline/pull/780)

**Full Changelog**:
nushell/reedline@v0.30.0...v0.31.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 8pm,before 6am" in timezone
America/Los_Angeles, Automerge - "after 8pm,before 6am" in timezone
America/Los_Angeles.

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/oxidecomputer/crucible).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants