Questions tagged [vim]

Vim is a free and open-source modal text editor available for most major platforms. It allows high efficiency in many text editing tasks but has a steep learning curve. To learn the basics, run ":help vimtutor". For non-programming questions please use https://vi.stackexchange.com/ instead.

Vim is a free and open source text editor with a steep learning curve that leads to high efficiency in many tasks related to text editing. If you wish to start with Vim, run :help vimtutor in Vim or run the vimtutor command in shell, which will teach you basic commands.

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems and is available on a large number of other systems including Win32, MS-DOS, OS X, AMIGA, OS/2, Cygwin and many more. Vim is written by Bram Moolenaar.

Vim is often called a "programmer's editor," and is so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.

Before you ask

  • If your question is not about programming, consider posting Vim related questions at the dedicated Vim Stack Exchange site.
  • Vim has an extensive help system that will often address your questions. Type :help <subject> within Vim to search for help on a particular subject; for instance: :help search. The help documentation is also available online.
  • Search Stack Overflow for similar or duplicate questions.

Free Vim books

Vim books

Documentation

Tutorial

See also

License/charityware

Vim is Charityware. You can use and copy it as much as you like, but you are encouraged to make a donation for needy children in Uganda. Please see |kcc| below or visit the ICCF web site, available at these URLs:

Related tags

27998 questions
1219
votes
29 answers

How to effectively work with multiple files in Vim

I've started using Vim to develop Perl scripts and am starting to find it very powerful. One thing I like is to be able to open multiple files at once with: vi main.pl maintenance.pl and then hop between them with: :n :prev and see which file are…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
1124
votes
50 answers

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 with Vim than with any other editor. I'm using Vim to do some basic stuff and I'm at best 10 times less productive with Vim. The only two things…
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213
1080
votes
17 answers

How do I use vim registers?

I only know of one instance using registers is via CtrlR* whereby I paste text from a clipboard. What are other uses of registers? How to use them? Everything you know about VI registers (let's focus on vi 7.2) -- share with us.
vehomzzz
  • 42,832
  • 72
  • 186
  • 216
1067
votes
38 answers

How to make vim paste from (and copy to) system's clipboard?

Unlike other editors, vim stores copied text in its own clipboard. So, it's very hard for me to copy some text from a webpage and paste it into the current working file. It so happens I have to either open gedit or type it manually. Can I make vim…
Santosh Kumar
  • 26,475
  • 20
  • 67
  • 118
1060
votes
40 answers

How to copy to clipboard in Vim?

Is it possible to copy to clipboard directly from Vim? yy only copies stuff to Vim's internal buffer. I want to copy to the OS's clipboard. Is there any such command in Vim or you can only yank stuff within Vim?
Hari Menon
  • 33,649
  • 14
  • 85
  • 108
899
votes
6 answers

What is Vim recording and how can it be disabled?

I keep seeing the recording message at the bottom of my gVim 7.2 window. What is it and how do I turn it off?
vehomzzz
  • 42,832
  • 72
  • 186
  • 216
887
votes
23 answers

Make Vim show ALL white spaces as a character

I can't find a way to make Vim show all white spaces as a character. All I found was about tabs, trailing spaces etc.
Matt
829
votes
70 answers

What are the dark corners of Vim your mom never told you about?

There are a plethora of questions where people talk about common tricks, notably "Vim+ctags tips and tricks". However, I don't refer to commonly used shortcuts that someone new to Vim would find cool. I am talking about a seasoned Unix user (be they…
Sasha
818
votes
29 answers

Convert DOS/Windows line endings to Linux line endings in Vim

If I open files I created in Windows, the lines all end with ^M. How do I delete these characters all at once?
Bert Hekman
  • 8,987
  • 3
  • 21
  • 14
793
votes
14 answers

How to move screen without moving cursor in Vim?

I recently discovered Ctrl+E and Ctrl+Y shortcuts for Vim that respectively move the screen up and down with a one line step, without moving the cursor. Do you know any command that leaves the cursor where it is but moves the screen so that the line…
ereOn
  • 53,676
  • 39
  • 161
  • 238
791
votes
30 answers

Differences between Emacs and Vim

What practical, objective differences are there between Emacs and Vim? For example, what can be done using one but not the other (or done more easily with one than the other)? What should I know in order to choose one to learn?
Sasha Chedygov
  • 127,549
  • 26
  • 102
  • 115
764
votes
28 answers

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 it's not using clipboard to store those lines. So is it possible?
Xinus
  • 29,617
  • 32
  • 119
  • 165
754
votes
14 answers

Vim delete blank lines

What command can I run to remove blank lines in Vim?
nearly_lunchtime
  • 12,203
  • 15
  • 37
  • 42
725
votes
10 answers

How do I do redo (i.e. "undo undo") in Vim?

In Vim, I did too much undo. How do I undo this (that is, redo)?
flybywire
  • 261,858
  • 191
  • 397
  • 503
704
votes
11 answers

How to paste yanked text into the Vim command line

I'd like to paste yanked text into Vim's command line. Is it possible?
dan
  • 43,914
  • 47
  • 153
  • 254