feat(vim): apply number and relativenumber from the rc file to the line numbers

`set relativenumber` in ~/.ideavimrc was reported as an unsupported option
and the gutter kept absolute numbers. As in IdeaVim, `number` / `nu` and
`relativenumber` / `rnu` now set every editor's line numbers over Settings ›
Editor › General › Appearance › Show line numbers: both on is hybrid,
`relativenumber` alone shows 0 on the caret line, both off hides them. An
option the rc file leaves alone reads and follows Settings, nothing is
written back, and turning Vim mode off or reloading an rc file without them
returns to Settings.

Fixes #7341
Цей коміт міститься в:
l0ng-ai committed 2026-12-02 12:53:20 +08:00
1 джерело 7ff8d472f7
коміт f2ea8778bc
14 files changed
+223 -4

No files matched your search

+2
Переглянути файл
@@ -47,6 +47,8 @@ Supported lines:
`set clipboard+=unnamedplus` (or `unnamed`) also copies yanks, deletes and changes without a register to the system clipboard. The `"+` register always reads and writes the system clipboard.
`set number` (`nu`) and `set relativenumber` (`rnu`) switch the line numbers of every editor, as in IdeaVim: both together show hybrid numbers, `relativenumber` alone shows 0 on the caret line, and `nonumber norelativenumber` hides them. An option the file does not set follows **Settings › Editor › General › Appearance › Show line numbers**, and nothing is written to Settings.
`<C-g>u` on the right-hand side of an Insert-mode mapping breaks the undo sequence, as in Vim.
Anything else (functions, `if`, `autocmd`, plugin commands) is reported as ignored and never executed.
+2
Переглянути файл
@@ -47,6 +47,8 @@ Vim 模式开启时(如果上次是开启状态,启动时也会),OpenIDE
`set clipboard+=unnamedplus`(或 `unnamed`)让不指定寄存器的复制、删除和修改也写入系统剪贴板。`"+` 寄存器始终读写系统剪贴板。
`set number`(`nu`)和 `set relativenumber`(`rnu`)与 IdeaVim 一样切换所有编辑器的行号:两者同时开启显示混合行号,只开 `relativenumber` 时光标行显示 0,`nonumber norelativenumber` 隐藏行号。文件里没有设置的选项跟随 **设置 › 编辑器 › 常规 › 外观 › 显示行号**,不会写回设置。
在插入模式映射的右侧,`<C-g>u` 会像 Vim 一样断开撤销序列。
其他内容(函数、`if`、`autocmd`、插件命令等)都会被标记为已忽略,不会执行。