@@ -29,6 +29,7 @@ to execute code instantly!
2929 :ScratchBufferOpen ts
3030
3131 " Write TypeScript code
32+ " ...
3233
3334 " ...and run it immediately!
3435 :QuickRun
@@ -42,13 +43,17 @@ https://github.com/aiya000/vim-scratch-buffer
4243==============================================================================
4344USAGE *scratch-buffer-usage*
4445
45- Open a scratch buffer. Please specify a file extension you want :
46+ Open a scratch buffer with or without a file extension:
4647>
48+ " Open a new scratch buffer without file extension and filetype
49+ :ScratchBufferOpen
50+ :ScratchBufferOpen --no-file-ext
51+
4752 " Open a markdown buffer
4853 :ScratchBufferOpen md
4954
50- " Open a markdown buffer with :sp
51- :ScratchBufferOpen md sp
55+ " Open a buffer without file extension and filetype with :sp and 3 lines
56+ :ScratchBufferOpen --no-file-ext sp 3
5257
5358 " Open a markdown buffer with :sp and 3 lines
5459 :ScratchBufferOpen md sp 3
@@ -78,12 +83,18 @@ VARIABLES *scratch-buffer-variables*
7883COMMANDS *scratch-buffer-commands*
7984
8085 *:ScratchBufferOpen*
81- :ScratchBufferOpen { file-extension} [open-method] [buffer-size]
86+ :ScratchBufferOpen [ file-extension | --no-file-ext] [open-method] [buffer-size]
8287 Open a scratch buffer with a random file name.
83-
88+
8489 This opens buffers by the rule
8590 described in `g: scratch_buffer_tmp_file_pattern ` .
8691
92+ [file-extension] is an optional argument:
93+ - When omitted or --no-file-ext is specified:
94+ Creates a buffer without file extension and filetype
95+ - Otherwise:
96+ Uses the specified extension (e.g., 'md' , 'ts' ) as filetype
97+
8798 The buffer is opened as a temporary buffer.
8899 The following properties:
89100>
@@ -115,8 +126,13 @@ COMMANDS *scratch-buffer-commands*
115126FUNCTIONS *scratch-buffer-functions*
116127
117128 *scratch_buffer#open()*
118- scratch_buffer#open({file-extension} [, open-method][, buffer-size])
119- Same as `:ScratchBufferOpen` .
129+ scratch_buffer#open([file-extension | --no-filetype][, open-method][, buffer-size])
130+ Same as `:ScratchBufferOpen` . Creates a buffer with or without
131+ filetype based on the first argument:
132+ - When an empty string or`' --no-file-ext' ` is specified:
133+ Creates a buffer without file extension and filetype
134+ - Otherwise:
135+ Uses the specified extension as filetype
120136
121137 *scratch_buffer#clean_all_of()*
122138scratch_buffer#clean_all_of({file-extension} )
0 commit comments