Может быть, вы можете сделать nnormap.
Каждая пара end / do находится в одном и том же отступе, поэтому сначала вы должны найти отступ для пары - в этом случае следующая строка для того же отступа (потому что ваш курсор находится вdo
строка.)
Таким образом, вы можете сделать функцию vimscript с поиском следующей строки отступа и удалить ее.
Это пример функции.Вы можете настроить желаемый - т.е.) установить отступ для линий покоя.
function! DeleteWithSameIndent(inc)
" Get the cursor current position
let currentPos = getpos('.')
let currentLine = currentPos[1]
let firstLine = currentPos[1]
let matchIndent = 0
d
" Look for a line with the same indent level whithout going out of the buffer
while !matchIndent && currentLine != line('$') + 1 && currentLine != -1
let currentLine += a:inc
let matchIndent = indent(currentLine) == indent('.')
endwhile
" If a line is found go to this line
if (matchIndent)
let currentPos[1] = currentLine
call setpos('.', currentPos)
d
endif
endfunction
nnoremap di :call DeleteWithSameIndent(1)<CR>