Skip to content

Commit ff18978

Browse files
committed
Make documentation
1 parent 9f5ebee commit ff18978

File tree

1 file changed

+126
-0
lines changed

1 file changed

+126
-0
lines changed

doc/vim-scratch-buffer.txt

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
*scratch-buffer.vim* The fastest way to open scratch buffers
2+
3+
Author: aiya000
4+
License: MIT license
5+
6+
==============================================================================
7+
CONTENTS *scratch-buffer-contents*
8+
9+
INTRODUCTION |scratch-buffer-introduction|
10+
USAGE |scratch-buffer-usage|
11+
INTERFACE |scratch-buffer-interface|
12+
VARIABLES |scratch-buffer-variables|
13+
COMMANDS |scratch-buffer-commands|
14+
FUNCTIONS |scratch-buffer-functions|
15+
CHANGELOG |scratch-buffer-changelog|
16+
17+
18+
==============================================================================
19+
INTRODUCTION *scratch-buffer-introduction*
20+
21+
**No more hassle with file paths!**
22+
A fastest way to open a instant scratch buffer.
23+
24+
Supercharge with vim-quickrun!
25+
Combine it with [vim-quickrun](https://github.com/thinca/vim-quickrun)
26+
to execute code instantly!
27+
>
28+
" Open a TypeScript buffer
29+
:ScratchBufferOpen ts
30+
31+
" Write TypeScript code
32+
33+
" ...and run it immediately!
34+
:QuickRun
35+
<
36+
Please see the`scratch-buffer-usage`section for usage of`:ScratchBufferOpen`.
37+
38+
Newer Version:
39+
https://github.com/aiya000/vim-scratch-buffer
40+
41+
42+
==============================================================================
43+
USAGE *scratch-buffer-usage*
44+
45+
Open a scratch buffer. Please specify a file extension you want:
46+
>
47+
" Open a markdown buffer
48+
:ScratchBufferOpen md
49+
50+
" Open a markdown buffer by :sp
51+
:ScratchBufferOpen md sp
52+
53+
" Open a markdown buffer by :sp with 3 lines
54+
:ScratchBufferOpen md sp 3
55+
<
56+
Of course, you can open other file types too:
57+
>
58+
" Open a TypeScript buffer
59+
:ScratchBufferOpen ts
60+
<
61+
62+
==============================================================================
63+
INTERFACE *scratch-buffer-interface*
64+
65+
------------------------------------------------------------------------------
66+
VARIABLES *scratch-buffer-variables*
67+
68+
*g:scratch_buffer_tmp_file_pattern*
69+
Default: '/tmp/vim-scratch-buffer-%d'
70+
71+
When `ScratchBufferOpen` opens a scratch buffer, it will make a
72+
decision based on this.
73+
Specifically, `printf($'/tmp/vim-scratch-buffer-%d.{ext}', count)` will
74+
opened. `ext` is the first argument of `ScratchBufferOpen`.
75+
`count` is the number of currently open scratch buffers +1.
76+
77+
------------------------------------------------------------------------------
78+
COMMANDS *scratch-buffer-commands*
79+
80+
*:ScratchBufferOpen*
81+
:ScratchBufferOpen {file-extension} [open-method] [buffer-size]
82+
Open a scratch buffer with a random file name.
83+
84+
This opens buffers by the rule
85+
described in`g:scratch_buffer_tmp_file_pattern`.
86+
87+
The opened buffers doesn't`:write`automatically.
88+
You can select do`:write`or don't.
89+
90+
[open-method] is an optional argument, should be`'sp'`or`'vsp'`.
91+
Open the buffer onto top if `'sp'`,
92+
or open the buffer onto left if`'vsp'`.
93+
Please also see`:split`and`:vsplit`.
94+
Default value is`'vsp'`.
95+
96+
[buffer-size] is an optional argument, should be a positive number.
97+
`:ScratchBufferOpen`resizes the opened buffer on opened,
98+
or doesn't resize if this is omitted.
99+
100+
101+
*:ScratchBufferCleanAllOf*
102+
:ScratchBufferCleanAllOf [file-extension]
103+
Delete all scratch files and buffers that
104+
is opened by`:ScratchBufferOpen`.
105+
106+
107+
==============================================================================
108+
FUNCTIONS *scratch-buffer-functions*
109+
110+
*scratch_buffer#open()*
111+
scratch_buffer#open({file-extension}[, open-method][, buffer-size])
112+
Same as`:ScratchBufferOpen`.
113+
114+
*scratch_buffer#clean_all_of()*
115+
scratch_buffer#clean_all_of({file-extension})
116+
Same as`:ScratchBufferCleanAllOf`.
117+
118+
119+
==============================================================================
120+
CHANGELOG *scratch-buffer-changelog*
121+
122+
Please see https://github.com/aiya000/vim-scratch-buffer/commits/main
123+
124+
125+
==============================================================================
126+
vim:tw=78:ts=8:ft=help:norl:noet:fen:fdm=marker

0 commit comments

Comments
 (0)