Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete till the end of line (exclusive of current letter)

I know d$ or D will delete till the end of line including the letter on the cursor? Is there a way to do this excluding the letter on the cursor? I did :h d in vim and browsed around a bit but couldn't find if this is possible. I am trying to do this in AppCode with IdeaVim plugin.

like image 654
user674669 Avatar asked Aug 12 '12 12:08

user674669


People also ask

How do I remove the content from current cursor position to end of the file?

The command dw will delete from the current cursor position to the beginning of the next word character. The command d$ (note, that's a dollar sign, not an 'S') will delete from the current cursor position to the end of the current line. D (uppercase D) is a synonym for d$ (lowercase D + dollar sign). Save this answer.

What is the command to delete part of the line starting from the current cursor position in Vi?

To delete a line in Vi or Vim, switch to normal mode first. If you're into command mode or insert mode, you can switch back to normal mode by pressing Escape. Highlight the line that you want to delete, then hit dd or D on the keyboard.

How do I remove the content from current cursor position to end of the file in Linux?

Make sure you are in the normal mode by pressing Esc . Enter the Visual mode by pressing V . Press G i.e Shift + g to select the text from the cursor to the end of the file . Now press x to delete the selected text .


1 Answers

In normal mode, you could do lD or ld$.

like image 178
src Avatar answered Sep 17 '22 15:09

src