@@ -79,3 +79,47 @@ Compared to scratch.vim, vim-scratch-buffer provides these additional features:
79
79
" Delete all scratch files and buffers
80
80
:ScratchBufferClean
81
81
```
82
+
83
+ ## :keyboard : Default Keymappings
84
+
85
+ By default (` g:scratch_buffer_use_default_keymappings ` is enabled), the following keymappings are available:
86
+
87
+ ``` vim
88
+ nnoremap <silent> <leader>b <Cmd>ScratchBufferOpen<CR>
89
+ nnoremap <silent> <leader>B <Cmd>ScratchBufferOpenFile<CR>
90
+ nnoremap <leader><leader>b :<C-u>ScratchBufferOpen<Space>
91
+ nnoremap <leader><leader>B :<C-u>ScratchBufferOpenFile<Space>
92
+ ```
93
+
94
+ You can disable these default keymappings by setting:
95
+
96
+ ``` vim
97
+ let g:scratch_buffer_use_default_keymappings = v:false
98
+ ```
99
+
100
+ ## :sparkles : scratch.vim Compatibility
101
+
102
+ To make the plugin behave like scratch.vim, you can enable automatic buffer hiding!
103
+ When enabled, scratch buffers will automatically hide when you leave the window.
104
+ You can configure this behavior separately for temporary buffers and file buffers.
105
+
106
+ Enable both types of buffer hiding with:
107
+
108
+ ``` vim
109
+ let g:scratch_buffer_auto_hide_buffer = #{
110
+ \ when_tmp_buffer: v:true,
111
+ \ when_file_buffer: v:true,
112
+ \ }
113
+ ```
114
+
115
+ Or enable hiding for only temporary buffers:
116
+
117
+ ``` vim
118
+ let g:scratch_buffer_auto_hide_buffer = #{ when_tmp_buffer: v:true }
119
+ ```
120
+
121
+ Or enable hiding for only file buffers:
122
+
123
+ ``` vim
124
+ let g:scratch_buffer_auto_hide_buffer = #{ when_file_buffer: v:true }
125
+ ```
0 commit comments