diff --git a/README.md b/README.md index 6d50e2e..a482c03 100644 --- a/README.md +++ b/README.md @@ -330,6 +330,7 @@ _343 TILs and counting..._ - [Absolute And Relative Line Numbers](vim/absolute-and-relative-line-numbers.md) - [Add A File Without Loading It](vim/add-a-file-without-loading-it.md) - [Add Custom Dictionary Words](vim/add-custom-dictionary-words.md) +- [Almost The End Of The Line](vim/almost-the-end-of-the-line.md) - [Alternate Files With vim-rails](vim/alternate-files-with-vim-rails.md) - [Amend Commits With Fugitive](vim/amend-commits-with-fugitive.md) - [Backspace Options](vim/backspace-options.md) diff --git a/vim/almost-the-end-of-the-line.md b/vim/almost-the-end-of-the-line.md new file mode 100644 index 0000000..5343cee --- /dev/null +++ b/vim/almost-the-end-of-the-line.md @@ -0,0 +1,21 @@ +# Almost The End Of The Line + +If you are visually selecting from the cursor to the end of the line, you +will probably hit: + +``` +v$ +``` + +This isn't always ideal though because the visual selection includes the +newline character at the end of the line. If instead you'd like to select to +the last non-blank character on the line you can use the `_g` motion. This +is great for deleting to the end of the line. + +``` +dg_ +``` + +See `:h g_` for more details. + +h/t Dorian Karter