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:
@@ -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)
|
||||
|
||||
21
vim/almost-the-end-of-the-line.md
Normal file
21
vim/almost-the-end-of-the-line.md
Normal 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
|
||||
Reference in New Issue
Block a user