Skip to content

Commit 5218c68

Browse files
committed
readme: Follow latest specs
1 parent 4dc3680 commit 5218c68

File tree

1 file changed

+83
-28
lines changed

1 file changed

+83
-28
lines changed

README.md

Lines changed: 83 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,28 @@ This Vim plugin is created by **Cline (Roo Code)** and me!
1414

1515
- - -
1616

17-
## :wrench: Quick Start
17+
## Table of Contents
1818

19-
```vim
20-
" Open a new scratch buffer without file extension and filetype
21-
:ScratchBufferOpen
22-
:ScratchBufferOpen --no-file-ext
23-
```
19+
- [:sparkles: scratch-buffer.vim :sparkles:](#sparkles-scratch-buffervim-sparkles)
20+
- [:wrench: Quick Start](#wrench-quick-start)
21+
- [:fire: Why scratch-buffer.vim?](#fire-why-scratch-buffervim)
22+
- [:zap: Supercharge with vim-quickrun!](#zap-supercharge-with-vim-quickrun)
23+
- [:balance_scale: Comparison with scratch.vim](#balance_scale-comparison-with-scratchvim)
24+
- [:gear: Detailed Usage](#gear-detailed-usage)
25+
- [:keyboard: Default Keymappings](#keyboard-default-keymappings)
26+
- [:sparkles: scratch.vim Compatibility](#sparkles-scratchvim-compatibility)
2427

25-
```vim
26-
" Open a new scratch buffer with Markdown filetype
27-
:ScratchBufferOpen md
28-
```
28+
## :wrench: Quick Start
2929

3030
```vim
31-
" Open a small buffer at the top for quick notes
32-
:ScratchBufferOpen md sp 5
33-
:ScratchBufferOpen --no-file-ext sp 5
31+
:ScratchBufferOpen " Open a temporary buffer using default options
32+
:ScratchBufferOpen md sp 5 " Open a temporary Markdown buffer with :sp and height 5
33+
:ScratchBufferOpenFile ts vsp 100 " Open a persistent TypeScript buffer with :vsp and width 100
34+
:ScratchBufferOpenNext " Open next temporary buffer
35+
:ScratchBufferOpenFileNext " Open next persistent buffer
3436
```
3537

36-
Of course, you can open other file types too!
37-
38-
```vim
39-
" Open a TypeScript buffer
40-
:ScratchBufferOpen ts
41-
```
38+
Please see '[Detailed Usage](#gear-detailed-usage)' section for more information.
4239

4340
## :fire: Why scratch-buffer.vim?
4441

@@ -65,15 +62,60 @@ However, vim-scratch-buffer adds more features.
6562

6663
Compared to scratch.vim, vim-scratch-buffer provides these additional features:
6764

68-
- Open multiple buffers with sequential numbering
65+
- Flexible buffer management
66+
- Open multiple buffers with sequential numbering (`:ScratchBufferOpenNext`)
67+
- Quick access to recently used buffers (`:ScratchBufferOpen`)
6968
- When you want to take notes on different topics, scratch.vim only allows one buffer
70-
- See [`:ScratchBufferOpen`](https://github.com/aiya000/vim-scratch-buffer/blob/736eef08b531b91c95497917ddb97ffbc2047c73/doc/vim-scratch-buffer.txt#L86)
71-
- Choose between writeable buffers or temporary buffers
72-
- See [`:ScratchBufferOpen`](https://github.com/aiya000/vim-scratch-buffer/blob/736eef08b531b91c95497917ddb97ffbc2047c73/doc/vim-scratch-buffer.txt#L86) and [`:ScratchBufferOpenFile`](https://github.com/aiya000/vim-scratch-buffer/blob/736eef08b531b91c95497917ddb97ffbc2047c73/doc/vim-scratch-buffer.txt#L120)
73-
- Specify filetype, opening method (`:split` or `:vsplit`), and buffer height (width)
74-
- Filetype specification enables syntax highlighting
69+
- See `:help :ScratchBufferOpen` and `:help :ScratchBufferOpenNext`
70+
71+
- Buffer type options
72+
- Choose between writeable buffers or temporary buffers
73+
- Automatic saving for file buffers when enabled
74+
- Convert temporary buffers to persistent ones when needed
75+
- See `:help :ScratchBufferOpen` and `:help :ScratchBufferOpenFile`
76+
77+
- Customization options
78+
- Specify filetype for syntax highlighting
79+
- Choose opening method (`:split` or `:vsplit`)
80+
- Control buffer height/width
81+
- Configurable auto-hiding behavior
82+
83+
### :gear: Detailed Usage
84+
85+
```vim
86+
" Basic Usage
87+
88+
" Open a temporary buffer using default settings
89+
:ScratchBufferOpen
90+
91+
" Same as :ScratchBufferOpen but opens a writable persistent buffer
92+
:ScratchBufferOpenFile
93+
```
94+
95+
```vim
96+
" Open a new scratch buffer with a specific filetype
97+
98+
" Example: Markdown
99+
:ScratchBufferOpen md
100+
101+
" Example: TypeScript
102+
:ScratchBufferOpen ts
103+
104+
" Example: No filetype
105+
:ScratchBufferOpen --no-file-ext
106+
```
107+
108+
```vim
109+
" Open multiple scratch buffers
110+
:ScratchBufferOpen md " Opens most recently used buffer
111+
:ScratchBufferOpenNext md " Always creates a new buffer
112+
```
75113

76-
## :gear: Other Features
114+
```vim
115+
" Open a small buffer at the top for quick notes
116+
:ScratchBufferOpen md sp 5
117+
:ScratchBufferOpen --no-file-ext sp 5
118+
```
77119

78120
```vim
79121
" Delete all scratch files and buffers
@@ -82,21 +124,34 @@ Compared to scratch.vim, vim-scratch-buffer provides these additional features:
82124

83125
## :keyboard: Default Keymappings
84126

85-
By default (`g:scratch_buffer_use_default_keymappings` is enabled), the following keymappings are available:
127+
When `g:scratch_buffer_use_default_keymappings` is enabled (default: `v:false`), the following keymappings are available:
86128

87129
```vim
130+
" Quick open commands (execute immediately)
88131
nnoremap <silent> <leader>b <Cmd>ScratchBufferOpen<CR>
89132
nnoremap <silent> <leader>B <Cmd>ScratchBufferOpenFile<CR>
133+
134+
" Interactive commands (allows adding arguments)
90135
nnoremap <leader><leader>b :<C-u>ScratchBufferOpen<Space>
91136
nnoremap <leader><leader>B :<C-u>ScratchBufferOpenFile<Space>
92137
```
93138

94-
You can disable these default keymappings by setting:
139+
The quick open commands create buffers with default settings, while the interactive commands let you specify file extension, open method, and buffer size.
140+
141+
You can customize these mappings by disabling the defaults:
95142

96143
```vim
97144
let g:scratch_buffer_use_default_keymappings = v:false
98145
```
99146

147+
And then defining your own:
148+
149+
```vim
150+
" Example custom mappings
151+
nnoremap <silent> <leader>s <Cmd>ScratchBufferOpen<CR>
152+
nnoremap <silent> <leader>S <Cmd>ScratchBufferOpenFile<CR>
153+
```
154+
100155
## :sparkles: scratch.vim Compatibility
101156

102157
To make the plugin behave like scratch.vim, you can enable automatic buffer hiding!

0 commit comments

Comments
 (0)