From a5091fe2b294d1a79fc0b8096eae6a287e3346f6 Mon Sep 17 00:00:00 2001 From: Nathan Schneider Date: Wed, 13 Aug 2025 16:41:55 -0600 Subject: [PATCH] Improved comment function for multiline selection --- .vimrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index 99f95f7..111f0fc 100644 --- a/.vimrc +++ b/.vimrc @@ -34,7 +34,14 @@ set shell=bash\ -l " Shortcuts command! Proximate :e ~/Cloud/Notes/Proximate.md command! W :w|b#|bd# -command! -range Comment ,s/\%V.*\%V.// +command! -range Comment call CommentWrap(, ) + +function! CommentWrap(start, end) + " Insert closing comment after the last line + call append(a:end, '--->') + " Insert opening comment before the first line + call append(a:start - 1, '