Top "Vim" questions

Vim is a free and open-source modal text editor available for most major platforms.

How do I exit the Vim editor?

I'm stuck and cannot escape. It says: "type :quit<Enter> to quit VIM" But when I type that …

vim vi
How do I make Git use the editor of my choice for commits?

I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I …

git vim emacs editor commit-message
What's a quick way to comment/uncomment lines in Vim?

I have a Ruby code file open in vi, there are lines commented out with #: class Search < ActiveRecord::Migration …

vim comments
Redefine tab as 4 spaces

My current setting assumes 8 spaces; how could I redefine it?

vim
Tab key == 4 spaces and auto-indent after curly braces in Vim

How do I make vi-Vim never use tabs (converting spaces to tabs, bad!), makes the tab key == 4 spaces, and automatically …

vim whitespace indentation vi auto-indent
Copy all the lines to clipboard

Is there any way to copy all lines from open file to clipboard in VI editor. I tried yG but …

vim editor keyboard-shortcuts vi
How to replace a character by a newline in Vim

I'm trying to replace each , in the current file by a new line: :%s/,/\n/g But it inserts what …

vim replace escaping newline vi
Indent multiple lines quickly in vi

It should be trivial, and it might even be in the help, but I can't figure out how to navigate …

vim editor indentation vi
What is your most productive shortcut with Vim?

I've heard a lot about Vim, both pros and cons. It really seems you should be (as a developer) faster …

vim vi
How do I move to end of line in Vim?

I know how to generally move around in command mode, specifically, jumping to lines, etc. But what is the command …

vim editor keyboard-shortcuts vi