Select entire line in VIM, without the new line character

vim

Solution

No, there is nothing built-in that does the job. That's why people have even created plugins to address the need.

Probably the most popular choice is textobj-line. With textobj-line you get two new text objects, `al` "a line" and `il` "inner line". Then,

- `vil` selects the printable contents of the line (like `^vg_`),

- `val` selects the entire line contents (like `0v$h`).

Both do not include the newline in the selection.

Pretty handy plugin if you ask me. And it works with operators, too.

By request, the installation:

- With plain Vim:

- Get the latest textobj-user and extract its directories into `~/.vim`.

- Get the latest textobj-line and extract its directories into `~/.vim`.

- Generate the help tags `:helptags ~/.vim/doc`.

- With a plugin manager (recommended): just follow the usual installation procedure for your plugin manager, and don't forget to install the textobj-user dependency as well.

Problem

Which is the shortest way to select an entire line without the new line character in VIM? I know that SHIFT + v selects the entire line, but with new line character. To do this I go to the line and I press: - ^ (puts the cursor at the start of the line) - v (starts the visual select) - $ (selects the entire line including new line character) - Left (unselects the new line character) I also know that I can create a recording that does such a thing. But I am asking if is there any built-in shortcuts...

Original source