aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-06-23 17:22:48 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-06-23 17:22:48 +1200
commite95e4c2acc1c9dd131dde12e733c86cdc090ba6c (patch)
treed79bdf998e04bbf6faf6015f45041ffa2cd6d33a
parent1b66c80a383db3cc0634a2d8f3bd759d73537ad7 (diff)
parent82c535433eb763b98ffd4bc88bbadd46321b0bcd (diff)
downloaddotfiles-e95e4c2acc1c9dd131dde12e733c86cdc090ba6c.tar.gz
dotfiles-e95e4c2acc1c9dd131dde12e733c86cdc090ba6c.zip
Merge branch 'release/v6.41.0'v6.41.0
* release/v6.41.0: Add basic homebrew scratch buffer plugin Have a little fun with compatible vi
-rw-r--r--VERSION4
-rw-r--r--vim/autoload/scratch.vim11
-rw-r--r--vim/plugin/scratch.vim2
-rw-r--r--vim/vimrc6
-rw-r--r--vim/vimrc.stub11
5 files changed, 27 insertions, 7 deletions
diff --git a/VERSION b/VERSION
index 133bccc7..a56d4a94 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v6.40.0
-Sun, 23 Jun 2019 04:31:46 +0000
+tejr dotfiles v6.41.0
+Sun, 23 Jun 2019 05:22:48 +0000
diff --git a/vim/autoload/scratch.vim b/vim/autoload/scratch.vim
new file mode 100644
index 00000000..bf6566dc
--- /dev/null
+++ b/vim/autoload/scratch.vim
@@ -0,0 +1,11 @@
+function! scratch#(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/vim/plugin/scratch.vim b/vim/plugin/scratch.vim
new file mode 100644
index 00000000..399f5a31
--- /dev/null
+++ b/vim/plugin/scratch.vim
@@ -0,0 +1,2 @@
+command! -bar -count=0 -nargs=* Scratch
+ \ call scratch#(<q-mods>, <q-count>, <f-args>)
diff --git a/vim/vimrc b/vim/vimrc
index d8c40e38..b9b491e9 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1625,6 +1625,12 @@ xmap <Leader>7 <Leader>&
"" Leader,*/8 is sticky-star: search, highlight, but don't move
nnoremap <silent> <Leader>* *N
nmap <Leader>8 <Leader>*
+"" Leader,` opens a scratch buffer, horizontally split
+nnoremap <silent> <Leader>`
+ \ :<C-U>Scratch<CR>
+"" Leader,~ opens a scratch buffer, vertically split
+nnoremap <silent> <Leader>~
+ \ :<C-U>vertical Scratch<CR>
" And last, but definitely not least, I'm required by Vim fanatic law to
" include a mapping that reloads my whole configuration. This uses the
diff --git a/vim/vimrc.stub b/vim/vimrc.stub
index dfadac92..00a44ba3 100644
--- a/vim/vimrc.stub
+++ b/vim/vimrc.stub
@@ -13,14 +13,15 @@ endif
" If we got this far, it means we're running a tiny, 'compatible', and/or
" ancient version of Vim.
"
-" So, strip out our user runtime directories from 'runtimepath', force
+" So, strip out our the runtime directories from 'runtimepath', force
" 'compatible' on, source your trusty ~/.exrc, put on your dubbed cassette
-" copy of Kraftwerk's 'Computerwelt', and start using Sun OS 4.x vi v3.7, from
-" July 1985.
-"
-" Don't grizzle, just use it. It's good for you, like raisin bran.
+" copy of Kraftwerk's 'Computerwelt', and start using vi v3.7 on your
+" engineering department's Sun OS 4.x server via your VT220 terminal. It's
+" July 1985, you grok ANSI C, and it's good for you, like raisin bran.
"
set runtimepath-=~/.vim
set runtimepath-=~/.vim/after
set compatible
+set shortmess+=I
+set t_Co=0
silent! source ~/.exrc