unexpected value from mode(1) command

21 views
Skip to first unread message

Mike

unread,
May 26, 2024, 12:25:50 PMMay 26
to vim...@googlegroups.com
Hello.

If, in normal mode, I type a colon followed by the command "echo
mode(1)", the value "n" is displayed in the command-line area indicating
normal mode. I would have expected something beginning with "c" which
would be consistent with what ":help cmdline-mode" states.

Could someone explain why the observed behavior should have been expected?

Thanks in advance for the education!

M

unread,
May 26, 2024, 10:43:16 PMMay 26
to vim...@googlegroups.com


вс, 26 мая 2024 г., 19:25 Mike <mss...@gmail.com>:
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/v2vnpp%24i0q%241%40ciao.gmane.io.

Vim stays in Command-line mode as long as user _is editing_ the command line. After enter key has been pressed Vim gets back into the Normal mode, as explained at `:help mode-switching` topic.

Kind regards,

Mike

unread,
Jun 1, 2024, 8:55:39 PMJun 1
to vim...@googlegroups.com
Thanks for the explanation and link, it certainly explains what I'm
seeing. It just seemed odd that an ex-command is being executed in
"normal" mode. But, now that I think about it, autocommands do invoke
ex-commands and we do expect them to be aware of the current buffer's
mode setting.

Reply all
Reply to author
Forward
0 new messages