aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/version.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2023-07-01 03:45:45 -0700
committerGitHub <noreply@github.com>2023-07-01 03:45:45 -0700
commit43ded8d3584477ab14731486cfb0e86534f2b2dc (patch)
tree09a39aa6aa13939d0b033843c7195a2e882ab8fb /src/nvim/version.c
parentba8f19ebb67ca27d746f4b1cd902ab3d807eace3 (diff)
downloadrneovim-43ded8d3584477ab14731486cfb0e86534f2b2dc.tar.gz
rneovim-43ded8d3584477ab14731486cfb0e86534f2b2dc.tar.bz2
rneovim-43ded8d3584477ab14731486cfb0e86534f2b2dc.zip
feat(version): unverbose ":version", ":verbose version" #24195
Problem: `nvim -v` and `:version` prints system vimrc, fallback files, and compilation info by default, which most people don't care about and just clutters up the output. Solution: Omit extra info unless 'verbose' is set.
Diffstat (limited to 'src/nvim/version.c')
-rw-r--r--src/nvim/version.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/src/nvim/version.c b/src/nvim/version.c
index b9fa7799a6..95e275bceb 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -2700,33 +2700,39 @@ void list_version(void)
msg(longVersion);
msg(version_buildtype);
list_lua_version();
+
+ if (p_verbose > 0) {
#ifndef NDEBUG
- msg(version_cflags);
+ msg(version_cflags);
#endif
-
- version_msg("\n\n");
+ version_msg("\n\n");
#ifdef SYS_VIMRC_FILE
- version_msg(_(" system vimrc file: \""));
- version_msg(SYS_VIMRC_FILE);
- version_msg("\"\n");
-#endif // ifdef SYS_VIMRC_FILE
-#ifdef HAVE_PATHDEF
-
- if (*default_vim_dir != NUL) {
- version_msg(_(" fall-back for $VIM: \""));
- version_msg(default_vim_dir);
+ version_msg(_(" system vimrc file: \""));
+ version_msg(SYS_VIMRC_FILE);
version_msg("\"\n");
- }
+#endif
- if (*default_vimruntime_dir != NUL) {
- version_msg(_(" f-b for $VIMRUNTIME: \""));
- version_msg(default_vimruntime_dir);
- version_msg("\"\n");
+#ifdef HAVE_PATHDEF
+ if (*default_vim_dir != NUL) {
+ version_msg(_(" fall-back for $VIM: \""));
+ version_msg(default_vim_dir);
+ version_msg("\"\n");
+ }
+
+ if (*default_vimruntime_dir != NUL) {
+ version_msg(_(" f-b for $VIMRUNTIME: \""));
+ version_msg(default_vimruntime_dir);
+ version_msg("\"\n");
+ }
+#endif
}
-#endif // ifdef HAVE_PATHDEF
- version_msg("\nRun :checkhealth for more info");
+ version_msg(p_verbose > 0
+ ? "\nRun :checkhealth for more info"
+ : (starting
+ ? "\nRun \"nvim -V1 -v\" for more info"
+ : "\nRun \":verbose version\" for more info"));
}
/// Show the intro message when not editing a file.