aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autoload/scratch_buffer.vim11
-rw-r--r--plugin/scratch_buffer.vim2
2 files changed, 13 insertions, 0 deletions
diff --git a/autoload/scratch_buffer.vim b/autoload/scratch_buffer.vim
new file mode 100644
index 0000000..c0ef7cf
--- /dev/null
+++ b/autoload/scratch_buffer.vim
@@ -0,0 +1,11 @@
+function! scratch_buffer#(mods, count, ...) abort
+ let command = []
+ call add(command, a:mods)
+ if a:count
+ call add(command, a:count)
+ endif
+ call add(command, 'new')
+ call extend(command, a:000)
+ execute join(command)
+ set buftype=nofile
+endfunction
diff --git a/plugin/scratch_buffer.vim b/plugin/scratch_buffer.vim
new file mode 100644
index 0000000..c209c8b
--- /dev/null
+++ b/plugin/scratch_buffer.vim
@@ -0,0 +1,2 @@
+command! -bar -count=0 -nargs=* ScratchBuffer
+ \ call scratch_buffer#(<q-mods>, <q-count>, <f-args>)