Last active
July 31, 2020 12:02
-
-
Save mrbalihai/afa9e9cf9413f2386b7f2bb726913d2d to your computer and use it in GitHub Desktop.
Toggle strike through in pandoc markdown
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! ToggleStrikethrough() | |
let line = getline('.') | |
if stridx(line, "~~") == -1 | |
call setline(line('.'), substitute(line, '\(\s*-\s\)\(.*\)', '\1\~\~\2\~\~', "g")) | |
else | |
call setline(line('.'), substitute(line, '\~\~', '', "g")) | |
endif | |
endfunction | |
map <localleader>d :call ToggleStrikethrough()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment