<commit_before>" See the accompanying README for details.

" vat - visually select all text with the current tag
" \<esc> - exit visual selection mode
" `< - jump to beginning of visual selection
" The substitute "e" flag in the following two commands tells Vim
" that not finding a match should not be treated as an error.
" :'<,'>s/<!--/<!__/ge\<cr> - replace all beginning comment delimiters in the range with <!__
" :'<,'>s/-->/__>/ge\<cr> - replace all ending comment delimiters in the range with __>
" :nohlsearch\<cr> - turn off highlighting of previous search results
" `> - jump to ending of previous visual selection
" i-- - insert ending comment delimiter --
" esc - exit insert mode
" `< - jump to beginning of previous visual selection
" a!-- - append beginning comment delimiter !--
" esc - insert mode
command! ElementComment execute "normal! vat\<esc>`<:'<,'>s/<!--/<!__/ge\<cr>:'<,'>s/-->/__>/ge\<cr>:nohlsearch\<cr>`>i--\<esc>`<a!--\<esc>"

" ?!--\<cr> - search backward for beginning comment delimiter
" mb - mark beginning of comment
" 3x - delete the beginning comment delimiter
" /--\<cr> - search forward for ending comment delimiter
" me - mark end of comment
" 2x - delete the ending comment delimiter
" :'b,'es/<!__/<!--/g\<cr> - fix nested beginning comment delimiters
" :'b,'es/__>/-->/g\<cr> - fix nested ending comment delimters
command! ElementUncomment execute "normal! ?!--\<cr>mb3x/--\<cr>me2x:'b,'es/<!__/<!--/ge\<cr>:'b,'es/__>/-->/ge\<cr>"

command TagComment execute "normal! vi<\<esc>a--\<esc>`<i!--\<esc>"
command TagUncomment execute "normal! vi<\<esc>hxx`<xxxh"

nnoremap <leader>tc :ElementComment<cr>
nnoremap <leader>tu :ElementUncomment<cr>

nnoremap <leader>tC :TagStartComment<cr>
nnoremap <leader>tU :TagStartUncomment<cr>
<commit_msg>Update tag-comment.vim<commit_after>" See the accompanying README for details.

" vat - visually select all text with the current tag
" \<esc> - exit visual selection mode
" `< - jump to beginning of visual selection
" The substitute "e" flag in the following two commands tells Vim
" that not finding a match should not be treated as an error.
" :'<,'>s/<!--/<!__/ge\<cr> - replace all beginning comment delimiters in the range with <!__
" :'<,'>s/-->/__>/ge\<cr> - replace all ending comment delimiters in the range with __>
" :nohlsearch\<cr> - turn off highlighting of previous search results
" `> - jump to ending of previous visual selection
" i-- - insert ending comment delimiter --
" esc - exit insert mode
" `< - jump to beginning of previous visual selection
" a!-- - append beginning comment delimiter !--
" esc - insert mode
command! ElementComment execute "normal! vat\<esc>`<:'<,'>s/<!--/<!__/ge\<cr>:'<,'>s/-->/__>/ge\<cr>:nohlsearch\<cr>`>i--\<esc>`<a!--\<esc>"

" ?!--\<cr> - search backward for beginning comment delimiter
" mb - mark beginning of comment
" 3x - delete the beginning comment delimiter
" /--\<cr> - search forward for ending comment delimiter
" me - mark end of comment
" 2x - delete the ending comment delimiter
" :'b,'es/<!__/<!--/g\<cr> - fix nested beginning comment delimiters
" :'b,'es/__>/-->/g\<cr> - fix nested ending comment delimters
command! ElementUncomment execute "normal! ?!--\<cr>mb3x/--\<cr>me2x:'b,'es/<!__/<!--/ge\<cr>:'b,'es/__>/-->/ge\<cr>"

command! TagComment execute "normal! vi<\<esc>a--\<esc>`<i!--\<esc>"
command! TagUncomment execute "normal! vi<\<esc>hxx`<xxxh"

nnoremap <leader>tc :ElementComment<cr>
nnoremap <leader>tu :ElementUncomment<cr>

nnoremap <leader>tC :TagComment<cr>
nnoremap <leader>tU :TagUncomment<cr>

{'fraction_non_alphanumeric': 0.17539927150462314, 'fraction_numerical': 0.002241524236480807, 'mean_word_length': 4.028169014084507, 'pattern_counts': {'":': 0, '<': 105, '<?xml version=': 0, '>': 93, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4083264', 'n_tokens_mistral': 1213, 'n_tokens_neox': 1135, 'n_words': 379}