Repository navigation
Add --vim flag to emulate vim editing mode - #111218
Conversation
|
|
|
I have signed a CCLA. |
|
Workflow [PR], commit [6d1b5bd] Summary: ✅
AI ReviewSummaryThe PR adds optional Final VerdictStatus: ✅ Approve. |
|
Thanks! I've merged the submodule PR. |
alexey-milovidov
left a comment
There was a problem hiding this comment.
The code LGTM.
What is more correct to say?
- VI mode;
- VIM mode;
|
If saying |
There are many vim specific keybindings, so it should be called vim mode I think. I will rebase on master. |
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=111218&sha=cdcf76648ac6a81df5b056b396a8dbfa9d6ea22c&name_0=PR&name_1=Storage%20memory%20check and provide a fix in a separate PR. This PR only changes the interactive client ( |
|
The fix is #128485 (mine, open, CI green). This PR is not involved. Cause: This job ran at 2026-11-01 13:06 UTC, inside this month's window (2026-10-31 23:00 to 2026-11-02 02:46 UTC), and the report's cross-diff is exactly that:
6 PRs, this one included, went red this way inside the window. #128485 pins the inserted timestamps to a fixed date, so the table always has one partition. Since the window closed, the |
|
🕵 Thanks, @groeneai. The Status at eee5530: the branch includes |
… max_upload_part_size The Azure object storage generator drew `strict_upload_part_size` (0..100 MiB, plus a rare 2**64 - 1) and `min_upload_part_size` (rare 2**64 - 1) independently of `max_upload_part_size` (floor 16 MiB). `RequestSettings::validateUploadSettings` rejects strict > max and max < min, so the disk's startup `checkAccess` throws INVALID_SETTING_VALUE, the server exits, and `dolor.py` only reports a startup timeout. Seen in La Casa Del Dolor (amd_msan) on PR ClickHouse#111218: strict 87.22 MiB against max 16 MiB. Bound both under the lower bound of `max_upload_part_size` (16 MiB, bits=24), as the S3 block already does for `s3_min_upload_part_size`. Driving the real `add_single_disk`, about 4.2% of generated Azure disks were rejected before and none after (150k disks, 1M direct draws). Co-Authored-By: Claude Opus 5.5 <[email protected]>
… the line break of an empty line ending a counted `iw`, `ce` on an empty last line, `v` forcing for linewise motions in the vim mode Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 Addressed the four open AI review threads in b096515: counted The only CI failure was |
…, `dvd`/`cvc`, `dvl` at the end of a line in the vim mode - A linewise motion forced characterwise by `v` that ends in the first column of a line now ends at the end of the previous line (or becomes linewise when it starts in the indentation), like vim, so `gg$dvG` keeps the line break. - `v` now applies to the doubled operators: `dvd` and `cvc` act characterwise exclusive up to the first non-blank of the last line of the count instead of on whole lines. - `dvl` does not go past the last character of the line: when the count stops short, the motion is inclusive and `v` makes it exclusive, so `dvl` on the last character deletes nothing and never consumes the line break. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ext objects, `g` prefix after `dvgg`, counted `dd`/`cc`/`S` on the last line in the vim mode - Whitespace that starts within a line ends at the end of that line in counted `iw`/`aw`, so e.g. `d2iw` on `note ` keeps the line break instead of joining the next line into a comment. - A counted `aw` skips the line break at the end of a non-empty line like `iw`, keeps trailing whitespace within the line, and takes the leading whitespace when the selection does not end with whitespace. - `v` after the operator makes the text objects (`iw`, `aw`, `i(`, ...) exclusive, and `w` that stops at the end of a line or of the input is inclusive on its last character, so `dvw` there deletes nothing. - The second `g` of `gg` leaves the `g` prefix mode on every path, so the command after a forced characterwise `d2vgg` is not swallowed. - Counted `dd`, `cc` and `S` fail on the last line, like in vim. All expected results are verified against vim 9 with `-u NONE`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 Status at 4470f31: the four AI review findings (counted |
…line inner bracket objects, `cv0` on an empty line, quotes in comments in the vim mode - `aw` cancels when no word follows the selected whitespace before the end of the input, e.g. `c2aw` on the last word before an empty last line, or `caw` on trailing blanks. - The inner object of a multiline block starts on the next line when the opening bracket ends its line, and ends before the line break when only blanks precede the closing bracket, so `ci(` keeps the brackets on their own lines (and is linewise when both hold), as in vim. - `v` makes `0` inclusive only when the cursor is on a character, so `cv0` on an empty line keeps its line break. - A quote inside a `--`, `#` or `/* */` comment does not start a literal, so an apostrophe in a comment no longer hides the brackets after it from `%` and the bracket objects. All expected results are verified against vim 9 with `-u NONE`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he timeout of `05394_client_vim_mode` on macOS - Classify quotes with the comment rules of the `Lexer`: `//` starts a line comment, like `--` and `# `, and block comments nest. An apostrophe in such a comment no longer hides the brackets after it from `%` and the bracket objects. - The test exceeded the 60 s time limit of the fast test on macOS: every Escape was followed by a pause of 0.3 s. The escape delay of the vim mode is 10 ms (`set_escdelay(10)`), so a pause of 0.1 s is still ten times longer. The test now runs in about 20 s, and three copies in parallel pass in about 30 s. https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=111218&sha=8f277594819846b2ee654c7f8f1eb0c16bab0cae&name_0=PR&name_1=Fast%20test%20%28arm_darwin%29 ClickHouse#111218 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…me limit The single expect test took about 46 seconds in the Linux fast test and exceeded the 60-second per-test limit of `Fast test (arm_darwin)`: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=111218&sha=8f277594819846b2ee654c7f8f1eb0c16bab0cae&name_0=PR&name_1=Fast%20test%20%28arm_darwin%29 PR: ClickHouse#111218 The cases are independent (each one submits its own query and none relies on a find, register or history entry from an earlier case), so they are split in order between `05394_client_vim_mode_{1,2,3,4}.expect`, each with its own client session. The cases themselves are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 Status at 332d356: the only failure in the last full CI run (8f27759) was |
…ty line, counted `%`, linewise deletes over whole lines in the vim mode - `v` makes `cw` on an empty line inclusive, so it also changes the first character of the next line, like `cvw` in vim. - Backspace without an operator stops on an empty previous line instead of skipping it. - A count before `%` is a percentage of the input: `50%` goes linewise to the first non-blank of the line halfway through, and a count above 100 fails. - Like `op_delete` in vim, a characterwise delete without `v` over several lines becomes linewise when only blanks precede its start and follow its end. The new shared `vimDeleteLinewise` applies it to `%`, the word motions, and the word and bracket objects, e.g. `d%` and `d4e` over whole lines. - The new cases are in `05394_client_vim_mode_5.expect`, so that each test stays well within the time limit of the fast test. All expected results are verified against vim 9 with `-u NONE`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
With `v` after the operator, `i(` and `a(` now follow vim's range computation before toggling the inclusivity: `i(` starts on the next line when the opening bracket ends its line, and when the closing bracket is in the first column or after blanks, the object is exclusive up to the start of the next line, so `v` also takes that character. An exclusive range that ends in the first column ends at the end of the previous line and may become linewise, as for other motions. Previously, `v` only decremented the raw delimiter-to-delimiter count, so `ggjcvi(9000)` on a multiline block left an extra closing bracket. The expected results are verified against vim 9.1 (`-u NONE`). Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🕵 Status at 6d1b5bd: every CI check passed, there are no unresolved review threads, and the branch is two days behind |
|
@alexey-milovidov I have already signed a CCLA. |
alexey-milovidov
left a comment
There was a problem hiding this comment.
All ok except the complex logic of the vim mode itself, that couldn't be comprehend. It is well isolated in a single file.
14f2227
This PR depends on ClickHouse/replxx#43.
It also depends on ClickHouse/replxx#49 and ClickHouse/replxx#52 (
bind_default_key, to take a non-ASCII argument off,tandr).Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Added the client flag --vim which emulates vim editing mode for the client.
Workflow [PR]
Sync PR [sync-upstream/pr/111218]
Version info
26.11.1.2185-master(included in26.11and later)