aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-07-23 23:34:47 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-07-23 23:34:47 +1200
commit91b0c9f47100ae2c24bc963ab22c24c76d592502 (patch)
tree9a26f5d6900534d4d207f9e2fc368be1da030679
downloadvim-scratch-buffer-91b0c9f47100ae2c24bc963ab22c24c76d592502.tar.gz
vim-scratch-buffer-91b0c9f47100ae2c24bc963ab22c24c76d592502.zip
Commit plugin as it stands
Extracted from my dotfiles v7.1.0
-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>)