aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin/paste_hook.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-09-14 15:42:26 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-09-14 15:42:26 +1200
commit0023ffb488256c8b89911d88ab7cea418c09e6c1 (patch)
treeb0ac2db9362704f8f83610ed7fdd253e1b69a1dc /vim/plugin/paste_hook.vim
parentMerge branch 'release/v1.69.0' into develop (diff)
downloaddotfiles-0023ffb488256c8b89911d88ab7cea418c09e6c1.tar.gz
dotfiles-0023ffb488256c8b89911d88ab7cea418c09e6c1.zip
Revert "Replace paste_open.vim with paste_hook....
This reverts commit dce5abc0724428f805562dd32bf9a71677d55aaa. On review, paste_open is good enough. I can always dig this back up again if I need to.
Diffstat (limited to 'vim/plugin/paste_hook.vim')
-rw-r--r--vim/plugin/paste_hook.vim44
1 files changed, 0 insertions, 44 deletions
diff --git a/vim/plugin/paste_hook.vim b/vim/plugin/paste_hook.vim
deleted file mode 100644
index 5697a198..00000000
--- a/vim/plugin/paste_hook.vim
+++ /dev/null
@@ -1,44 +0,0 @@
-"
-" paste_hook.vim: Mapping target to add a self-clearing autocmd that unsets
-" 'paste' on the next InsertLeave event, if set; intended for use as a prefix
-" to an insert session to make it happen in paste mode.
-"
-" Author: Tom Ryder <tom@sanctum.geek.nz
-" Copyright: Same as Vim itself
-"
-if exists('g:loaded_paste_hook') || &compatible
- finish
-endif
-if !exists('##InsertLeave')
- finish
-endif
-let g:loaded_paste_hook = 1
-
-" Start paste mode, establish hook to end it
-function! s:Set() abort
-
- " Do nothing if 'paste' is already set
- if &paste
- return
- endif
-
- " Turn on 'paste' mode and set up the hook to clear it the next time we
- " leave insert mode
- set paste
- augroup paste_hook
- autocmd!
- autocmd InsertLeave * call s:Clear()
- augroup END
-
-endfunction
-
-" End paste mode and clear the hook that called us
-function! s:Clear() abort
- set nopaste
- autocmd! paste_hook InsertLeave
-endfunction
-
-" Set up mappings
-nnoremap <silent> <unique>
- \ <Plug>(PasteHook)
- \ :<C-U>call <SID>Set()<CR>