Skip to content

Instantly share code, notes, and snippets.

@saisasidhar
saisasidhar / alapasty.vim
Created March 27, 2021 19:50
Paste text from alacritty into vim without additional blanklines
" Paste text from alacritty (windows) into vim without additional blanklines
" Issue: https://github.com/alacritty/alacritty/issues/2324
"
" Place this vim file in a plugin directory of vim. Example: $HOME/.vim/plugin/alapasty.vim
" Type `:Ap<Cr>` to open up a buffer in insert mode. Use `Shift+Insert` to copy text into this buffer.
" Press <Esc> and the text will be formatted and placed in the originating buffer
"
" Note: This plugin takes care of some common edge-cases when working with code. Make sure the first few lines are
" either blank (just line endings is okay) or it has the first line of the content you want to paste.
" This is critical because the script uses "%normal jdd" to dispatch repetitive jump and delete motions over the entire file.