This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! FindAndReplaceInputWordInNext3Lines() | |
call inputsave() | |
let word = input("> ") | |
call inputrestore() | |
execute printf(":.,.+3s/THISISAWORD/%s/g", word) | |
endfunction | |
au! FileType tex inoremap ,beg \begin{THISISAWORD}<Enter><Enter>\end{THISISAWORD}<Enter><Enter><++><Esc>4k0fR:call FindAndReplaceInputWordInNext3Lines()<cr>ka |