1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 07:08:01 +00:00

Add Almost The End Of The Line as a vim til

This commit is contained in:
jbranchaud
2016-02-22 20:15:01 -06:00
parent 5a82c39f8e
commit 26173e164b
2 changed files with 22 additions and 0 deletions

View File

@@ -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)

View File

@@ -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