commit 8964ad45dab9aaa79d1fe8c83d2ae657d525028f
parent 3c480fca57497c5d3c66636428fb9e9769d01588
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu, 18 Sep 2025 08:07:43 +0800
vim-patch:9.1.1550: defaults: 'showcmd' is not enabled in non-compatible mode on Unix
Problem: defaults: 'showcmd' is not enabled in non-compatible mode on
Unix
Solution: Always enable 'showcmd' in non-compatible mode, drop it from
defaults.vim.
'showcmd' was already always enabled in Vim compatible mode except for
UNIX environments. So let's just enable it always, there is no good
reason why UNIX platforms should be handled differently than other
platforms, especially since `defaults.vim` did enable this option
anyhow.
closes: vim/vim#17739
https://github.com/vim/vim/commit/3f9d2378bd70748fc59e02a402422269bd096492
Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat:
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
@@ -77,7 +77,6 @@ Defaults *defaults* *nvim-defaults*
- 'ruler' is enabled
- 'sessionoptions' includes "unix,slash", excludes "options"
- 'shortmess' includes "CF", excludes "S"
-- 'showcmd' is enabled
- 'sidescroll' defaults to 1
- 'smarttab' is enabled
- 'spellfile' defaults to `stdpath("data").."/site/spell/"`
diff --git a/test/old/testdir/setup.vim b/test/old/testdir/setup.vim
@@ -19,7 +19,7 @@ if exists('s:did_load')
set listchars=eol:$
set maxsearchcount=99
set mousemodel=extend
- set nohidden nosmarttab noautoindent noautoread noruler noshowcmd
+ set nohidden nosmarttab noautoindent noautoread noruler
set nohlsearch noincsearch
set nrformats=bin,octal,hex
set sessionoptions+=options
diff --git a/test/old/testdir/test_display.vim b/test/old/testdir/test_display.vim
@@ -187,10 +187,13 @@ func Test_edit_long_file_name()
let longName = 'x'->repeat(min([&columns, 255]))
call writefile([], longName, 'D')
- let buf = RunVimInTerminal('-N -u NONE ' .. longName, #{rows: 8})
+ let buf = RunVimInTerminal('-N -u NONE --cmd ":set noshowcmd" ' .. longName, #{rows: 8})
call VerifyScreenDump(buf, 'Test_long_file_name_1', {})
+ call term_sendkeys(buf, ":set showcmd\<cr>:e!\<cr>")
+ call VerifyScreenDump(buf, 'Test_long_file_name_2', {})
+
" clean up
call StopVimInTerminal(buf)
endfunc
diff --git a/test/old/testdir/test_options.vim b/test/old/testdir/test_options.vim
@@ -2903,4 +2903,16 @@ func Test_set_missing_options()
set w9600=23
endfunc
+func Test_showcmd()
+ throw 'Skipped: Nvim does not support support Vi-compatible mode'
+ " in no-cp mode, 'showcmd' is enabled
+ let _cp=&cp
+ call assert_equal(1, &showcmd)
+ set cp
+ call assert_equal(0, &showcmd)
+ set nocp
+ call assert_equal(1, &showcmd)
+ let &cp = _cp
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab