-*options.txt* For Vim version 9.1. Last change: 2025 Nov 09
+*options.txt* For Vim version 9.1. Last change: 2025 Nov 20
VIM REFERENCE MANUAL by Bram Moolenaar
*'commentstring'* *'cms'* *E537*
'commentstring' 'cms' string (default "/* %s */")
local to buffer
- {not available when compiled without the |+folding|
- feature}
A template for a comment. The "%s" in the value is replaced with the
comment text, and should be padded with a space when possible.
Currently used to add markers for folding, see |fold-marker|. Also
-*version9.txt* For Vim version 9.1. Last change: 2025 Nov 09
+*version9.txt* For Vim version 9.1. Last change: 2025 Nov 20
VIM REFERENCE MANUAL by Bram Moolenaar
- 'smartcase' applies to completion filtering
Options: ~
+- 'commentstring' is now available in all builds and no longer requires the
+ |+folding| feature
- the default for 'commentstring' contains whitespace padding to have
automatic comments look nicer |comment-install|
- 'completeopt' is now a |global-local| option.
" These commands create the option window.
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Oct 07
+" Last Change: 2025 Nov 20
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" If there already is an option window, jump to that one.
call <SID>AddOption("comments", gettext("definition of what comment lines look like"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("com")
+call <SID>AddOption("commentstring", gettext("template for comments; used to put the marker in"))
+call <SID>OptionL("cms")
call <SID>AddOption("formatoptions", gettext("list of flags that tell how automatic formatting works"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("fo")
call <SID>AddOption("foldminlines", gettext("minimum number of screen lines for a fold to be closed"))
call append("$", "\t" .. s:local_to_window)
call <SID>OptionL("fml")
- call <SID>AddOption("commentstring", gettext("template for comments; used to put the marker in"))
- call <SID>OptionL("cms")
call <SID>AddOption("foldmethod", gettext("folding type: \"manual\", \"indent\", \"expr\", \"marker\",\n\"syntax\" or \"diff\""))
call append("$", "\t" .. s:local_to_window)
call <SID>OptionL("fdm")
ga_clear(&buf->b_kmap_ga);
#endif
clear_string_option(&buf->b_p_com);
-#ifdef FEAT_FOLDING
clear_string_option(&buf->b_p_cms);
-#endif
clear_string_option(&buf->b_p_nf);
#ifdef FEAT_SYN_HL
clear_string_option(&buf->b_p_syn);
#ifdef FEAT_FOLDING
EXTERN char e_comma_required[]
INIT(= N_("E536: Comma required"));
+#endif
EXTERN char e_commentstring_must_be_empty_or_contain_str[]
INIT(= N_("E537: 'commentstring' must be empty or contain %s"));
-#endif
EXTERN char e_pattern_found_in_every_line_str[]
INIT(= N_("E538: Pattern found in every line: %s"));
EXTERN char e_illegal_character_str[]
case PV_CINSD: return (char_u *)&(curbuf->b_p_cinsd);
case PV_CINW: return (char_u *)&(curbuf->b_p_cinw);
case PV_COM: return (char_u *)&(curbuf->b_p_com);
-#ifdef FEAT_FOLDING
case PV_CMS: return (char_u *)&(curbuf->b_p_cms);
-#endif
case PV_CPT: return (char_u *)&(curbuf->b_p_cpt);
#ifdef BACKSLASH_IN_FILENAME
case PV_CSL: return (char_u *)&(curbuf->b_p_csl);
COPY_OPT_SCTX(buf, BV_SN);
buf->b_p_com = vim_strsave(p_com);
COPY_OPT_SCTX(buf, BV_COM);
-#ifdef FEAT_FOLDING
buf->b_p_cms = vim_strsave(p_cms);
COPY_OPT_SCTX(buf, BV_CMS);
-#endif
buf->b_p_fo = vim_strsave(p_fo);
COPY_OPT_SCTX(buf, BV_FO);
buf->b_p_flp = vim_strsave(p_flp);
EXTERN char_u *p_cpm; // 'clipmethod'
#endif
EXTERN long p_ch; // 'cmdheight'
-#ifdef FEAT_FOLDING
EXTERN char_u *p_cms; // 'commentstring'
-#endif
EXTERN char_u *p_cpt; // 'complete'
EXTERN long p_cto; // 'completetimeout'
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
, BV_CINSD
, BV_CINW
, BV_CM
-#ifdef FEAT_FOLDING
, BV_CMS
-#endif
, BV_COM
, BV_COT
, BV_CPT
#define PV_CINSD OPT_BUF(BV_CINSD)
#define PV_CINW OPT_BUF(BV_CINW)
#define PV_CM OPT_BOTH(OPT_BUF(BV_CM))
-#ifdef FEAT_FOLDING
-# define PV_CMS OPT_BUF(BV_CMS)
-#endif
+#define PV_CMS OPT_BUF(BV_CMS)
#define PV_COM OPT_BUF(BV_COM)
#define PV_COT OPT_BOTH(OPT_BUF(BV_COT))
#define PV_CPT OPT_BUF(BV_CPT)
(char_u *)0L}
SCTX_INIT},
{"commentstring", "cms", P_STRING|P_ALLOCED|P_VI_DEF,
-#ifdef FEAT_FOLDING
(char_u *)&p_cms, PV_CMS, did_set_commentstring, NULL,
{(char_u *)"/* %s */", (char_u *)0L}
-#else
- (char_u *)NULL, PV_NONE, NULL, NULL,
- {(char_u *)0L, (char_u *)0L}
-#endif
SCTX_INIT},
// P_PRI_MKRC isn't needed here, optval_default()
// always returns TRUE for 'compatible'
check_string_option(&buf->b_p_flp);
check_string_option(&buf->b_p_isk);
check_string_option(&buf->b_p_com);
-#ifdef FEAT_FOLDING
check_string_option(&buf->b_p_cms);
-#endif
check_string_option(&buf->b_p_nf);
check_string_option(&buf->b_p_qe);
#ifdef FEAT_SYN_HL
return errmsg;
}
-#if defined(FEAT_FOLDING)
/*
* The 'commentstring' option is changed.
*/
return NULL;
}
-#endif
/*
* Check if value for 'complete' is valid when 'complete' option is changed.
char_u *b_p_cinsd; // 'cinscopedecls'
char_u *b_p_cinw; // 'cinwords'
char_u *b_p_com; // 'comments'
-#ifdef FEAT_FOLDING
char_u *b_p_cms; // 'commentstring'
-#endif
char_u *b_p_cot; // 'completeopt' local value
unsigned b_cot_flags; // flags for 'completeopt'
char_u *b_p_cpt; // 'complete'
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1924,
/**/
1923,
/**/