Last active
July 14, 2020 08:24
-
-
Save wheelsandmetal/64968a35001dea0782146f04c6aef5eb to your computer and use it in GitHub Desktop.
Creating a custom begin command in latex and have the matching end command auto inserted. All pure vim script
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment