In Vim, I want to visually select some lines, and then insert a copy of the selected selection either above or below the original selection, depending on whether the visual selection was created up or down. Therefore, if I start visual mode on line 100 and move the cursor 10 lines, it will be an upward visual selection, whereas if I start from line 100 and move the cursor down 10 lines, it will be a downward selection. line("'<") and line("'>") identical in both cases, so it seems that Vim always selects a smaller number as the start of the selection. Is there a way to determine if the visual selection was up or down?
source share