aboutsummaryrefslogtreecommitdiff
path: root/plugin/paste_insert.vim
blob: ecb97ca28b13469cba7c3c30d14c236b2b0e7268 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"
" This small plugin provides a simple "one shot paste" method, with a command
" or mapping to prefix opening an insert, with the 'paste' option
" automatically set after the insert ends, to avoid the annoyances caused by
" forgetting to do so.
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
"
if exists('loaded_paste_insert') || &compatible
  finish
endif
let loaded_paste_insert = 1

" Create the augroup here, so that the user can hook into it if they need to
augroup paste_insert
  autocmd!
augroup END

" Command interface
command! -bar PasteInsert
      \ call paste_insert#()

" Normal mode mapping interface
nnoremap <Plug>PasteInsert
      \ :<C-U>PasteInsert<CR>