Immediately after opening a file, type “gg” to move the cursor to the first line of the file, assuming it is not already there. Then type dG to delete all the lines or text in it.
press q and q for recording into q register (we use "q" as shortcut to remember "quotes"). press a then press ' again to surround the word with quotes.
d<leftArrow> will delete current and left character. d$ will delete from current position to end of line. d^ will delete from current backward to first non-white-space character. d0 will delete from current backward to beginning of line.
Try the following sequence, which can be thought of as "d"elete, "i"nside, quotes, so: di"
The following sentence drops everything inside the quotes while being in normal mode:
di"
where:
Note that it is not needed to be inside the quotes when you call it, the own command looks for the first occurence of text inside quotes in the current line and deletes it, so you can save some key strokes.
Additionally, if you are interested in deleting the quotes too, then apply the following command (a means "and around it")
da"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With