December 18th, 2024

Ask HN: What Vim habits did you need to unlearn?

Vim's steep learning curve leads to user habits that may need unlearning, such as confusing `i` and `a` commands, while custom key bindings can enhance navigation efficiency.

Ask HN: What Vim habits did you need to unlearn?

Vim is known for its steep learning curve compared to other text editors, leading many users to develop habits that may need to be unlearned. One common issue is the confusion between the `i` and `a` commands; while `i` inserts text before the cursor, `a` appends text after the cursor, which is often the desired action. Additionally, users must adapt to using the `h`, `j`, `k`, and `l` keys for navigation instead of the arrow keys. Some users, like the author, have found it more efficient to bind these navigation keys to a combination with the Command key on Mac, enhancing their editing experience.

- Vim has a steep learning curve, making it challenging for new users.

- Users often develop habits that require unlearning, such as confusing `i` and `a`.

- Adapting to the `h`, `j`, `k`, and `l` keys for navigation is essential.

- Custom key bindings can improve efficiency in Vim.

Link Icon 5 comments
By @wruza - 5 months
Not particularly a vim habit but doing this:

  function foo() {|

  function foo() {
  }|<esc>O<sp><esc>x

  function foo() {
  ....
  }
I know that I can just {<cr>}, and then o/O any time, but for some reason I want that empty indented line which I delete half of the times anyway.
By @qup - 5 months
I press ESC twice instead of once every time I want to get out of insert mode.

And the real problem is I have a binding to do ESC with 'jk' instead, but I always forget to use that one.

By @Twizzlewhisker - 5 months
I use `:wq!` every single time instead of `:x!`, and I think of it every single time. The muscle memory is faster than me recalling to use something different.
By @djaouen - 5 months
`I` and `A` for opening at the beginning and end of lines respectively (rather than `0i` and `$a`)